From de5cbd4a38a33e0412f1c481fe8e01a871dc13e5 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 29 Aug 2018 22:28:06 +0200 Subject: records: Adjust 'record-abi-mismatch-error' arguments. Previously, 'display-error' (as used by 'warn-about-load-error', for instance) would be called with a wrong number of arguments when a 'record-abi-mismatch-error' was caught: warning: failed to load '(gnu tests install)': Backtrace: [...] ERROR: In procedure display-error: Wrong number of arguments to # Now you get warnings and error reports as intended: warning: failed to load '(gnu tests install)': In procedure abi-check: : record ABI mismatch; recompilation needed warning: failed to load '(gnu tests ssh)': In procedure abi-check: : record ABI mismatch; recompilation needed * guix/records.scm (print-record-abi-mismatch-error): Remove. Remove top-level call to 'set-exception-printer!'. (abi-check): Use arguments as expected by 'display-error'. --- guix/records.scm | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'guix') diff --git a/guix/records.scm b/guix/records.scm index da3ecdaaf8..1f11648e2c 100644 --- a/guix/records.scm +++ b/guix/records.scm @@ -52,17 +52,6 @@ ((weird _ ...) ;weird! (syntax-violation name "invalid field specifier" #'weird))))) -(define (print-record-abi-mismatch-error port key args - default-printer) - (match args - ((rtd . _) - ;; The source file where this exception is thrown must be recompiled. - (format port "ERROR: ~a: record ABI mismatch; recompilation needed" - rtd)))) - -(set-exception-printer! 'record-abi-mismatch-error - print-record-abi-mismatch-error) - (eval-when (expand load eval) ;; The procedures below are needed both at run time and at expansion time. @@ -81,7 +70,11 @@ interface\" (ABI) for TYPE is equal to COOKIE." (with-syntax ((current-abi (current-abi-identifier type))) #`(unless (eq? current-abi #,cookie) - (throw 'record-abi-mismatch-error #,type))))) + ;; The source file where this exception is thrown must be + ;; recompiled. + (throw 'record-abi-mismatch-error 'abi-check + "~a: record ABI mismatch; recompilation needed" + '(#,type) '()))))) (define-syntax make-syntactic-constructor (syntax-rules () -- cgit v1.2.3 From a3ece51a29241c7060323cbbfc602c83200ffe4a Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Mon, 20 Aug 2018 17:38:56 +0200 Subject: import: stackage: Support recursive importing. * guix/import/hackage.scm (hackage-name->package-name): Export procedure. * guix/import/stackage.scm (lts-info-packages-lts-info): Fix match expression. (stackage-recursive-import): New procedure. (stackage->guix-package): Memoize results. * guix/scripts/import/stackage.scm (show-help, %options, guix-import-stackage): Support recursive importing. * doc/guix.texi (Invoking guix import): Document option. --- doc/guix.texi | 7 +++++- guix/import/hackage.scm | 1 + guix/import/stackage.scm | 45 ++++++++++++++++++++++++--------------- guix/scripts/import/stackage.scm | 46 ++++++++++++++++++++++++++++++---------- 4 files changed, 70 insertions(+), 29 deletions(-) (limited to 'guix') diff --git a/doc/guix.texi b/doc/guix.texi index 97631d52e4..1e17c294b6 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -6699,9 +6699,14 @@ Specific command-line options are: @itemx -t Do not include dependencies required only by the test suites. @item --lts-version=@var{version} -@itemx -r @var{version} +@itemx -l @var{version} @var{version} is the desired LTS release version. If omitted the latest release is used. +@item --recursive +@itemx -r +Traverse the dependency graph of the given upstream package recursively +and generate package expressions for all those packages that are not yet +in Guix. @end table The command below imports metadata for the @code{HTTP} Haskell package diff --git a/guix/import/hackage.scm b/guix/import/hackage.scm index 3c00f680bf..54301de2e8 100644 --- a/guix/import/hackage.scm +++ b/guix/import/hackage.scm @@ -44,6 +44,7 @@ %hackage-updater guix-package->hackage-name + hackage-name->package-name hackage-fetch hackage-source-url hackage-cabal-url diff --git a/guix/import/stackage.scm b/guix/import/stackage.scm index ec93fbced6..afd5d997ae 100644 --- a/guix/import/stackage.scm +++ b/guix/import/stackage.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2017 Federico Beffa +;;; Copyright © 2018 Ricardo Wurmus ;;; ;;; This file is part of GNU Guix. ;;; @@ -25,10 +26,12 @@ #:use-module (srfi srfi-35) #:use-module (guix import json) #:use-module (guix import hackage) + #:use-module (guix import utils) #:use-module (guix memoization) #:use-module (guix packages) #:use-module (guix upstream) #:export (stackage->guix-package + stackage-recursive-import %stackage-updater)) @@ -45,9 +48,9 @@ (_ #f))) (define (lts-info-packages lts-info) - "Retruns the alist of packages contained in LTS-INFO." + "Returns the alist of packages contained in LTS-INFO." (match lts-info - ((_ ("packages" pkg ...)) pkg) + ((("packages" pkg ...) . _) pkg) (_ '()))) (define (leave-with-message fmt . args) @@ -85,25 +88,33 @@ (define (hackage-name-version name version) (and version (string-append name "@" version))) -(define* (stackage->guix-package package-name ; upstream name - #:key - (include-test-dependencies? #t) - (lts-version "") - (packages-info - (lts-info-packages - (stackage-lts-info-fetch lts-version)))) - "Fetch Cabal file for PACKAGE-NAME from hackage.haskell.org. The retrieved +(define stackage->guix-package + (memoize + (lambda* (package-name ; upstream name + #:key + (include-test-dependencies? #t) + (lts-version "") + (packages-info + (lts-info-packages + (stackage-lts-info-fetch lts-version)))) + "Fetch Cabal file for PACKAGE-NAME from hackage.haskell.org. The retrieved vesion corresponds to the version of PACKAGE-NAME specified in the LTS-VERSION release at stackage.org. Return the `package' S-expression corresponding to that package, or #f on failure. PACKAGES-INFO is the alist with the packages included in the Stackage LTS release." - (let* ((version (lts-package-version packages-info package-name)) - (name-version (hackage-name-version package-name version))) - (if name-version - (hackage->guix-package name-version - #:include-test-dependencies? - include-test-dependencies?) - (leave-with-message "~a: Stackage package not found" package-name)))) + (let* ((version (lts-package-version packages-info package-name)) + (name-version (hackage-name-version package-name version))) + (if name-version + (hackage->guix-package name-version + #:include-test-dependencies? + include-test-dependencies?) + (leave-with-message "~a: Stackage package not found" package-name)))))) + +(define (stackage-recursive-import package-name . args) + (recursive-import package-name #f + #:repo->guix-package (lambda (name repo) + (apply stackage->guix-package (cons name args))) + #:guix-name hackage-name->package-name)) ;;; diff --git a/guix/scripts/import/stackage.scm b/guix/scripts/import/stackage.scm index e6676e93e8..b4b12581bf 100644 --- a/guix/scripts/import/stackage.scm +++ b/guix/scripts/import/stackage.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2017 Federico Beffa +;;; Copyright © 2018 Ricardo Wurmus ;;; ;;; This file is part of GNU Guix. ;;; @@ -26,6 +27,7 @@ #:use-module (srfi srfi-1) #:use-module (srfi srfi-11) #:use-module (srfi srfi-37) + #:use-module (srfi srfi-41) #:use-module (ice-9 match) #:use-module (ice-9 format) #:export (guix-import-stackage)) @@ -43,11 +45,13 @@ (display (G_ "Usage: guix import stackage PACKAGE-NAME Import and convert the LTS Stackage package for PACKAGE-NAME.\n")) (display (G_ " - -r VERSION, --lts-version=VERSION + -l VERSION, --lts-version=VERSION specify the LTS version to use")) (display (G_ " -h, --help display this help and exit")) (display (G_ " + -r, --recursive import packages recursively")) + (display (G_ " -t, --no-test-dependencies don't include test-only dependencies")) (display (G_ " -V, --version display version information and exit")) @@ -68,11 +72,14 @@ Import and convert the LTS Stackage package for PACKAGE-NAME.\n")) (alist-cons 'include-test-dependencies? #f (alist-delete 'include-test-dependencies? result)))) - (option '(#\r "lts-version") #t #f + (option '(#\l "lts-version") #t #f (lambda (opt name arg result) (alist-cons 'lts-version arg (alist-delete 'lts-version result)))) + (option '(#\r "recursive") #f #f + (lambda (opt name arg result) + (alist-cons 'recursive #t result))) %standard-import-options)) @@ -90,6 +97,27 @@ Import and convert the LTS Stackage package for PACKAGE-NAME.\n")) (alist-cons 'argument arg result)) %default-options)) + (define (run-importer package-name opts error-fn) + (let* ((arguments (list + package-name + #:include-test-dependencies? + (assoc-ref opts 'include-test-dependencies?) + #:lts-version (assoc-ref opts 'lts-version))) + (sexp (if (assoc-ref opts 'recursive) + ;; Recursive import + (map (match-lambda + ((and ('package ('name name) . rest) pkg) + `(define-public ,(string->symbol name) + ,pkg)) + (_ #f)) + (reverse + (stream->list + (apply stackage-recursive-import arguments)))) + ;; Single import + (apply stackage->guix-package arguments)))) + (unless sexp (error-fn)) + sexp)) + (let* ((opts (parse-options)) (args (filter-map (match-lambda (('argument . value) @@ -99,15 +127,11 @@ Import and convert the LTS Stackage package for PACKAGE-NAME.\n")) (match args ((package-name) (with-error-handling - (let ((sexp (stackage->guix-package - package-name - #:include-test-dependencies? - (assoc-ref opts 'include-test-dependencies?) - #:lts-version (assoc-ref opts 'lts-version)))) - (unless sexp - (leave (G_ "failed to download cabal file for package '~a'~%") - package-name)) - sexp))) + (run-importer package-name opts + (lambda () + (leave (G_ "failed to download cabal file \ +for package '~a'~%") + package-name))))) (() (leave (G_ "too few arguments~%"))) ((many ...) -- cgit v1.2.3 From e37f889404b9055a50ea1b47259ce4acae23167d Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Thu, 30 Aug 2018 15:02:10 +0200 Subject: import: pypi: Also guess dependencies from *.egg-info/requires.txt. * guix/import/pypi.scm (guess-requirements): Extract "requires.txt" from the egg-info directory in addition to "requirements.txt"; strip off version constraints; use call-with-temporary-directory. --- guix/import/pypi.scm | 54 ++++++++++++++++++++++++++++++---------------------- 1 file changed, 31 insertions(+), 23 deletions(-) (limited to 'guix') diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm index 25560bac46..51c2d5264a 100644 --- a/guix/import/pypi.scm +++ b/guix/import/pypi.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2015 Cyril Roelandt ;;; Copyright © 2015, 2016, 2017 Ludovic Courtès ;;; Copyright © 2017 Mathieu Othacehe +;;; Copyright © 2018 Ricardo Wurmus ;;; ;;; This file is part of GNU Guix. ;;; @@ -36,7 +37,8 @@ #:use-module (guix utils) #:use-module ((guix build utils) #:select ((package-name->name+version - . hyphen-package-name->name+version))) + . hyphen-package-name->name+version) + find-files)) #:use-module (guix import utils) #:use-module ((guix download) #:prefix download:) #:use-module (guix import json) @@ -114,9 +116,9 @@ package definition." `((propagated-inputs (,'quasiquote ,package-inputs)))))) (define (guess-requirements source-url wheel-url tarball) - "Given SOURCE-URL, WHEEL-URL and a TARBALL of the package, return a list of -the required packages specified in the requirements.txt file. TARBALL will be -extracted in the current directory, and will be deleted." + "Given SOURCE-URL, WHEEL-URL and a TARBALL of the package, return a list +of the required packages specified in the requirements.txt file. TARBALL will +be extracted in a temporary directory." (define (tarball-directory url) ;; Given the URL of the package's tarball, return the name of the directory @@ -140,8 +142,8 @@ cannot determine package dependencies")) ;; file, remove everything other than the actual name of the required ;; package, and return it. (string-take s - (or (string-index s #\space) - (string-length s)))) + (or (string-index s (lambda (chr) (member chr '(#\space #\> #\= #\<)))) + (string-length s)))) (define (comment? line) ;; Return #t if the given LINE is a comment, #f otherwise. @@ -197,31 +199,37 @@ cannot determine package dependencies")) (read-wheel-metadata temp)) #f)))) - (define (guess-requirements-from-source) ;; Return the package's requirements by guessing them from the source. (let ((dirname (tarball-directory source-url))) (if (string? dirname) - (let* ((req-file (string-append dirname "/requirements.txt")) - (exit-code (system* "tar" "xf" tarball req-file))) - ;; TODO: support more formats. - (if (zero? exit-code) - (dynamic-wind - (const #t) - (lambda () - (read-requirements req-file)) - (lambda () - (delete-file req-file) - (rmdir dirname))) - (begin - (warning (G_ "'tar xf' failed with exit code ~a\n") - exit-code) - '()))) + (call-with-temporary-directory + (lambda (dir) + (let* ((pypi-name (string-take dirname (string-rindex dirname #\-))) + (req-files (list (string-append dirname "/requirements.txt") + (string-append dirname "/" pypi-name ".egg-info" + "/requires.txt"))) + (exit-codes (map (lambda (file-name) + (parameterize ((current-error-port (%make-void-port "rw+")) + (current-output-port (%make-void-port "rw+"))) + (system* "tar" "xf" tarball "-C" dir file-name))) + req-files))) + ;; Only one of these files needs to exist. + (if (any zero? exit-codes) + (match (find-files dir) + ((file . _) + (read-requirements file)) + (() + (warning (G_ "No requirements file found.\n")))) + (begin + (warning (G_ "Failed to extract requirements files\n")) + '()))))) '()))) ;; First, try to compute the requirements using the wheel, since that is the ;; most reliable option. If a wheel is not provided for this package, try - ;; getting them by reading the "requirements.txt" file from the source. Note + ;; getting them by reading either the "requirements.txt" file or the + ;; "requires.txt" from the egg-info directory from the source tarball. Note ;; that "requirements.txt" is not mandatory, so this is likely to fail. (or (guess-requirements-from-wheel) (guess-requirements-from-source))) -- cgit v1.2.3 From ac906cb7bb2ec77821ddec291db4857cc812599d Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Thu, 30 Aug 2018 15:12:07 +0200 Subject: import: pypi: Support recursive importing. * guix/import/pypi.scm (guess-requirements): Use upstream names. (compute-inputs): Return the upstream dependency names as an additional value. (make-pypi-sexp): Likewise. (pypi->guix-package): Memoize it. (pypi-recursive-import): New procedure. * guix/scripts/import/pypi.scm (show-help, %options): Accept "recursive" option. (guix-import-pypi): Use pypi-recursive-import. * doc/guix.texi (Invoking guix import): Document it. --- doc/guix.texi | 8 +++ guix/import/pypi.scm | 119 ++++++++++++++++++++++++------------------- guix/scripts/import/pypi.scm | 28 ++++++++-- 3 files changed, 99 insertions(+), 56 deletions(-) (limited to 'guix') diff --git a/doc/guix.texi b/doc/guix.texi index 1e17c294b6..8611059791 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -6442,6 +6442,14 @@ package: guix import pypi itsdangerous @end example +@table @code +@item --recursive +@itemx -r +Traverse the dependency graph of the given upstream package recursively +and generate package expressions for all those packages that are not yet +in Guix. +@end table + @item gem @cindex gem Import metadata from @uref{https://rubygems.org/, diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm index 51c2d5264a..87b047bdac 100644 --- a/guix/import/pypi.scm +++ b/guix/import/pypi.scm @@ -25,6 +25,7 @@ #:use-module (ice-9 match) #:use-module (ice-9 pretty-print) #:use-module (ice-9 regex) + #:use-module (ice-9 receive) #:use-module ((ice-9 rdelim) #:select (read-line)) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) @@ -47,6 +48,7 @@ #:use-module ((guix licenses) #:prefix license:) #:use-module (guix build-system python) #:export (guix-package->pypi-name + pypi-recursive-import pypi->guix-package %pypi-updater)) @@ -162,7 +164,7 @@ cannot determine package dependencies")) ((or (string-null? line) (comment? line)) (loop result)) (else - (loop (cons (python->package-name (clean-requirement line)) + (loop (cons (clean-requirement line) result)))))))))) (define (read-wheel-metadata wheel-archive) @@ -182,9 +184,7 @@ cannot determine package dependencies")) (hash-ref (list-ref run_requires 0) "requires") '()))) - (map (lambda (r) - (python->package-name (clean-requirement r))) - requirements))))) + (map clean-requirement requirements))))) (lambda () (delete-file json-file) (rmdir dirname)))))) @@ -237,16 +237,21 @@ cannot determine package dependencies")) (define (compute-inputs source-url wheel-url tarball) "Given the SOURCE-URL of an already downloaded TARBALL, return a list of -name/variable pairs describing the required inputs of this package." - (sort - (map (lambda (input) - (list input (list 'unquote (string->symbol input)))) - (remove (cut string=? "python-argparse" <>) - (guess-requirements source-url wheel-url tarball))) - (lambda args - (match args - (((a _ ...) (b _ ...)) - (string-ci) + (guess-requirements source-url wheel-url tarball)))) + (values (sort + (map (lambda (input) + (let ((guix-name (python->package-name input))) + (list guix-name (list 'unquote (string->symbol guix-name))))) + dependencies) + (lambda args + (match args + (((a _ ...) (b _ ...)) + (string-cipackage-name name)) - (version ,version) - (source (origin - (method url-fetch) + (receive (input-package-names upstream-dependency-names) + (compute-inputs source-url wheel-url temp) + (values + `(package + (name ,(python->package-name name)) + (version ,version) + (source (origin + (method url-fetch) - ;; Sometimes 'pypi-uri' doesn't quite work due to mixed - ;; cases in NAME, for instance, as is the case with - ;; "uwsgi". In that case, fall back to a full URL. - (uri (pypi-uri ,(string-downcase name) version)) - (sha256 - (base32 - ,(guix-hash-url temp))))) - (build-system python-build-system) - ,@(maybe-inputs (compute-inputs source-url wheel-url temp)) - (home-page ,home-page) - (synopsis ,synopsis) - (description ,description) - (license ,(license->symbol license))))))) + ;; Sometimes 'pypi-uri' doesn't quite work due to mixed + ;; cases in NAME, for instance, as is the case with + ;; "uwsgi". In that case, fall back to a full URL. + (uri (pypi-uri ,(string-downcase name) version)) + (sha256 + (base32 + ,(guix-hash-url temp))))) + (build-system python-build-system) + ,@(maybe-inputs input-package-names) + (home-page ,home-page) + (synopsis ,synopsis) + (description ,description) + (license ,(license->symbol license))) + upstream-dependency-names)))))) -(define (pypi->guix-package package-name) - "Fetch the metadata for PACKAGE-NAME from pypi.org, and return the +(define pypi->guix-package + (memoize + (lambda* (package-name) + "Fetch the metadata for PACKAGE-NAME from pypi.org, and return the `package' s-expression corresponding to that package, or #f on failure." - (let ((package (pypi-fetch package-name))) - (and package - (guard (c ((missing-source-error? c) - (let ((package (missing-source-error-package c))) - (leave (G_ "no source release for pypi package ~a ~a~%") - (assoc-ref* package "info" "name") - (assoc-ref* package "info" "version"))))) - (let ((name (assoc-ref* package "info" "name")) - (version (assoc-ref* package "info" "version")) - (release (assoc-ref (latest-source-release package) "url")) - (wheel (assoc-ref (latest-wheel-release package) "url")) - (synopsis (assoc-ref* package "info" "summary")) - (description (assoc-ref* package "info" "summary")) - (home-page (assoc-ref* package "info" "home_page")) - (license (string->license (assoc-ref* package "info" "license")))) - (make-pypi-sexp name version release wheel home-page synopsis - description license)))))) + (let ((package (pypi-fetch package-name))) + (and package + (guard (c ((missing-source-error? c) + (let ((package (missing-source-error-package c))) + (leave (G_ "no source release for pypi package ~a ~a~%") + (assoc-ref* package "info" "name") + (assoc-ref* package "info" "version"))))) + (let ((name (assoc-ref* package "info" "name")) + (version (assoc-ref* package "info" "version")) + (release (assoc-ref (latest-source-release package) "url")) + (wheel (assoc-ref (latest-wheel-release package) "url")) + (synopsis (assoc-ref* package "info" "summary")) + (description (assoc-ref* package "info" "summary")) + (home-page (assoc-ref* package "info" "home_page")) + (license (string->license (assoc-ref* package "info" "license")))) + (make-pypi-sexp name version release wheel home-page synopsis + description license)))))))) + +(define (pypi-recursive-import package-name) + (recursive-import package-name #f + #:repo->guix-package (lambda (name repo) + (pypi->guix-package name)) + #:guix-name python->package-name)) (define (string->license str) "Convert the string STR into a license object." diff --git a/guix/scripts/import/pypi.scm b/guix/scripts/import/pypi.scm index 59a925a3ca..7bd83818ba 100644 --- a/guix/scripts/import/pypi.scm +++ b/guix/scripts/import/pypi.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2014 David Thompson +;;; Copyright © 2018 Ricardo Wurmus ;;; ;;; This file is part of GNU Guix. ;;; @@ -25,6 +26,7 @@ #:use-module (srfi srfi-1) #:use-module (srfi srfi-11) #:use-module (srfi srfi-37) + #:use-module (srfi srfi-41) #:use-module (ice-9 match) #:use-module (ice-9 format) #:export (guix-import-pypi)) @@ -43,6 +45,8 @@ Import and convert the PyPI package for PACKAGE-NAME.\n")) (display (G_ " -h, --help display this help and exit")) (display (G_ " + -r, --recursive import packages recursively")) + (display (G_ " -V, --version display version information and exit")) (newline) (show-bug-report-information)) @@ -56,6 +60,9 @@ Import and convert the PyPI package for PACKAGE-NAME.\n")) (option '(#\V "version") #f #f (lambda args (show-version-and-exit "guix import pypi"))) + (option '(#\r "recursive") #f #f + (lambda (opt name arg result) + (alist-cons 'recursive #t result))) %standard-import-options)) @@ -81,11 +88,22 @@ Import and convert the PyPI package for PACKAGE-NAME.\n")) (reverse opts)))) (match args ((package-name) - (let ((sexp (pypi->guix-package package-name))) - (unless sexp - (leave (G_ "failed to download meta-data for package '~a'~%") - package-name)) - sexp)) + (if (assoc-ref opts 'recursive) + ;; Recursive import + (map (match-lambda + ((and ('package ('name name) . rest) pkg) + `(define-public ,(string->symbol name) + ,pkg)) + (_ #f)) + (reverse + (stream->list + (pypi-recursive-import package-name)))) + ;; Single import + (let ((sexp (pypi->guix-package package-name))) + (unless sexp + (leave (G_ "failed to download meta-data for package '~a'~%") + package-name)) + sexp))) (() (leave (G_ "too few arguments~%"))) ((many ...) -- cgit v1.2.3 From 8e1395be5c7d1a6e895fb5b1e70bebc0fef161a6 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 31 Aug 2018 17:23:38 +0200 Subject: records: Adjust to test changes in 'record-abi-mismatch-error'. Fixes a test failure introduced in de5cbd4a38a33e0412f1c481fe8e01a871dc13e5. * guix/records.scm (abi-check): Refer to TYPE in an unquoted context so we get at the RTD. * tests/records.scm ("ABI checks"): Adjust 'catch' handler to changes in the 'record-abi-mismatch-error' arguments. --- guix/records.scm | 2 +- tests/records.scm | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'guix') diff --git a/guix/records.scm b/guix/records.scm index 1f11648e2c..98f3c8fef0 100644 --- a/guix/records.scm +++ b/guix/records.scm @@ -74,7 +74,7 @@ interface\" (ABI) for TYPE is equal to COOKIE." ;; recompiled. (throw 'record-abi-mismatch-error 'abi-check "~a: record ABI mismatch; recompilation needed" - '(#,type) '()))))) + (list #,type) '()))))) (define-syntax make-syntactic-constructor (syntax-rules () diff --git a/tests/records.scm b/tests/records.scm index 80e08a9a5f..09ada70c2d 100644 --- a/tests/records.scm +++ b/tests/records.scm @@ -313,8 +313,9 @@ (lambda () (eval '(foo? (make-me-a-record)) module) #f) - (lambda (key rtd . _) - (eq? rtd (eval ' module)))))) + (match-lambda* + ((key 'abi-check (? string? message) (rtd) . _) + (eq? rtd (eval ' module))))))) (test-equal "recutils->alist" '((("Name" . "foo") -- cgit v1.2.3 From 301aa9e76c76026628e2abc88104410e0150b409 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 31 Aug 2018 17:26:19 +0200 Subject: pack: Correctly report "unknown pack format" errors. * guix/scripts/pack.scm (guix-pack): Fix "unknown pack format" error message. --- guix/scripts/pack.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'guix') diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm index 729850839b..fb0677de28 100644 --- a/guix/scripts/pack.scm +++ b/guix/scripts/pack.scm @@ -748,8 +748,8 @@ Create a bundle of PACKAGE.\n")) (build-image (match (assq-ref %formats pack-format) ((? procedure? proc) proc) (#f - (leave (G_ "~a: unknown pack format") - format)))) + (leave (G_ "~a: unknown pack format~%") + pack-format)))) (localstatedir? (assoc-ref opts 'localstatedir?))) (run-with-store store (mlet* %store-monad ((profile (profile-derivation -- cgit v1.2.3 From 02fa1d251c9caeba39c7593e0b8ab52b60735b17 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 24 Aug 2018 15:51:31 +0200 Subject: discovery: Add 'scheme-modules*'. * guix/self.scm (scheme-modules*): Move to... * guix/discovery.scm (scheme-modules*): ... here. New procedure. Make 'sub-directory' an optional parameter. --- guix/discovery.scm | 13 ++++++++++++- guix/self.scm | 7 ------- 2 files changed, 12 insertions(+), 8 deletions(-) (limited to 'guix') diff --git a/guix/discovery.scm b/guix/discovery.scm index 2b627d108e..3fc6e2c9e7 100644 --- a/guix/discovery.scm +++ b/guix/discovery.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017 Ludovic Courtès +;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -27,6 +27,7 @@ #:use-module (ice-9 ftw) #:export (scheme-files scheme-modules + scheme-modules* fold-modules all-modules fold-module-public-variables)) @@ -115,6 +116,16 @@ name and the exception key and arguments." (string-append directory "/" sub-directory) directory)))) +(define* (scheme-modules* directory #:optional sub-directory) + "Return the list of module names found under SUB-DIRECTORY in DIRECTORY. +This is a source-only variant that does not try to load files." + (let ((prefix (string-length directory))) + (map (lambda (file) + (file-name->module-name (string-drop file prefix))) + (scheme-files (if sub-directory + (string-append directory "/" sub-directory) + directory))))) + (define* (fold-modules proc init path #:key (warn (const #f))) "Fold over all the Scheme modules present in PATH, a list of directories. Call (PROC MODULE RESULT) for each module that is found." diff --git a/guix/self.scm b/guix/self.scm index 90649db17f..81f9b0cfd5 100644 --- a/guix/self.scm +++ b/guix/self.scm @@ -206,13 +206,6 @@ list of file-name/file-like objects suitable as inputs to 'imported-files'." (local-file file #:recursive? #t))) (find-files (string-append directory "/" sub-directory) pred))) -(define (scheme-modules* directory sub-directory) - "Return the list of module names found under SUB-DIRECTORY in DIRECTORY." - (let ((prefix (string-length directory))) - (map (lambda (file) - (file-name->module-name (string-drop file prefix))) - (scheme-files (string-append directory "/" sub-directory))))) - (define* (sub-directory item sub-directory) "Return SUB-DIRECTORY within ITEM, which may be a file name or a file-like object." -- cgit v1.2.3 From fe634eaf93ba40862acdf62d7f197c6f19f0651c Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 27 Aug 2018 15:38:59 +0200 Subject: Add (guix describe) and use it to initialize '%package-search-path'. * guix/describe.scm: New file. * Makefile.am (MODULES): Add it. * gnu/packages.scm (%default-package-module-path): New variable. (%package-module-path): Honor 'package-path-entries'. * build-aux/update-NEWS.scm (main): Use %DEFAULT-PACKAGE-MODULE-PATH instead of (last (%package-module-path)). --- Makefile.am | 1 + build-aux/update-NEWS.scm | 9 +++--- gnu/packages.scm | 27 ++++++++++++------ guix/describe.scm | 73 +++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 97 insertions(+), 13 deletions(-) create mode 100644 guix/describe.scm (limited to 'guix') diff --git a/Makefile.am b/Makefile.am index 324674a60e..b6efd6d625 100644 --- a/Makefile.am +++ b/Makefile.am @@ -86,6 +86,7 @@ MODULES = \ guix/derivations.scm \ guix/grafts.scm \ guix/inferior.scm \ + guix/describe.scm \ guix/gnu-maintenance.scm \ guix/self.scm \ guix/upstream.scm \ diff --git a/build-aux/update-NEWS.scm b/build-aux/update-NEWS.scm index 2e8f68c9a8..a9dffef1d2 100644 --- a/build-aux/update-NEWS.scm +++ b/build-aux/update-NEWS.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2017 Ludovic Courtès +;;; Copyright © 2017, 2018 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -128,11 +128,10 @@ paragraph." (define (main . args) (match args ((news-file data-directory) - ;; Don't browse things listed in the user's $GUIX_PACKAGE_PATH. Here we - ;; assume that the last item in (%package-module-path) is the distro - ;; directory. + ;; Don't browse things listed in the user's $GUIX_PACKAGE_PATH and + ;; in external channels. (parameterize ((%package-module-path - (list (last (%package-module-path))))) + %default-package-module-path)) (define (package-file version) (string-append data-directory "/packages-" version ".txt")) diff --git a/gnu/packages.scm b/gnu/packages.scm index 7b954769e9..532297239d 100644 --- a/gnu/packages.scm +++ b/gnu/packages.scm @@ -30,6 +30,7 @@ #:select ((package-name->name+version . hyphen-separated-name->name+version))) #:autoload (guix profiles) (packages->manifest) + #:use-module (guix describe) #:use-module (ice-9 vlist) #:use-module (ice-9 match) #:use-module (srfi srfi-1) @@ -46,6 +47,7 @@ %auxiliary-files-path %bootstrap-binaries-path %package-module-path + %default-package-module-path fold-packages @@ -130,22 +132,31 @@ for system '~a'") ("gnu/packages.scm" gnu/) ("guix.scm")))) +(define %default-package-module-path + ;; Default search path for package modules. + `((,%distro-root-directory . "gnu/packages"))) + (define %package-module-path ;; Search path for package modules. Each item must be either a directory ;; name or a pair whose car is a directory and whose cdr is a sub-directory ;; to narrow the search. (let* ((not-colon (char-set-complement (char-set #\:))) (environment (string-tokenize (or (getenv "GUIX_PACKAGE_PATH") "") - not-colon))) - ;; Automatically add items from $GUIX_PACKAGE_PATH to Guile's search path. - (for-each (lambda (directory) - (set! %load-path (cons directory %load-path)) - (set! %load-compiled-path - (cons directory %load-compiled-path))) - environment) + not-colon)) + (channels (package-path-entries))) + ;; Automatically add channels and items from $GUIX_PACKAGE_PATH to Guile's + ;; search path. For historical reasons, $GUIX_PACKAGE_PATH goes to the + ;; front; channels go to the back so that they don't override Guix' own + ;; modules. + (set! %load-path + (append environment %load-path channels)) + (set! %load-compiled-path + (append environment %load-compiled-path channels)) (make-parameter - (append environment `((,%distro-root-directory . "gnu/packages")))))) + (append environment + %default-package-module-path + channels)))) (define %patch-path ;; Define it after '%package-module-path' so that '%load-path' contains user diff --git a/guix/describe.scm b/guix/describe.scm new file mode 100644 index 0000000000..3122a762fe --- /dev/null +++ b/guix/describe.scm @@ -0,0 +1,73 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2018 Ludovic Courtès +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (guix describe) + #:use-module (guix memoization) + #:use-module (guix profiles) + #:use-module (srfi srfi-1) + #:use-module (ice-9 match) + #:export (package-path-entries)) + +;;; Commentary: +;;; +;;; This module provides supporting code to allow a Guix instance to find, at +;;; run time, which profile it's in (profiles created by 'guix pull'). That +;;; allows it to read meta-information about itself (e.g., repository URL and +;;; commit ID) and to find other channels available in the same profile. It's +;;; a bit like ELPA's pkg-info.el. +;;; +;;; Code: + +(define current-profile + (mlambda () + "Return the profile (created by 'guix pull') the calling process lives in, +or #f if this is not applicable." + (match (command-line) + ((program . _) + (and (string-suffix? "/bin/guix" program) + ;; Note: We want to do _lexical dot-dot resolution_. Using ".." + ;; for real would instead take us into the /gnu/store directory + ;; that ~/.config/guix/current/bin points to, whereas we want to + ;; obtain ~/.config/guix/current. + (let ((candidate (dirname (dirname program)))) + (and (file-exists? (string-append candidate "/manifest")) + candidate))))))) + +(define current-profile-entries + (mlambda () + "Return the list of entries in the 'guix pull' profile the calling process +lives in, or #f if this is not applicable." + (match (current-profile) + (#f '()) + (profile + (let ((manifest (profile-manifest profile))) + (manifest-entries manifest)))))) + +(define package-path-entries + (mlambda () + "Return a list of package path entries to be added to the package search +path. These entries are taken from the 'guix pull' profile the calling +process lives in, when applicable." + ;; Filter out Guix itself. + (filter-map (lambda (entry) + (and (not (string=? (manifest-entry-name entry) + "guix")) + (string-append (manifest-entry-item entry) + "/share/guile/site/" + (effective-version)))) + (current-profile-entries)))) -- cgit v1.2.3 From 0d39a3b98948314e135566b9315717695a9035ea Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 27 Aug 2018 18:05:49 +0200 Subject: Add (guix channels) and use it in (guix scripts pull). * guix/channels.scm: New file. * Makefile.am (MODULES): Add it. * guix/scripts/pull.scm: Use it. (%default-options): Remove 'repository-url' and 'ref'. (show-help, %options): Add '--channels'. (%self-build-file, %pull-version, build-from-source) (whole-package-for-legacy, derivation->manifest-entry): Remove. These now exist in a similar form in (guix channels). (build-and-install): Change 'source' to 'instances'. Remove #:url, #:branch, and #:commit. Rewrite using 'channel-instances->manifest'. (channel-list): New procedure. (guix-pull): Parameterize %REPOSITORY-CACHE-DIRECTORY. Call 'honor-lets-encrypt-certificates!' unconditionally. Load ~/.config/guix/channels.scm. Rewrite to use (guix channels). [use-le-certs?]: Remove. * po/guix/POTFILES.in: Add (guix channels). * doc/guix.texi (Invoking guix pull): Group the description of '--url', '--commit', and '--branch'. Remove mention of 'GUIX_PULL_URL'. Add references to "Channels". Document '--channels'. (Channels): New node. (Defining Packages): Link to "Channels" instead of "Package Modules". (Invoking guix edit): Link to "Package Modules" instead of "Defining Packages". (Package Modules): Document both GUIX_PACKAGE_PATH and channels. --- Makefile.am | 1 + doc/guix.texi | 277 +++++++++++++++++++++++++++++++++++++++-------- guix/channels.scm | 292 ++++++++++++++++++++++++++++++++++++++++++++++++++ guix/scripts/pull.scm | 218 +++++++++++++++++-------------------- po/guix/POTFILES.in | 1 + 5 files changed, 623 insertions(+), 166 deletions(-) create mode 100644 guix/channels.scm (limited to 'guix') diff --git a/Makefile.am b/Makefile.am index b6efd6d625..af6870cf67 100644 --- a/Makefile.am +++ b/Makefile.am @@ -87,6 +87,7 @@ MODULES = \ guix/grafts.scm \ guix/inferior.scm \ guix/describe.scm \ + guix/channels.scm \ guix/gnu-maintenance.scm \ guix/self.scm \ guix/upstream.scm \ diff --git a/doc/guix.texi b/doc/guix.texi index 8611059791..ad82c67932 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -146,17 +146,18 @@ Package Management * Packages with Multiple Outputs:: Single source package, multiple outputs. * Invoking guix gc:: Running the garbage collector. * Invoking guix pull:: Fetching the latest Guix and distribution. +* Channels:: Customizing the package collection. * Invoking guix pack:: Creating software bundles. * Invoking guix archive:: Exporting and importing store files. Substitutes -* Official Substitute Server:: One particular source of substitutes. -* Substitute Server Authorization:: How to enable or disable substitutes. -* Substitute Authentication:: How Guix verifies substitutes. -* Proxy Settings:: How to get substitutes via proxy. -* Substitution Failure:: What happens when substitution fails. -* On Trusting Binaries:: How can you trust that binary blob? +* Official Substitute Server:: One particular source of substitutes. +* Substitute Server Authorization:: How to enable or disable substitutes. +* Substitute Authentication:: How Guix verifies substitutes. +* Proxy Settings:: How to get substitutes via proxy. +* Substitution Failure:: What happens when substitution fails. +* On Trusting Binaries:: How can you trust that binary blob? Programming Interface @@ -202,7 +203,7 @@ GNU Distribution * System Installation:: Installing the whole operating system. * System Configuration:: Configuring the operating system. -* Documentation:: Browsing software user manuals. +* Documentation:: Browsing software user manuals. * Installing Debugging Files:: Feeding the debugger. * Security Updates:: Deploying security fixes quickly. * Package Modules:: Packages from the programmer's viewpoint. @@ -264,7 +265,7 @@ Services * Audio Services:: The MPD. * Virtualization Services:: Virtualization services. * Version Control Services:: Providing remote access to Git repositories. -* Game Services:: Game servers. +* Game Services:: Game servers. * Miscellaneous Services:: Other services. Defining Services @@ -1694,6 +1695,7 @@ guix package -i emacs-guix * Packages with Multiple Outputs:: Single source package, multiple outputs. * Invoking guix gc:: Running the garbage collector. * Invoking guix pull:: Fetching the latest Guix and distribution. +* Channels:: Customizing the package collection. * Invoking guix pack:: Creating software bundles. * Invoking guix archive:: Exporting and importing store files. @end menu @@ -2276,12 +2278,12 @@ pre-built package binaries, but source tarballs, for instance, which also result from derivation builds, can be available as substitutes. @menu -* Official Substitute Server:: One particular source of substitutes. -* Substitute Server Authorization:: How to enable or disable substitutes. -* Substitute Authentication:: How Guix verifies substitutes. -* Proxy Settings:: How to get substitutes via proxy. -* Substitution Failure:: What happens when substitution fails. -* On Trusting Binaries:: How can you trust that binary blob? +* Official Substitute Server:: One particular source of substitutes. +* Substitute Server Authorization:: How to enable or disable substitutes. +* Substitute Authentication:: How Guix verifies substitutes. +* Proxy Settings:: How to get substitutes via proxy. +* Substitution Failure:: What happens when substitution fails. +* On Trusting Binaries:: How can you trust that binary blob? @end menu @node Official Substitute Server @@ -2746,7 +2748,8 @@ the distribution currently available on your local machine. To update that distribution, along with the Guix tools, you must run @command{guix pull}: the command downloads the latest Guix source code and package descriptions, and deploys it. Source code is downloaded from a -@uref{https://git-scm.com, Git} repository. +@uref{https://git-scm.com, Git} repository, by default the official +GNU@tie{}Guix repository, though this can be customized. On completion, @command{guix package} will use packages and package versions from this just-retrieved copy of Guix. Not only that, but all @@ -2821,20 +2824,23 @@ but it supports the following options: Produce verbose output, writing build logs to the standard error output. @item --url=@var{url} -Download Guix from the Git repository at @var{url}. - -@vindex GUIX_PULL_URL -By default, the source is taken from its canonical Git repository at -@code{gnu.org}, for the stable branch of Guix. To use a different source, -set the @code{GUIX_PULL_URL} environment variable. - -@item --commit=@var{commit} -Deploy @var{commit}, a valid Git commit ID represented as a hexadecimal -string. - -@item --branch=@var{branch} -Deploy the tip of @var{branch}, the name of a Git branch available on -the repository at @var{url}. +@itemx --commit=@var{commit} +@itemx --branch=@var{branch} +Download code from the specified @var{url}, at the given @var{commit} (a valid +Git commit ID represented as a hexadecimal string), or @var{branch}. + +@cindex @file{channels.scm}, configuration file +@cindex configuration file for channels +These options are provided for convenience, but you can also specify your +configuration in the @file{~/.config/guix/channels.scm} file or using the +@option{--channels} option (see below). + +@item --channels=@var{file} +@itemx -C @var{file} +Read the list of channels from @var{file} instead of +@file{~/.config/guix/channels.scm}. @var{file} must contain Scheme code that +evaluates to a list of channel objects. @xref{Channels}, for more +information. @item --list-generations[=@var{pattern}] @itemx -l [@var{pattern}] @@ -2848,9 +2854,180 @@ Use the bootstrap Guile to build the latest Guix. This option is only useful to Guix developers. @end table +The @dfn{channel} mechanism allows you to instruct @command{guix pull} which +repository and branch to pull from, as well as @emph{additional} repositories +containing package modules that should be deployed. @xref{Channels}, for more +information. + In addition, @command{guix pull} supports all the common build options (@pxref{Common Build Options}). +@node Channels +@section Channels + +@cindex channels +@cindex @file{channels.scm}, configuration file +@cindex configuration file for channels +@cindex @command{guix pull}, configuration file +@cindex configuration of @command{guix pull} +Guix and its package collection are updated by running @command{guix pull} +(@pxref{Invoking guix pull}). By default @command{guix pull} downloads and +deploys Guix itself from the official GNU@tie{}Guix repository. This can be +customized by defining @dfn{channels} in the +@file{~/.config/guix/channels.scm} file. A channel specifies a URL and branch +of a Git repository to be deployed, and @command{guix pull} can be instructed +to pull from one or more channels. In other words, channels can be used to +@emph{customize} and to @emph{extend} Guix, as we will see below. + +@subsection Using a Custom Guix Channel + +The channel called @code{guix} specifies where Guix itself---its command-line +tools as well as its package collection---should be downloaded. For instance, +suppose you want to update from your own copy of the Guix repository at +@code{example.org}, and specifically the @code{super-hacks} branch, you can +write in @code{~/.config/guix/channels.scm} this specification: + +@lisp +;; Tell 'guix pull' to use my own repo. +(list (channel + (name 'guix) + (url "https://example.org/my-guix.git") + (branch "super-hacks"))) +@end lisp + +@noindent +From there on, @command{guix pull} will fetch code from the @code{super-hacks} +branch of the repository at @code{example.org}. + +@subsection Specifying Additional Channels + +@cindex extending the package collection (channels) +@cindex personal packages (channels) +@cindex channels, for personal packages +You can also specify @emph{additional channels} to pull from. Let's say you +have a bunch of custom package variants or personal packages that you think +would make little sense to contribute to the Guix project, but would like to +have these packages transparently available to you at the command line. You +would first write modules containing those package definitions (@pxref{Package +Modules}), maintain them in a Git repository, and then you and anyone else can +use it as an additional channel to get packages from. Neat, no? + +@c What follows stems from discussions at +@c as well as +@c earlier discussions on guix-devel@gnu.org. +@quotation Warning +Before you, dear user, shout---``woow this is @emph{soooo coool}!''---and +publish your personal channel to the world, we would like to share a few words +of caution: + +@itemize +@item +Before publishing a channel, please consider contributing your package +definitions to Guix proper (@pxref{Contributing}). Guix as a project is open +to free software of all sorts, and packages in Guix proper are readily +available to all Guix users and benefit from the project's quality assurance +process. + +@item +When you maintain package definitions outside Guix, we, Guix developers, +consider that @emph{the compatibility burden is on you}. Remember that +package modules and package definitions are just Scheme code that uses various +programming interfaces (APIs). We want to remain free to change these APIs to +keep improving Guix, possibly in ways that break your channel. We never +change APIs gratuitously, but we will @emph{not} commit to freezing APIs +either. + +@item +Corollary: if you're using an external channel and that channel breaks, please +@emph{report the issue to the channel authors}, not to the Guix project. +@end itemize + +You've been warned! Having said this, we believe external channels are a +practical way to exert your freedom to augment Guix' package collection and to +share your improvements, which are basic tenets of +@uref{https://www.gnu.org/philosophy/free-sw.html, free software}. Please +email us at @email{guix-devel@@gnu.org} if you'd like to discuss this. +@end quotation + +Once you have a Git repository containing your own package modules, you can +write @code{~/.config/guix/channels.scm} to instruct @command{guix pull} to +pull from your personal channel @emph{in addition} to the default Guix +channel(s): + +@vindex %default-channels +@lisp +;; Add my personal packages to those Guix provides. +(cons (channel + (name 'my-personal-packages) + (url "https://example.org/personal-packages.git")) + %default-channels) +@end lisp + +@noindent +Note that the snippet above is (as always!) Scheme code; we use @code{cons} to +add a channel the list of channels that the variable @code{%default-channels} +is bound to (@pxref{Pairs, @code{cons} and lists,, guile, GNU Guile Reference +Manual}). With this file in place, @command{guix pull} builds not only Guix +but also the package modules from your own repository. The result in +@file{~/.config/guix/current} is the union of Guix with your own package +modules: + +@example +$ guix pull --list-generations +@dots{} +Generation 19 Aug 27 2018 16:20:48 + guix d894ab8 + repository URL: https://git.savannah.gnu.org/git/guix.git + branch: master + commit: d894ab8e9bfabcefa6c49d9ba2e834dd5a73a300 + my-personal-packages dd3df5e + repository URL: https://example.org/personal-packages.git + branch: master + commit: dd3df5e2c8818760a8fc0bd699e55d3b69fef2bb + 11 new packages: my-gimp, my-emacs-with-cool-features, @dots{} + 4 packages upgraded: emacs-racket-mode@@0.0.2-2.1b78827, @dots{} +@end example + +@noindent +The output of @command{guix pull} above shows that Generation@tie{}19 includes +both Guix and packages from the @code{my-personal-packages} channel. Among +the new and upgraded packages that are listed, some like @code{my-gimp} and +@code{my-emacs-with-cool-features} might come from +@code{my-personal-packages}, while others come from the Guix default channel. + +@subsection Replicating Guix + +@cindex pinning, channels +@cindex replicating Guix +@cindex reproducibility, of Guix +The @command{guix pull --list-generations} output above shows precisely which +commits were used to build this instance of Guix. We can thus replicate it, +say, on another machine, by providing a channel specification in +@file{~/.config/guix/channels.scm} that is ``pinned'' to these commits: + +@lisp +;; Deploy specific commits of my channels of interest. +(list (channel + (name 'guix) + (url "https://git.savannah.gnu.org/git/guix.git") + (commit "d894ab8e9bfabcefa6c49d9ba2e834dd5a73a300")) + (channel + (name 'my-personal-packages) + (url "https://example.org/personal-packages.git") + (branch "dd3df5e2c8818760a8fc0bd699e55d3b69fef2bb"))) +@end lisp + +At this point the two machines run the @emph{exact same Guix}, with access to +the @emph{exact same packages}. The output of @command{guix build gimp} on +one machine will be exactly the same, bit for bit, as the output of the same +command on the other machine. It also means both machines have access to all +the source code of Guix and, transitively, to all the source code of every +package it defines. + +This gives you super powers, allowing you to track the provenance of binary +artifacts with very fine grain, and to reproduce software environments at +will---some sort of ``meta reproducibility'' capabilities, if you will. + @node Invoking guix pack @section Invoking @command{guix pack} @@ -3431,9 +3608,9 @@ more information on how to test package definitions, and @ref{Invoking guix lint}, for information on how to check a definition for style conformance. @vindex GUIX_PACKAGE_PATH -Lastly, @pxref{Package Modules}, for information +Lastly, @pxref{Channels}, for information on how to extend the distribution by adding your own package definitions -to @code{GUIX_PACKAGE_PATH}. +in a ``channel''. Finally, updating the package definition to a new upstream version can be partly automated by the @command{guix refresh} command @@ -6255,8 +6432,8 @@ and that of Vim. If you are using a Guix Git checkout (@pxref{Building from Git}), or have created your own packages on @code{GUIX_PACKAGE_PATH} -(@pxref{Defining Packages}), you will be able to edit the package -recipes. Otherwise, you will be able to examine the read-only recipes +(@pxref{Package Modules}), you will be able to edit the package +recipes. In other cases, you will be able to examine the read-only recipes for packages currently in the store. @@ -8376,7 +8553,7 @@ For information on porting to other architectures or kernels, @menu * System Installation:: Installing the whole operating system. * System Configuration:: Configuring the operating system. -* Documentation:: Browsing software user manuals. +* Documentation:: Browsing software user manuals. * Installing Debugging Files:: Feeding the debugger. * Security Updates:: Deploying security fixes quickly. * Package Modules:: Packages from the programmer's viewpoint. @@ -8415,7 +8592,7 @@ available. @menu * Limitations:: What you can expect. * Hardware Considerations:: Supported hardware. -* USB Stick and DVD Installation:: Preparing the installation medium. +* USB Stick and DVD Installation:: Preparing the installation medium. * Preparing for Installation:: Networking, partitioning, etc. * Proceeding with the Installation:: The real thing. * Installing GuixSD in a VM:: GuixSD playground. @@ -10096,7 +10273,7 @@ declaration. * Audio Services:: The MPD. * Virtualization Services:: Virtualization services. * Version Control Services:: Providing remote access to Git repositories. -* Game Services:: Game servers. +* Game Services:: Game servers. * Miscellaneous Services:: Other services. @end menu @@ -22641,16 +22818,24 @@ name and module name must match. For instance, the @code{(my-packages emacs)} module must be stored in a @file{my-packages/emacs.scm} file relative to the load path specified with @option{--load-path} or @code{GUIX_PACKAGE_PATH}. @xref{Modules and the File System,,, -guile, GNU Guile Reference Manual}, for details.}. These package definitions -will not be visible by default. Users can invoke commands such as -@command{guix package} and @command{guix build} with the -@code{-e} option so that they know where to find the package. Better -yet, they can use the -@code{-L} option of these commands to make those modules visible -(@pxref{Invoking guix build, @code{--load-path}}), or define the -@code{GUIX_PACKAGE_PATH} environment variable. This environment -variable makes it easy to extend or customize the distribution and is -honored by all the user interfaces. +guile, GNU Guile Reference Manual}, for details.}. There are two ways to make +these package definitions visible to the user interfaces: + +@enumerate +@item +By adding the directory containing your package modules to the search path +with the @code{-L} flag of @command{guix package} and other commands +(@pxref{Common Build Options}), or by setting the @code{GUIX_PACKAGE_PATH} +environment variable described below. + +@item +By defining a @dfn{channel} and configuring @command{guix pull} so that it +pulls from it. A channel is essentially a Git repository containing package +modules. @xref{Channels}, for more information on how to define and use +channels. +@end enumerate + +@code{GUIX_PACKAGE_PATH} works similarly to other search path variables: @defvr {Environment Variable} GUIX_PACKAGE_PATH This is a colon-separated list of directories to search for additional diff --git a/guix/channels.scm b/guix/channels.scm new file mode 100644 index 0000000000..ec3e05eaf5 --- /dev/null +++ b/guix/channels.scm @@ -0,0 +1,292 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2018 Ludovic Courtès +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (guix channels) + #:use-module (guix git) + #:use-module (guix records) + #:use-module (guix gexp) + #:use-module (guix discovery) + #:use-module (guix monads) + #:use-module (guix profiles) + #:use-module (guix derivations) + #:use-module (guix store) + #:use-module (guix i18n) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-9) + #:use-module (srfi srfi-11) + #:autoload (guix self) (whole-package) + #:use-module (ice-9 match) + #:export (channel + channel? + channel-name + channel-url + channel-branch + channel-commit + channel-location + + %default-channels + + channel-instance? + channel-instance-channel + channel-instance-commit + channel-instance-checkout + + latest-channel-instances + channel-instance-derivations + latest-channel-derivations + channel-instances->manifest)) + +;;; Commentary: +;;; +;;; This module implements "channels." A channel is usually a source of +;;; package definitions. There's a special channel, the 'guix' channel, that +;;; provides all of Guix, including its commands and its documentation. +;;; User-defined channels are expected to typically provide a bunch of .scm +;;; files meant to be added to the '%package-search-path'. +;;; +;;; This module provides tools to fetch and update channels from a Git +;;; repository and to build them. +;;; +;;; Code: + +(define-record-type* channel make-channel + channel? + (name channel-name) + (url channel-url) + (branch channel-branch (default "master")) + (commit channel-commit (default #f)) + (location channel-location + (default (current-source-location)) (innate))) +;; TODO: Add a way to express dependencies among channels. + +(define %default-channels + ;; Default list of channels. + (list (channel + (name 'guix) + (branch "origin/master") + (url "https://git.savannah.gnu.org/git/guix.git")))) + +(define (guix-channel? channel) + "Return true if CHANNEL is the 'guix' channel." + (eq? 'guix (channel-name channel))) + +(define-record-type + (channel-instance channel commit checkout) + channel-instance? + (channel channel-instance-channel) + (commit channel-instance-commit) + (checkout channel-instance-checkout)) + +(define (channel-reference channel) + "Return the \"reference\" for CHANNEL, an sexp suitable for +'latest-repository-commit'." + (match (channel-commit channel) + (#f `(branch . ,(channel-branch channel))) + (commit `(commit . ,(channel-commit channel))))) + +(define (latest-channel-instances store channels) + "Return a list of channel instances corresponding to the latest checkouts of +CHANNELS." + (map (lambda (channel) + (format (current-error-port) + (G_ "Updating channel '~a' from Git repository at '~a'...~%") + (channel-name channel) + (channel-url channel)) + (let-values (((checkout commit) + (latest-repository-commit store (channel-url channel) + #:ref (channel-reference + channel)))) + (channel-instance channel commit checkout))) + channels)) + +(define %self-build-file + ;; The file containing code to build Guix. This serves the same purpose as + ;; a makefile, and, similarly, is intended to always keep this name. + "build-aux/build-self.scm") + +(define %pull-version + ;; This is the version of the 'guix pull' protocol. It specifies what's + ;; expected from %SELF-BUILD-FILE. The initial version ("0") was when we'd + ;; place a set of compiled Guile modules in ~/.config/guix/latest. + 1) + +(define (standard-module-derivation name source dependencies) + "Return a derivation that builds the Scheme modules in SOURCE and that +depend on DEPENDENCIES, a list of lowerable objects. The assumption is that +SOURCE contains package modules to be added to '%package-module-path'." + (define modules + (scheme-modules* source)) + + ;; FIXME: We should load, say SOURCE/.guix-channel.scm, which would allow + ;; channel publishers to specify things such as the sub-directory where .scm + ;; files live, files to exclude from the channel, preferred substitute URLs, + ;; etc. + (mlet* %store-monad ((compiled + (compiled-modules modules + #:name name + #:module-path (list source) + #:extensions dependencies))) + + (gexp->derivation name + (with-extensions dependencies + (with-imported-modules '((guix build utils)) + #~(begin + (use-modules (guix build utils)) + + (let ((go (string-append #$output "/lib/guile/" + (effective-version) + "/site-ccache")) + (scm (string-append #$output + "/share/guile/site/" + (effective-version)))) + (mkdir-p (dirname go)) + (symlink #$compiled go) + (mkdir-p (dirname scm)) + (symlink #$source scm)))))))) + +(define* (build-from-source name source + #:key verbose? commit + (dependencies '())) + "Return a derivation to build Guix from SOURCE, using the self-build script +contained therein. Use COMMIT as the version string." + ;; Running the self-build script makes it easier to update the build + ;; procedure: the self-build script of the Guix-to-be-installed contains the + ;; right dependencies, build procedure, etc., which the Guix-in-use may not + ;; be know. + (define script + (string-append source "/" %self-build-file)) + + (if (file-exists? script) + (let ((build (save-module-excursion + (lambda () + (primitive-load script))))) + ;; BUILD must be a monadic procedure of at least one argument: the + ;; source tree. + ;; + ;; Note: BUILD can return #f if it does not support %PULL-VERSION. In + ;; the future we'll fall back to a previous version of the protocol + ;; when that happens. + (build source #:verbose? verbose? #:version commit + #:pull-version %pull-version)) + + ;; Build a set of modules that extend Guix using the standard method. + (standard-module-derivation name source dependencies))) + +(define* (build-channel-instance instance #:optional (dependencies '())) + "Return, as a monadic value, the derivation for INSTANCE, a channel +instance. DEPENDENCIES is a list of extensions providing Guile modules that +INSTANCE depends on." + (build-from-source (symbol->string + (channel-name (channel-instance-channel instance))) + (channel-instance-checkout instance) + #:commit (channel-instance-commit instance) + #:dependencies dependencies)) + +(define (channel-instance-derivations instances) + "Return the list of derivations to build INSTANCES, in the same order as +INSTANCES." + (define core-instance + ;; The 'guix' channel is treated specially: it's an implicit dependency of + ;; all the other channels. + (find (lambda (instance) + (guix-channel? (channel-instance-channel instance))) + instances)) + + (mlet %store-monad ((core (build-channel-instance core-instance))) + (mapm %store-monad + (lambda (instance) + (if (eq? instance core-instance) + (return core) + (build-channel-instance instance + (list core)))) + instances))) + +(define latest-channel-derivations + (let ((latest-channel-instances (store-lift latest-channel-instances))) + (lambda (channels) + "Return, as a monadic value, the list of derivations for the latest +instances of CHANNELS." + (mlet %store-monad ((instances (latest-channel-instances channels))) + (channel-instance-derivations instances))))) + +(define (whole-package-for-legacy name modules) + "Return a full-blown Guix package for MODULES, a derivation that builds Guix +modules in the old ~/.config/guix/latest style." + (define packages + (resolve-interface '(gnu packages guile))) + + (letrec-syntax ((list (syntax-rules (->) + ((_) + '()) + ((_ (module -> variable) rest ...) + (cons (module-ref (resolve-interface + '(gnu packages module)) + 'variable) + (list rest ...))) + ((_ variable rest ...) + (cons (module-ref packages 'variable) + (list rest ...)))))) + (whole-package name modules + + ;; In the "old style", %SELF-BUILD-FILE would simply return a + ;; derivation that builds modules. We have to infer what the + ;; dependencies of these modules were. + (list guile-json guile-git guile-bytestructures + (ssh -> guile-ssh) (tls -> gnutls))))) + +(define (old-style-guix? drv) + "Return true if DRV corresponds to a ~/.config/guix/latest style of +derivation." + ;; Here we rely on a gross historical fact: that derivations produced by the + ;; "old style" (before commit 8a0d9bc8a3f153159d9e239a151c0fa98f1e12d8, + ;; dated May 30, 2018) did not depend on "guix-command.drv". + (not (find (lambda (input) + (string-suffix? "-guix-command.drv" + (derivation-input-path input))) + (derivation-inputs drv)))) + +(define (channel-instances->manifest instances) + "Return a profile manifest with entries for all of INSTANCES, a list of +channel instances." + (define instance->entry + (match-lambda + ((instance drv) + (let ((commit (channel-instance-commit instance)) + (channel (channel-instance-channel instance))) + (with-monad %store-monad + (return (manifest-entry + (name (symbol->string (channel-name channel))) + (version (string-take commit 7)) + (item (if (guix-channel? channel) + (if (old-style-guix? drv) + (whole-package-for-legacy + (string-append name "-" version) + drv) + drv) + drv)) + (properties + `((source (repository + (version 0) + (url ,(channel-url channel)) + (branch ,(channel-branch channel)) + (commit ,commit)))))))))))) + + (mlet* %store-monad ((derivations (channel-instance-derivations instances)) + (entries (mapm %store-monad instance->entry + (zip instances derivations)))) + (return (manifest entries)))) diff --git a/guix/scripts/pull.scm b/guix/scripts/pull.scm index ee68c21a4c..18c04f05dd 100644 --- a/guix/scripts/pull.scm +++ b/guix/scripts/pull.scm @@ -30,26 +30,19 @@ #:use-module (guix grafts) #:use-module (guix memoization) #:use-module (guix monads) + #:use-module (guix channels) #:autoload (guix inferior) (open-inferior) #:use-module (guix scripts build) - #:autoload (guix self) (whole-package) #:use-module (guix git) #:use-module (git) #:use-module (gnu packages) - #:autoload (gnu packages ssh) (guile-ssh) - #:autoload (gnu packages tls) (gnutls) #:use-module ((guix scripts package) #:select (build-and-use-profile)) - #:use-module ((guix build utils) - #:select (with-directory-excursion delete-file-recursively)) - #:use-module ((guix build download) - #:select (%x509-certificate-directory)) #:use-module (gnu packages base) #:use-module (gnu packages guile) #:use-module ((gnu packages bootstrap) #:select (%bootstrap-guile)) #:use-module ((gnu packages certs) #:select (le-certs)) #:use-module (srfi srfi-1) - #:use-module (srfi srfi-11) #:use-module (srfi srfi-26) #:use-module (srfi srfi-35) #:use-module (srfi srfi-37) @@ -57,9 +50,6 @@ #:use-module (ice-9 vlist) #:export (guix-pull)) -(define %repository-url - (or (getenv "GUIX_PULL_URL") "https://git.savannah.gnu.org/git/guix.git")) - ;;; ;;; Command-line options. @@ -67,9 +57,7 @@ (define %default-options ;; Alist of default option values. - `((repository-url . ,%repository-url) - (ref . (branch . "origin/master")) - (system . ,(%current-system)) + `((system . ,(%current-system)) (substitutes? . #t) (build-hook? . #t) (graft? . #t) @@ -80,6 +68,8 @@ Download and deploy the latest version of Guix.\n")) (display (G_ " --verbose produce verbose output")) + (display (G_ " + -C, --channels=FILE deploy the channels defined in FILE")) (display (G_ " --url=URL download from the Git repository at URL")) (display (G_ " @@ -105,6 +95,9 @@ Download and deploy the latest version of Guix.\n")) (cons* (option '("verbose") #f #f (lambda (opt name arg result) (alist-cons 'verbose? #t result))) + (option '(#\C "channels") #t #f + (lambda (opt name arg result) + (alist-cons 'channel-file arg result))) (option '(#\l "list-generations") #f #t (lambda (opt name arg result) (cons `(query list-generations ,(or arg "")) @@ -142,70 +135,6 @@ Download and deploy the latest version of Guix.\n")) (define indirect-root-added (store-lift add-indirect-root)) -(define %self-build-file - ;; The file containing code to build Guix. This serves the same purpose as - ;; a makefile, and, similarly, is intended to always keep this name. - "build-aux/build-self.scm") - -(define %pull-version - ;; This is the version of the 'guix pull' protocol. It specifies what's - ;; expected from %SELF-BUILD-FILE. The initial version ("0") was when we'd - ;; place a set of compiled Guile modules in ~/.config/guix/latest. - 1) - -(define* (build-from-source source - #:key verbose? commit) - "Return a derivation to build Guix from SOURCE, using the self-build script -contained therein. Use COMMIT as the version string." - ;; Running the self-build script makes it easier to update the build - ;; procedure: the self-build script of the Guix-to-be-installed contains the - ;; right dependencies, build procedure, etc., which the Guix-in-use may not - ;; be know. - (let* ((script (string-append source "/" %self-build-file)) - (build (primitive-load script))) - ;; BUILD must be a monadic procedure of at least one argument: the source - ;; tree. - ;; - ;; Note: BUILD can return #f if it does not support %PULL-VERSION. In the - ;; future we'll fall back to a previous version of the protocol when that - ;; happens. - (build source #:verbose? verbose? #:version commit - #:pull-version %pull-version))) - -(define (whole-package-for-legacy name modules) - "Return a full-blown Guix package for MODULES, a derivation that builds Guix -modules in the old ~/.config/guix/latest style." - (whole-package name modules - - ;; In the "old style", %SELF-BUILD-FILE would simply return a - ;; derivation that builds modules. We have to infer what the - ;; dependencies of these modules were. - (list guile-json guile-git guile-bytestructures - guile-ssh gnutls))) - -(define* (derivation->manifest-entry drv - #:key url branch commit) - "Return a manifest entry for DRV, which represents Guix at COMMIT. Record -URL, BRANCH, and COMMIT as a property in the manifest entry." - (mbegin %store-monad - (what-to-build (list drv)) - (built-derivations (list drv)) - (let ((out (derivation->output-path drv))) - (return (manifest-entry - (name "guix") - (version (string-take commit 7)) - (item (if (file-exists? (string-append out "/bin/guix")) - drv - (whole-package-for-legacy (string-append name "-" - version) - drv))) - (properties - `((source (repository - (version 0) - (url ,url) - (branch ,branch) - (commit ,commit)))))))))) - (define (display-profile-news profile) "Display what's up in PROFILE--new packages, and all that." (match (memv (generation-number profile) @@ -223,8 +152,8 @@ URL, BRANCH, and COMMIT as a property in the manifest entry." #:heading (G_ "New in this revision:\n")))) (_ #t))) -(define* (build-and-install source config-dir - #:key verbose? url branch commit) +(define* (build-and-install instances config-dir + #:key verbose?) "Build the tool from SOURCE, and install it in CONFIG-DIR." (define update-profile (store-lift build-and-use-profile)) @@ -232,15 +161,9 @@ URL, BRANCH, and COMMIT as a property in the manifest entry." (define profile (string-append config-dir "/current")) - (mlet* %store-monad ((drv (build-from-source source - #:commit commit - #:verbose? verbose?)) - (entry (derivation->manifest-entry drv - #:url url - #:branch branch - #:commit commit))) + (mlet %store-monad ((manifest (channel-instances->manifest instances))) (mbegin %store-monad - (update-profile profile (manifest (list entry))) + (update-profile profile manifest) (return (display-profile-news profile))))) (define (honor-lets-encrypt-certificates! store) @@ -426,45 +349,106 @@ and ALIST2 differ, display HEADING upfront." ((numbers ...) (list-generations profile numbers))))))))) +(define (channel-list opts) + "Return the list of channels to use. If OPTS specify a channel file, +channels are read from there; otherwise, if ~/.config/guix/channels.scm +exists, read it; otherwise %DEFAULT-CHANNELS is used. Apply channel +transformations specified in OPTS (resulting from '--url', '--commit', or +'--branch'), if any." + (define file + (assoc-ref opts 'channel-file)) + + (define default-file + (string-append (config-directory) "/channels.scm")) + + (define (load-channels file) + (let ((result (load* file (make-user-module '((guix channels)))))) + (if (and (list? result) (every channel? result)) + result + (leave (G_ "'~a' did not return a list of channels~%") file)))) + + (define channels + (cond (file + (load-channels file)) + ((file-exists? default-file) + (load-channels default-file)) + (else + %default-channels))) + + (define (environment-variable) + (match (getenv "GUIX_PULL_URL") + (#f #f) + (url + (warning (G_ "The 'GUIX_PULL_URL' environment variable is deprecated. +Use '~/.config/guix/channels.scm' instead.")) + url))) + + (let ((ref (assoc-ref opts 'ref)) + (url (or (assoc-ref opts 'repository-url) + (environment-variable)))) + (if (or ref url) + (match channels + ((one) + ;; When there's only one channel, apply '--url', '--commit', and + ;; '--branch' to this specific channel. + (let ((url (or url (channel-url one)))) + (list (match ref + (('commit . commit) + (channel (inherit one) + (url url) (commit commit) (branch #f))) + (('branch . branch) + (channel (inherit one) + (url url) (commit #f) (branch branch))) + (#f + (channel (inherit one) (url url))))))) + (_ + ;; Otherwise bail out. + (leave + (G_ "'--url', '--commit', and '--branch' are not applicable~%")))) + channels))) + (define (guix-pull . args) - (define (use-le-certs? url) - (string-prefix? "https://git.savannah.gnu.org/" url)) - (with-error-handling (with-git-error-handling - (let* ((opts (parse-command-line args %options - (list %default-options))) - (url (assoc-ref opts 'repository-url)) - (ref (assoc-ref opts 'ref)) - (cache (string-append (cache-directory) "/pull"))) + (let* ((opts (parse-command-line args %options + (list %default-options))) + (cache (string-append (cache-directory) "/pull")) + (channels (channel-list opts))) + (cond ((assoc-ref opts 'query) (process-query opts)) ((assoc-ref opts 'dry-run?) #t) ;XXX: not very useful (else (with-store store - (parameterize ((%graft? (assoc-ref opts 'graft?))) + (parameterize ((%graft? (assoc-ref opts 'graft?)) + (%repository-cache-directory cache)) (set-build-options-from-command-line store opts) - ;; For reproducibility, always refer to the LE certificates - ;; when we know we're talking to Savannah. - (when (use-le-certs? url) - (honor-lets-encrypt-certificates! store)) - - (format (current-error-port) - (G_ "Updating from Git repository at '~a'...~%") - url) - - (let-values (((checkout commit) - (latest-repository-commit store url - #:ref ref - #:cache-directory - cache))) + ;; When certificates are already installed, use them. + ;; Otherwise, use the Let's Encrypt certificates, which we + ;; know Savannah uses. + (let ((certs (or (getenv "SSL_CERT_DIR") "/etc/ssl/certs"))) + (unless (file-exists? certs) + (honor-lets-encrypt-certificates! store))) + (let ((instances (latest-channel-instances store channels))) (format (current-error-port) - (G_ "Building from Git commit ~a...~%") - commit) + (N_ "Building from this channel:~%" + "Building from these channels:~%" + (length instances))) + (for-each (lambda (instance) + (let ((channel + (channel-instance-channel instance))) + (format (current-error-port) + " ~10a~a\t~a~%" + (channel-name channel) + (channel-url channel) + (string-take + (channel-instance-commit instance) + 7)))) + instances) (parameterize ((%guile-for-build (package-derivation store @@ -472,13 +456,7 @@ and ALIST2 differ, display HEADING upfront." %bootstrap-guile (canonical-package guile-2.2))))) (run-with-store store - (build-and-install checkout (config-directory) - #:url url - #:branch (match ref - (('branch . branch) - branch) - (_ #f)) - #:commit commit + (build-and-install instances (config-directory) #:verbose? (assoc-ref opts 'verbose?))))))))))))) diff --git a/po/guix/POTFILES.in b/po/guix/POTFILES.in index d11f408d42..7f881355e7 100644 --- a/po/guix/POTFILES.in +++ b/po/guix/POTFILES.in @@ -38,4 +38,5 @@ guix/upstream.scm guix/ui.scm guix/http-client.scm guix/nar.scm +guix/channels.scm nix/nix-daemon/guix-daemon.cc -- cgit v1.2.3