From ab77b69eca6959c9ce946ca18d218aab8ade1cc1 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 16 Apr 2019 23:23:02 +0200 Subject: self: Remove unused variable. This variable is unused since commit 45779fa676419de8838cb26b6c7a24678a2be1cd. * guix/self.scm (%dependency-variables): Remove. * build-aux/build-self.scm (%dependency-variables): Remove. --- guix/self.scm | 4 ---- 1 file changed, 4 deletions(-) (limited to 'guix') diff --git a/guix/self.scm b/guix/self.scm index 7ba2764eb9..de921e6d9c 100644 --- a/guix/self.scm +++ b/guix/self.scm @@ -753,10 +753,6 @@ Info manual." ;;; Generating (guix config). ;;; -(define %dependency-variables - ;; (guix config) variables corresponding to dependencies. - '(%libz %xz %gzip %bzip2)) - (define %persona-variables ;; (guix config) variables that define Guix's persona. '(%guix-package-name -- cgit v1.2.3 From f2d86ed0b3e371ee95cbc0098b7b2ccb757bc948 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 16 Apr 2019 23:32:39 +0200 Subject: build: No longer substitute 'LIBGCRYPT'. This had become useless since ca719424455465fca4b872c371daf2a46de88b33. * configure.ac (LIBGCRYPT): Remove. * guix/config.scm.in (%libgcrypt): Remove. --- configure.ac | 8 -------- guix/config.scm.in | 4 ---- 2 files changed, 12 deletions(-) (limited to 'guix') diff --git a/configure.ac b/configure.ac index 5d70de4beb..7e7ae02730 100644 --- a/configure.ac +++ b/configure.ac @@ -202,7 +202,6 @@ else AC_MSG_RESULT([not found]) fi -LIBGCRYPT="libgcrypt" LIBGCRYPT_LIBDIR="no" LIBGCRYPT_PREFIX="no" @@ -212,7 +211,6 @@ AC_ARG_WITH([libgcrypt-prefix], yes|no) ;; *) - LIBGCRYPT="$withval/lib/libgcrypt" LIBGCRYPT_PREFIX="$withval" LIBGCRYPT_LIBDIR="$withval/lib" ;; @@ -223,11 +221,9 @@ AC_ARG_WITH([libgcrypt-libdir], [search for GNU libgcrypt's shared library in DIR])], [case "$withval" in yes|no) - LIBGCRYPT="libgcrypt" LIBGCRYPT_LIBDIR="no" ;; *) - LIBGCRYPT="$withval/libgcrypt" LIBGCRYPT_LIBDIR="$withval" ;; esac]) @@ -240,10 +236,6 @@ case "x$LIBGCRYPT_PREFIX$LIBGCRYPT_LIBDIR" in ;; esac -dnl Library name suitable for `dynamic-link'. -AC_MSG_CHECKING([for libgcrypt shared library name]) -AC_MSG_RESULT([$LIBGCRYPT]) -AC_SUBST([LIBGCRYPT]) AC_SUBST([LIBGCRYPT_PREFIX]) AC_SUBST([LIBGCRYPT_LIBDIR]) diff --git a/guix/config.scm.in b/guix/config.scm.in index d2ec9921c6..247b15ed81 100644 --- a/guix/config.scm.in +++ b/guix/config.scm.in @@ -33,7 +33,6 @@ %config-directory %system - %libgcrypt %libz %gzip %bzip2 @@ -88,9 +87,6 @@ (define %system "@guix_system@") -(define %libgcrypt - "@LIBGCRYPT@") - (define %libz "@LIBZ@") -- cgit v1.2.3 From 72f749dcb83dbda9f98e28fa3622cc1d3db6275a Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 17 Apr 2019 13:56:40 +0200 Subject: pull: '--url', '--commit', and '--branch' apply to the 'guix' channel. Suggested by pkill9 . * guix/scripts/pull.scm (channel-list): Apply REF and URL to the 'guix' channel. * doc/guix.texi (Invoking guix pull): Adjust accordingly. --- doc/guix.texi | 5 +++-- guix/channels.scm | 1 + guix/scripts/pull.scm | 24 +++++++++++------------- 3 files changed, 15 insertions(+), 15 deletions(-) (limited to 'guix') diff --git a/doc/guix.texi b/doc/guix.texi index f8e7436cf1..6b713aaf9c 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -3646,8 +3646,9 @@ but it supports the following options: @item --url=@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}. +Download code for the @code{guix} channel 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 diff --git a/guix/channels.scm b/guix/channels.scm index 9658cf9393..e93879e1b4 100644 --- a/guix/channels.scm +++ b/guix/channels.scm @@ -52,6 +52,7 @@ channel-location %default-channels + guix-channel? channel-instance? channel-instance-channel diff --git a/guix/scripts/pull.scm b/guix/scripts/pull.scm index 55137fce8f..71e13686c0 100644 --- a/guix/scripts/pull.scm +++ b/guix/scripts/pull.scm @@ -502,24 +502,22 @@ Use '~/.config/guix/channels.scm' instead.")) (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 + (match (find guix-channel? channels) + ((? channel? guix) + ;; Apply '--url', '--commit', and '--branch' to the 'guix' channel. + (let ((url (or url (channel-url guix)))) + (cons (match ref (('commit . commit) - (channel (inherit one) + (channel (inherit guix) (url url) (commit commit) (branch #f))) (('branch . branch) - (channel (inherit one) + (channel (inherit guix) (url url) (commit #f) (branch branch))) (#f - (channel (inherit one) (url url))))))) - (_ - ;; Otherwise bail out. - (leave - (G_ "'--url', '--commit', and '--branch' are not applicable~%")))) + (channel (inherit guix) (url url)))) + (remove guix-channel? channels)))) + (#f ;no 'guix' channel, failure will ensue + channels)) channels))) -- cgit v1.2.3 From 702c3c7dab87df674c3d6abc138805895b5d1d32 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 18 Apr 2019 10:19:54 +0200 Subject: lint: 'check-github-url' uses our own 'open-connection-for-uri'. Fixes . Reported by Efraim Flashner . Previously 'check-github-url' would let Guile 2.2's (web client) module take care of opening the connection. Consequently, it wouldn't use the TLS priority strings that we use in (guix build download), 'open-connection-for-uri'. In particular, it would not disable TLSv1.3, which would trigger for github.com. * guix/scripts/lint.scm (check-github-url): Add #:timeout parameter. [follow-redirect]: Change parameter name to 'url' and pass it to 'string->uri'. Call 'guix:open-connection-for-uri' to open the connection and pass it to 'http-head' via #:port. --- guix/scripts/lint.scm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'guix') diff --git a/guix/scripts/lint.scm b/guix/scripts/lint.scm index ddad5b7fd0..dc338a1d7b 100644 --- a/guix/scripts/lint.scm +++ b/guix/scripts/lint.scm @@ -45,7 +45,6 @@ #:use-module (guix cve) #:use-module (gnu packages) #:use-module (ice-9 match) - #:use-module (ice-9 receive) #:use-module (ice-9 regex) #:use-module (ice-9 format) #:use-module (web client) @@ -796,10 +795,13 @@ descriptions maintained upstream." (let ((uris (origin-uris origin))) (for-each check-mirror-uri uris))))) -(define (check-github-url package) +(define* (check-github-url package #:key (timeout 3)) "Check whether PACKAGE uses source URLs that redirect to GitHub." - (define (follow-redirect uri) - (receive (response body) (http-head uri) + (define (follow-redirect url) + (let* ((uri (string->uri url)) + (port (guix:open-connection-for-uri uri #:timeout timeout)) + (response (http-head uri #:port port))) + (close-port port) (case (response-code response) ((301 302) (uri->string (assoc-ref (response-headers response) 'location))) -- cgit v1.2.3 From 3fdb9a375f1cee7dd302349a9527437df20b3f61 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Sun, 24 Mar 2019 21:23:45 +0000 Subject: guile-build-system: Support building in parallel. * guix/build/guile-build-system.scm (build): Use invoke-each, instead of for-each, to use multiple cores if available. (invoke-each, report-build-process): New procedures. --- guix/build/guile-build-system.scm | 98 ++++++++++++++++++++++++++++++++------- 1 file changed, 80 insertions(+), 18 deletions(-) (limited to 'guix') diff --git a/guix/build/guile-build-system.scm b/guix/build/guile-build-system.scm index 0bed049436..31f0d3d6f4 100644 --- a/guix/build/guile-build-system.scm +++ b/guix/build/guile-build-system.scm @@ -65,6 +65,62 @@ Return #false if it cannot be determined." (setenv "GUIX_LOCPATH" (string-append locales "/lib/locale")) #t))) +(define* (invoke-each commands + #:key (max-processes (current-processor-count)) + report-progress) + "Run each command in COMMANDS in a separate process, using up to +MAX-PROCESSES processes in parallel. Call REPORT-PROGRESS at each step. +Raise an error if one of the processes exit with non-zero." + (define total + (length commands)) + + (define (wait-for-one-process) + (match (waitpid WAIT_ANY) + ((_ . status) + (unless (zero? (status:exit-val status)) + (error "process failed" status))))) + + (define (fork-and-run-command command) + (match (primitive-fork) + (0 + (dynamic-wind + (const #t) + (lambda () + (apply execlp command)) + (lambda () + (primitive-exit 127)))) + (pid + #t))) + + (let loop ((commands commands) + (running 0) + (completed 0)) + (match commands + (() + (or (zero? running) + (let ((running (- running 1)) + (completed (+ completed 1))) + (wait-for-one-process) + (report-progress total completed) + (loop commands running completed)))) + ((command . rest) + (if (< running max-processes) + (let ((running (+ 1 running))) + (fork-and-run-command command) + (loop rest running completed)) + (let ((running (- running 1)) + (completed (+ completed 1))) + (wait-for-one-process) + (report-progress total completed) + (loop commands running completed))))))) + +(define* (report-build-progress total completed + #:optional (log-port (current-error-port))) + "Report that COMPLETED out of TOTAL files have been completed." + (format log-port "compiling...\t~5,1f% of ~d files~%" ;FIXME: i18n + (* 100. (/ completed total)) total) + (force-output log-port)) + (define* (build #:key outputs inputs native-inputs (source-directory ".") (compile-flags '()) @@ -101,24 +157,30 @@ Return #false if it cannot be determined." (match (getenv "GUILE_LOAD_COMPILED_PATH") (#f "") (path (string-append ":" path))))) - (for-each (lambda (file) - (let* ((go (string-append go-dir - (file-sans-extension file) - ".go"))) - ;; Install source module. - (install-file (string-append source-directory "/" file) - (string-append module-dir - "/" (dirname file))) - - ;; Install and compile module. - (apply invoke guild "compile" "-L" source-directory - "-o" go - (string-append source-directory "/" file) - flags))) - - ;; Arrange to strip SOURCE-DIRECTORY from file names. - (with-directory-excursion source-directory - (find-files "." scheme-file-regexp))) + + (let ((source-files + (with-directory-excursion source-directory + (find-files "." scheme-file-regexp)))) + (invoke-each + (map (lambda (file) + (cons* guild + "guild" "compile" + "-L" source-directory + "-o" (string-append go-dir + (file-sans-extension file) + ".go") + (string-append source-directory "/" file) + flags)) + source-files) + #:max-processes (parallel-job-count) + #:report-progress report-build-progress) + + (for-each + (lambda (file) + (install-file (string-append source-directory "/" file) + (string-append module-dir + "/" (dirname file)))) + source-files)) #t)) (define* (install-documentation #:key outputs -- cgit v1.2.3 From ea261dea0c581771b4cf297e983f7addc6807051 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 19 Apr 2019 15:18:20 +0200 Subject: guix build: Accept multiple '-s' options. * guix/scripts/build.scm (%default-options): Remove 'system'. (%options) <--system>: Keep previous occurrences of 'system in RESULT. (options->derivations)[system]: Remove. [systems, things-to-build]: New variables. [compute-derivation]: New procedure. Iterate on all of SYSTEMS to compute the derivations of THINGS-TO-BUILD. * tests/guix-build.sh: Add test for one and multiple '-s' flags. * doc/guix.texi (Additional Build Options): Document this behavior. --- doc/guix.texi | 4 +- guix/scripts/build.scm | 107 +++++++++++++++++++++++++++---------------------- tests/guix-build.sh | 7 ++++ 3 files changed, 70 insertions(+), 48 deletions(-) (limited to 'guix') diff --git a/doc/guix.texi b/doc/guix.texi index 6b713aaf9c..8c7522f286 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -8030,7 +8030,9 @@ The following derivations will be built: @item --system=@var{system} @itemx -s @var{system} Attempt to build for @var{system}---e.g., @code{i686-linux}---instead of -the system type of the build host. +the system type of the build host. The @command{guix build} command allows +you to repeat this option several times, in which case it builds for all the +specified systems; other commands ignore extraneous @option{-s} options. @quotation Note The @code{--system} flag is for @emph{native} compilation and must not diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm index fc0c0e2ad3..ba143ad16b 100644 --- a/guix/scripts/build.scm +++ b/guix/scripts/build.scm @@ -635,8 +635,7 @@ options handled by 'set-build-options-from-command-line', and listed in (define %default-options ;; Alist of default option values. - `((system . ,(%current-system)) - (build-mode . ,(build-mode normal)) + `((build-mode . ,(build-mode normal)) (graft? . #t) (substitutes? . #t) (build-hook? . #t) @@ -729,8 +728,7 @@ must be one of 'package', 'all', or 'transitive'~%") rest))) (option '(#\s "system") #t #f (lambda (opt name arg result) - (alist-cons 'system arg - (alist-delete 'system result eq?)))) + (alist-cons 'system arg result))) (option '("target") #t #f (lambda (opt name arg result) (alist-cons 'target arg @@ -811,56 +809,71 @@ build." (cut package-cross-derivation <> <> triplet <>)))) (define src (assoc-ref opts 'source)) - (define system (assoc-ref opts 'system)) (define graft? (assoc-ref opts 'graft?)) + (define systems + (match (filter-map (match-lambda + (('system . system) system) + (_ #f)) + opts) + (() (list (%current-system))) + (systems systems))) + + (define things-to-build + (map (cut transform store <>) + (options->things-to-build opts))) + + (define (compute-derivation obj system) + ;; Compute the derivation of OBJ for SYSTEM. + (match obj + ((? package? p) + (let ((p (or (and graft? (package-replacement p)) p))) + (match src + (#f + (list (package->derivation store p system))) + (#t + (match (package-source p) + (#f + (format (current-error-port) + (G_ "~a: warning: \ +package '~a' has no source~%") + (location->string (package-location p)) + (package-name p)) + '()) + (s + (list (package-source-derivation store s))))) + (proc + (map (cut package-source-derivation store <>) + (proc p)))))) + ((? derivation? drv) + (list drv)) + ((? procedure? proc) + (list (run-with-store store + (mbegin %store-monad + (set-guile-for-build (default-guile)) + (proc)) + #:system system))) + ((? file-like? obj) + (list (run-with-store store + (lower-object obj system + #:target (assoc-ref opts 'target)) + #:system system))) + ((? gexp? gexp) + (list (run-with-store store + (mbegin %store-monad + (set-guile-for-build (default-guile)) + (gexp->derivation "gexp" gexp + #:system system)) + #:system system))))) ;; We may get 'unbound-variable' errors while evaluating the 'inputs' fields ;; of user packages. Since 'guix build' is the primary tool for people ;; testing new packages, report such errors gracefully. (with-unbound-variable-handling (parameterize ((%graft? graft?)) - (append-map (match-lambda - ((? package? p) - (let ((p (or (and graft? (package-replacement p)) p))) - (match src - (#f - (list (package->derivation store p system))) - (#t - (match (package-source p) - (#f - (format (current-error-port) - (G_ "~a: warning: \ -package '~a' has no source~%") - (location->string (package-location p)) - (package-name p)) - '()) - (s - (list (package-source-derivation store s))))) - (proc - (map (cut package-source-derivation store <>) - (proc p)))))) - ((? derivation? drv) - (list drv)) - ((? procedure? proc) - (list (run-with-store store - (mbegin %store-monad - (set-guile-for-build (default-guile)) - (proc)) - #:system system))) - ((? file-like? obj) - (list (run-with-store store - (lower-object obj system - #:target (assoc-ref opts 'target)) - #:system system))) - ((? gexp? gexp) - (list (run-with-store store - (mbegin %store-monad - (set-guile-for-build (default-guile)) - (gexp->derivation "gexp" gexp - #:system system)) - #:system system)))) - (map (cut transform store <>) - (options->things-to-build opts)))))) + (append-map (lambda (system) + (append-map (cut compute-derivation <> system) + things-to-build)) + systems)))) (define (show-build-log store file urls) "Show the build log for FILE, falling back to remote logs from URLS if diff --git a/tests/guix-build.sh b/tests/guix-build.sh index d479296ef1..63a9fe68da 100644 --- a/tests/guix-build.sh +++ b/tests/guix-build.sh @@ -44,6 +44,13 @@ guix build -e '(@@ (gnu packages bootstrap) %bootstrap-guile)' guix build -e '(@@ (gnu packages bootstrap) %bootstrap-guile)'; \ then exit 1; fi ) +# Passing one '-s' flag. +test `guix build sed -s x86_64-linux -d | wc -l` = 1 + +# Passing multiple '-s' flags. +all_systems="-s x86_64-linux -s i686-linux -s armhf-linux -s aarch64-linux" +test `guix build sed $all_systems -d | sort -u | wc -l` = 4 + # Check --sources option with its arguments module_dir="t-guix-build-$$" mkdir "$module_dir" -- cgit v1.2.3 From c5265a095172b213ba6fbdf618d6779359ca56b2 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 21 Apr 2019 21:26:06 +0200 Subject: pull: Add '--news'. Suggested by Tobias Geerinckx-Rice . * guix/scripts/pull.scm (%options, show-help): Add '--news'. (display-profile-news): Add #:current-is-newer? and #:concise?. Honor them. (build-and-install): Pass #:concise? #t. (display-new/upgraded-packages)[concise/max-item-count]: New variable. Add call to 'display-hint'. (process-query): Add clause for 'display-news'. * doc/guix.texi (Invoking guix pull): Add '--news'. --- doc/guix.texi | 8 ++++++ guix/scripts/pull.scm | 76 ++++++++++++++++++++++++++++++++++++--------------- 2 files changed, 62 insertions(+), 22 deletions(-) (limited to 'guix') diff --git a/doc/guix.texi b/doc/guix.texi index 8c7522f286..785329add8 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -3663,6 +3663,14 @@ Read the list of channels from @var{file} instead of evaluates to a list of channel objects. @xref{Channels}, for more information. +@item --news +@itemx -N +Display the list of packages added or upgraded since the previous generation. + +This is the same information as displayed upon @command{guix pull} completion, +but without ellipses; it is also similar to the output of @command{guix pull +-l} for the last generation (see below). + @item --list-generations[=@var{pattern}] @itemx -l [@var{pattern}] List all the generations of @file{~/.config/guix/current} or, if @var{pattern} diff --git a/guix/scripts/pull.scm b/guix/scripts/pull.scm index 71e13686c0..04e83f970f 100644 --- a/guix/scripts/pull.scm +++ b/guix/scripts/pull.scm @@ -86,6 +86,8 @@ Download and deploy the latest version of Guix.\n")) (display (G_ " --branch=BRANCH download the tip of the specified BRANCH")) (display (G_ " + -N, --news display news compared to the previous generation")) + (display (G_ " -l, --list-generations[=PATTERN] list generations matching PATTERN")) (display (G_ " @@ -117,6 +119,9 @@ Download and deploy the latest version of Guix.\n")) (lambda (opt name arg result) (cons `(query list-generations ,(or arg "")) result))) + (option '(#\N "news") #f #f + (lambda (opt name arg result) + (cons '(query display-news) result))) (option '("url") #t #f (lambda (opt name arg result) (alist-cons 'repository-url arg @@ -162,25 +167,33 @@ Download and deploy the latest version of Guix.\n")) (define indirect-root-added (store-lift add-indirect-root)) -(define (display-profile-news profile) - "Display what's up in PROFILE--new packages, and all that." +(define* (display-profile-news profile #:key concise? + current-is-newer?) + "Display what's up in PROFILE--new packages, and all that. If +CURRENT-IS-NEWER? is true, assume that the current process represents the +newest generation of PROFILE.x" (match (memv (generation-number profile) (reverse (profile-generations profile))) ((current previous _ ...) - (newline) - (let ((old (fold-available-packages - (lambda* (name version result - #:key supported? deprecated? - #:allow-other-keys) - (if (and supported? (not deprecated?)) - (alist-cons name version result) - result)) - '())) - (new (profile-package-alist - (generation-file-name profile current)))) - (display-new/upgraded-packages old new - #:concise? #t - #:heading (G_ "New in this revision:\n")))) + (let ((these (fold-available-packages + (lambda* (name version result + #:key supported? deprecated? + #:allow-other-keys) + (if (and supported? (not deprecated?)) + (alist-cons name version result) + result)) + '())) + (those (profile-package-alist + (generation-file-name profile + (if current-is-newer? + previous + current))))) + (let ((old (if current-is-newer? those these)) + (new (if current-is-newer? these those))) + (display-new/upgraded-packages old new + #:concise? concise? + #:heading + (G_ "New in this revision:\n"))))) (_ #t))) (define* (build-and-install instances profile @@ -196,7 +209,8 @@ true, display what would be built without actually building it." #:hooks %channel-profile-hooks #:dry-run? dry-run?) (munless dry-run? - (return (display-profile-news profile)) + (return (newline)) + (return (display-profile-news profile #:concise? #t)) (match (which "guix") (#f (return #f)) (str @@ -394,9 +408,13 @@ display long package lists that would fill the user's screen." column) 4)) + (define concise/max-item-count + ;; Maximum number of items to display when CONCISE? is true. + 12) + (define list->enumeration (if concise? - (lambda* (lst #:optional (max 12)) + (lambda* (lst #:optional (max concise/max-item-count)) (if (> (length lst) max) (string-append (string-join (take lst max) ", ") ", " (ellipsis)) @@ -404,10 +422,13 @@ display long package lists that would fill the user's screen." (cut string-join <> ", "))) (let-values (((new upgraded) (new/upgraded-packages alist1 alist2))) + (define new-count (length new)) + (define upgraded-count (length upgraded)) + (unless (and (null? new) (null? upgraded)) (display heading)) - (match (length new) + (match new-count (0 #t) (count (format #t (N_ " ~h new package: ~a~%" @@ -415,14 +436,20 @@ display long package lists that would fill the user's screen." count (pretty (list->enumeration (sort (map first new) stringenumeration (sort upgraded string new-count concise/max-item-count) + (> upgraded-count concise/max-item-count))) + (display-hint (G_ "Run @command{guix pull --news} to view the complete +list of package changes."))))) (define (display-profile-content-diff profile gen1 gen2) "Display the changes in PROFILE GEN2 compared to generation GEN1." @@ -462,7 +489,12 @@ display long package lists that would fill the user's screen." (() (exit 1)) ((numbers ...) - (list-generations profile numbers))))))))) + (list-generations profile numbers))))))) + (('display-news) + ;; Display profile news, with the understanding that this process + ;; represents the newest generation. + (display-profile-news profile + #:current-is-newer? #t)))) (define (channel-list opts) "Return the list of channels to use. If OPTS specify a channel file, -- cgit v1.2.3 From a06a95baffc2005ad1a64c4c3f82fc328e0d0009 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 22 Apr 2019 11:50:49 +0200 Subject: pull: Create profile after the store connection has been opened. Fixes . Reported by Florian Pelz . Previously, we'd call 'ensure-default-profile' before the connection to the daemon has been opened. On the first connection, the daemon ensures that /var/guix/profiles/per-user is world-writable. Since we were calling 'ensure-default-profile' before that, /var/guix/profiles/per-user was typically non-writable (555 and root-owned), and thus 'guix pull' would error out. * guix/scripts/pull.scm (guix-pull): Call 'ensure-default-profile' within 'with-store'. --- guix/scripts/pull.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guix') diff --git a/guix/scripts/pull.scm b/guix/scripts/pull.scm index 04e83f970f..3929cd402e 100644 --- a/guix/scripts/pull.scm +++ b/guix/scripts/pull.scm @@ -561,11 +561,11 @@ Use '~/.config/guix/channels.scm' instead.")) (cache (string-append (cache-directory) "/pull")) (channels (channel-list opts)) (profile (or (assoc-ref opts 'profile) %current-profile))) - (ensure-default-profile) (cond ((assoc-ref opts 'query) (process-query opts profile)) (else (with-store store + (ensure-default-profile) (with-status-verbosity (assoc-ref opts 'verbosity) (parameterize ((%current-system (assoc-ref opts 'system)) (%graft? (assoc-ref opts 'graft?)) -- cgit v1.2.3