summaryrefslogtreecommitdiff
path: root/guix/scripts
Commit message (Collapse)AuthorAge
* scripts: import: gem: Fix recursive error handling.zimoun2022-03-07
| | | | | | | | Partly fixes <https://bugs.gnu.org/44115>. * guix/scripts/import/gem.scm (guix-import-gem): Handle error. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* shell: Disable caching when '-p' is passed.Ludovic Courtès2022-03-02
| | | | | | | | | | | | Fixes <https://issues.guix.gnu.org/53658>. Reported by Guillaume Le Vaillant <glv@posteo.net>. Previously we would wrongfully cache things, by adding a new (profile . _) pair to the option alist, when the user runs: guix shell -p /path/to/profile -q * guix/scripts/shell.scm (profile-cached-gc-root): Add ('profile . _) case.
* pull: No longer print upgraded/added packages upon completion.Ludovic Courtès2022-02-27
| | | | | * guix/scripts/pull.scm (build-and-install): Remove call to 'display-profile-news' and adjust accordingly.
* pull: '--news' no longer shows package lists.Ludovic Courtès2022-02-27
| | | | | | | | | | * guix/scripts/pull.scm (display-channel-news): Return #t when news were displayed. (display-news): Add #:profile-news? parameter and honor it. Print something there were no news. (process-query): For 'display-news', call 'display-channel-news' directly. * doc/guix.texi (Invoking guix pull): Adjust accordingly.
* guix build: Warn when attempting to build an unsupported package.Ludovic Courtès2022-02-18
| | | | | | | | | | Fixes <https://issues.guix.gnu.org/51801>. Reported by Maxim Cournoyer <maxim.cournoyer@gmail.com>. * guix/scripts/build.scm (options->derivations)[warn-if-unsupported]: New procedure. [compute-derivation]: Use it. * tests/guix-build.sh: Add test.
* guix system: Fix 'describe' when booting the latest generation.Ludovic Courtès2022-02-15
| | | | | | | | | | | Fixes a regression introduced in 9679123ce083c69cdfd1505d95a4066d41280394, whereby 'guix system describe' would error out when /run/current-system points to /gnu/store/…-system, which is the case when booting the latest generation or after reconfigure. * guix/scripts/system.scm (process-command): For 'describe'. Try 'generation-number' with and without the optional argument.
* pull: '--list-generations' pipes its output to the pager.Ludovic Courtès2022-02-14
| | | | | | | * guix/scripts/pull.scm (process-query): For 'list-generations queries, use 'with-paginated-output-port'. (display-news-entry-title): Pass second argument to 'highlight'. (display-news-entry): Pass second argument to 'dim'.
* pull: '--list-generations' lists packages only with '--details'.Ludovic Courtès2022-02-14
| | | | | | * guix/scripts/pull.scm (show-help, %options): Add "--details". (process-query): Honor it. * doc/guix.texi (Invoking guix pull): Document it.
* publish: Do not sign the URL/Compression/FileSize narinfo fields.Ludovic Courtès2022-02-14
| | | | | | | | | | | | | | This will allow mirror operators to alter these non-normative bits of a narinfo without having to resign narinfos. * guix/scripts/publish.scm (narinfo-string): Remove URL/Compression/FileSize from BASE-INFO. Move them after "Signature". * tests/publish.scm ("/*.narinfo") ("/*.narinfo with properly encoded '+' sign") ("/*.narinfo with lzip + gzip") ("with cache, lzip + gzip"): Adjust accordingly. * tests/substitute.scm ("query narinfo with signature over relevant subset"): New test.
* deploy: Add '--execute'.Ludovic Courtès2022-02-02
| | | | | | | | * guix/scripts/deploy.scm (show-help, %options): Add '--execute'. (invoke-command): New procedure. (guix-deploy): Break arguments at "--" and handle '-x' and associated command. * doc/guix.texi (Invoking guix deploy): Document it.
* guix system: 'describe' shows the running system, not the current one.Ludovic Courtès2022-02-02
| | | | | | | | | * guix/profiles.scm (generation-number): Add optional 'base-profile' parameter and use it. * guix/scripts/system.scm (process-command): Add "/run/current-system" as first argument to 'generation-number'. * doc/guix.texi (Invoking guix system): Clarify that 'guix system describe' shows the running system.
* import: pypi: Use 'with-error-handling'.Ludovic Courtès2022-02-02
| | | | | * guix/scripts/import/pypi.scm (guix-import-pypi): Wrap body in 'with-error-handling'.
* home: 'reconfigure' checks for potential downgrades.Ludovic Courtès2022-01-28
| | | | | | | | | | * guix/scripts/home.scm (show-help, %options): Add "--allow-downgrades". (%default-options): Remove 'build-mode'; add 'validate-reconfigure'. (perform-action): Add #:validate-reconfigure. Call 'check-forward-update' when ACTION is 'reconfigure. (process-action): Pass #:validate-reconfigure to 'perform-action'. * gnu/home/services.scm (home-provenance): Export. * doc/guix.texi (Invoking guix home): Document '--allow-downgrades'.
* environment: '--check' does nothing when used with '--container'.Ludovic Courtès2022-01-25
| | | | | | | | Partly fixes <https://issues.guix.gnu.org/53355>. Reported by Chris Marusich <cmmarusich@gmail.com>. * guix/scripts/environment.scm (guix-environment*): Warn and do nothing when both '--check' and '--container' are used.
* package: Honor '--dry-run' when target profile is already in store.Ludovic Courtès2022-01-19
| | | | | | | | | | | | | | | | | | | Fixes <https://issues.guix.gnu.org/53267>. Reported by Tirifto <tirifto@posteo.cz>. Regression introduced in 65ffb9388c1c3d870cb07e4cb3ef12c9ac06a161. In the (unlikely) case where the profile we're targeting with "guix upgrade -n" or similar is already built, a new profile generation would be created and linked to despite the use of '-n'. This is because 65ffb9388c1c3d870cb07e4cb3ef12c9ac06a161 assumed that dry-run behavior would be handled solely by the build handler, which is not the case when there's nothing to build. * guix/scripts/package.scm (build-and-use-profile): Reintroduce #:dry-run? and honor it. (process-actions): Pass #:dry-run? to 'build-and-use-profile'. * tests/guix-package-net.sh: Add test.
* guix home: Default verbosity is the same as for 'guix system'.Ludovic Courtès2022-01-17
| | | | | | | | | Previously the default verbosity would always be 3, and 'verbosity-level' would thus have no effect. * guix/scripts/home.scm (verbosity-level): Change to level 3 for 'build'. (%default-options): Set 'verbosity' to #f.
* scripts: system: Rationalize persistency.Mathieu Othacehe2022-01-14
| | | | | | | | | | | | | | | Make sure that the images are created with a non volatile root by default and the vm are created with a volatile root by default. Break the --volatile option into --volatile-image and --persistent-vm options. * guix/scripts/system.scm (perform-action): Turn volatile? argument into volatile-vm-root?. (show-help): Introduce --volatile-image and --persistent-vm options instead of --volatile. (%default-options): Adapt it. (%options): Handle those options. (process-action): Honor them. * doc/guix.texi (Invoking guix system): Adapt it accordingly.
* shell: Cache profiles even when using package specs.Ludovic Courtès2022-01-11
| | | | | | | | | | | | | | | | | | | | | | | | This enables profile caching not just when '-m' or '-f' is used, but also when package specs are passed on the command line, as in: guix shell -D guix git It also changes profile cache keys to include the system type, which was previously ignored. * guix/scripts/shell.scm (options-with-caching)[single-file-for-caching]: Remove. Call 'profile-cached-gc-root' instead; adjust to accept two values. (profile-cache-primary-key): New procedure. (profile-cache-key): Remove. (profile-file-cache-key, profile-spec-cache-key): New procedures. (profile-cached-gc-root): Rewrite to include functionality formally in 'single-file-for-caching', but extend to handle package specs. * gnu/packages.scm (cache-is-authoritative?): Export. * guix/transformations.scm (transformation-option-key?): New procedure. * doc/guix.texi (Invoking guix shell): Move '--rebuild-cache' documentation to the bottom, just above '--root'. Explain caching and how these two options relate to that.
* guix hash: Allow '-r' as a non-deprecated alias.Ludovic Courtès2022-01-10
| | | | | | | | | | | This is a followup to 05c962594c346da21f201be72caadfa19060cc9d. Discussed at <https://issues.guix.gnu.org/51307#24>. * guix/scripts/hash.scm (%options): Warn about deprecation for "--recursive", but not for '-r' as it's a convenient shorthand. Mention '--serializer=nar' in the deprecation message. * doc/guix.texi (Invoking guix hash): Adjust accordingly.
* style: '-S format' canonicalizes comments.Ludovic Courtès2022-01-10
| | | | | | | | | | * guix/scripts/style.scm (canonicalize-comment): New procedure. (pretty-print-with-comments): Add #:format-comment. and honor it. (object->string*): Add 'args' and honor them. (format-package-definition): Pass #:format-comment to 'object->string*'. * tests/style.scm ("pretty-print-with-comments, canonicalize-comment"): New test.
* style: Add '--styling' option.Ludovic Courtès2022-01-10
| | | | | | | | | | | | | | | | | | | * guix/scripts/style.scm (format-package-definition): New procedure. (%options, show-help): Add "--styling". (%default-options): Add 'styling-procedure'. (guix-style): Honor it. * tests/style.scm (with-test-package) ("input labels, 'safe' policy") ("input labels, 'safe' policy, nothing changed") ("input labels, margin comment") ("input labels, margin comment on long list") ("input labels, line comment") ("input labels, modify-inputs and margin comment"): Pass "-S inputs". * etc/indent-code.el: Remove. * doc/contributing.texi (Formatting Code): Mention "guix style" instead of "etc/indent-code.el". (Submitting Patches): Add item for "guix style". * doc/guix.texi (Invoking guix style): Document "-S" and update.
* style: Add support for "newline forms".Ludovic Courtès2022-01-10
| | | | | | | | | | This allows us to express cases where a newline should be inserted immediately after the head symbol of a list. * guix/scripts/style.scm (%newline-forms): New variable. (newline-form?): New procedure. (pretty-print-with-comments): Handle "newline forms". * tests/style.scm: Add test.
* style: Allow special forms to be scoped.Ludovic Courtès2022-01-10
| | | | | | | | | | | | * guix/scripts/style.scm (vhashq): Add clause for 'lst, and change default clause. (%special-forms): Add context for 'add-after and 'add-before. Add 'replace. (prefix?, special-form-lead): New procedures. (special-form?): Remove. (pretty-print-with-comments): Add 'context' to the threaded state. Adjust 'print-sequence' and adjust 'loop' calls accordingly. * tests/style.scm: Add tests for 'replace.
* style: Improve pretty printer and add tests.Ludovic Courtès2022-01-10
| | | | | | | | | | * guix/scripts/style.scm (vhashq): New macro. (%special-forms): New variable. (special-form?): New procedure. (pretty-print-with-comments): Add many clauses and tweak existing rules. * tests/style.scm (test-pretty-print): New macro. <top level>: Add 'test-pretty-print' tests.
* import: texlive: Update error message.Ricardo Wurmus2022-01-10
| | | | | | We aren't downloading anything. * guix/scripts/import/texlive.scm (guix-import-texlive): Update error message.
* scripts: import: go: Wrap body in 'with-error-handling'.Ludovic Courtès2022-01-09
| | | | | | | | This ensures proper error reporting and an exception reaches the top level. * guix/scripts/import/go.scm (guix-import-go): Wrap body in 'with-error-handling'.
* guix home, system: Use 'leave' to report missing generations.Ludovic Courtès2022-01-06
| | | | | | | | | | | | Fixes <https://issues.guix.gnu.org/50982>. Reported by Xinglu Chen <public@yoctocell.xyz>. Fixes a typo ('error' instead of 'leave') introduced in 158032bd7dcc33d17da8091b2319bf59ee9db6a1 and copied in 89e05a695574fdabd76834aba35ad125620b8b5d. * guix/scripts/system.scm (process-command): Use 'leave', not 'error'. * guix/scripts/home.scm (process-command): Likewise.
* refresh: Support non-tarball sources.Sarah Morgensen2022-01-06
| | | | | | | * guix/scripts/refresh.scm (update-package): Use 'file-hash*' instead of 'port-sha256'. Rename TARBALL to OUTPUT. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* guix hash: Extract file hashing procedures.Sarah Morgensen2022-01-06
| | | | | | | | | | * guix/scripts/hash.scm (guix-hash)[vcs-file?] (nar-hash, default-hash): Extract hashing logic to... * guix/hash.scm (vcs-file?, file-hash*): ... these new procedures in this new file. Modified-by: Maxime Devos <maximedevos@telenet.be> Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* home: import: Fix handling of manifest entries with specific output.Arjan Adriaanse2022-01-05
| | | | | | | | | | | | specification->package fails on manifest entries with specific outputs, resulting in an invalid home configuration. This changes the import command to use specification->package+output instead. * guix/scripts/home/import.scm (manifest+configuration-files->code): Make sure manifest entries with specific output are also handled. * tests/home-import.scm: Specify output in home environment manifest entry. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* guix hash: Allow '--exclude-vcs' option using 'git' serializer.zimoun2022-01-04
| | | | | | | | * guix/scripts/hash.scm (git-hash): Use '#:select?' with 'git-hash-directory'. * tests/guix-hash.sh: Adjust accordingly. Signed-off-by: Timothy Sample <samplet@ngyro.com>
* offload: Do not read ~/.ssh/config.Ludovic Courtès2022-01-03
| | | | | | | Fixes <https://issues.guix.gnu.org/39366>. Reported by zimoun <zimon.toutoune@gmail.com>. * guix/scripts/offload.scm (open-ssh-session): Pass #:config.
* substitute: Document the limited UI.Tobias Geerinckx-Rice2021-12-29
| | | | * guix/scripts/substitute.scm (show-help): Accept exactly one OPTION.
* scripts: system: Add a missing module.Mathieu Othacehe2021-12-23
| | | | * guix/scripts/system.scm: Add a missing module.
* scripts: system: Use the disk-image size argument for VM generation.Mathieu Othacehe2021-12-23
| | | | | * guix/scripts/system.scm (system-derivation-for-action): Use the given image-size unconditionnaly when calling system-qemu-image/shared-store-script.
* scripts: system: Pass the volatile field to VM generation.Mathieu Othacehe2021-12-23
| | | | | | | | * guix/scripts/system.scm (system-derivation-for-action): Add new volatile? argument and pass it to system-qemu-image/shared-store-script. (perform-action): Add new volatile? argument and pass it to system-derivation-for-action. (process-action): Pass the volatile? argument to perform-action.
* scripts: system: Deprecate the docker-image command.Mathieu Othacehe2021-12-23
| | | | | | | * guix/scripts/system.scm (system-derivation-for-action): Use the image API to generate the docker images and deprecate the docker-image command. (process-action): Ditto. * doc/guix.texi (Invoking guix system): Adapt it.
* style: Gracefully handle errors such as EACCES when opening files.Ludovic Courtès2021-12-18
| | | | | * guix/scripts/style.scm (guix-style): Wrap body in 'with-error-handling'.
* style: Refer to source files by absolute file names.Ludovic Courtès2021-12-18
| | | | | | | | | Previously, "guix style PACKAGE" would end up modifying a file looked up under the current directory since the location associated with PACKAGE is usually a relative file name. * guix/scripts/style.scm (absolute-location): New procedure. (simplify-package-inputs): Use it.
* guix hash: Add git serializer.zimoun2021-12-17
| | | | | | | | | * guix/scripts/hash.scm (git-hash): New procedure. (%options): Use it. * tests/guix-hash.sh: Test it. * doc/guix.texi: Update. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* guix hash: Add 'serializer' option.zimoun2021-12-17
| | | | | | | | | | | | | * guix/scripts/hash.scm (%options): Deprecate 'recursive', add 'serializer'. (%default-options): Add 'serializer'. (nar-hash): New procedure. (default-hash): New procedure. (guix-hash)[file-hash]: Use them. (show-help): Adjust. * tests/guix-hash.scm: Adjust. * doc/guix.texi: Update. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* guix hash: Support several files.zimoun2021-12-17
| | | | | | | | | | * guix/scripts/hash.scm (guix-hash): Allow several files. [file-hash]: Catch system-error. [formatted-hash]: New procedure. * tests/guix-hash.sh: Add test. * doc/guix.texi (Invoking guix hash): Mention "one or more files". Co-authored-by: Ludovic Courtès <ludo@gnu.org>
* offload: Autoload Guile-SSH.Ludovic Courtès2021-12-15
| | | | | | | | | | | | | This halves the number of syscalls made by "guix offload" during startup and delays loading of Guile-SSH until there are actually machines to offload to. * guix/scripts/offload.scm: Remove unused module imports. Autoload many modules. (check-ssh-zlib-support): New procedure. (process-request): Call it when accepting. (guix-offload): Remove 'zlib-support?' check, now moved to 'check-ssh-zlib-support'.
* offload: Delay call to 'read-derivation-from-file'.Ludovic Courtès2021-12-15
| | | | | | | | | This significantly reduces the amount of work done by "guix offload" when there's no machine to offload to. * guix/scripts/offload.scm (process-request): Add call to 'read-derivation-from-file', moved from... (guix-offload): ... here.
* Merge branch 'master' into core-updates-frozenLudovic Courtès2021-12-13
|\
| * challenge: Store item contents are returned in canonical order.Ludovic Courtès2021-12-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows the 'delete-duplicates' call in 'differing-files' to have the intended effect. Before that, a "guix challenge" invocation with three builds of a store item, two of which are identical, would lead 'differing-files' to not print anything, as in this example: $ ./pre-inst-env guix challenge python-numpy /gnu/store/…-python-numpy-1.17.3 contents differ: local hash: 07var0wn8fywxchldz5pjqpnlavrlbc8s81aqwsqyi0i7qlh6ka7 https://ci.guix.gnu.org/nar/lzip/…-python-numpy-1.17.3: 07var0wn8fywxchldz5pjqpnlavrlbc8s81aqwsqyi0i7qlh6ka7 https://bordeaux.guix.gnu.org/nar/lzip/…-python-numpy-1.17.3: 0cbl3q19bshb6ddz8xkcrjzkcmillsqii4z852ybzixyp7rg40qa 1 store items were analyzed: - 0 (0.0%) were identical - 1 (100.0%) differed - 0 (0.0%) were inconclusive With this change, 'differing-files' prints additional info as intended: differing file: /lib/python3.8/site-packages/numpy/distutils/fcompiler/__pycache__/vast.cpython-38.pyc * guix/scripts/challenge.scm (archive-contents): Add tail call to 'reverse'. (store-item-contents): Rewrite to use 'scandir' and recursive calls instead of 'file-system-fold'.
| * challenge: Use SRFI-71 instead of SRFI-11.Ludovic Courtès2021-12-12
| | | | | | | | * guix/scripts/challenge.scm (port-sha256*, call-with-nar): Use SRFI-71.
* | Merge remote-tracking branch 'signed/master' into core-updatesMathieu Othacehe2021-12-10
|\|
| * environment: Suggestion code gracefully handles empty "/bin" directories.Ludovic Courtès2021-12-10
| | | | | | | | | | * guix/scripts/environment.scm (suggest-command-name): Handle the case where 'scandir' returns #f.
| * shell: When using '-D -f', '-D' has no effect on remaining packages.Ludovic Courtès2021-12-10
| | | | | | | | | | | | | | | | | | Fixes <https://issues.guix.gnu.org/52093>. Reported by Konrad Hinsen <konrad.hinsen@fastmail.net>. * guix/scripts/shell.scm (%options): In "--file" handler, add call to 'ensure-ad-hoc'. * tests/guix-shell.sh: Add test.