From 4f5234be0378368e6af25925db46612838d25e58 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 21 Nov 2019 20:36:20 +0100 Subject: substitute: Don't fetch /nix-cache-info. This avoids one GET request every time 'fetch-narinfos' is called. The file itself was essentially useless. * guix/scripts/substitute.scm (, download-cache-info): Remove. (%unreachable-hosts): New variable. (open-connection-for-uri/maybe): New procedure. (fetch-narinfos)[handle-narinfo-response]: Check whether NARINFO has its 'path' under (%store-prefix) and ignore it otherwise. Move 'update-progress!' call before 'if'. [do-fetch]: Remove 'port' parameter. Use 'open-connection-for-uri/maybe'. Remove call to 'download-cache-info'. --- guix/scripts/substitute.scm | 142 +++++++++++++++++++------------------------- 1 file changed, 61 insertions(+), 81 deletions(-) (limited to 'guix') diff --git a/guix/scripts/substitute.scm b/guix/scripts/substitute.scm index dba08edf50..992b21d505 100755 --- a/guix/scripts/substitute.scm +++ b/guix/scripts/substitute.scm @@ -227,58 +227,6 @@ provide." (leave (G_ "unsupported substitute URI scheme: ~a~%") (uri->string uri))))) -(define-record-type - (%make-cache-info url store-directory wants-mass-query?) - cache-info? - (url cache-info-url) - (store-directory cache-info-store-directory) - (wants-mass-query? cache-info-wants-mass-query?)) - -(define (download-cache-info url) - "Download the information for the cache at URL. On success, return a - object and a port on which to send further HTTP requests. On -failure, return #f and #f." - (define uri - (string->uri (string-append url "/nix-cache-info"))) - - (define (read-cache-info port) - (alist->record (fields->alist port) - (cut %make-cache-info url <...>) - '("StoreDir" "WantMassQuery"))) - - (catch #t - (lambda () - (case (uri-scheme uri) - ((file) - (values (call-with-input-file (uri-path uri) - read-cache-info) - #f)) - ((http https) - (let ((port (guix:open-connection-for-uri - uri - #:verify-certificate? #f - #:timeout %fetch-timeout))) - (guard (c ((http-get-error? c) - (warning (G_ "while fetching '~a': ~a (~s)~%") - (uri->string (http-get-error-uri c)) - (http-get-error-code c) - (http-get-error-reason c)) - (close-connection port) - (warning (G_ "ignoring substitute server at '~s'~%") url) - (values #f #f))) - (values (read-cache-info (http-fetch uri - #:verify-certificate? #f - #:port port - #:keep-alive? #t)) - port)))))) - (lambda (key . args) - (case key - ((getaddrinfo-error system-error) - ;; Silently ignore the error: probably due to lack of network access. - (values #f #f)) - (else - (apply throw key args)))))) - (define-record-type (%make-narinfo path uri-base uris compressions file-sizes file-hashes @@ -628,6 +576,41 @@ if file doesn't exist, and the narinfo otherwise." #f (apply throw args))))) +(define %unreachable-hosts + ;; Set of names of unreachable hosts. + (make-hash-table)) + +(define* (open-connection-for-uri/maybe uri + #:key + (verify-certificate? #f) + (time %fetch-timeout)) + "Open a connection to URI and return a port to it, or, if connection failed, +print a warning and return #f." + (define host + (uri-host uri)) + + (catch #t + (lambda () + (guix:open-connection-for-uri uri + #:verify-certificate? verify-certificate? + #:timeout time)) + (match-lambda* + (('getaddrinfo-error error) + (unless (hash-ref %unreachable-hosts host) + (hash-set! %unreachable-hosts host #t) ;warn only once + (warning (G_ "~a: host not found: ~a~%") + host (gai-strerror error))) + #f) + (('system-error . args) + (unless (hash-ref %unreachable-hosts host) + (hash-set! %unreachable-hosts host #t) + (warning (G_ "~a: connection failed: ~a~%") host + (strerror + (system-error-errno `(system-error ,@args))))) + #f) + (args + (apply throw args))))) + (define (fetch-narinfos url paths) "Retrieve all the narinfos for PATHS from the cache at URL and return them." (define update-progress! @@ -657,13 +640,18 @@ if file doesn't exist, and the narinfo otherwise." (len (response-content-length response)) (cache (response-cache-control response)) (ttl (and cache (assoc-ref cache 'max-age)))) + (update-progress!) + ;; Make sure to read no more than LEN bytes since subsequent bytes may ;; belong to the next response. (if (= code 200) ; hit (let ((narinfo (read-narinfo port url #:size len))) - (cache-narinfo! url (narinfo-path narinfo) narinfo ttl) - (update-progress!) - (cons narinfo result)) + (if (string=? (dirname (narinfo-path narinfo)) + (%store-prefix)) + (begin + (cache-narinfo! url (narinfo-path narinfo) narinfo ttl) + (cons narinfo result)) + result)) (let* ((path (uri-path (request-uri request))) (hash-part (basename (string-drop-right path 8)))) ;drop ".narinfo" @@ -674,26 +662,28 @@ if file doesn't exist, and the narinfo otherwise." (if (= 404 code) ttl %narinfo-transient-error-ttl)) - (update-progress!) result)))) - (define (do-fetch uri port) + (define (do-fetch uri) (case (and=> uri uri-scheme) ((http https) (let ((requests (map (cut narinfo-request url <>) paths))) - (update-progress!) - - ;; Note: Do not check HTTPS server certificates to avoid depending on - ;; the X.509 PKI. We can do it because we authenticate narinfos, - ;; which provides a much stronger guarantee. - (let ((result (http-multiple-get uri - handle-narinfo-response '() - requests - #:verify-certificate? #f - #:port port))) - (close-connection port) - (newline (current-error-port)) - result))) + (match (open-connection-for-uri/maybe uri) + (#f + '()) + (port + (update-progress!) + ;; Note: Do not check HTTPS server certificates to avoid depending + ;; on the X.509 PKI. We can do it because we authenticate + ;; narinfos, which provides a much stronger guarantee. + (let ((result (http-multiple-get uri + handle-narinfo-response '() + requests + #:verify-certificate? #f + #:port port))) + (close-port port) + (newline (current-error-port)) + result))))) ((file #f) (let* ((base (string-append (uri-path uri) "/")) (files (map (compose (cut string-append base <> ".narinfo") @@ -704,17 +694,7 @@ if file doesn't exist, and the narinfo otherwise." (leave (G_ "~s: unsupported server URI scheme~%") (if uri (uri-scheme uri) url))))) - (let-values (((cache-info port) - (download-cache-info url))) - (and cache-info - (if (string=? (cache-info-store-directory cache-info) - (%store-prefix)) - (do-fetch (string->uri url) port) ;reuse PORT - (begin - (warning (G_ "'~a' uses different store '~a'; ignoring it~%") - url (cache-info-store-directory cache-info)) - (close-connection port) - #f))))) + (do-fetch (string->uri url))) (define (lookup-narinfos cache paths) "Return the narinfos for PATHS, invoking the server at CACHE when no -- cgit v1.2.3 From c0e9d470e1eb3eba0d2c2da3c6ffdd5665c4638b Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 22 Nov 2019 14:21:13 +0100 Subject: import: texlive: Handle multi-license packages. This fixes "guix import texlive translator". * guix/import/texlive.scm (sxml->package): Add clause for when 'license' is a list of licences, as is the case with the "translator" package. --- guix/import/texlive.scm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'guix') diff --git a/guix/import/texlive.scm b/guix/import/texlive.scm index 791b514485..d528aace9a 100644 --- a/guix/import/texlive.scm +++ b/guix/import/texlive.scm @@ -140,7 +140,9 @@ expression describing it." (synopsis (sxml-value '(entry caption *text*))) (version (or (sxml-value '(entry version @ number *text*)) (sxml-value '(entry version @ date *text*)))) - (license (string->license (sxml-value '(entry license @ type *text*)))) + (license (match ((sxpath '(entry license @ type *text*)) sxml) + ((license) (string->license license)) + ((lst ...) (map string->license lst)))) (home-page (string-append "http://www.ctan.org/pkg/" id)) (ref (texlive-ref component id)) (checkout (download-svn-to-store store ref))) @@ -169,7 +171,9 @@ expression describing it." (sxml->string (or (sxml-value '(entry description)) '()))) #\newline))))) - (license ,license))))) + (license ,(match license + ((lst ...) `(list ,@lst)) + (license license))))))) (define texlive->guix-package (memoize -- cgit v1.2.3 From ce30a0eb7e21481815df379b4621aa48a13200bb Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 20 Nov 2019 12:07:02 +0100 Subject: profiles: Add 'concatenate-manifests'. * guix/profiles.scm (concatenate-manifests): New procedure. * tests/profiles.scm ("concatenate-manifests"): New test. --- guix/profiles.scm | 5 +++++ tests/profiles.scm | 5 +++++ 2 files changed, 10 insertions(+) (limited to 'guix') diff --git a/guix/profiles.scm b/guix/profiles.scm index cd3b21e390..f5e5cc33d6 100644 --- a/guix/profiles.scm +++ b/guix/profiles.scm @@ -92,6 +92,7 @@ manifest-pattern-version manifest-pattern-output + concatenate-manifests manifest-remove manifest-add manifest-lookup @@ -515,6 +516,10 @@ procedure is here for backward-compatibility and will eventually vanish." "Return the packages listed in MANIFEST." (sexp->manifest (read port))) +(define (concatenate-manifests lst) + "Concatenate the manifests listed in LST and return the resulting manifest." + (manifest (append-map manifest-entries lst))) + (define (entry-predicate pattern) "Return a procedure that returns #t when passed a manifest entry that matches NAME/OUTPUT/VERSION. OUTPUT and VERSION may be #f, in which case they diff --git a/tests/profiles.scm b/tests/profiles.scm index a4e28672b5..21c912a532 100644 --- a/tests/profiles.scm +++ b/tests/profiles.scm @@ -113,6 +113,11 @@ (manifest-matching-entries m (list p)) #f))) +(test-equal "concatenate-manifests" + (manifest (list guile-2.0.9 glibc)) + (concatenate-manifests (list (manifest (list guile-2.0.9)) + (manifest (list glibc))))) + (test-assert "manifest-remove" (let* ((m0 (manifest (list guile-2.0.9 guile-2.0.9:debug))) (m1 (manifest-remove m0 -- cgit v1.2.3 From bf9206d8edb06cc4c62fe5559504cf1518c2de9e Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 20 Nov 2019 12:08:56 +0100 Subject: package: Allow multiple '--manifest' options. * guix/scripts/package.scm (manifest-action): Remove. (%actions): Remove it. (load-manifest): New procedure. (process-actions): Handle 'manifest' options. Define 'files' from 'manifest' options. Define 'manifest' based on FILES. Define 'trans' to represent the final transaction. * tests/guix-package.sh: Test it. * doc/guix.texi (Invoking guix package): Mention --- doc/guix.texi | 3 ++- guix/scripts/package.scm | 50 +++++++++++++++++++++++++----------------------- tests/guix-package.sh | 13 +++++++++++++ 3 files changed, 41 insertions(+), 25 deletions(-) (limited to 'guix') diff --git a/doc/guix.texi b/doc/guix.texi index 0dc49c3cda..7ef77015cc 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -2830,7 +2830,8 @@ $ guix package --upgrade . --do-not-upgrade emacs @cindex profile declaration @cindex profile manifest Create a new generation of the profile from the manifest object -returned by the Scheme code in @var{file}. +returned by the Scheme code in @var{file}. This option can be repeated +several times, in which case the manifests are concatenated. This allows you to @emph{declare} the profile's contents rather than constructing it through a sequence of @code{--install} and similar diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm index bcd03a1df9..eb578f7642 100644 --- a/guix/scripts/package.scm +++ b/guix/scripts/package.scm @@ -832,32 +832,17 @@ processed, #f otherwise." (unless dry-run? (delete-matching-generations store profile pattern))) -(define* (manifest-action store profile file opts - #:key dry-run?) - "Change PROFILE to contain the packages specified in FILE." - (let* ((user-module (make-user-module '((guix profiles) (gnu)))) - (manifest (load* file user-module)) - (bootstrap? (assoc-ref opts 'bootstrap?)) - (substitutes? (assoc-ref opts 'substitutes?)) - (allow-collisions? (assoc-ref opts 'allow-collisions?))) - (if dry-run? - (format #t (G_ "would install new manifest from '~a' with ~d entries~%") - file (length (manifest-entries manifest))) - (format #t (G_ "installing new manifest from '~a' with ~d entries~%") - file (length (manifest-entries manifest)))) - (build-and-use-profile store profile manifest - #:allow-collisions? allow-collisions? - #:bootstrap? bootstrap? - #:use-substitutes? substitutes? - #:dry-run? dry-run?))) +(define (load-manifest file) + "Load the user-profile manifest (Scheme code) from FILE and return it." + (let ((user-module (make-user-module '((guix profiles) (gnu))))) + (load* file user-module))) (define %actions ;; List of actions that may be processed. The car of each pair is the ;; action's symbol in the option list; the cdr is the action's procedure. `((roll-back? . ,roll-back-action) (switch-generation . ,switch-generation-action) - (delete-generations . ,delete-generations-action) - (manifest . ,manifest-action))) + (delete-generations . ,delete-generations-action))) (define (process-actions store opts) "Process any install/remove/upgrade action from OPTS." @@ -896,7 +881,13 @@ processed, #f otherwise." opts) ;; Then, process normal package removal/installation/upgrade. - (let* ((manifest (profile-manifest profile)) + (let* ((files (filter-map (match-lambda + (('manifest . file) file) + (_ #f)) + opts)) + (manifest (match files + (() (profile-manifest profile)) + (_ (concatenate-manifests (map load-manifest files))))) (step1 (options->removable opts manifest (manifest-transaction))) (step2 (options->installable opts manifest step1)) @@ -904,12 +895,23 @@ processed, #f otherwise." (inherit step2) (install (map transform-entry (manifest-transaction-install step2))))) - (new (manifest-perform-transaction manifest step3))) + (new (manifest-perform-transaction manifest step3)) + (trans (if (null? files) + step3 + (fold manifest-transaction-install-entry + step3 + (manifest-entries manifest))))) (warn-about-old-distro) - (unless (manifest-transaction-null? step3) - (show-manifest-transaction store manifest step3 + (unless (manifest-transaction-null? trans) + ;; When '--manifest' is used, display information about TRANS as if we + ;; were starting from an empty profile. + (show-manifest-transaction store + (if (null? files) + manifest + (make-manifest '())) + trans #:dry-run? dry-run?) (build-and-use-profile store profile new #:allow-collisions? allow-collisions? diff --git a/tests/guix-package.sh b/tests/guix-package.sh index 7ad0699380..6d081d58be 100644 --- a/tests/guix-package.sh +++ b/tests/guix-package.sh @@ -394,6 +394,19 @@ guix package -I | grep guile test `guix package -I | wc -l` -eq 1 guix package --rollback --bootstrap +# Applying two manifests. +cat > "$module_dir/manifest2.scm"<manifest (list p)) +EOF +guix package --bootstrap \ + -m "$module_dir/manifest.scm" -m "$module_dir/manifest2.scm" +guix package -I | grep guile +guix package -I | grep eliug +test `guix package -I | wc -l` -eq 2 +guix package --rollback --bootstrap + # Applying a manifest file with inferior packages. cat > "$module_dir/manifest.scm"< Date: Wed, 20 Nov 2019 12:13:32 +0100 Subject: pack: Allow multiple '--manifest' options. * guix/scripts/pack.scm (guix-pack): Collect 'manifest' options, and concatenate the resulting manifests. * tests/guix-pack.sh: Test it. * doc/guix.texi (Invoking guix pack): Document it. --- doc/guix.texi | 3 ++- guix/scripts/pack.scm | 17 ++++++++++++----- tests/guix-pack.sh | 11 +++++++++++ 3 files changed, 25 insertions(+), 6 deletions(-) (limited to 'guix') diff --git a/doc/guix.texi b/doc/guix.texi index 7ef77015cc..7a004d2ee4 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -5178,7 +5178,8 @@ build} (@pxref{Additional Build Options, @code{--expression} in @item --manifest=@var{file} @itemx -m @var{file} Use the packages contained in the manifest object returned by the Scheme -code in @var{file}. +code in @var{file}. This option can be repeated several times, in which +case the manifests are concatenated. This has a similar purpose as the same-named option in @command{guix package} (@pxref{profile-manifest, @option{--manifest}}) and uses the diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm index 89b3e389fc..c8a52374bd 100644 --- a/guix/scripts/pack.scm +++ b/guix/scripts/pack.scm @@ -965,7 +965,10 @@ Create a bundle of PACKAGE.\n")) (list (transform store package) "out"))) (reverse (filter-map maybe-package-argument opts)))) - (manifest-file (assoc-ref opts 'manifest))) + (manifests (filter-map (match-lambda + (('manifest . file) file) + (_ #f)) + opts))) (define properties (if (assoc-ref opts 'save-provenance?) (lambda (package) @@ -979,11 +982,15 @@ Create a bundle of PACKAGE.\n")) (const '()))) (cond - ((and manifest-file (not (null? packages))) + ((and (not (null? manifests)) (not (null? packages))) (leave (G_ "both a manifest and a package list were given~%"))) - (manifest-file - (let ((user-module (make-user-module '((guix profiles) (gnu))))) - (load* manifest-file user-module))) + ((not (null? manifests)) + (concatenate-manifests + (map (lambda (file) + (let ((user-module (make-user-module + '((guix profiles) (gnu))))) + (load* file user-module))) + manifests))) (else (manifest (map (match-lambda diff --git a/tests/guix-pack.sh b/tests/guix-pack.sh index cf4e4ca4f9..7a0f3400c3 100644 --- a/tests/guix-pack.sh +++ b/tests/guix-pack.sh @@ -109,3 +109,14 @@ drv1="`guix pack -n guile 2>&1 | grep pack.*\.drv`" drv2="`guix pack -n --with-source=guile=$test_directory guile 2>&1 | grep pack.*\.drv`" test -n "$drv1" test "$drv1" != "$drv2" + +# Try '--manifest' options. +cat > "$test_directory/manifest1.scm" <manifest '("guile")) +EOF +cat > "$test_directory/manifest2.scm" <manifest '("emacs")) +EOF +drv="`guix pack -nd -m "$test_directory/manifest1.scm" -m "$test_directory/manifest2.scm"`" +guix gc -R "$drv" | grep `guix build guile -nd` +guix gc -R "$drv" | grep `guix build emacs -nd` -- cgit v1.2.3 From 74f1718081a33203fcc92b811eac6a7094d8c64b Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Tue, 20 Aug 2019 17:45:50 +0200 Subject: utils: Use target-aarch64? and target-arm? helpers. * guix/utils.scm (target-aarch64?, target-arm?): New exported procedures. --- guix/utils.scm | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'guix') diff --git a/guix/utils.scm b/guix/utils.scm index 64853f2989..728039fbf0 100644 --- a/guix/utils.scm +++ b/guix/utils.scm @@ -78,6 +78,8 @@ package-name->name+version target-mingw? target-arm32? + target-aarch64? + target-arm? target-64bit? version-compare version>? @@ -494,6 +496,12 @@ a character other than '@'." (define (target-arm32?) (string-prefix? "arm" (or (%current-target-system) (%current-system)))) +(define (target-aarch64?) + (string-prefix? "aarch64" (or (%current-target-system) (%current-system)))) + +(define (target-arm?) + (or (target-arm32?) (target-aarch64?))) + (define (target-64bit?) (let ((system (or (%current-target-system) (%current-system)))) (any (cut string-prefix? <> system) '("x86_64" "aarch64" "mips64" "ppc64")))) -- cgit v1.2.3 From fed36328129def5f10b1d1f3e4ea8886916fd22a Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 23 Nov 2019 22:43:40 +0100 Subject: compile: Adjust for Guile 2.9.5. * guix/build/compile.scm (optimizations-for-level): New procedure. Include '%lightweight-optimizations' and '%default-optimizations'. (optimization-options): Use 'optimizations-for-level'. --- guix/build/compile.scm | 49 ++++++++++++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 21 deletions(-) (limited to 'guix') diff --git a/guix/build/compile.scm b/guix/build/compile.scm index 06ed57c9d7..3781e148ce 100644 --- a/guix/build/compile.scm +++ b/guix/build/compile.scm @@ -39,25 +39,32 @@ ;;; ;;; Code: -(define %default-optimizations - ;; Default optimization options (equivalent to -O2 on Guile 2.2). - (append (if (defined? 'tree-il-default-optimization-options) - (tree-il-default-optimization-options) ;Guile 2.2 - (tree-il-optimizations)) ;Guile 3 - (if (defined? 'cps-default-optimization-options) - (cps-default-optimization-options) ;Guile 2.2 - (cps-optimizations)))) ;Guile 3 - -(define %lightweight-optimizations - ;; Lightweight optimizations (like -O0, but with partial evaluation). - (let loop ((opts %default-optimizations) - (result '())) - (match opts - (() (reverse result)) - ((#:partial-eval? _ rest ...) - (loop rest `(#t #:partial-eval? ,@result))) - ((kw _ rest ...) - (loop rest `(#f ,kw ,@result)))))) +(define optimizations-for-level + (or (and=> (false-if-exception + (resolve-interface '(system base optimize))) + (lambda (iface) + (module-ref iface 'optimizations-for-level))) ;Guile 3.0 + (let () ;Guile 2.2 + (define %default-optimizations + ;; Default optimization options (equivalent to -O2 on Guile 2.2). + (append (tree-il-default-optimization-options) + (cps-default-optimization-options))) + + (define %lightweight-optimizations + ;; Lightweight optimizations (like -O0, but with partial evaluation). + (let loop ((opts %default-optimizations) + (result '())) + (match opts + (() (reverse result)) + ((#:partial-eval? _ rest ...) + (loop rest `(#t #:partial-eval? ,@result))) + ((kw _ rest ...) + (loop rest `(#f ,kw ,@result)))))) + + (lambda (level) + (if (<= level 1) + %lightweight-optimizations + %default-optimizations))))) (define (supported-warning-type? type) "Return true if TYPE, a symbol, denotes a supported warning type." @@ -80,8 +87,8 @@ (define (optimization-options file) "Return the default set of optimizations options for FILE." (if (string-contains file "gnu/packages/") - %lightweight-optimizations ;build faster - '())) + (optimizations-for-level 1) ;build faster + (optimizations-for-level 3))) (define (scm->go file) "Strip the \".scm\" suffix from FILE, and append \".go\"." -- cgit v1.2.3 From dc209d5a5ddba4320c9a4f893d6df4b70f3685a0 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 21 Nov 2019 15:14:33 +0100 Subject: guix build, daemon: Rename "--no-build-hook" to "--no-offload". This is a followup to bc69ea2d605810cc32e13ed03d5848b8dc358b61. * guix/scripts/build.scm (show-build-options-help): Rename "--no-build-hook" to "--no-offload". (%standard-build-options): Likewise, and warn when "--no-build-hook" is passed. * nix/nix-daemon/guix-daemon.cc (options): Add "--no-offload" and mark "--no-build-hook" as hidden. * guix/scripts/offload.scm: Adjust comment. * doc/guix.texi (Invoking guix-daemon, Common Build Options): Replace "--no-build-hook" with "--no-offload". * etc/completion/fish/guix.fish, etc/completion/zsh/_guix: Adjust accordingly. --- doc/guix.texi | 20 +++++++++----------- etc/completion/fish/guix.fish | 28 ++++++++++++++-------------- etc/completion/zsh/_guix | 8 ++++---- guix/scripts/build.scm | 8 ++++++-- guix/scripts/offload.scm | 2 +- nix/nix-daemon/guix-daemon.cc | 7 +++++-- 6 files changed, 39 insertions(+), 34 deletions(-) (limited to 'guix') diff --git a/doc/guix.texi b/doc/guix.texi index 7a004d2ee4..5756b6aa2c 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -1368,13 +1368,11 @@ source URLs. When this option is omitted, This means that substitutes may be downloaded from @var{urls}, as long as they are signed by a trusted signature (@pxref{Substitutes}). -@cindex build hook -@item --no-build-hook -Do not use the @dfn{build hook}. - -The build hook is a helper program that the daemon can start and to -which it submits build requests. This mechanism is used to offload -builds to other machines (@pxref{Daemon Offload Setup}). +@cindex offloading +@item --no-offload +Do not use offload builds to other machines (@pxref{Daemon Offload +Setup}). That is, always build things locally instead of offloading +builds to remote machines. @item --cache-failures Cache build failures. By default, only successful builds are cached. @@ -8112,10 +8110,10 @@ stashing one of the build results with @code{guix archive --export} (@pxref{Invoking guix archive}), then rebuilding, and finally comparing the two results. -@item --no-build-hook -Do not attempt to offload builds @i{via} the ``build hook'' of the daemon -(@pxref{Daemon Offload Setup}). That is, always build things locally -instead of offloading builds to remote machines. +@item --no-offload +Do not use offload builds to other machines (@pxref{Daemon Offload +Setup}). That is, always build things locally instead of offloading +builds to remote machines. @item --max-silent-time=@var{seconds} When the build or substitution process remains silent for more than diff --git a/etc/completion/fish/guix.fish b/etc/completion/fish/guix.fish index 525d39679d..6582f3a186 100644 --- a/etc/completion/fish/guix.fish +++ b/etc/completion/fish/guix.fish @@ -133,7 +133,7 @@ complete -f -c guix -n '__fish_guix_using_command pull' -l url -d 'download the complete -f -c guix -n '__fish_guix_using_command pull' -l bootstrap -d 'use the bootstrap Guile to build the new Guix' #### system -set -l remotecommands reconfigure roll-back switch-generation list-generations build container vm vm-image disk-image init extension-graph shepherd-graph load-path keep-failed keep-going dry-run fallback no-substitutes substitutes-urls no-grafts no-build-hook max-silent-time timeout verbosity rounds cores max-jobs derivation on-error image-size no-grub share expose full-boot +set -l remotecommands reconfigure roll-back switch-generation list-generations build container vm vm-image disk-image init extension-graph shepherd-graph load-path keep-failed keep-going dry-run fallback no-substitutes substitutes-urls no-grafts no-offload max-silent-time timeout verbosity rounds cores max-jobs derivation on-error image-size no-grub share expose full-boot complete -f -c guix -n '__fish_guix_needs_command' -a system -d 'Build the operating system declared in FILE according to ACTION.' complete -f -c guix -n '__fish_guix_using_command system' -l reconfigure -d 'switch to a new operating system configuration' complete -f -c guix -n '__fish_guix_using_command system' -l roll-back -d 'switch to the previous operating system configuration' @@ -156,7 +156,7 @@ complete -f -c guix -n '__fish_guix_using_command system' -l fallback -d 'fall b complete -f -c guix -n '__fish_guix_using_command system' -l no-substitutes -d 'build instead of resorting to pre-built substitutes' complete -f -c guix -n '__fish_guix_using_command system' -a "--substitute-urls=" -d 'fetch substitute from URLS if they are authorized' complete -f -c guix -n '__fish_guix_using_command system' -l no-grafts -d 'do not graft packages' -complete -f -c guix -n '__fish_guix_using_command system' -l no-build-hook -d 'do not attempt to offload builds via the build hook' +complete -f -c guix -n '__fish_guix_using_command system' -l no-offload -d 'do not attempt to offload builds' complete -f -c guix -n '__fish_guix_using_command system' -a "--max-silent-time=" -d 'mark the build as failed after SECONDS of silence' complete -f -c guix -n '__fish_guix_using_command system' -a "--timeout=" -d 'mark the build as failed after SECONDS of activity' complete -f -c guix -n '__fish_guix_using_command system' -a "--verbosity=" -d 'use the given verbosity LEVEL' @@ -174,7 +174,7 @@ complete -f -c guix -n '__fish_guix_using_command system' -a "--expose=" -d 'for complete -f -c guix -n '__fish_guix_using_command system' -l full-boot -d 'for \'vm\', make a full boot sequence' #### build -set -l remotecommands expression file source sources system target derivations check repair root quiet log-file load-path keep-failed keep-going dry-run fallback no-substitutes substitute-urls no-grafts no-build-hook max-silent-time timeout verbosity rounds cores max-jobs with-source with-input with-graft +set -l remotecommands expression file source sources system target derivations check repair root quiet log-file load-path keep-failed keep-going dry-run fallback no-substitutes substitute-urls no-grafts no-offload max-silent-time timeout verbosity rounds cores max-jobs with-source with-input with-graft complete -f -c guix -n '__fish_guix_needs_command' -a build -d 'Build the given PACKAGE-OR-DERIVATION and return their output paths.' complete -f -c guix -n '__fish_guix_using_command build' -a "--expression=" -d 'build the package or derivation EXPR evaluates to' complete -f -c guix -n '__fish_guix_using_command build' -s f -d 'build the package or derivation that the code within FILE evaluates to' --exclusive --arguments "(ls -ap)" @@ -201,7 +201,7 @@ complete -f -c guix -n '__fish_guix_using_command build' -l fallback -d 'fall ba complete -f -c guix -n '__fish_guix_using_command build' -l no-substitutes -d 'build instead of resorting to pre-built substitutes' complete -f -c guix -n '__fish_guix_using_command build' -a "--substitute-urls=" -d 'fetch substitute from URLS if they are authorized' complete -f -c guix -n '__fish_guix_using_command build' -l no-grafts -d 'do not graft packages' -complete -f -c guix -n '__fish_guix_using_command build' -l no-build-hook -d 'do not attempt to offload builds via the build hook' +complete -f -c guix -n '__fish_guix_using_command build' -l no-offload -d 'do not attempt to offload builds' complete -f -c guix -n '__fish_guix_using_command build' -a "--max-silent-time=" -d 'mark the build as failed after SECONDS of silence' complete -f -c guix -n '__fish_guix_using_command build' -a "--timeout=" -d 'mark the build as failed after SECONDS of activity' complete -f -c guix -n '__fish_guix_using_command build' -a "--verbosity=" -d 'use the given verbosity LEVEL' @@ -215,7 +215,7 @@ complete -f -c guix -n '__fish_guix_using_command build' -a "--with-input=" -d ' complete -f -c guix -n '__fish_guix_using_command build' -a "--with-graft=" -d 'PACKAGE=REPLACEMENT .. graft REPLACEMENT on packages that refer to PACKAGE' #### package -set -l remotecommands install install-from-expression install-from-file remove upgrade manifest do-no-upgrade roll-back search-paths list-generations delete-generations switch-generation profile bootstrap verbose search list-installed list-available show load-path keep-failed keep-going dry-run fallback no.substitutes substitute-urls no-grafts no-build-hook max-silent-time timenout verbosity rounds cores max-jobs with-source with-input with-graft +set -l remotecommands install install-from-expression install-from-file remove upgrade manifest do-no-upgrade roll-back search-paths list-generations delete-generations switch-generation profile bootstrap verbose search list-installed list-available show load-path keep-failed keep-going dry-run fallback no.substitutes substitute-urls no-grafts no-offload max-silent-time timenout verbosity rounds cores max-jobs with-source with-input with-graft complete -f -c guix -n '__fish_guix_needs_command' -a package -d 'Install, remove, or upgrade packages in a single transaction.' complete -f -c guix -n '__fish_guix_using_command package' -s i -l install -d 'install PACKAGEs' complete -f -c guix -n '__fish_guix_using_command package' -s e -d 'install the package EXP evaluates to' @@ -252,7 +252,7 @@ complete -f -c guix -n '__fish_guix_using_command package' -l fallback -d 'fall complete -f -c guix -n '__fish_guix_using_command package' -l no-substitutes -d 'build instead of resorting to pre-built substitutes' complete -f -c guix -n '__fish_guix_using_command package' -a "--substitute-urls=" -d 'URLS fetch substitute from URLS if they are authorized' complete -f -c guix -n '__fish_guix_using_command package' -l no-grafts -d 'do not graft packages' -complete -f -c guix -n '__fish_guix_using_command package' -l no-build-hook -d 'do not attempt to offload builds via the build hook' +complete -f -c guix -n '__fish_guix_using_command package' -l no-offload -d 'do not attempt to offload builds' complete -f -c guix -n '__fish_guix_using_command package' -a "--max-silent-time=" -d 'SECONDS mark the build as failed after SECONDS of silence' complete -f -c guix -n '__fish_guix_using_command package' -a "--timeout=" -d 'SECONDS mark the build as failed after SECONDS of activity' complete -f -c guix -n '__fish_guix_using_command package' -a "--verbosity=" -d 'LEVEL use the given verbosity LEVEL' @@ -391,7 +391,7 @@ complete -f -c guix -n '__fish_guix_using_command gc' -l list-failures -d 'list complete -f -c guix -n '__fish_guix_using_command gc' -l clear-failures -d 'remove PATHS from the set of cached failures' #### environment -set -l remotecommands expression load ad-hoc pure search-paths system root container network share expose bootstrap load-path keep-failed keep-going dry-run fallback no-substitutes substitute-urls no-grafts no-build-hook max-silent-time timeout verbosity rounds cores max-jobs +set -l remotecommands expression load ad-hoc pure search-paths system root container network share expose bootstrap load-path keep-failed keep-going dry-run fallback no-substitutes substitute-urls no-grafts no-offload max-silent-time timeout verbosity rounds cores max-jobs complete -f -c guix -n '__fish_guix_needs_command' -a environment -d 'Build an environment that includes the dependencies of PACKAGE and execute COMMAND or an interactive shell in that environment.' complete -f -c guix -n '__fish_guix_using_command environment' -s e -d 'Create environment for the package that EXPR evaluates to' complete -f -c guix -n '__fish_guix_using_command environment' -a "--expression=" -d 'Create environment for the package that EXPR evaluates to' @@ -418,7 +418,7 @@ complete -f -c guix -n '__fish_guix_using_command environment' -l fallback -d 'f complete -f -c guix -n '__fish_guix_using_command environment' -l no-substitutes -d 'build instead of resorting to pre-built substitutes' complete -f -c guix -n '__fish_guix_using_command environment' -a "--substitute-urls=" -d 'fetch substitute from URLS if they are authorized' complete -f -c guix -n '__fish_guix_using_command environment' -l no-grafts -d 'do not graft packages' -complete -f -c guix -n '__fish_guix_using_command environment' -l no-build-hook -d 'do not attempt to offload builds via the build hook' +complete -f -c guix -n '__fish_guix_using_command environment' -l no-offload -d 'do not attempt to offload builds' complete -f -c guix -n '__fish_guix_using_command environment' -a "--max-silent-time=" -d 'mark the build as failed after SECONDS of silence' complete -f -c guix -n '__fish_guix_using_command environment' -a "--timeout=" -d 'mark the build as failed after SECONDS of activity' complete -f -c guix -n '__fish_guix_using_command environment' -a "--verbosity=" -d 'use the given verbosity LEVEL' @@ -432,7 +432,7 @@ complete -f -c guix -n '__fish_guix_using_command environment' -a "--max-jobs=" complete -f -c guix -n '__fish_guix_needs_command' -a edit -d 'Start $VISUAL or $EDITOR to edit the definitions of PACKAGE.' #### copy -set -l remotecommands to= from= load-path= keep-failed keep-going dry-run fallback no-substitutes substitute-urls= no-grafts no-build-hook max-silent-time= timeout= verbosity= rounds= cores= max-jobs= +set -l remotecommands to= from= load-path= keep-failed keep-going dry-run fallback no-substitutes substitute-urls= no-grafts no-offload max-silent-time= timeout= verbosity= rounds= cores= max-jobs= complete -f -c guix -n '__fish_guix_needs_command' -a copy -d 'Copy ITEMS to or from the specified host over SSH.' complete -f -c guix -n '__fish_guix_using_command copy' -a "--to=" -d 'send ITEMS to HOST' complete -f -c guix -n '__fish_guix_using_command copy' -a "--from=" -d 'receive ITEMS from HOST' @@ -445,7 +445,7 @@ complete -f -c guix -n '__fish_guix_using_command copy' -l fallback -d 'fall bac complete -f -c guix -n '__fish_guix_using_command copy' -l no-substitutes -d 'build instead of resorting to pre-built substitutes' complete -f -c guix -n '__fish_guix_using_command copy' -a "--substitute-urls=" -d 'fetch substitute from URLS if they are authorized' complete -f -c guix -n '__fish_guix_using_command copy' -l no-grafts -d 'do not graft packages' -complete -f -c guix -n '__fish_guix_using_command copy' -l no-build-hook -d 'do not attempt to offload builds via the build hook' +complete -f -c guix -n '__fish_guix_using_command copy' -l no-offload -d 'do not attempt to offload builds' complete -f -c guix -n '__fish_guix_using_command copy' -a "--max-silent-time=" -d 'mark the build as failed after SECONDS of silence' complete -f -c guix -n '__fish_guix_using_command copy' -a "--timeout=" -d 'mark the build as failed after SECONDS of activity' complete -f -c guix -n '__fish_guix_using_command copy' -a "--verbosity=" -d 'use the given verbosity LEVEL' @@ -467,7 +467,7 @@ complete -f -c guix -n '__fish_guix_using_command challenge' -a "--substitute-ur complete -f -c guix -n '__fish_guix_using_command challenge' -s v -l verbose -d 'show details about successful comparisons' #### archive -set -l remotecommands export format= recursive import missing extract= generate-key authorize expression= source system= target= load-path= keep-failed keep-going dry-run fallback no-substitutes substitute-urls= no-grafts no-build-hook max-silent-time= timeout= verbosity= rounds= cores= max-jobs= +set -l remotecommands export format= recursive import missing extract= generate-key authorize expression= source system= target= load-path= keep-failed keep-going dry-run fallback no-substitutes substitute-urls= no-grafts no-offload max-silent-time= timeout= verbosity= rounds= cores= max-jobs= complete -f -c guix -n '__fish_guix_needs_command' -a archive -d 'Export/import one or more packages from/to the store.' complete -f -c guix -n '__fish_guix_using_command archive' -l export -d 'export the specified files/packages to stdout' complete -f -c guix -n '__fish_guix_using_command archive' -a "--format=" -d 'export files/packages in the specified format FMT' @@ -489,7 +489,7 @@ complete -f -c guix -n '__fish_guix_using_command archive' -l fallback -d 'fall complete -f -c guix -n '__fish_guix_using_command archive' -l no-substitutes -d 'build instead of resorting to pre-built substitutes' complete -f -c guix -n '__fish_guix_using_command archive' -a "--substitute-urls=" -d 'fetch substitute from URLS if they are authorized' complete -f -c guix -n '__fish_guix_using_command archive' -l no-grafts -d 'do not graft packages' -complete -f -c guix -n '__fish_guix_using_command archive' -l no-build-hook -d 'do not attempt to offload builds via the build hook' +complete -f -c guix -n '__fish_guix_using_command archive' -l no-offload -d 'do not attempt to offload builds' complete -f -c guix -n '__fish_guix_using_command archive' -a "--max-silent-time=" -d 'mark the build as failed after SECONDS of silence' complete -f -c guix -n '__fish_guix_using_command archive' -a "--timeout=" -f -d 'mark the build as failed after SECONDS of activity' complete -f -c guix -n '__fish_guix_using_command archive' -a "--verbosity=" -d 'use the given verbosity LEVEL' @@ -498,7 +498,7 @@ complete -f -c guix -n '__fish_guix_using_command archive' -a "--cores=" -d 'all complete -f -c guix -n '__fish_guix_using_command archive' -a "--max-jobs=" -d 'allow at most N build jobs' #### pack -set -l remotecommands --load-path= --keep-failed --keep-going --dry-run --fallback --no-substitutes --substitute-urls= --no-grafts --no-build-hook --max-silent-time= --timeout= --verbosity= --rounds= --cores= --max-jobs= --with-source= --with-input= --with-graft= --format= --expression= --system= --target= --compression= --symlink= --localstatedir --help --version +set -l remotecommands --load-path= --keep-failed --keep-going --dry-run --fallback --no-substitutes --substitute-urls= --no-grafts --no-offload --max-silent-time= --timeout= --verbosity= --rounds= --cores= --max-jobs= --with-source= --with-input= --with-graft= --format= --expression= --system= --target= --compression= --symlink= --localstatedir --help --version complete -f -c guix -n '__fish_guix_needs_command' -a pack -d 'Create a bundle of PACKAGE.' complete -f -c guix -n '__fish_guix_using_command pack' -a "--load-path=" -d 'prepend DIR to the package module search path' complete -f -c guix -n '__fish_guix_using_command pack' -s L -d 'prepend DIR to the package module search path' @@ -512,7 +512,7 @@ complete -f -c guix -n '__fish_guix_using_command pack' -a "--fallback" -d 'fall complete -f -c guix -n '__fish_guix_using_command pack' -a "--no-substitutes" -d 'build instead of resorting to pre-built substitutes' complete -f -c guix -n '__fish_guix_using_command pack' -a "--substitute-urls=" -d 'fetch substitute from URLS if they are authorized' complete -f -c guix -n '__fish_guix_using_command pack' -a "--no-grafts" -d 'do not graft packages' -complete -f -c guix -n '__fish_guix_using_command pack' -a "--no-build-hook" -d 'do not attempt to offload builds via the build hook' +complete -f -c guix -n '__fish_guix_using_command pack' -a "--no-offload" -d 'do not attempt to offload builds via the build hook' complete -f -c guix -n '__fish_guix_using_command pack' -a "--max-silent-time=" -d 'mark the build as failed after SECONDS of silence' complete -f -c guix -n '__fish_guix_using_command pack' -a "--timeout=" -d 'mark the build as failed after SECONDS of activity' complete -f -c guix -n '__fish_guix_using_command pack' -a "--verbosity=" -d 'use the given verbosity LEVEL' diff --git a/etc/completion/zsh/_guix b/etc/completion/zsh/_guix index 3760bb629b..ae93b62b1d 100644 --- a/etc/completion/zsh/_guix +++ b/etc/completion/zsh/_guix @@ -87,7 +87,7 @@ _guix_list_installed_packages() '--no-substitutes[build instead of resorting to pre-built substitutes]' \ '--substitute-urls=[fetch substitute from URLS if they are authorized]:URLS:_urls' \ '--no-grafts[do not graft packages]' \ - '--no-build-hook[do not attempt to offload builds via the build hook]' \ + '--no-offload[do not attempt to offload builds]' \ '--max-silent-time=[mark the build as failed after SECONDS of silence]:SECONDS' \ '--timeout=[mark the build as failed after SECONDS of activity]:SECONDS' \ '--verbosity=[use the given verbosity LEVEL]:LEVEL' \ @@ -158,7 +158,7 @@ _guix_list_installed_packages() '--no-substitutes[build instead of resorting to pre-built substitutes]' \ '--substitute-urls=[fetch substitute from URLS if they are authorized]:URLS:_urls' \ '--no-grafts[do not graft packages]' \ - '--no-build-hook[do not attempt to offload builds via the build hook]' \ + '--no-offload[do not attempt to offload builds]' \ '--max-silent-time=[mark the build as failed after SECONDS of silence]:SECONDS' \ '--timeout=[mark the build as failed after SECONDS of activity]:SECONDS' \ '--verbosity=[use the given verbosity LEVEL]:LEVEL' \ @@ -282,7 +282,7 @@ _guix_list_installed_packages() '--no-substitutes[build instead of resorting to pre-built substitutes]' \ '--substitute-urls=[fetch substitute from URLS if they are authorized]:URLS:_urls' \ '--no-grafts[do not graft packages]' \ - '--no-build-hook[do not attempt to offload builds via the build hook]' \ + '--no-offload[do not attempt to offload builds]' \ '--max-silent-time=[mark the build as failed after SECONDS of silence]:SECONDS' \ '--timeout=[mark the build as failed after SECONDS of activity]:SECONDS' \ '--verbosity=[use the given verbosity LEVEL]:LEVEL' \ @@ -374,7 +374,7 @@ _guix_list_installed_packages() '--no-substitutes[build instead of resorting to pre-built substitutes]' \ '--substitute-urls=[fetch substitute from URLS if they are authorized]:URL:_urls' \ '--no-grafts[do not graft packages]' \ - '--no-build-hook[do not attempt to offload builds via the build hook]' \ + '--no-offload[do not attempt to offload builds]' \ '--max-silent-time=[mark the build as failed after SECONDS of silence]:SECONDS' \ '--timeout=[mark the build as failed after SECONDS of activity]:SECONDS' \ '--verbosity=[use the given verbosity LEVEL]:LEVEL' \ diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm index ae78df9c5c..e72b89d2d4 100644 --- a/guix/scripts/build.scm +++ b/guix/scripts/build.scm @@ -504,7 +504,7 @@ options handled by 'set-build-options-from-command-line', and listed in (display (G_ " --no-grafts do not graft packages")) (display (G_ " - --no-build-hook do not attempt to offload builds via the build hook")) + --no-offload do not attempt to offload builds")) (display (G_ " --max-silent-time=SECONDS mark the build as failed after SECONDS of silence")) @@ -610,8 +610,12 @@ talking to a remote daemon\n"))) (alist-cons 'graft? #f (alist-delete 'graft? result eq?)) rest))) - (option '("no-build-hook") #f #f + (option '("no-offload" "no-build-hook") #f #f (lambda (opt name arg result . rest) + (when (string=? name "no-build-hook") + (warning (G_ "'--no-build-hook' is deprecated; \ +use '--no-offload' instead~%"))) + (apply values (alist-cons 'build-hook? #f (alist-delete 'build-hook? result)) diff --git a/guix/scripts/offload.scm b/guix/scripts/offload.scm index 1384f6b41d..18473684eb 100644 --- a/guix/scripts/offload.scm +++ b/guix/scripts/offload.scm @@ -60,7 +60,7 @@ ;;; retrieving the build output(s) over SSH upon success. ;;; ;;; This command should not be used directly; instead, it is called on-demand -;;; by the daemon, unless it was started with '--no-build-hook' or a client +;;; by the daemon, unless it was started with '--no-offload' or a client ;;; inhibited build hooks. ;;; ;;; Code: diff --git a/nix/nix-daemon/guix-daemon.cc b/nix/nix-daemon/guix-daemon.cc index 6f9c404c8d..cd949aca67 100644 --- a/nix/nix-daemon/guix-daemon.cc +++ b/nix/nix-daemon/guix-daemon.cc @@ -113,8 +113,11 @@ static const struct argp_option options[] = n_("do not use substitutes") }, { "substitute-urls", GUIX_OPT_SUBSTITUTE_URLS, n_("URLS"), 0, n_("use URLS as the default list of substitute providers") }, - { "no-build-hook", GUIX_OPT_NO_BUILD_HOOK, 0, 0, - n_("do not use the 'build hook'") }, + { "no-offload", GUIX_OPT_NO_BUILD_HOOK, 0, 0, + n_("do not attempt to offload builds") }, + { "no-build-hook", GUIX_OPT_NO_BUILD_HOOK, 0, + OPTION_HIDDEN, // deprecated + n_("do not attempt to offload builds") }, { "cache-failures", GUIX_OPT_CACHE_FAILURES, 0, 0, n_("cache build failures") }, { "rounds", GUIX_OPT_BUILD_ROUNDS, "N", 0, -- cgit v1.2.3 From 7f44ab48f902e713ece5c5a0ae68519577a2344e Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 21 Nov 2019 15:28:13 +0100 Subject: Use 'offload?' instead of 'build-hook?' internally. * guix/scripts/archive.scm (%default-options): Replace 'build-hook?' with 'offload?'. * guix/scripts/build.scm (set-build-options-from-command-line): Pass #:offload? instead of #:use-build-hook?. (%standard-build-options): Use the 'offload? key instead of 'build-hook?. (%default-options): Replace 'build-hook?' with 'offload?'. * guix/scripts/copy.scm (%default-options): Likewise. * guix/scripts/deploy.scm (%default-options): Likewise. * guix/scripts/environment.scm (%default-options): Likewise. * guix/scripts/pack.scm (%default-options): Likewise. * guix/scripts/package.scm (%default-options): Likewise. * guix/scripts/pull.scm (%default-options): Likewise. * guix/scripts/system.scm (%default-options): Likewise. * guix/scripts/time-machine.scm (%default-options): Likewise. * guix/store.scm (set-build-options): Have #:use-build-hook? default to *unspecified*. Add #:offload?. Add call to 'warn-about-deprecation' when #:use-build-hook? is specified. --- guix/scripts/archive.scm | 2 +- guix/scripts/build.scm | 8 ++++---- guix/scripts/copy.scm | 2 +- guix/scripts/deploy.scm | 2 +- guix/scripts/environment.scm | 2 +- guix/scripts/pack.scm | 2 +- guix/scripts/package.scm | 2 +- guix/scripts/pull.scm | 2 +- guix/scripts/system.scm | 2 +- guix/scripts/time-machine.scm | 2 +- guix/store.scm | 11 +++++++++-- 11 files changed, 22 insertions(+), 15 deletions(-) (limited to 'guix') diff --git a/guix/scripts/archive.scm b/guix/scripts/archive.scm index fba0f73826..3318ef0889 100644 --- a/guix/scripts/archive.scm +++ b/guix/scripts/archive.scm @@ -55,7 +55,7 @@ ;; Alist of default option values. `((system . ,(%current-system)) (substitutes? . #t) - (build-hook? . #t) + (offload? . #t) (graft? . #t) (print-build-trace? . #t) (print-extended-build-trace? . #t) diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm index e72b89d2d4..acb495a462 100644 --- a/guix/scripts/build.scm +++ b/guix/scripts/build.scm @@ -545,7 +545,7 @@ talking to a remote daemon\n"))) #:fallback? (assoc-ref opts 'fallback?) #:use-substitutes? (assoc-ref opts 'substitutes?) #:substitute-urls (assoc-ref opts 'substitute-urls) - #:use-build-hook? (assoc-ref opts 'build-hook?) + #:offload? (assoc-ref opts 'offload?) #:max-silent-time (assoc-ref opts 'max-silent-time) #:timeout (assoc-ref opts 'timeout) #:print-build-trace (assoc-ref opts 'print-build-trace?) @@ -617,8 +617,8 @@ talking to a remote daemon\n"))) use '--no-offload' instead~%"))) (apply values - (alist-cons 'build-hook? #f - (alist-delete 'build-hook? result)) + (alist-cons 'offload? #f + (alist-delete 'offload? result)) rest))) (option '("max-silent-time") #t #f (lambda (opt name arg result . rest) @@ -663,7 +663,7 @@ use '--no-offload' instead~%"))) `((build-mode . ,(build-mode normal)) (graft? . #t) (substitutes? . #t) - (build-hook? . #t) + (offload? . #t) (print-build-trace? . #t) (print-extended-build-trace? . #t) (multiplexed-build-output? . #t) diff --git a/guix/scripts/copy.scm b/guix/scripts/copy.scm index ce70f2f0b3..664cb32b7c 100644 --- a/guix/scripts/copy.scm +++ b/guix/scripts/copy.scm @@ -158,7 +158,7 @@ Copy ITEMS to or from the specified host over SSH.\n")) (define %default-options `((system . ,(%current-system)) (substitutes? . #t) - (build-hook? . #t) + (offload? . #t) (graft? . #t) (print-build-trace? . #t) (print-extended-build-trace? . #t) diff --git a/guix/scripts/deploy.scm b/guix/scripts/deploy.scm index 27b7e4fd1c..bc0ceabd3f 100644 --- a/guix/scripts/deploy.scm +++ b/guix/scripts/deploy.scm @@ -84,7 +84,7 @@ Perform the deployment specified by FILE.\n")) (debug . 0) (graft? . #t) (substitutes? . #t) - (build-hook? . #t) + (offload? . #t) (print-build-trace? . #t) (print-extended-build-trace? . #t) (multiplexed-build-output? . #t))) diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm index d78ca0f303..f04363750e 100644 --- a/guix/scripts/environment.scm +++ b/guix/scripts/environment.scm @@ -191,7 +191,7 @@ COMMAND or an interactive shell in that environment.\n")) (define %default-options `((system . ,(%current-system)) (substitutes? . #t) - (build-hook? . #t) + (offload? . #t) (graft? . #t) (print-build-trace? . #t) (print-extended-build-trace? . #t) diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm index c8a52374bd..61d18e2609 100644 --- a/guix/scripts/pack.scm +++ b/guix/scripts/pack.scm @@ -759,7 +759,7 @@ last resort for relocation." (profile-name . "guix-profile") (system . ,(%current-system)) (substitutes? . #t) - (build-hook? . #t) + (offload? . #t) (graft? . #t) (print-build-trace? . #t) (print-extended-build-trace? . #t) diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm index eb578f7642..97436feee7 100644 --- a/guix/scripts/package.scm +++ b/guix/scripts/package.scm @@ -318,7 +318,7 @@ Alternately, see @command{guix package --search-paths -p ~s}.") (debug . 0) (graft? . #t) (substitutes? . #t) - (build-hook? . #t) + (offload? . #t) (print-build-trace? . #t) (print-extended-build-trace? . #t) (multiplexed-build-output? . #t))) diff --git a/guix/scripts/pull.scm b/guix/scripts/pull.scm index ef8d5c8fd9..a74776bd7b 100644 --- a/guix/scripts/pull.scm +++ b/guix/scripts/pull.scm @@ -71,7 +71,7 @@ ;; Alist of default option values. `((system . ,(%current-system)) (substitutes? . #t) - (build-hook? . #t) + (offload? . #t) (print-build-trace? . #t) (print-extended-build-trace? . #t) (multiplexed-build-output? . #t) diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm index 27b014db68..e49c9d36b9 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm @@ -1013,7 +1013,7 @@ Some ACTIONS support additional ARGS.\n")) ;; Alist of default option values. `((system . ,(%current-system)) (substitutes? . #t) - (build-hook? . #t) + (offload? . #t) (print-build-trace? . #t) (print-extended-build-trace? . #t) (multiplexed-build-output? . #t) diff --git a/guix/scripts/time-machine.scm b/guix/scripts/time-machine.scm index 19e635555a..1e800e160f 100644 --- a/guix/scripts/time-machine.scm +++ b/guix/scripts/time-machine.scm @@ -94,7 +94,7 @@ Execute COMMAND ARGS... in an older version of Guix.\n")) ;; Alist of default option values. `((system . ,(%current-system)) (substitutes? . #t) - (build-hook? . #t) + (offload? . #t) (print-build-trace? . #t) (print-extended-build-trace? . #t) (multiplexed-build-output? . #t) diff --git a/guix/store.scm b/guix/store.scm index a276554a52..cf25d347fc 100644 --- a/guix/store.scm +++ b/guix/store.scm @@ -763,7 +763,8 @@ encoding conversion errors." max-build-jobs timeout max-silent-time - (use-build-hook? #t) + (offload? #t) + (use-build-hook? *unspecified*) ;deprecated (build-verbosity 0) (log-type 0) (print-build-trace #t) @@ -803,6 +804,10 @@ encoding conversion errors." (define socket (store-connection-socket server)) + (unless (unspecified? use-build-hook?) + (warn-about-deprecation #:use-build-hook? #f + #:replacement #:offload?)) + (let-syntax ((send (syntax-rules () ((_ (type option) ...) (begin @@ -816,7 +821,9 @@ encoding conversion errors." (max-silent-time (or max-silent-time 3600))) (send (integer max-build-jobs) (integer max-silent-time)))) (when (>= (store-connection-minor-version server) 2) - (send (boolean use-build-hook?))) + (send (boolean (if (unspecified? use-build-hook?) + offload? + use-build-hook?)))) (when (>= (store-connection-minor-version server) 4) (send (integer build-verbosity) (integer log-type) (boolean print-build-trace))) -- cgit v1.2.3 From 2ce08a5d79f6eb1d2d3839aca859559b9829ae36 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 21 Nov 2019 15:41:11 +0100 Subject: guix build: '--keep-failed' implies '--no-offload'. * guix/scripts/build.scm (set-build-options-from-command-line): Pass #:offload? #f when 'keep-failed? is true. * doc/guix.texi (Common Build Options): Document it. --- doc/guix.texi | 6 +++--- guix/scripts/build.scm | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'guix') diff --git a/doc/guix.texi b/doc/guix.texi index 5756b6aa2c..a64b0fb84c 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -8051,9 +8051,9 @@ the end of the build log. This is useful when debugging build issues. @xref{Debugging Build Failures}, for tips and tricks on how to debug build issues. -This option has no effect when connecting to a remote daemon with a -@code{guix://} URI (@pxref{The Store, the @code{GUIX_DAEMON_SOCKET} -variable}). +This option implies @option{--no-offload}, and it has no effect when +connecting to a remote daemon with a @code{guix://} URI (@pxref{The +Store, the @code{GUIX_DAEMON_SOCKET} variable}). @item --keep-going @itemx -k diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm index acb495a462..a853ac6c7d 100644 --- a/guix/scripts/build.scm +++ b/guix/scripts/build.scm @@ -545,7 +545,8 @@ talking to a remote daemon\n"))) #:fallback? (assoc-ref opts 'fallback?) #:use-substitutes? (assoc-ref opts 'substitutes?) #:substitute-urls (assoc-ref opts 'substitute-urls) - #:offload? (assoc-ref opts 'offload?) + #:offload? (and (assoc-ref opts 'offload?) + (not (assoc-ref opts 'keep-failed?))) #:max-silent-time (assoc-ref opts 'max-silent-time) #:timeout (assoc-ref opts 'timeout) #:print-build-trace (assoc-ref opts 'print-build-trace?) -- cgit v1.2.3 From d1e4e64cd788b2a7179d0ca5e5c5d3a4518bfa51 Mon Sep 17 00:00:00 2001 From: Hartmut Goebel Date: Fri, 22 Nov 2019 09:25:56 +0100 Subject: guix: Fix wrap-qt-program. Directory names added here need to match qtbase's native-search-path specifications. * guix/build/qt-utils.scm (wrap-qt-program): Change paths used for QML2_IMPORT_PATH and QT_PLUGIN_PATH. --- guix/build/qt-utils.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'guix') diff --git a/guix/build/qt-utils.scm b/guix/build/qt-utils.scm index 48a32674e9..d2486ee86c 100644 --- a/guix/build/qt-utils.scm +++ b/guix/build/qt-utils.scm @@ -26,9 +26,9 @@ (if env-val (string-append env-val ":" path) path))) (let ((qml-path (suffix "QML2_IMPORT_PATH" - (string-append out "/qml"))) + (string-append out "/lib/qt5/qml"))) (plugin-path (suffix "QT_PLUGIN_PATH" - (string-append out "/plugins"))) + (string-append out "/lib/qt5/plugins"))) (xdg-data-path (suffix "XDG_DATA_DIRS" (string-append out "/share"))) (xdg-config-path (suffix "XDG_CONFIG_DIRS" -- cgit v1.2.3 From 7f3bbfaf8ec3b96e02e0cf74e7515ac33c002107 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 26 Nov 2019 12:21:26 +0100 Subject: ui: Adjust SRFI-34 exception handling to Guile 2.9.5. * guix/ui.scm (report-load-error, warn-about-load-error) (read/eval): Match (or 'srfi-34 '%exception) instead of just 'srfi-34 to match what Guile 2.9.5 does. --- guix/ui.scm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'guix') diff --git a/guix/ui.scm b/guix/ui.scm index eb17d274c8..12611cb2bc 100644 --- a/guix/ui.scm +++ b/guix/ui.scm @@ -372,7 +372,7 @@ ARGS is the list of arguments received by the 'throw' handler." (report-error loc (G_ "~a~%") message))) (('unbound-variable _ ...) (report-unbound-variable-error args #:frame frame)) - (('srfi-34 obj) + (((or 'srfi-34 '%exception) obj) (if (message-condition? obj) (report-error (and (error-location? obj) (error-location obj)) @@ -404,7 +404,7 @@ exiting. ARGS is the list of arguments received by the 'throw' handler." (warning loc (G_ "~a~%") message))) (('unbound-variable _ ...) (report-unbound-variable-error args)) - (('srfi-34 obj) + (((or 'srfi-34 '%exception) obj) (if (message-condition? obj) (warning (G_ "failed to load '~a': ~a~%") file @@ -813,7 +813,7 @@ similar." (match args (('syntax-error proc message properties form . rest) (report-error (G_ "syntax error: ~a~%") message)) - (('srfi-34 obj) + (((or 'srfi-34 '%exception) obj) (if (message-condition? obj) (report-error (G_ "~a~%") (gettext (condition-message obj) -- cgit v1.2.3 From 434138e2f26b28bb5cc83e62327aae8ed0902475 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 26 Nov 2019 12:30:45 +0100 Subject: substitute: Make '%allow-unauthenticated-substitutes?' public. * guix/scripts/substitute.scm (warn-about-missing-authentication): New procedure. (%allow-unauthenticated-substitutes?): Turn into a public parameter and use 'warn-about-missing-authentication'. (valid-narinfo?): Adjust accordingly. * tests/substitute.scm (call-with-narinfo): Likewise. --- guix/scripts/substitute.scm | 22 +++++++++++++++------- tests/substitute.scm | 6 ++---- 2 files changed, 17 insertions(+), 11 deletions(-) (limited to 'guix') diff --git a/guix/scripts/substitute.scm b/guix/scripts/substitute.scm index 992b21d505..ba2fb291d8 100755 --- a/guix/scripts/substitute.scm +++ b/guix/scripts/substitute.scm @@ -86,6 +86,8 @@ read-narinfo write-narinfo + %allow-unauthenticated-substitutes? + substitute-urls guix-substitute)) @@ -118,15 +120,21 @@ (string-append %state-directory "/substitute/cache")) (string-append (cache-directory #:ensure? #f) "/substitute"))) +(define (warn-about-missing-authentication) + (warning (G_ "authentication and authorization of substitutes \ +disabled!~%")) + #t) + (define %allow-unauthenticated-substitutes? ;; Whether to allow unchecked substitutes. This is useful for testing ;; purposes, and should be avoided otherwise. - (and (and=> (getenv "GUIX_ALLOW_UNAUTHENTICATED_SUBSTITUTES") - (cut string-ci=? <> "yes")) - (begin - (warning (G_ "authentication and authorization of substitutes \ -disabled!~%")) - #t))) + (make-parameter + (and=> (getenv "GUIX_ALLOW_UNAUTHENTICATED_SUBSTITUTES") + (cut string-ci=? <> "yes")) + (lambda (value) + (when value + (warn-about-missing-authentication)) + value))) (define %narinfo-ttl ;; Number of seconds during which cached narinfo lookups are considered @@ -370,7 +378,7 @@ No authentication and authorization checks are performed here!" (define* (valid-narinfo? narinfo #:optional (acl (current-acl)) #:key verbose?) "Return #t if NARINFO's signature is not valid." - (or %allow-unauthenticated-substitutes? + (or (%allow-unauthenticated-substitutes?) (let ((hash (narinfo-sha256 narinfo)) (signature (narinfo-signature narinfo)) (uri (uri->string (first (narinfo-uris narinfo))))) diff --git a/tests/substitute.scm b/tests/substitute.scm index ff2be662be..a4246aff82 100644 --- a/tests/substitute.scm +++ b/tests/substitute.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2014 Nikita Karetnikov -;;; Copyright © 2014, 2015, 2017, 2018 Ludovic Courtès +;;; Copyright © 2014, 2015, 2017, 2018, 2019 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -169,9 +169,7 @@ a file for NARINFO." (cute write-file (string-append narinfo-directory "/example.out") <>)) - (set! (@@ (guix scripts substitute) - %allow-unauthenticated-substitutes?) - #f)) + (%allow-unauthenticated-substitutes? #f)) thunk (lambda () (when (file-exists? cache-directory) -- cgit v1.2.3