summaryrefslogtreecommitdiff
path: root/guix/scripts
Commit message (Collapse)AuthorAge
* 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.
| * shell: Fix '--file' description in '--help' output.Ludovic Courtès2021-12-10
| | | | | | | | | | | | Reported by pinoaffe on #guix. * guix/scripts/shell.scm (show-help): Fix '--file' description.
* | Merge remote-tracking branch 'origin/master' into core-updates-frozenRicardo Wurmus2021-12-05
|\|
| * guix system vm: Add --no-graphic CLI argument.Attila Lendvai2021-12-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It configures QEMU to use the tty it was started in for IO (as opposed to opening a separate graphical window). This enables copy-pasting and scrollback. Exit QEMU with C-a x. * gnu/system/vm.scm (system-qemu-image/shared-store-script): Also add the '-nographic' QEMU argument when called with #:graphic? #false. * guix/scripts/system.scm (system-derivation-for-action): Propagate the #:graphic? keyword arg. (perform-action): Add and propagate the #:graphic? keyword arg. (show-help): Add --no-graphic CLI arg. (%options): Process the new --no-graphic CLI arg. (process-action): Feed in the CLI arg through the #:graphic? keyword arg. * doc/guix.texi (Invoking guix system): Add example to combine guix system and invoking the vm start script into one command. Split the description of the various options into separate paragraphs. Add a paragraph to describe --no-graphic. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
* | style: Add '--dry-run'.Ludovic Courtès2021-11-23
| | | | | | | | | | | | | | * guix/scripts/style.scm (edit-expression/dry-run): New procedure. (simplify-package-inputs): Add #:edit-expression parameter. (%options, show-help): Add '--dry-run'. (guix-style): Honor '--dry-run'.
* | Merge branch 'master' into core-updates-frozenLudovic Courtès2021-11-23
|\|
| * guix graph: Show '-M' in '--help' output.Ludovic Courtès2021-11-23
| | | | | | | | * guix/scripts/graph.scm (show-help): Add -M shorthand.
| * scripts: home: Make ‘guix home import’ write home-configuration.scm.Xinglu Chen2021-11-17
| | | | | | | | | | | | | | | | | | | | * guix/scripts/home.scm (process-command): Populate ‘home-configuration.scm’ in the destination directory instead of printing to stdout. * doc/guix.texi (Declaring the Home Environment): Adjust accordingly. (Invoking guix home): Likewise. Suggested-by: Ludovic Courtès <ludo@gnu.org> Co-authored-by: Ludovic Courtès <ludo@gnu.org>
| * import: Replace texlive importer.Ricardo Wurmus2021-11-17
| | | | | | | | | | | | | | | | | | | | | | | | | | * guix/import/texlive.scm (fetch-sxml, sxml->package): Remove procedures. (tlpdb-file, tlpdb, files->directories, tlpdb->package): New procedures. (string->license): Add case for lpplgpl license combination. (guix-name): Remove COMPONENT argument. (texlive->guix-package): Use new procedures. (texlive-recursive-import): New procedure. * guix/scripts/import/texlive.scm (show-help, %options): Remove --archive option. (guix-import-texlive): Adjust call of texlive->guix-package. * doc/guix.texi (Invoking guix import): Update documentation.
* | Merge branch 'master' into core-updates-frozenLudovic Courtès2021-11-17
|\|
| * environment: Fix ‘--check’ with exported PS1 variable.Thiago Jung Bauermann2021-11-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If your .bashrc (unnecessarily) exports PS1 and you’re in a non-login shell, Guix crashes: user@popigai:~$ guix shell --check coreutils guix shell: checking the environment variables visible from shell '/bin/bash'... Backtrace: 14 (primitive-load "/home/user/.config/guix/current/bin/g…") In guix/ui.scm: 2206:7 13 (run-guix . _) 2169:10 12 (run-guix-command _ . _) In ice-9/boot-9.scm: 1752:10 11 (with-exception-handler _ _ #:unwind? _ # _) 1752:10 10 (with-exception-handler _ _ #:unwind? _ # _) In guix/store.scm: 658:37 9 (thunk) 1320:8 8 (call-with-build-handler _ _) 1320:8 7 (call-with-build-handler #<procedure 7fe393b7c420 at g…> …) In guix/status.scm: 800:4 6 (call-with-status-report _ _) In guix/scripts/environment.scm: 951:12 5 (_) In guix/store.scm: 2119:24 4 (run-with-store #<store-connection 256.99 7fe39627e500> …) In guix/scripts/environment.scm: 521:35 3 (_ _) In unknown file: 2 (string=? ("PS1" . "${debian_chroot:+($debian_chroot)…") …) In ice-9/boot-9.scm: 1685:16 1 (raise-exception _ #:continuable? _) 1685:16 0 (raise-exception _ #:continuable? _) ice-9/boot-9.scm:1685:16: In procedure raise-exception: In procedure string=: Wrong type argument in position 1 (expecting string): ("PS1" . "${debian_chroot:+($debian_chroot)}\\[\\033[01;32m\\]\\u@\\h\\[\\033[00m\\]:\\[\\033[01;34m\\]\\w\\[\\033[00m\\]${EXTRA}\\$ ") user@popigai:~$ This is because the match pattern doesn’t expect `(vhash-assoc "PS1" actual)` to return a pair. * guix/scripts/environment.scm (validate-child-shell-environment): Change match pattern to expect a pair. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
| * import: cran: Allow imports of a specific version.Ludovic Courtès2021-11-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * guix/import/cran.scm (download): Handle the case where URL is a list. (fetch-description-from-tarball): New procedure. (fetch-description): Add #:version parameter. Honor it when REPOSITORY is 'cran. Use 'fetch-description-from-tarball' when REPOSITORY is 'bioconductor. (description->package): SOURCE-URL may now be a list. (cran->guix-package): Pass VERSION to 'fetch-description'. (cran-recursive-import): Add #:version parameter. * guix/scripts/import/cran.scm (guix-import-cran): Expect a spec rather than a mere package name. * doc/guix.texi (Invoking guix import): Document it.
| * import: pypi: Allow imports of a specific version.Ludovic Courtès2021-11-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * guix/import/pypi.scm (latest-version): New procedure. (latest-source-release): Rename to... (source-release): ... this. Add 'version' parameter. (latest-wheel-release): Rename to... (wheel-release): ... this. Add 'version' parameter. (pypi->guix-package): Honor 'version' parameter. (pypi-recursive-import): Add 'version' parameter and honor it. * guix/scripts/import/pypi.scm (guix-import-pypi): Expect a spec. Pass it to 'package-name->name+version'. Pass the 'version' parameter. * tests/pypi.scm ("pypi->guix-package, no wheel"): Exercise the #:version parameter. * doc/guix.texi (Invoking guix import): Document it.