From 88bfabf111dfc794dc8c8f6d44d253842b39b55e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Lassieur?= Date: Mon, 27 Aug 2018 22:47:14 +0200 Subject: hydra: Add support for manifests. * build-aux/hydra/gnu-system.scm (arguments->manifests, manifests->packages): New procedures. (hydra-jobs): Add a "manifests" subset. * doc/guix.texi (Continuous Integration): Update accordingly. --- build-aux/hydra/gnu-system.scm | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'build-aux') diff --git a/build-aux/hydra/gnu-system.scm b/build-aux/hydra/gnu-system.scm index b1554ced4c..7234e2d0e8 100644 --- a/build-aux/hydra/gnu-system.scm +++ b/build-aux/hydra/gnu-system.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès ;;; Copyright © 2017 Jan Nieuwenhuizen +;;; Copyright © 2018 Clément Lassieur ;;; ;;; This file is part of GNU Guix. ;;; @@ -56,6 +57,7 @@ (guix packages) (guix derivations) (guix monads) + (guix ui) ((guix licenses) #:select (gpl3+)) ((guix utils) #:select (%current-system)) ((guix scripts system) #:select (read-operating-system)) @@ -311,6 +313,30 @@ valid." packages))) #:select? (const #t))) ;include hidden packages +(define (arguments->manifests arguments) + "Return the list of manifests extracted from ARGUMENTS." + (map (match-lambda + ((input-name . relative-path) + (let* ((checkout (assq-ref arguments (string->symbol input-name))) + (base (assq-ref checkout 'file-name))) + (in-vicinity base relative-path)))) + (assq-ref arguments 'manifests))) + +(define (manifests->packages store manifests) + "Return the list of packages found in MANIFESTS." + (define (load-manifest manifest) + (save-module-excursion + (lambda () + (set-current-module (make-user-module '((guix profiles) (gnu)))) + (primitive-load manifest)))) + + (parameterize ((%graft? #f)) + (delete-duplicates! + (map manifest-entry-item + (append-map (compose manifest-entries + load-manifest) + manifests))))) + ;;; ;;; Hydra entry point. @@ -323,6 +349,7 @@ valid." ("core" 'core) ; only build core packages ("hello" 'hello) ; only build hello (((? string?) (? string?) ...) 'list) ; only build selected list of packages + ("manifests" 'manifests) ; only build packages in the list of manifests (_ 'all))) ; build everything (define systems @@ -419,6 +446,14 @@ valid." package system)) packages)) '())) + ((manifests) + ;; Build packages in the list of manifests. + (let* ((manifests (arguments->manifests arguments)) + (packages (manifests->packages store manifests))) + (map (lambda (package) + (package-job store (job-name package) + package system)) + packages))) (else (error "unknown subset" subset)))) systems))) -- cgit v1.2.3 From 78c9058dde237d6913a30a40c1f5ca19395f86c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 13 Sep 2018 10:10:49 +0200 Subject: build-self: Add a dummy (git) module to 'compute-guix-derivation'. Fixes a regression introduced in aed0a594058a59bc3bb1d2686391dc0e8a181b1f. * build-aux/build-self.scm (build-program)[fake-git]: New variable. Use it as an imported module. --- build-aux/build-self.scm | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'build-aux') diff --git a/build-aux/build-self.scm b/build-aux/build-self.scm index f91b43987a..09979dc410 100644 --- a/build-aux/build-self.scm +++ b/build-aux/build-self.scm @@ -263,6 +263,9 @@ interface (FFI) of Guile.") #~(define-module (gcrypt hash) #:export (sha1 sha256)))) + (define fake-git + (scheme-file "git.scm" #~(define-module (git)))) + (with-imported-modules `(((guix config) => ,(make-config.scm)) @@ -272,6 +275,11 @@ interface (FFI) of Guile.") ;; adjust %LOAD-PATH later on. ((gcrypt hash) => ,fake-gcrypt-hash) + ;; (guix git-download) depends on (git) but only + ;; for peripheral functionality. Provide a dummy + ;; (git) to placate it. + ((git) => ,fake-git) + ,@(source-module-closure `((guix store) (guix self) (guix derivations) -- cgit v1.2.3 From ac4d2ec81a9f7c439b21b4c4ae4a2e949c78ab2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 13 Sep 2018 10:23:39 +0200 Subject: build-self: Emit a useful message upon error. * build-aux/build-self.scm (build): Raise a '&message' condition instead of calling 'error'. --- build-aux/build-self.scm | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'build-aux') diff --git a/build-aux/build-self.scm b/build-aux/build-self.scm index 09979dc410..306b2c6b63 100644 --- a/build-aux/build-self.scm +++ b/build-aux/build-self.scm @@ -25,6 +25,8 @@ #:use-module (guix build-system gnu) #:use-module (srfi srfi-1) #:use-module (srfi srfi-19) + #:use-module (srfi srfi-34) + #:use-module (srfi srfi-35) #:use-module (rnrs io ports) #:use-module (ice-9 match) #:use-module (ice-9 popen) @@ -420,7 +422,15 @@ files." ;; Unsupported PULL-VERSION. (return #f)) ((? string? str) - (error "invalid build result" (list build str)))))))) + (raise (condition + (&message + (message (format #f "You found a bug: the program '~a' +failed to compute the derivation for Guix (version: ~s; system: ~s; +host version: ~s; pull-version: ~s). +Please report it by email to <~a>.~%" + (derivation->output-path build) + version system %guix-version pull-version + %guix-bug-report-address))))))))))) ;; This file is loaded by 'guix pull'; return it the build procedure. build -- cgit v1.2.3