From b98293ebed46086c21cdd975c4a8c6139b2edcd0 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Tue, 22 Mar 2016 15:12:30 +0100 Subject: import: cran: Accept single URL in addition to single URL. * guix/import/cran.scm (package->upstream-name): Match single URL in addition to list of URLs. --- guix/import/cran.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guix') diff --git a/guix/import/cran.scm b/guix/import/cran.scm index f36e9482cf..562917c0a0 100644 --- a/guix/import/cran.scm +++ b/guix/import/cran.scm @@ -227,7 +227,7 @@ s-expression corresponding to that package, or #f on failure." (match (package-source package) ((? origin? origin) (match (origin-uri origin) - ((url rest ...) + ((or (? string? url) (url _ ...)) (let ((end (string-rindex url #\_)) (start (string-rindex url #\/))) ;; The URL ends on -- cgit v1.2.3 From 8c321299c532e620c0d2327dd15acad3d6b4476c Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 22 Mar 2016 09:57:15 +0100 Subject: substitute: Gracefully handle TLS errors. * guix/scripts/substitute.scm (with-networking): Use 'match-lambda*' and add case for 'gnutls-error'. --- guix/scripts/substitute.scm | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'guix') diff --git a/guix/scripts/substitute.scm b/guix/scripts/substitute.scm index 4563f3df0f..82ce069598 100755 --- a/guix/scripts/substitute.scm +++ b/guix/scripts/substitute.scm @@ -780,16 +780,24 @@ PORT. REPORT-PROGRESS is a two-argument procedure such as that returned by (define-syntax with-networking (syntax-rules () - "Catch DNS lookup errors and gracefully exit." + "Catch DNS lookup errors and TLS errors and gracefully exit." ;; Note: no attempt is made to catch other networking errors, because DNS ;; lookup errors are typically the first one, and because other errors are ;; a subset of `system-error', which is harder to filter. ((_ exp ...) - (catch 'getaddrinfo-error + (catch #t (lambda () exp ...) - (lambda (key error) - (leave (_ "host name lookup error: ~a~%") - (gai-strerror error))))))) + (match-lambda* + (('getaddrinfo-error error) + (leave (_ "host name lookup error: ~a~%") + (gai-strerror error))) + (('gnutls-error error proc . rest) + (let ((error->string (module-ref (resolve-interface '(gnutls)) + 'error->string))) + (leave (_ "TLS error in procedure '~a': ~a~%") + proc (error->string error)))) + (args + (apply throw args))))))) ;;; -- cgit v1.2.3 From 6985335faaa23965887b62ce8123f8f12e352bd5 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 22 Mar 2016 14:58:59 +0100 Subject: derivations: Add 'module->source-file-name'. * guix/derivations.scm (module->source-file-name): New procedure. (%imported-modules): Use it. * guix/gexp.scm (imported-modules): Likewise. --- guix/derivations.scm | 11 ++++++++--- guix/gexp.scm | 4 +--- 2 files changed, 9 insertions(+), 6 deletions(-) (limited to 'guix') diff --git a/guix/derivations.scm b/guix/derivations.scm index f24e3c6f92..2af65b1dc0 100644 --- a/guix/derivations.scm +++ b/guix/derivations.scm @@ -91,6 +91,7 @@ built-derivations + module->source-file-name build-expression->derivation) ;; Re-export it from here for backward compatibility. @@ -1040,6 +1041,12 @@ system, imported, and appears under FINAL-PATH in the resulting store path." ;; up looking for the same files over and over again. (memoize search-path)) +(define (module->source-file-name module) + "Return the file name corresponding to MODULE, a Guile module name (a list +of symbols.)" + (string-append (string-join (map symbol->string module) "/") + ".scm")) + (define* (%imported-modules store modules ;deprecated #:key (name "module-import") (system (%current-system)) @@ -1051,9 +1058,7 @@ search path." ;; TODO: Determine the closure of MODULES, build the `.go' files, ;; canonicalize the source files through read/write, etc. (let ((files (map (lambda (m) - (let ((f (string-append - (string-join (map symbol->string m) "/") - ".scm"))) + (let ((f (module->source-file-name m))) (cons f (search-path* module-path f)))) modules))) (imported-files store files #:name name #:system system diff --git a/guix/gexp.scm b/guix/gexp.scm index 7cbc79c31c..c408c94c43 100644 --- a/guix/gexp.scm +++ b/guix/gexp.scm @@ -918,9 +918,7 @@ search path." ;; TODO: Determine the closure of MODULES, build the `.go' files, ;; canonicalize the source files through read/write, etc. (let ((files (map (lambda (m) - (let ((f (string-append - (string-join (map symbol->string m) "/") - ".scm"))) + (let ((f (module->source-file-name m))) (cons f (search-path* module-path f)))) modules))) (imported-files files #:name name #:system system -- cgit v1.2.3 From d26e19671e2a50a25d37357aba301bef5df1818e Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 22 Mar 2016 15:00:53 +0100 Subject: derivations: Raise an error when a module file is not found. Suggested by Jookia. * guix/derivations.scm (&file-search-error): New error condition. (search-path*): Raise it when 'search-path' returns #f. * guix/gexp.scm (search-path*): Remove. * guix/ui.scm (call-with-error-handling): Add case for 'file-search-error?'. * tests/derivations.scm ("build-expression->derivation and invalid module name"): New test. --- guix/derivations.scm | 18 +++++++++++++++++- guix/gexp.scm | 5 ----- guix/ui.scm | 5 +++++ tests/derivations.scm | 9 +++++++++ 4 files changed, 31 insertions(+), 6 deletions(-) (limited to 'guix') diff --git a/guix/derivations.scm b/guix/derivations.scm index 2af65b1dc0..2d8584e72d 100644 --- a/guix/derivations.scm +++ b/guix/derivations.scm @@ -90,7 +90,11 @@ build-derivations built-derivations + file-search-error? + file-search-error-file-name + file-search-error-search-path + search-path* module->source-file-name build-expression->derivation) @@ -1036,10 +1040,22 @@ system, imported, and appears under FINAL-PATH in the resulting store path." #:guile-for-build guile #:local-build? #t))) +;; The "file not found" error condition. +(define-condition-type &file-search-error &error + file-search-error? + (file file-search-error-file-name) + (path file-search-error-search-path)) + (define search-path* ;; A memoizing version of 'search-path' so 'imported-modules' does not end ;; up looking for the same files over and over again. - (memoize search-path)) + (memoize (lambda (path file) + "Search for FILE in PATH and memoize the result. Raise a +'&file-search-error' condition if it could not be found." + (or (search-path path file) + (raise (condition + (&file-search-error (file file) + (path path)))))))) (define (module->source-file-name module) "Return the file name corresponding to MODULE, a Guile module name (a list diff --git a/guix/gexp.scm b/guix/gexp.scm index c408c94c43..b4d737ecae 100644 --- a/guix/gexp.scm +++ b/guix/gexp.scm @@ -902,11 +902,6 @@ system, imported, and appears under FINAL-PATH in the resulting store path." #:guile-for-build guile #:local-build? #t))) -(define search-path* - ;; A memoizing version of 'search-path' so 'imported-modules' does not end - ;; up looking for the same files over and over again. - (memoize search-path)) - (define* (imported-modules modules #:key (name "module-import") (system (%current-system)) diff --git a/guix/ui.scm b/guix/ui.scm index 7b7bee0ac8..3b1887ccbf 100644 --- a/guix/ui.scm +++ b/guix/ui.scm @@ -461,6 +461,11 @@ interpreted." (leave (_ "reference to invalid output '~a' of derivation '~a'~%") (derivation-missing-output c) (derivation-file-name (derivation-error-derivation c)))) + ((file-search-error? c) + (leave (_ "file '~a' could not be found in these \ +directories:~{ ~a~}~%") + (file-search-error-file-name c) + (file-search-error-search-path c))) ((message-condition? c) ;; Normally '&message' error conditions have an i18n'd message. (leave (_ "~a~%") diff --git a/tests/derivations.scm b/tests/derivations.scm index 4d3b82fe1a..a52142e0f1 100644 --- a/tests/derivations.scm +++ b/tests/derivations.scm @@ -570,6 +570,15 @@ (test-skip (if (%guile-for-build) 0 8)) +(test-equal "build-expression->derivation and invalid module name" + '(file-search-error "guix/module/that/does/not/exist.scm") + (guard (c ((file-search-error? c) + (list 'file-search-error + (file-search-error-file-name c)))) + (build-expression->derivation %store "foo" #t + #:modules '((guix module that + does not exist))))) + (test-assert "build-expression->derivation and derivation-prerequisites" (let ((drv (build-expression->derivation %store "fail" #f))) (any (match-lambda -- cgit v1.2.3 From 9a2a20052a1a9c384a1b877d7c71d2d239f9467e Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 23 Mar 2016 22:32:44 +0100 Subject: guix build: '--with-source' correctly matches versioned file names. * guix/scripts/build.scm: Use the right 'package-name->name+version' procedure. Fixes a regression introduced in 1b846da8c372bee78851439fd9e72b2499115e5a. * tests/scripts-build.scm ("options->transformation, with-source, with version"): New test. --- guix/scripts/build.scm | 6 +++++- tests/scripts-build.scm | 20 ++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) (limited to 'guix') diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm index b25bf50d2b..9a6b427fc5 100644 --- a/guix/scripts/build.scm +++ b/guix/scripts/build.scm @@ -24,7 +24,11 @@ #:use-module (guix derivations) #:use-module (guix packages) #:use-module (guix grafts) - #:use-module (guix utils) + + ;; Use the procedure that destructures "NAME-VERSION" forms. + #:use-module ((guix utils) #:hide (package-name->name+version)) + #:use-module ((guix build utils) #:select (package-name->name+version)) + #:use-module (guix monads) #:use-module (guix gexp) #:autoload (guix http-client) (http-fetch http-get-error?) diff --git a/tests/scripts-build.scm b/tests/scripts-build.scm index 94ddaf447b..cf9770e952 100644 --- a/tests/scripts-build.scm +++ b/tests/scripts-build.scm @@ -22,6 +22,7 @@ #:use-module (guix packages) #:use-module (guix scripts build) #:use-module (guix ui) + #:use-module (guix utils) #:use-module (gnu packages base) #:use-module (gnu packages busybox) #:use-module (ice-9 match) @@ -49,6 +50,25 @@ (add-to-store store "guix.scm" #t "sha256" s))))))) +(test-assert "options->transformation, with-source, with version" + ;; Our pseudo-package is called 'guix.scm' so the 'guix.scm-2.0' source + ;; should be applicable, and its version should be extracted. + (let ((p (dummy-package "foo")) + (s (search-path %load-path "guix.scm"))) + (call-with-temporary-directory + (lambda (directory) + (let* ((f (string-append directory "/foo-42.0.tar.gz")) + (t (options->transformation `((with-source . ,f))))) + (copy-file s f) + (with-store store + (let ((new (t store p))) + (and (not (eq? new p)) + (string=? (package-name new) (package-name p)) + (string=? (package-version new) "42.0") + (string=? (package-source new) + (add-to-store store (basename f) #t + "sha256" f)))))))))) + (test-assert "options->transformation, with-source, no matches" ;; When a transformation in not applicable, a warning must be raised. (let* ((p (dummy-package "foobar")) -- cgit v1.2.3 From 001dae0d7431719655f525a94dc900cc078cca99 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 25 Mar 2016 17:24:47 +0100 Subject: syscalls: printer correctly handles lack of sockaddr. Reported by Danny Milosavljevic in . * guix/build/syscalls.scm (write-interface): Check whether ADDRESS is true. --- guix/build/syscalls.scm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'guix') diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm index ea68b22bb7..69a507def8 100644 --- a/guix/build/syscalls.scm +++ b/guix/build/syscalls.scm @@ -767,10 +767,14 @@ the same type as that returned by 'make-socket-address'." (format port "#" (number->string (object-address interface) 16))))) (set-record-type-printer! write-interface) -- cgit v1.2.3 From a01ad63893da1f1cf1b35482037382030724716c Mon Sep 17 00:00:00 2001 From: David Thompson Date: Thu, 17 Mar 2016 23:19:25 -0400 Subject: environment: container: Create dummy home directory and /etc/passwd. * guix/scripts/environment.scm (launch-environment/container): Change $HOME to the current user's home directory instead of /homeless-shelter. Create a dummy /etc/passwd with a single entry for the current user. * doc/guix.texi ("invoking guix environment"): Add a note about the dummy home directory and /etc/passwd. --- doc/guix.texi | 15 ++++++++------- guix/scripts/environment.scm | 31 +++++++++++++++++++++---------- 2 files changed, 29 insertions(+), 17 deletions(-) (limited to 'guix') diff --git a/doc/guix.texi b/doc/guix.texi index b618480353..008a5cf714 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -3292,7 +3292,7 @@ omitted since it will take place implicitly, as we will see later @end example @c See -@c +@c @c for the funny quote. Calling the monadic @code{sh-symlink} has no effect. As someone once said, ``you exit a monad like you exit a building on fire: by running''. @@ -4339,7 +4339,7 @@ So for instance, imagine you want to see the build log of GDB on MIPS, but you are actually on an @code{x86_64} machine: @example -$ guix build --log-file gdb -s mips64el-linux +$ guix build --log-file gdb -s mips64el-linux https://hydra.gnu.org/log/@dots{}-gdb-7.10 @end example @@ -5338,10 +5338,11 @@ Attempt to build for @var{system}---e.g., @code{i686-linux}. @itemx -C @cindex container Run @var{command} within an isolated container. The current working -directory outside the container is mapped inside the -container. Additionally, the spawned process runs as the current user -outside the container, but has root privileges in the context of the -container. +directory outside the container is mapped inside the container. +Additionally, a dummy home directory is created that matches the current +user's home directory, and @file{/etc/passwd} is configured accordingly. +The spawned process runs as the current user outside the container, but +has root privileges in the context of the container. @item --network @itemx -N @@ -8748,7 +8749,7 @@ isn't enough disk space, just skip it. @item fcntl Use this if possible. Works with NFS too if lockd is used. @item flock -May not exist in all systems. Doesn't work with NFS. +May not exist in all systems. Doesn't work with NFS. @item lockf May not exist in all systems. Doesn't work with NFS. @end table diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm index b122b4cd40..0d5cab432c 100644 --- a/guix/scripts/environment.scm +++ b/guix/scripts/environment.scm @@ -373,6 +373,7 @@ host file systems to mount inside the container." (list (direct-store-path bash) profile)))) (return (let* ((cwd (getcwd)) + (passwd (getpwuid (getuid))) ;; Bind-mount all requisite store items, user-specified mappings, ;; /bin/sh, the current working directory, and possibly networking ;; configuration files within the container. @@ -417,16 +418,26 @@ host file systems to mount inside the container." ;; The same variables as in Nix's 'build.cc'. '("TMPDIR" "TEMPDIR" "TMP" "TEMP")) - ;; From Nix build.cc: - ;; - ;; Set HOME to a non-existing path to prevent certain - ;; programs from using /etc/passwd (or NIS, or whatever) - ;; to locate the home directory (for example, wget looks - ;; for ~/.wgetrc). I.e., these tools use /etc/passwd if - ;; HOME is not set, but they will just assume that the - ;; settings file they are looking for does not exist if - ;; HOME is set but points to some non-existing path. - (setenv "HOME" "/homeless-shelter") + ;; Create a dummy home directory under the same name as on the + ;; host. + (mkdir-p (passwd:dir passwd)) + (setenv "HOME" (passwd:dir passwd)) + + ;; Create a dummy /etc/passwd to satisfy applications that demand + ;; to read it, such as 'git clone' over SSH, a valid use-case when + ;; sharing the host's network namespace. + (mkdir-p "/etc") + (call-with-output-file "/etc/passwd" + (lambda (port) + (display (string-join (list (passwd:name passwd) + "x" ; but there is no shadow + "0" "0" ; user is now root + (passwd:gecos passwd) + (passwd:dir passwd) + bash) + ":") + port) + (newline port))) ;; For convenience, start in the user's current working ;; directory rather than the root directory. -- cgit v1.2.3 From 13bc8d5e4f842fe595306c22c99a5868d8016318 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Sat, 26 Mar 2016 08:45:08 -0400 Subject: environment: Properly handle SIGINT. Switching to execlp means that the process spawned in a container is PID 1, which obsoleted one of the 'guix environment --container' tests because the init process can't be killed in the usual manner. * guix/scripts/environment.scm (launch-environment/fork): New procedure. (launch-environment): Switch from system* to execlp. Add handler for SIGINT. (guix-environment): Use launch-environment/fork. * tests/guix-environment-container.sh: Replace abnormal exit test with one that works now that the spawned process is PID 1. --- guix/scripts/environment.scm | 19 +++++++++++++++++-- tests/guix-environment-container.sh | 7 ++++++- 2 files changed, 23 insertions(+), 3 deletions(-) (limited to 'guix') diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm index 0d5cab432c..fc75d78611 100644 --- a/guix/scripts/environment.scm +++ b/guix/scripts/environment.scm @@ -358,8 +358,22 @@ and suitable for 'exit'." "Run COMMAND in a new environment containing INPUTS, using the native search paths defined by the list PATHS. When PURE?, pre-existing environment variables are cleared before setting the new ones." + ;; Properly handle SIGINT, so pressing C-c in an interactive terminal + ;; application works. + (sigaction SIGINT SIG_DFL) (create-environment inputs paths pure?) - (apply system* command)) + (match command + ((program . args) + (apply execlp program program args)))) + +(define (launch-environment/fork command inputs paths pure?) + "Run COMMAND in a new process with an environment containing INPUTS, using +the native search paths defined by the list PATHS. When PURE?, pre-existing +environment variables are cleared before setting the new ones." + (match (primitive-fork) + (0 (launch-environment command inputs paths pure?)) + (pid (match (waitpid pid) + ((_ . status) status))))) (define* (launch-environment/container #:key command bash user-mappings profile paths network?) @@ -582,4 +596,5 @@ message if any test fails." (else (return (exit/status - (launch-environment command profile paths pure?))))))))))))) + (launch-environment/fork command profile + paths pure?))))))))))))) diff --git a/tests/guix-environment-container.sh b/tests/guix-environment-container.sh index aba34a3bd0..0a7ea481fc 100644 --- a/tests/guix-environment-container.sh +++ b/tests/guix-environment-container.sh @@ -82,8 +82,13 @@ grep -e "$NIX_STORE_DIR/.*-bash" $tmpdir/mounts # bootstrap bash rm $tmpdir/mounts +abnormal_exit_code=" +(use-modules (system foreign)) +;; Purposely make Guile crash with a segfault. :) +(pointer->string (make-pointer 123) 123)" + if guix environment --bootstrap --container \ - --ad-hoc bootstrap-binaries -- kill -SEGV 2 + --ad-hoc guile-bootstrap -- guile -c "$abnormal_exit_code" then false; else test $? -gt 127 -- cgit v1.2.3 From d70533cbe9210c665f86d935b61ac0aaf28d397e Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 28 Mar 2016 22:18:17 +0200 Subject: store: Prepend mirror.hydra.gnu.org to %DEFAULT-SUBSTITUTE-URLS. This allows GuixSD to default to the right list of URLs, with mirror.hydra.gnu.org coming first. Reported by Chris Marusich . * guix/store.scm (%default-substitute-urls): Prepend "mirror.hydra.gnu.org." --- guix/store.scm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'guix') diff --git a/guix/store.scm b/guix/store.scm index ae52628545..906611658e 100644 --- a/guix/store.scm +++ b/guix/store.scm @@ -504,12 +504,13 @@ encoding conversion errors." (status k)))))))) (define %default-substitute-urls - ;; Default list of substituters. This is *not* the list used by - ;; 'guix-daemon', and few clients use it ('guix build --log-file' uses it.) + ;; Default list of substituters. This is *not* the list baked in + ;; 'guix-daemon', but it is used by 'guix-service-type' and and a couple of + ;; clients ('guix build --log-file' uses it.) (map (if (false-if-exception (resolve-interface '(gnutls))) (cut string-append "https://" <>) (cut string-append "http://" <>)) - '("hydra.gnu.org"))) + '("mirror.hydra.gnu.org" "hydra.gnu.org"))) (define* (set-build-options server #:key keep-failed? keep-going? fallback? -- cgit v1.2.3 From 7f949db03e5dffa7873ce63723c0a92a28594511 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 28 Mar 2016 22:49:42 +0200 Subject: guix system: Warn against missing 'guix pull'. Suggested by Leo Famulari and others. * guix/scripts/system.scm (maybe-suggest-running-guix-pull): New procedure. (perform-action): Call it when ACTION is 'reconfigure. --- guix/scripts/system.scm | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'guix') diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm index 8ebeb4d595..566e7e8768 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm @@ -482,6 +482,21 @@ PATTERN, a string. When PATTERN is #f, display all the system generations." ((disk-image) (system-disk-image os #:disk-image-size image-size)))) +(define (maybe-suggest-running-guix-pull) + "Suggest running 'guix pull' if this has never been done before." + ;; The reason for this is that the 'guix' binding that we see here comes + ;; from either ~/.config/latest or, if it's missing, from the + ;; globally-installed Guix, which is necessarily older. See + ;; for + ;; a discussion. + (define latest + (string-append (config-directory) "/latest")) + + (unless (file-exists? latest) + (warning (_ "~a not found: 'guix pull' was never run~%") latest) + (warning (_ "Consider running 'guix pull' before 'reconfigure'.~%")) + (warning (_ "Failing to do that may downgrade your system!~%")))) + (define* (perform-action action os #:key grub? dry-run? derivations-only? use-substitutes? device target @@ -498,6 +513,9 @@ building anything." (define println (cut format #t "~a~%" <>)) + (when (eq? action 'reconfigure) + (maybe-suggest-running-guix-pull)) + (mlet* %store-monad ((sys (system-derivation-for-action os action #:image-size image-size -- cgit v1.2.3 From aa2a0d4bb8e60321a814860f08eebfcf78dfde8f Mon Sep 17 00:00:00 2001 From: David Thompson Date: Sun, 27 Mar 2016 21:20:19 -0400 Subject: environment: Set a default value for PS1. * guix/scripts/environment.scm (launch-environment/container): Set PS1 during container initialization. --- guix/scripts/environment.scm | 3 +++ 1 file changed, 3 insertions(+) (limited to 'guix') diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm index fc75d78611..0ec2c5d3cb 100644 --- a/guix/scripts/environment.scm +++ b/guix/scripts/environment.scm @@ -425,6 +425,9 @@ host file systems to mount inside the container." (mkdir-p "/bin") (symlink bash "/bin/sh") + ;; Set a reasonable default PS1. + (setenv "PS1" "\\u@\\h \\w [env]\\$ ") + ;; Setup directory for temporary files. (mkdir-p "/tmp") (for-each (lambda (var) -- cgit v1.2.3 From 3bd9672c8579f27c4dab20c334d96c6fb747c1b8 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 30 Mar 2016 15:00:25 +0200 Subject: ui: Add comment on the translation of "current". * guix/ui.scm (display-generation): Add "TRANSLATORS" comment. --- guix/ui.scm | 3 +++ 1 file changed, 3 insertions(+) (limited to 'guix') diff --git a/guix/ui.scm b/guix/ui.scm index 3b1887ccbf..f95c63a81b 100644 --- a/guix/ui.scm +++ b/guix/ui.scm @@ -1048,6 +1048,9 @@ DURATION-RELATION with the current time." "~b ~d ~Y ~T"))) (current (generation-number profile))) (if (= number current) + ;; TRANSLATORS: The word "current" here is an adjective for + ;; "Generation", as in "current generation". Use the appropriate + ;; gender where applicable. (format #t (_ "~a\t(current)~%") header) (format #t "~a~%" header))))) -- cgit v1.2.3 From f9ea74ad043cb1982467ae21dd967ba98b9ecd04 Mon Sep 17 00:00:00 2001 From: Eric Bavier Date: Tue, 22 Mar 2016 22:40:38 -0500 Subject: import: hackage: Factorize url synthesis. * guix/import/hackage.scm (hackage-source-url, hackage-cabal-url): New procedures. (hackage-fetch, hackage-module->sexp): Use them. --- guix/import/hackage.scm | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) (limited to 'guix') diff --git a/guix/import/hackage.scm b/guix/import/hackage.scm index 8725ffa0df..e79576207b 100644 --- a/guix/import/hackage.scm +++ b/guix/import/hackage.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2015 Federico Beffa +;;; Copyright © 2016 Eric Bavier ;;; ;;; This file is part of GNU Guix. ;;; @@ -65,6 +66,22 @@ (define package-name-prefix "ghc-") +(define (hackage-source-url name version) + "Given a Hackage package NAME and VERSION, return a url to the source +tarball." + (string-append "http://hackage.haskell.org/package/" name + "/" name "-" version ".tar.gz")) + +(define* (hackage-cabal-url name #:optional version) + "Given a Hackage package NAME and VERSION, return a url to the corresponding +.cabal file on Hackage. If VERSION is #f or missing, the url for the latest +version is returned." + (if version + (string-append "http://hackage.haskell.org/package/" + name "-" version "/" name ".cabal") + (string-append "http://hackage.haskell.org/package/" + name "/" name ".cabal"))) + (define (hackage-name->package-name name) "Given the NAME of a Cabal package, return the corresponding Guix name." (if (string-prefix? package-name-prefix name) @@ -76,12 +93,7 @@ the version part is omitted from the package name, then return the latest version." (let*-values (((name version) (package-name->name+version name-version)) - ((url) - (if version - (string-append "http://hackage.haskell.org/package/" - name "-" version "/" name ".cabal") - (string-append "http://hackage.haskell.org/package/" - name "/" name ".cabal")))) + ((url) (hackage-cabal-url name version))) (call-with-temporary-output-file (lambda (temp port) (and (url-fetch url temp) @@ -154,8 +166,7 @@ representation of a Cabal file as produced by 'read-cabal'." (cabal-package-version cabal)) (define source-url - (string-append "http://hackage.haskell.org/package/" name - "/" name "-" version ".tar.gz")) + (hackage-source-url name version)) (define dependencies (let ((names -- cgit v1.2.3 From 2ae9c63f159c883f894d20cdcb222e96c3fa1802 Mon Sep 17 00:00:00 2001 From: Eric Bavier Date: Tue, 22 Mar 2016 22:38:54 -0500 Subject: import: hackage: Silence download output. * guix/import/hackage.scm (hackage-fetch): Use http-fetch to avoid progress output from url-fetch. --- guix/import/hackage.scm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'guix') diff --git a/guix/import/hackage.scm b/guix/import/hackage.scm index e79576207b..4f14df4d61 100644 --- a/guix/import/hackage.scm +++ b/guix/import/hackage.scm @@ -26,6 +26,7 @@ #:use-module ((guix utils) #:select (package-name->name+version canonical-newline-port)) #:use-module (guix import utils) + #:use-module (guix http-client) #:use-module (guix import cabal) #:use-module (guix store) #:use-module (guix hash) @@ -92,13 +93,12 @@ version is returned." "Return the Cabal file for the package NAME-VERSION, or #f on failure. If the version part is omitted from the package name, then return the latest version." - (let*-values (((name version) (package-name->name+version name-version)) - ((url) (hackage-cabal-url name version))) - (call-with-temporary-output-file - (lambda (temp port) - (and (url-fetch url temp) - (call-with-input-file temp - (compose read-cabal canonical-newline-port))))))) + (let-values (((name version) (package-name->name+version name-version))) + (let* ((url (hackage-cabal-url name version)) + (port (http-fetch url)) + (result (read-cabal (canonical-newline-port port)))) + (close-port port) + result))) (define string->license ;; List of valid values from -- cgit v1.2.3 From 42efe27a30b1f0981b69336089b42afa3537fcc7 Mon Sep 17 00:00:00 2001 From: Eric Bavier Date: Tue, 22 Mar 2016 22:44:51 -0500 Subject: import: Add Hackage updater. * guix/import/hackage.scm (guix-package->hackage-name, hackage-package?) (latest-release): New procedures. (%hackage-updater): New variable. * guix/scripts/refresh.scm (%updaters): Add it. * doc/guix.texi (Invoking guix refresh): Mention it. --- doc/guix.texi | 2 ++ guix/import/hackage.scm | 64 +++++++++++++++++++++++++++++++++++++++++++++--- guix/scripts/refresh.scm | 2 ++ 3 files changed, 65 insertions(+), 3 deletions(-) (limited to 'guix') diff --git a/doc/guix.texi b/doc/guix.texi index 3eb25adec8..c5b13e0572 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -4792,6 +4792,8 @@ the updater for @uref{https://pypi.python.org, PyPI} packages. the updater for @uref{https://rubygems.org, RubyGems} packages. @item github the updater for @uref{https://github.com, GitHub} packages. +@item hackage +the updater for @uref{https://hackage.haskell.org, Hackage} packages. @end table For instance, the following command only checks for updates of Emacs diff --git a/guix/import/hackage.scm b/guix/import/hackage.scm index 4f14df4d61..640ead24f3 100644 --- a/guix/import/hackage.scm +++ b/guix/import/hackage.scm @@ -19,20 +19,25 @@ (define-module (guix import hackage) #:use-module (ice-9 match) + #:use-module (ice-9 regex) #:use-module (srfi srfi-26) #:use-module (srfi srfi-11) #:use-module (srfi srfi-1) - #:use-module ((guix download) #:select (download-to-store)) + #:use-module (gnu packages) + #:use-module ((guix download) #:select (download-to-store url-fetch)) #:use-module ((guix utils) #:select (package-name->name+version canonical-newline-port)) - #:use-module (guix import utils) #:use-module (guix http-client) + #:use-module ((guix import utils) #:select (factorize-uri)) #:use-module (guix import cabal) #:use-module (guix store) #:use-module (guix hash) #:use-module (guix base32) + #:use-module (guix upstream) + #:use-module (guix packages) #:use-module ((guix utils) #:select (call-with-temporary-output-file)) - #:export (hackage->guix-package)) + #:export (hackage->guix-package + %hackage-updater)) (define ghc-standard-libraries ;; List of libraries distributed with ghc (7.10.2). We include GHC itself as @@ -89,6 +94,17 @@ version is returned." (string-downcase name) (string-append package-name-prefix (string-downcase name)))) +(define guix-package->hackage-name + (let ((uri-rx (make-regexp "https?://hackage.haskell.org/package/([^/]+)/.*")) + (name-rx (make-regexp "(.*)-[0-9\\.]+"))) + (lambda (package) + "Given a Guix package name, return the corresponding Hackage name." + (let* ((source-url (and=> (package-source package) origin-uri)) + (name (match:substring (regexp-exec uri-rx source-url) 1))) + (match (regexp-exec name-rx name) + (#f name) + (m (match:substring m 1))))))) + (define (hackage-fetch name-version) "Return the Cabal file for the package NAME-VERSION, or #f on failure. If the version part is omitted from the package name, then return the latest @@ -236,4 +252,46 @@ respectively." include-test-dependencies?) (cut eval-cabal <> cabal-environment))))) +(define (hackage-package? package) + "Return #t if PACKAGE is a Haskell package from Hackage." + + (define haskell-url? + (let ((hackage-rx (make-regexp "https?://hackage.haskell.org"))) + (lambda (url) + (regexp-exec hackage-rx url)))) + + (let ((source-url (and=> (package-source package) origin-uri)) + (fetch-method (and=> (package-source package) origin-method))) + (and (eq? fetch-method url-fetch) + (match source-url + ((? string?) + (haskell-url? source-url)) + ((source-url ...) + (any haskell-url? source-url)))))) + +(define (latest-release guix-package) + "Return an for the latest release of GUIX-PACKAGE." + (let* ((hackage-name (guix-package->hackage-name + (specification->package guix-package))) + (cabal-meta (hackage-fetch hackage-name))) + (match cabal-meta + (#f + (format (current-error-port) + "warning: failed to parse ~a~%" + (hackage-cabal-url hackage-name)) + #f) + ((_ *** ("version" (version))) + (let ((url (hackage-source-url hackage-name version))) + (upstream-source + (package guix-package) + (version version) + (urls (list url)))))))) + +(define %hackage-updater + (upstream-updater + (name 'hackage) + (description "Updater for Hackage packages") + (pred hackage-package?) + (latest latest-release))) + ;;; cabal.scm ends here diff --git a/guix/scripts/refresh.scm b/guix/scripts/refresh.scm index e541138682..0efc190b22 100644 --- a/guix/scripts/refresh.scm +++ b/guix/scripts/refresh.scm @@ -35,6 +35,7 @@ #:select (%gnu-updater %gnome-updater %xorg-updater)) #:use-module (guix import elpa) #:use-module (guix import cran) + #:use-module (guix import hackage) #:use-module (guix gnupg) #:use-module (gnu packages) #:use-module ((gnu packages commencement) #:select (%final-inputs)) @@ -198,6 +199,7 @@ unavailable optional dependencies such as Guile-JSON." %elpa-updater %cran-updater %bioconductor-updater + %hackage-updater ((guix import pypi) => %pypi-updater) ((guix import gem) => %gem-updater) ((guix import github) => %github-updater))) -- cgit v1.2.3 From dcd19c0af86e96aced0593431ca2f54e8554e372 Mon Sep 17 00:00:00 2001 From: Leo Famulari Date: Sat, 30 Jan 2016 23:56:13 -0500 Subject: licenses: Add the nmap license. * guix/licenses.scm (nmap): New variable. --- guix/licenses.scm | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'guix') diff --git a/guix/licenses.scm b/guix/licenses.scm index 71c0736223..265f048278 100644 --- a/guix/licenses.scm +++ b/guix/licenses.scm @@ -57,6 +57,7 @@ mpl1.0 mpl1.1 mpl2.0 ms-pl ncsa + nmap openldap2.8 openssl psfl public-domain qpl @@ -360,6 +361,11 @@ at URI, which may be a file:// URI pointing the package's tree." "http://directory.fsf.org/wiki/License:IllinoisNCSA" "https://www.gnu.org/licenses/license-list#NCSA")) +(define nmap + (license "Nmap license" + "https://svn.nmap.org/nmap/COPYING" + "https://fedoraproject.org/wiki/Licensing/Nmap")) + (define openssl (license "OpenSSL" "http://directory.fsf.org/wiki/License:OpenSSL" -- cgit v1.2.3 From cb6ce89e21df4f7ddb8e87d7fb0c3c776120e3eb Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Thu, 31 Mar 2016 15:44:59 +0200 Subject: build-system/r: Support "substitutable?" flag. * guix/build-system/r.scm (r-build): Support the "substitutable?" flag. --- guix/build-system/r.scm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'guix') diff --git a/guix/build-system/r.scm b/guix/build-system/r.scm index a8ca354227..e8269fdeb1 100644 --- a/guix/build-system/r.scm +++ b/guix/build-system/r.scm @@ -101,6 +101,7 @@ release corresponding to NAME and VERSION." (search-paths '()) (system (%current-system)) (guile #f) + (substitutable? #t) (imported-modules %r-build-system-modules) (modules '((guix build r-build-system) (guix build utils)))) @@ -140,7 +141,8 @@ release corresponding to NAME and VERSION." #:system system #:modules imported-modules #:outputs outputs - #:guile-for-build guile-for-build)) + #:guile-for-build guile-for-build + #:substitutable? substitutable?)) (define r-build-system (build-system -- cgit v1.2.3 From ab50bba9f6965c82f4209aa19e1345882548ed70 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Thu, 24 Mar 2016 15:33:21 +0100 Subject: build-system/ant: Add zip. * guix/build-system/ant.scm (default-zip): New variable. (lower): Add zip to native inputs. --- guix/build-system/ant.scm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'guix') diff --git a/guix/build-system/ant.scm b/guix/build-system/ant.scm index d3054e5ffa..f333aa5ae8 100644 --- a/guix/build-system/ant.scm +++ b/guix/build-system/ant.scm @@ -54,15 +54,22 @@ (let ((jdk-mod (resolve-interface '(gnu packages java)))) (module-ref jdk-mod 'ant))) +(define (default-zip) + "Return the default ZIP package." + ;; Lazily resolve the binding to avoid a circular dependency. + (let ((zip-mod (resolve-interface '(gnu packages zip)))) + (module-ref zip-mod 'zip))) + (define* (lower name #:key source inputs native-inputs outputs system target (jdk (default-jdk)) (ant (default-ant)) + (zip (default-zip)) #:allow-other-keys #:rest arguments) "Return a bag for NAME." (define private-keywords - '(#:source #:target #:jdk #:ant #:inputs #:native-inputs)) + '(#:source #:target #:jdk #:ant #:zip #:inputs #:native-inputs)) (and (not target) ;XXX: no cross-compilation (bag @@ -77,6 +84,7 @@ ,@(standard-packages))) (build-inputs `(("jdk" ,jdk "jdk") ("ant" ,ant) + ("zip" ,zip) ,@native-inputs)) (outputs outputs) (build ant-build) -- cgit v1.2.3 From 9941e0812eca86a9da30211f0e905cda345aeae9 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Thu, 24 Mar 2016 15:39:45 +0100 Subject: ant-build-system: Keep jar manifest. * guix/build/ant-build-system.scm (default-build.xml): Generate default manifest. (strip-jar-timestamps): Repack jar archive with zip. --- guix/build/ant-build-system.scm | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) (limited to 'guix') diff --git a/guix/build/ant-build-system.scm b/guix/build/ant-build-system.scm index d302b948b5..27277af34b 100644 --- a/guix/build/ant-build-system.scm +++ b/guix/build/ant-build-system.scm @@ -65,13 +65,8 @@ (target (@ (name "jar") (depends "compile")) (mkdir (@ (dir "${jar.dir}"))) - ;; We cannot use the simpler "jar" task here, because - ;; there is no way to disable generation of a - ;; manifest. We do not include a generated manifest - ;; to ensure determinism, because we cannot easily - ;; reset the ctime/mtime before creating the archive. (exec (@ (executable "jar")) - (arg (@ (line ,(string-append "-Mcf ${jar.dir}/" jar-name + (arg (@ (line ,(string-append "-cf ${jar.dir}/" jar-name " -C ${classes.dir} .")))))) (target (@ (name "install")) @@ -105,16 +100,15 @@ INPUTS." (zero? (apply system* `("ant" ,build-target ,@make-flags)))) (define* (strip-jar-timestamps #:key outputs - #:allow-other-keys) + #:allow-other-keys) "Unpack all jar archives, reset the timestamp of all contained files, and repack them. This is necessary to ensure that archives are reproducible." (define (repack-archive jar) (format #t "repacking ~a\n" jar) - (let ((dir (mkdtemp! "jar-contents.XXXXXX"))) + (let* ((dir (mkdtemp! "jar-contents.XXXXXX")) + (manifest (string-append dir "/META-INF/MANIFEST.MF"))) (and (with-directory-excursion dir (zero? (system* "jar" "xf" jar))) - ;; The manifest file contains timestamps - (for-each delete-file (find-files dir "MANIFEST.MF")) (delete-file jar) ;; XXX: copied from (gnu build install) (for-each (lambda (file) @@ -122,8 +116,19 @@ repack them. This is necessary to ensure that archives are reproducible." (unless (eq? (stat:type s) 'symlink) (utime file 0 0 0 0)))) (find-files dir #:directories? #t)) - (unless (zero? (system* "jar" "-Mcf" jar "-C" dir ".")) - (error "'jar' failed")) + + ;; The jar tool will always set the timestamp on the manifest file + ;; and the containing directory to the current time, even when we + ;; reuse an existing manifest file. To avoid this we use "zip" + ;; instead of "jar". It is important that the manifest appears + ;; first. + (with-directory-excursion dir + (let* ((files (find-files "." ".*" #:directories? #t)) + (command (if (file-exists? manifest) + `("zip" "-X" ,jar ,manifest ,@files) + `("zip" "-X" ,jar ,@files)))) + (unless (zero? (apply system* command)) + (error "'zip' failed")))) (utime jar 0 0) #t))) -- cgit v1.2.3 From 97425486ee45d5a5043ebfa8d178e83458e8521b Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 31 Mar 2016 15:47:18 +0200 Subject: profiles: Use the right 'package-name->name+version'. * guix/profiles.scm: Use 'package-name->name+version' from (guix build utils). Fixes 'find-among-store-items' in 'gtk-icon-themes'. --- guix/profiles.scm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'guix') diff --git a/guix/profiles.scm b/guix/profiles.scm index 1c53c8047a..a3277cef71 100644 --- a/guix/profiles.scm +++ b/guix/profiles.scm @@ -21,7 +21,9 @@ ;;; along with GNU Guix. If not, see . (define-module (guix profiles) - #:use-module (guix utils) + #:use-module ((guix utils) #:hide (package-name->name+version)) + #:use-module ((guix build utils) + #:select (package-name->name+version)) #:use-module (guix records) #:use-module (guix packages) #:use-module (guix derivations) -- cgit v1.2.3 From ab83105bbe93cdaf10c4bdb4655428a2df8c7e24 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Sat, 26 Mar 2016 13:40:38 +0100 Subject: cvs: Allow checkouts when /tmp is a different device. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * guix/build/cvs.scm (cvs-fetch): Use 'copy-recursively' instead of 'rename-file'. Co-authored-by: Ludovic Courtès --- guix/build/cvs.scm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'guix') diff --git a/guix/build/cvs.scm b/guix/build/cvs.scm index bd5c50a51a..033b626b96 100644 --- a/guix/build/cvs.scm +++ b/guix/build/cvs.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2015 Mark H Weaver +;;; Copyright © 2016 Jan Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -58,7 +59,10 @@ Return #t on success, #f otherwise." "-D" "-r") revision module)) - (rename-file module directory) + ;; Copy rather than rename in case MODULE and DIRECTORY are on + ;; different devices. + (copy-recursively module directory) + (with-directory-excursion directory (for-each delete-file-recursively (find-cvs-directories))) #t)) -- cgit v1.2.3 From f4033fb5da9f07dce2b8049b1d7214c492790581 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 31 Mar 2016 23:52:15 +0200 Subject: cvs: Disable compression. Reported by Jan Nieuwenhuizen . * guix/build/cvs.scm (cvs-fetch): Use -z0. --- guix/build/cvs.scm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'guix') diff --git a/guix/build/cvs.scm b/guix/build/cvs.scm index 033b626b96..9976e624b3 100644 --- a/guix/build/cvs.scm +++ b/guix/build/cvs.scm @@ -52,7 +52,10 @@ "Fetch REVISION from MODULE of CVS-ROOT-DIRECTORY into DIRECTORY. REVISION must either be a date in ISO-8601 format (e.g. \"2012-12-21\") or a CVS tag. Return #t on success, #f otherwise." - (and (zero? (system* cvs-command "-z3" + ;; Use "-z0" because enabling compression leads to hangs during checkout on + ;; certain repositories, such as + ;; ":pserver:anonymous@cvs.savannah.gnu.org:/sources/gnustandards". + (and (zero? (system* cvs-command "-z0" "-d" cvs-root-directory "checkout" (if (string-match "^[0-9]{4}-[0-9]{2}-[0-9]{2}$" revision) -- cgit v1.2.3 From 8463d1345ef302fd016c73b412bd90fdf8adc818 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 2 Apr 2016 21:46:26 +0200 Subject: graph: Edges are colored based on their source node. * guix/graph.scm (%colors): New variable. (pop-color): New procedure. (emit-edge): Use it. --- guix/graph.scm | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'guix') diff --git a/guix/graph.scm b/guix/graph.scm index a39208e7f9..1a8f2d55b3 100644 --- a/guix/graph.scm +++ b/guix/graph.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2015 Ludovic Courtès +;;; Copyright © 2015, 2016 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -131,6 +131,16 @@ typically returned by 'node-edges' or 'node-back-edges'." (node graph-backend-node) (edge graph-backend-edge)) +(define %colors + ;; See colortbl.h in Graphviz. + #("red" "magenta" "blue" "cyan3" "darkseagreen" + "peachpuff4" "darkviolet" "dimgrey" "darkgoldenrod")) + +(define (pop-color hint) + "Return a Graphviz color based on HINT, an arbitrary object." + (let ((index (hash hint (vector-length %colors)))) + (vector-ref %colors index))) + (define (emit-prologue name port) (format port "digraph \"Guix ~a\" {\n" name)) @@ -140,8 +150,8 @@ typically returned by 'node-edges' or 'node-back-edges'." (format port " \"~a\" [label = \"~a\", shape = box, fontname = Helvetica];~%" id label)) (define (emit-edge id1 id2 port) - (format port " \"~a\" -> \"~a\" [color = red];~%" - id1 id2)) + (format port " \"~a\" -> \"~a\" [color = ~a];~%" + id1 id2 (pop-color id1))) (define %graphviz-backend (graph-backend emit-prologue emit-epilogue -- cgit v1.2.3 From 5f2928456bf70a6869b0a415ca60b6cc1e43214c Mon Sep 17 00:00:00 2001 From: Alex Kost Date: Fri, 25 Mar 2016 11:27:18 +0300 Subject: emacs: Use 'build-and-use-profile' from (guix scripts package). * guix/scripts/package.scm: Export 'build-and-use-profile'. * emacs/guix-main.scm (process-package-actions): Use it. --- emacs/guix-main.scm | 36 ++++++++---------------------------- guix/scripts/package.scm | 3 ++- 2 files changed, 10 insertions(+), 29 deletions(-) (limited to 'guix') diff --git a/emacs/guix-main.scm b/emacs/guix-main.scm index 86cedfd459..bcff9ce985 100644 --- a/emacs/guix-main.scm +++ b/emacs/guix-main.scm @@ -917,34 +917,14 @@ OUTPUTS is a list of package outputs (may be an empty list)." manifest transaction))) (unless (and (null? install) (null? remove)) (with-store store - (let* ((derivation (run-with-store store - (mbegin %store-monad - (set-guile-for-build (default-guile)) - (profile-derivation new-manifest)))) - (derivations (list derivation)) - (new-profile (derivation->output-path derivation))) - (set-build-options store - #:print-build-trace #f - #:use-substitutes? use-substitutes?) - (show-manifest-transaction store manifest transaction - #:dry-run? dry-run?) - (show-what-to-build store derivations - #:use-substitutes? use-substitutes? - #:dry-run? dry-run?) - (unless dry-run? - (let ((name (generation-file-name - profile - (+ 1 (generation-number profile))))) - (and (build-derivations store derivations) - (let* ((entries (manifest-entries new-manifest)) - (count (length entries))) - (switch-symlinks name new-profile) - (switch-symlinks profile name) - (format #t (N_ "~a package in profile~%" - "~a packages in profile~%" - count) - count) - (display-search-paths entries (list profile))))))))))) + (set-build-options store + #:print-build-trace #f + #:use-substitutes? use-substitutes?) + (show-manifest-transaction store manifest transaction + #:dry-run? dry-run?) + (build-and-use-profile store profile new-manifest + #:use-substitutes? use-substitutes? + #:dry-run? dry-run?))))) (define (delete-generations* profile generations) "Delete GENERATIONS from PROFILE. diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm index 1d88b33996..697afc17c3 100644 --- a/guix/scripts/package.scm +++ b/guix/scripts/package.scm @@ -47,7 +47,8 @@ #:autoload (gnu packages base) (canonical-package) #:autoload (gnu packages guile) (guile-2.0) #:autoload (gnu packages bootstrap) (%bootstrap-guile) - #:export (delete-generations + #:export (build-and-use-profile + delete-generations display-search-paths guix-package)) -- cgit v1.2.3