summaryrefslogtreecommitdiff
path: root/guix/scripts
Commit message (Collapse)AuthorAge
* guix describe: 'display-profile-content' checks the right generation.Ludovic Courtès2021-02-05
| | | | | | | | | | | | | Fixes a regression introduced in 316fc2acbb112bfa572ae30f95a93bcd56621234, whereby 'guix pull -l' would always display channel information corresponding to the latest profile generation. Reported by Vagrant Cascadian. * guix/scripts/describe.scm (profile-generation-channels): New procedure. (display-profile-content): Change default value of 'channels'.
* channels: Record 'guix' channel metadata in (guix config).Ludovic Courtès2021-02-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | Partially fixes <https://bugs.gnu.org/45896>. * guix/config.scm.in (%channel-metadata): New variable. * guix/describe.scm (channel-metadata): Use it. (current-channels): New procedure. (current-profile-entries): Clarify docstring. * guix/self.scm (compiled-guix): Add #:channel-metadata and pass it to 'make-config.scm'. (make-config.scm): Add #:channel-metadata and define '%channel-metadata' in the generated file. (guix-derivation): Add #:channel-metadata and pass it to 'compiled-guix'. * guix/channels.scm (build-from-source): Replace 'name', 'source', and 'commit' parameters with 'instance'. Pass #:channel-metadata to BUILD. (build-channel-instance): Adjust accordingly. * build-aux/build-self.scm (build-program): Add #:channel-metadata and pass it to 'guix-derivation'. (build): Add #:channel-metadata and pass it to 'build-program'. * guix/scripts/describe.scm (display-profile-info): Add optional 'channels' parameter. Pass it to 'display-profile-content'. (display-profile-content): Add optional 'channels' parameter and honor it. Iterate on CHANNELS rather than on the manifest entries of PROFILE. (guix-describe): When PROFILE is #f, call 'current-channels' and pass it to 'display-profile-info', unless it returns the empty list.
* guix package: Add '--export-channels'.Ludovic Courtès2021-02-01
| | | | | | | | | | | | | * guix/channels.scm (sexp->channel): Export. * guix/describe.scm: Use (guix channels). (manifest-entry-provenance): New procedure. * guix/scripts/package.scm (channel=?, export-channels): New procedures. (show-help, %options): Add '--export-channels'. (process-query): Honor it. * build-aux/build-self.scm (build-program)[select?]: Exclude (guix channels) to account for the (guix describe) change above. * doc/guix.texi (Invoking guix package): Document it.
* channels: Add 'channel->code'.Ludovic Courtès2021-02-01
| | | | | | * guix/channels.scm (channel->code): New procedure, taken from... * guix/scripts/describe.scm (channel->sexp): ... here. Adjust callers accordingly.
* guix describe: Use 'manifest-entry-channel'.Ludovic Courtès2021-02-01
| | | | | * guix/channels.scm (manifest-entry-channel): Export. * guix/scripts/describe.scm (display-profile-content): Use it.
* guix package: Add '--export-manifest'.Ludovic Courtès2021-02-01
| | | | | | | | | * guix/scripts/package.scm (export-manifest): New procedure. (show-help, %options): Add '--export-manifest'. (process-query): Honor it. * guix/build/profiles.scm (build-profile): Mention it. * tests/guix-package.sh: Test it. * doc/guix.texi (Invoking guix package): Document it.
* scripts: import: json: Fix error handling.zimoun2021-01-31
| | | | | | | | Fixes partially <https://bugs.gnu.org/44115>. * guix/scripts/import/json.scm (guix-import-json): Handle error. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* guix: channels: Introduce "channel-with-substitutes-available".Mathieu Othacehe2021-01-31
| | | | | | | | * guix/channels.scm (find-latest-commit-with-substitutes, channel-with-substitutes-available): New procedures. * guix/scripts/pull.scm (guix-pull): Move "channel-list" call inside the %current-system parameter scope. * doc/guix.texi (Channels with substitutes): New section.
* guix system: Adjust 'upgrade-shepherd-services' to shepherd service change.Ludovic Courtès2021-01-30
| | | | | | | Fixes a regression introduced in 95f72dcd7aece05e9252c93bef5a831f96cb5393. * guix/scripts/system/reconfigure.scm (upgrade-shepherd-services)[target-services]: Add call to 'shepherd-configuration-services'.
* services: shepherd: Allow custom 'shepherd' package.Maxime Devos2021-01-30
| | | | | | | | | | | | | * gnu/services/shepherd.scm (<shepherd-configuration>): New record. (shepherd-boot-gexp, shepherd-root-service-type): Use it. (scm->go, shepherd-configuration-file): Allow passing custom shepherd package. * gnu/system.scm (operating-system-shepherd-service-names): Use the new record. * guix/scripts/system.scm (export-shepherd-graph): Adjust accordingly. * doc/guix.texi (Shepherd Services). Document it. Co-authored-by: Ludovic Courtès <ludo@gnu.org>
* Revert "substitute: Remove extra 'newline' call."Ludovic Courtès2021-01-21
| | | | | | | | This reverts commit d5a1b0e86f248edd53c785b910b5d51ee708b0fc. This change turned out to be misguided; it would lead to "substitute:" lines being printed on the client side, without anything beyond the colon sign.
* archive: Note service type in ACL hint.Tobias Geerinckx-Rice2021-01-20
| | | | * guix/scripts/archive.scm (authorize-key): Mention guix-service-type.
* environment: Fix '--root' option with relative file name.JOULAUD François2021-01-19
| | | | | | | | | | | | The path normalization of `--root` option of `guix environment` was buggy as it appended full argument after normalized directory. This patch fixes it. * guix/scripts/environment.scm (register-gc-root): Fix gc-root path normalization. * tests/guix-environment.sh: Add test. Co-authored-by: Ludovic Courtès <ludo@gnu.org>
* system: Rename 'disk-image' command 'image'.Mathieu Othacehe2021-01-19
| | | | | | | | | | | | | * guix/scripts/system.scm (system-derivation-for-action): Rename 'disk-image' command 'image'. Warn when using the now deprecated 'disk-image' command. (show-help): Adapt accordingly. (guix-system): Ditto. * tests/guix-system.sh: Ditto. * gnu/system/examples/bare-hurd.tmpl: Ditto. * doc/guix.texi (Building the Installation Image, Building the Installation Image for ARM Boards, Invoking guix pack, Invoking guix system): Adapt documentation.
* image: Rename "raw" image-type to "efi-raw".Mathieu Othacehe2021-01-17
| | | | | | | | * gnu/system/image.scm (raw-image-type): Rename to "efi-raw-image-type". * guix/scripts/system.scm (%default-options): Adapt accordingly. * doc/guix.texi: Ditto. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
* guix: Move narinfo code from substitute script to module.Christopher Baines2021-01-16
| | | | | | | | | | | | | | | | | | | | This separation between the code for dealing with narinfos from the code doing that for a purpose should make things clearer, and better support components other that the substitute script in using this code. This is just moving the code around, no code should have been significantly changed. * guix/scripts/substitute.scm (<narinfo>): Move record type to (guix narinfo). (fields->alist, narinfo-hash-algorithm+value, narinfo-hash->sha256, narinfo-signature->canonical-sexp, narinfo-maker, read-narinfo, narinfo-sha256, valid-narinfo?, write-narinfo, narinfo->string, string->narinfo, equivalent-narinfo?, supported-compression?, compresses-better?, narinfo-best-uri): Move procedures to (guix narinfo). (%compression-methods): Move variable to (guix narinfo). * guix/narinfo.scm: New file. * Makefile.am (MODULES): Add it. * po/guix/POTFILES.in: Add 'guix/narinfo.scm'.
* substitute: Untangle skipping authentication from valid-narinfo?.Christopher Baines2021-01-16
| | | | | | | | | | | | Rather than having valid-narinfo? evaluate to #t if %allow-unauthenticated-substitutes? is set to #t, just use (const #t) for valid-narinfo? when %allow-unauthenticated-substitutes? is set to #t. This will allow moving valid-narinfo? in to a (guix substitutes) module. * guix/scripts/substitute.scm (process-query, process-substitution): Change the authorized? argument to lookup-narinfo and lookup-narinfos/diverse based on %allow-unauthenticated-substitutes?. (valid-narinfo?): Remove use of %allow-unauthenticated-substitutes?.
* substitute: Add zstd support.Ludovic Courtès2021-01-13
| | | | | * guix/scripts/substitute.scm (%compression-methods): Add zstd. (compresses-better?): "lzip" always wins.
* publish: Add support for zstd compression.Ludovic Courtès2021-01-13
| | | | | | | | | | | * guix/scripts/publish.scm (compress-nar)[write-compressed-file]: New procedure. Use it for 'gzip' and 'lzip'. Add 'zstd. (nar-response-port, string->compression-type): Add case for 'zstd'. * tests/publish.scm (zstd-supported?): New procedure. ("/nar/zstd/*"): New test. * doc/guix.texi (Invoking guix publish): Document zstd compression. (Base Services): Add cross-reference to the above node.
* substitute: Remove extra 'newline' call.Ludovic Courtès2021-01-13
| | | | | | | | | This led to extra "substitute:" lines since commit 79c6614f58a57b985daf8940766319e440311db0 or thereabouts. * guix/scripts/substitute.scm (fetch-narinfos): Remove extra 'newline' call, which can be traced back to d3a652037ef879f9279bc056c43d15ba7afcbb25 (2015).
* guix system: Add '--graph-backend'.Ludovic Courtès2021-01-04
| | | | | | | | | | | * guix/scripts/system.scm (lookup-backend): New procedure. (export-extension-graph, export-shepherd-graph): Add #:backend parameter and honor it. (show-help, %options): Add "--graph-backend". (%default-options): Add 'graph-backend'. (process-action): Pass #:backend to 'export-extension-graph' and 'export-shepherd-graph'. * doc/guix.texi (Invoking guix system): Document '--graph-backend'.
* environment: Remove unused modules.guy fleury iteriteka2021-01-04
| | | | | | | * guix/scripts/environment.scm: Do not use (ice-9 format) and (ice-9 rdelim). Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* substitute: Handle "invalid session" GnuTLS errors on reused connections.Ludovic Courtès2021-01-04
| | | | | | | | Reported by Christopher Baines <mail@cbaines.net> at <https://issues.guix.gnu.org/45323#2>. * guix/scripts/substitute.scm (call-with-cached-connection): Handle 'gnutls-error and ERROR/INVALID-SESSION.
* guix hash: Honor '-H' when used alongside '-r'.Ludovic Courtès2021-01-04
| | | | | | * guix/scripts/hash.scm (guix-hash): When 'recursive? is true, use 'open-hash-port' instead of 'open-sha256-port'. * tests/guix-hash.sh: Add test for 'guix hash -r -H sha512'.
* import/elpa: Abort early on failure to fetch meta data.Ricardo Wurmus2020-12-31
| | | | | | | * guix/import/elpa.scm (elpa->guix-package): Raise condition instead of returning #FALSE. * guix/scripts/import/elpa.scm (guix-import-elpa): Handle conditions when importing recursively.
* ssh: Use 'guix repl' instead of 'guile'.Ludovic Courtès2020-12-23
| | | | | | | | | | | | | | | | | | | | This simplifies setup of build machines: no need to install Guile in addition to Guix, no need to set 'GUILE_LOAD_PATH' & co., leading to fewer failure modes. * guix/ssh.scm (remote-run): New procedure. (remote-daemon-channel): Use it instead of 'open-remote-pipe*'. (store-import-channel)[import]: Remove check for module availability. Add call to 'primitive-exit'. Use 'remote-run' instead of 'open-remote-pipe'. (store-export-channel)[export]: Remove check for module availability. Add calls to 'primitive-exit'. Use 'remote-run' instead of 'open-remote-pipe'. (handle-import/export-channel-error): Remove 'module-error' clause. (report-module-error): Remove. * guix/scripts/offload.scm (assert-node-has-guix): Replace call to 'report-module-error' by 'leave'. * doc/guix.texi (Daemon Offload Setup): Remove mention of Guile.
* substitute: Reuse connections for '--query'.Ludovic Courtès2020-12-23
| | | | | | | | | | | | | | | This significantly speeds up things like substituting the closure of a .drv. This is a followup to 5ff521452b9ec2aae9ed8e4bb7bdc250a581f203. * guix/scripts/substitute.scm (http-multiple-get): Add #:open-connection and #:keep-alive? and honor them. (open-connection-for-uri/maybe): Use 'open-connection-for-uri/cached' instead of 'guix:open-connection-for-uri'. Call 'http-multiple-get' within 'call-with-cached-connection'. (open-connection-for-uri/cached): Add #:timeout and #:verify-certificate? and honor them. (call-with-cached-connection): Add 'open-connection' parameter and honor it.
* scripts: Fix typo in crate importer help message.Nicolas Goaziou2020-12-23
| | | | | | Fixes <https://issues.guix.gnu.org/45351>. * guix/scripts/import/crate.scm (show-help): Fix URL.
* import/cran: Add input style "specification".Ricardo Wurmus2020-12-22
| | | | | | | | | * guix/import/cran.scm (%input-style): New parameter. (format-inputs): Use it. * guix/scripts/import/cran.scm (guix-import-cran): Set the %input-style parameter. (%options): Add "--style" option. * doc/guix.texi (Invoking guix import): Document it.
* system: Allow separated /boot and encrypted root.Miguel Ángel Arruga Vivas2020-12-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * gnu/bootloader/grub.scm (grub-configuration-file): New parameter store-crypto-devices. [crypto-devices]: New helper function. [builder]: Use crypto-devices. * gnu/machine/ssh.scm (roll-back-managed-host): Use boot-parameters-store-crypto-devices to provide its contents to the bootloader configuration generation process. * gnu/tests/install.scm (%encrypted-root-not-boot-os, %encrypted-root-not-boot-os): New os declaration. (%encrypted-root-not-boot-installation-script): New script, whose contents were initially taken from %encrypted-root-installation-script. (%test-encrypted-root-not-boot-os): New test. * gnu/system.scm (define-module): Export operating-system-bootoader-crypto-devices and boot-parameters-store-crypto-devices. (<boot-parameters>): Add field store-crypto-devices. (read-boot-parameters): Parse store-crypto-devices field. [uuid-sexp->uuid]: New helper function extracted from device-sexp->device. (operating-system-bootloader-crypto-devices): New function. (operating-system-bootcfg): Use operating-system-bootloader-crypto-devices to provide its contents to the bootloader configuration generation process. (operating-system-boot-parameters): Add store-crypto-devices to the generated boot-parameters. (operating-system-boot-parameters-file): Likewise to the file with the serialized structure. * guix/scripts/system.scm (reinstall-bootloader): Use boot-parameters-store-crypto-devices to provide its contents to the bootloader configuration generation process. * tests/boot-parameters.scm (%default-store-crypto-devices): New variable. (%grub-boot-parameters, test-read-boot-parameters): Use %default-store-crypto-devices. (tests store-crypto-devices): New tests.
* scripts: discover: Remove previous cache file.Mathieu Othacehe2020-12-20
| | | | | | Partially fixes <https://issues.guix.gnu.org/45302>. * guix/scripts/discover.scm (guix-discover): Remove previous cache files.
* maint: Require Guile >= 2.2.6.Ludovic Courtès2020-12-19
| | | | | | | | | | | | * configure.ac: For Guile 2.2, require 2.2.6 or later. * guix/gexp.scm (define-syntax-parameter-once): Remove. Use 'define-syntax-parameter' instead. * guix/mnoads.scm: Likewise. * guix/inferior.scm (proxy)[select*]: Remove. * guix/scripts/publish.scm <top level>: Remove replacement for (@@ (web http) read-header-line). * guix/store/deduplication.scm (counting-wrapper-port): Remove. (nar-sha256): Call 'port-position' on PORT to compute SIZE.
* daemon: Delegate deduplication to 'guix substitute'.Ludovic Courtès2020-12-19
| | | | | | | | | | | | | | | This removes the main source of latency between subsequent downloads. * nix/libstore/build.cc (SubstitutionGoal::tryToRun): Add a "deduplicate" key to ENV. (SubstitutionGoal::finished): Remove call to 'optimisePath'. * guix/scripts/substitute.scm (process-substitution)[destination-in-store?] [dump-file/deduplicate*]: New variables. Pass #:dump-file to 'restore-file'. * guix/scripts/substitute.scm (guix-substitute)[deduplicate?]: New variable. Pass #:deduplicate? to 'process-substitution'. * guix/serialization.scm (dump-file): Export and augment 'dump-file'.
* daemon: Let 'guix substitute' perform hash checks.Ludovic Courtès2020-12-19
| | | | | | | | | | | | | | | | | | | | | | | | | | This way, the hash of the store item can be computed as it is restored, thereby avoiding an additional file tree traversal ('hashPath' call) later on in the daemon. Consequently, it should reduce latency between subsequent substitute downloads. This is a followup to 5ff521452b9ec2aae9ed8e4bb7bdc250a581f203. * guix/scripts/substitute.scm (narinfo-hash-algorithm+value): New procedure. (process-substitution): Wrap INPUT into a hash input port, 'hashed', and read from it. Compare the actual and expected hashes, and print a "hash-mismatch" status line when they differ. When they match, print not just "success" but also the nar hash and size. * nix/libstore/build.cc (class SubstitutionGoal)[expectedHashStr]: Remove. (SubstitutionGoal::finished): Tokenize 'status'. Parse it and handle "success" and "hash-mismatch" accordingly. Call 'hashPath' only when the returned hash is not SHA256. (SubstitutionGoal::handleChildOutput): Remove 'expectedHashStr' handling. * tests/substitute.scm ("substitute, invalid hash"): Rename to... ("substitute, invalid narinfo hash"): ... this. ("substitute, invalid hash"): New test.
* system: 'init' does not recompute the hash of each store item.Ludovic Courtès2020-12-15
| | | | | | | | | | | | | | | Fixes <https://bugs.gnu.org/44760>. Previously, the 'register-path' call would re-traverse ITEM to compute its nar hash, even though that hash is already known in the initial store. This patch also avoids repeated opening/closing of the database. * guix/store/database.scm (call-with-database): Export. * guix/scripts/system.scm (copy-item): Add 'db' parameter. Call 'sqlite-register' instead of 'register-path'. (copy-closure): Remove redundant call to 'references*'. Call 'call-with-database' and pass the database to 'copy-item'.
* database: Remove #:deduplicate? and #:reset-timestamps? from 'register-path'.Ludovic Courtès2020-12-15
| | | | | | | | * guix/store/database.scm (register-path): Remove #:deduplicate? and #:reset-timestamps?. * guix/scripts/system.scm (copy-item): Adjust accordingly. * tests/store-database.scm ("register-path") ("register-path, directory"): Call 'reset-timestamps'.
* guix system: 'init' copies, resets timestamps, and deduplicates at once.Ludovic Courtès2020-12-15
| | | | | | | | | Partly fixes <https://bugs.gnu.org/44760>. * guix/build/store-copy.scm (copy-store-item): New procedure. (populate-store): Use it instead of the inline 'copy-recursively' call. * guix/scripts/system.scm (copy-item): Likewise. Pass #:reset-timestamps? and #:deduplicate? to 'register-path'.
* database: Remove #:deduplicate? from 'register-items'.Ludovic Courtès2020-12-15
| | | | | | | | | | | | It is now up to the caller to deduplicate store contents. * guix/store/database.scm (register-items): Remove #:deduplicate? parameter and call to 'deduplicate'. (register-path): Call 'deduplicate' when #:deduplicate? is true. * gnu/build/image.scm (register-closure): Adjust call accordingly. * gnu/build/vm.scm (register-closure): Likewise. * guix/nar.scm (finalize-store-file): Likewise. * guix/scripts/pack.scm (store-database): Likewise.
* store-copy: 'populate-store' can optionally deduplicate files.Ludovic Courtès2020-12-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Until now deduplication was performed as an additional pass after copying files, which involve re-traversing all the files that had just been copied. * guix/store/deduplication.scm (copy-file/deduplicate): New procedure. * tests/store-deduplication.scm ("copy-file/deduplicate"): New test. * guix/build/store-copy.scm (populate-store): Add #:deduplicate? parameter and honor it. * tests/gexp.scm ("gexp->derivation, store copy"): Pass #:deduplicate? #f to 'populate-store'. * gnu/build/image.scm (initialize-root-partition): Pass #:deduplicate? to 'populate-store'. Pass #:deduplicate? #f to 'register-closure'. * gnu/build/vm.scm (root-partition-initializer): Likewise. * gnu/build/install.scm (populate-single-profile-directory): Pass #:deduplicate? #f to 'populate-store'. * gnu/build/linux-initrd.scm (build-initrd): Likewise. * guix/scripts/pack.scm (self-contained-tarball)[import-module?]: New procedure. [build]: Pass it as an argument to 'source-module-closure'. * guix/scripts/pack.scm (squashfs-image)[build]: Wrap in 'with-extensions'. * gnu/system/linux-initrd.scm (expression->initrd)[import-module?]: New procedure. [builder]: Pass it to 'source-module-closure'. * gnu/system/install.scm (cow-store-service-type)[import-module?]: New procedure. Pass it to 'source-module-closure'.
* database: Remove #:reset-timestamps? from 'register-items'.Ludovic Courtès2020-12-15
| | | | | | | | | | | | | | The assumption now is that the caller took care of resetting timestamps and permissions. * guix/store/database.scm (register-items): Remove #:reset-timestamps? parameter and the call to 'reset-timestamps'. (register-path): Adjust accordingly and add call to 'reset-timestamps'. * gnu/build/image.scm (register-closure): Remove #:reset-timestamps? parameter to 'register-items'. * gnu/build/vm.scm (register-closure): Likewise. * guix/nar.scm (finalize-store-file): Adjust accordingly. * guix/scripts/pack.scm (store-database)[build]: Likewise.
* serialization: 'fold-archive' notifies about directory processing completion.Ludovic Courtès2020-12-15
| | | | | | | | | * guix/serialization.scm (fold-archive): Call PROC with a 'directory-complete tag when done with a directory. (restore-file): Handle it. * guix/scripts/archive.scm (list-contents): Likewise. * guix/scripts/challenge.scm (archive-contents): Likewise. * tests/nar.scm ("write-file-tree + fold-archive"): Adjust accordingly.
* offload: Print warning in context.Julien Lepiller2020-12-15
| | | | | * guix/scripts/offload.scm (build-machine): Add `location` field. (build-machine-system): Print location with warning.
* scripts: discover: Remove file locks.Mathieu Othacehe2020-12-13
| | | | | | | | * guix/scripts/discover.scm (call-with-read-file-lock, with-read-file-lock): Remove them. (write-publish-file): Use "with-atomic-file-output" instead of "with-file-lock". (read-substitute-urls): Remove file lock.
* import/cran: Abort with error message when recursive import fails.Ricardo Wurmus2020-12-12
| | | | | | | | | Previously, after a failed recursive import "guix import" would signal success. * guix/import/cran.scm (cran->guix-package): Raise a condition when all repositories have been exhausted. * guix/scripts/import/cran.scm (guix-import-cran): Handle errors.
* substitute: Cache and reuse connections while substituting.Ludovic Courtès2020-12-08
| | | | | | | | | | | | | | | | | | | That way, when fetching a series of substitutes from the same server(s), the connection is reused instead of being closed/opened for each substitutes, which saves on network round trips and TLS handshakes. * guix/http-client.scm (http-fetch): Add #:keep-alive? and honor it. * guix/progress.scm (progress-report-port): Add #:close? parameter and honor it. * guix/scripts/substitute.scm (at-most): Return the tail as a second value. (fetch): Add #:port and #:keep-alive? and honor them. (%max-cached-connections): New variable. (open-connection-for-uri/cached, call-with-cached-connection): New procedures. (with-cached-connection): New macro. (process-substitution): Wrap 'fetch' call in 'with-cached-connection'. Pass #:close? to 'progress-report-port'.
* daemon: Run 'guix substitute --substitute' as an agent.Ludovic Courtès2020-12-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This avoids spawning one substitute process per substitution. * nix/libstore/build.cc (class Worker)[substituter]: New field. [outPipe, logPipe, pid]: Remove. (class SubstitutionGoal)[expectedHashStr, status, substituter]: New fields. (SubstitutionGoal::timedOut): Adjust to check 'substituter'. (SubstitutionGoal::tryToRun): Remove references to 'outPipe' and 'logPipe'. Run "guix substitute --substitute" as an 'Agent'. Send the request with 'writeLine'. (SubstitutionGoal::finished): Likewise. (SubstitutionGoal::handleChildOutput): Change to fill in 'expectedHashStr' and 'status'. (SubstitutionGoal::handleEOF): Call 'wakeUp' unconditionally. (SubstitutionGoal::~SubstitutionGoal): Adjust to check 'substituter'. * guix/scripts/substitute.scm (process-substitution): Write "success\n" to stdout upon success. (%error-to-file-descriptor-4?): New variable. (guix-substitute): Set 'current-error-port' to file descriptor 4 unless (%error-to-file-descriptor-4?) is false. Remove "--substitute" arguments. Loop reading line from stdin. * tests/substitute.scm <top level>: Call '%error-to-file-descriptor-4?'. (request-substitution): New procedure. ("substitute, no signature") ("substitute, invalid hash") ("substitute, unauthorized key") ("substitute, authorized key") ("substitute, unauthorized narinfo comes first") ("substitute, unsigned narinfo comes first") ("substitute, first narinfo is unsigned and has wrong hash") ("substitute, first narinfo is unsigned and has wrong refs") ("substitute, two invalid narinfos") ("substitute, narinfo with several URLs"): Adjust to new "guix substitute --substitute" calling convention.
* daemon: Use 'Agent' to spawn 'guix substitute --query'.Ludovic Courtès2020-12-08
| | | | | | | | | | | | | | | | | | | | | | | | | | * nix/libstore/local-store.hh (RunningSubstituter): Remove. (LocalStore)[runningSubstituter]: Change to unique_ptr<Agent>. [setSubstituterEnv, didSetSubstituterEnv]: Remove. [getLineFromSubstituter, getIntLineFromSubstituter]: Take an 'Agent'. * nix/libstore/local-store.cc (LocalStore::~LocalStore): Remove reference to 'runningSubstituter'. (LocalStore::setSubstituterEnv, LocalStore::startSubstituter): Remove. (LocalStore::getLineFromSubstituter): Adjust to 'run' being an 'Agent'. (LocalStore::querySubstitutablePaths): Spawn substituter agent if needed. Adjust to 'Agent' interface. (LocalStore::querySubstitutablePathInfos): Likewise. * nix/libstore/build.cc (SubstitutionGoal::tryToRun): Remove call to 'setSubstituterEnv' and add 'setenv' call for "_NIX_OPTIONS" instead. (SubstitutionGoal::finished): Remove 'readLine' call for 'dummy'. * guix/scripts/substitute.scm (%allow-unauthenticated-substitutes?): Remove second argument to 'make-parameter'. (process-query): Call 'warn-about-missing-authentication' when (%allow-unauthenticated-substitutes?) is #t. (guix-substitute): Wrap body in 'parameterize'. Set 'guix-warning-port' too. No longer exit when 'substitute-urls' returns the empty list. No longer print newline initially. * tests/substitute.scm (test-quit): Parameterize 'current-error-port' to account for the port changes in 'guix-substitute'.
* guix: opam: Add --repo argument to importer.Julien Lepiller2020-12-08
| | | | | | | | * guix/scripts/import/opam.scm (guix-import-opam): Pass --repo argument to recursive and non-recursive importers. * guix/import/opam.scm (get-opam-repository): Select proper repository location depending on a new repo argument. (opam->guix-package): Use get-opam-repository in the procedure body.
* pull: Accept no non-option arguments.Tobias Geerinckx-Rice2020-12-05
| | | | | * guix/scripts/pull.scm (guix-pull): LEAVE if any non-option arguments were passed.
* scripts: discover: Check for cache file existence.Mathieu Othacehe2020-12-05
| | | | | | Fixes: https://issues.guix.gnu.org/45045. * guix/scripts/discover.scm (read-substitute-urls): Check for file existence.