summaryrefslogtreecommitdiff
path: root/guix/scripts
AgeCommit message (Collapse)Author
2022-10-13shell: Handle '--emulate-fhs' in 'guix shell', not in 'guix environment'.Ludovic Courtès
Previously, using 'guix shell -CF coreutils' twice (such that the profile is cache) would result in: guix shell: error: '--profile' cannot be used with package options This patch fixes it by moving argument handling to (guix scripts shell), before 'options-with-caching' is called. * guix/scripts/environment.scm (show-environment-options-help) (%options): Remove '--emulate-fhs'. (guix-environment*): Pass OPTS as-is to 'options/resolve-packages'. * guix/scripts/shell.scm (show-help, %options): Add '--emulate-fhs'. Add the (expression . ...) component to RESULT right from the argument handler. * tests/guix-environment-container.sh: Change '--emulate-fhs' tests to use 'guix shell' instead of 'guix environment'.
2022-10-13environment: Add '--emulate-fhs'.John Kehayias
* guix/scripts/environment.scm (show-environment-options-help, %options): Add '--emulate-fhs'. (setup-fhs): New procedure. Setup for the Filesystem Hierarchy Standard (FHS) container. Defines and uses FHS-SYMLINKS and LINK-CONTENTS to create FHS expected directories and creates /etc/ld.so.conf. (launch-environment): Add 'emulate-fhs?' key and implement it to set $PATH and generate /etc/ld.so.cache before calling COMMAND. (launch-environment/container): Add 'emulate-fhs?' and 'setup-hook' keys and implement them. Define and use FHS-MAPPINGS, to set up additional bind mounts in the container to follow FHS expectations. (guix-environment*): Add glibc-for-fhs to the container packages when 'emulate-fhs?' key is in OPTS. * doc/guix.texi (Invoking guix shell): Document '--emulate-fhs'. (Invoking guix environment): Document '--emulate-fhs'. * tests/guix-environment-container.sh: Add tests for '--emulate-fhs'. Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2022-10-11Revert "guix system: Remove unused 'read-operating-system' procedure."Ludovic Courtès
This reverts commit d11a432adffe9308eafec6b77cddd3145029109e. The 'read-operating-system' is used in Emacs-Guix.
2022-10-11guix import: Add a blank line after each package definition.Ludovic Courtès
Starting from commit 371a83b764c4993d198666e1674454eecbefcdf1, 'guix import crate -r' (or similar) would no longer print a blank line in between definitions. This patch fixes it. Reported by jgart <jgart@dismail.de>. * guix/scripts/import.scm (guix-import): Add second 'newline' call.
2022-10-04deploy: Fix error message.Andrew Tropin
* guix/scripts/deploy.scm (guix-deploy): Fix error message.
2022-09-30scripts: build: Format strings before calling display-hint.Zhu Zihao
* guix/scripts/build.scm(%standard-cross-build-options): Format hint string. %standard-cross-build-options: Ditto. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
2022-09-28substitute: Retry downloading when a nar is unavailable.Ludovic Courtès
Fixes <https://issues.guix.gnu.org/57978> Reported by Attila Lendvai <attila@lendvai.name>. Previously, if a narinfo was available but its corresponding nar was missing (for instance because the narinfo was cached and the server became unreachable in the meantime), 'guix substitute --substitute' would try to download the nar from its preferred location and abort when that fails. This change forces one retry with each of the URLs. * guix/scripts/substitute.scm (download-nar): Do not catch 'http-get-error?' exceptions. (system-error?, network-error?, process-substitution/fallback): New procedures. (process-substitution): Call 'process-substitution/fallback' upon 'network-error?'. * tests/substitute.scm ("substitute, first URL has narinfo but lacks nar, second URL unauthorized") ("substitute, first URL has narinfo but nar is 404, both URLs authorized") ("substitute, first URL has narinfo but nar is 404, one URL authorized") ("substitute, narinfo is available but nar is missing"): New tests.
2022-09-28substitute: Split nar download.Ludovic Courtès
* guix/scripts/substitute.scm (download-nar): New procedure, with most of the code moved from... (process-substitution): ... here. Call it.
2022-09-24gnu: Add compression module.Mathieu Othacehe
Move the compression record to a dedicated module so that it can be used outside (guix scripts pack) module. * guix/scripts/pack.scm (<compressor>, %compressors, lookup-compressor): Move it to ... * gnu/compression.scm: ... this new file. * gnu/ci.scm: Adapt it. * local.mk (GNU_SYSTEM_MODULES): Add it.
2022-09-20home: import: Use (guix read-print) to render the config file.Ludovic Courtès
* guix/scripts/home/import.scm (manifest+configuration-files->code): Insert calls to 'comment' and 'vertical-space'. (import-manifest): Use 'pretty-print-with-comments/splice' instead of a loop on 'pretty-print'. * tests/home-import.scm (remove-recursively): New procedure. (eval-test-with-home-environment): Use it.
2022-09-20weather: Actually show the weather.Ludovic Courtès
* guix/scripts/weather.scm (report-server-coverage): Show a weather icon.
2022-09-17import: gem: Support importing a specific version of a gem.Taiju HIGASHI
* guix/import/gem.scm: (rubygems-fetch, gem->guix-package) (gem-recursive-import): Fix to fetch the specified version of the gem. * guix/scripts/import/gem.scm (show-help): Update the help message. (guix-import-gem): Modify so the version number to be passed to subsequent procedures. * tests/gem.scm: Add tests. * doc/guix.texi (Invoking guix import): Document. Signed-off-by: Christopher Baines <mail@cbaines.net>
2022-08-31pull: Create a version 3 manifest.Ludovic Courtès
This makes the profile readable by older Guix instances. This is a followup to c9fbd40785a99e13a59d8e530830ce85220a9871. Fixes <https://issues.guix.gnu.org/57306>. Reported by Arun Isaac <arunisaac@systemreboot.net>. * guix/profiles.scm (%manifest-format-version): Export. * guix/scripts/package.scm (build-and-use-profile): Add #:format-version and pass it to 'profile-derivation'. * guix/scripts/pull.scm (build-and-install): Pass #:format-version 3.
2022-08-31reconfigure: Use 'current-channels' to obtain provenance data.Ludovic Courtès
This reinstates a modified version of b08439809f0868a74d0bd0e14d45cb3e5dd46a8c, which contained a thinko. Previously, build-time metadata from (guix config) would be ignored when available--e.g., when running /run/current-system/profile/bin/guix. This is a followup to 316fc2acbb112bfa572ae30f95a93bcd56621234. * guix/scripts/system/reconfigure.scm (check-forward-update): Use 'current-channels' rather than 'current-profile' + 'profile-channels'.
2022-08-30scripts: system: Check the image operating-system.Mathieu Othacehe
* guix/scripts/system.scm (process-action): Check that the provided image has a defined operating-system.
2022-08-30guix system: Use standard cross and native build options.Thiago Jung Bauermann
This change prevents guix system from erroring out with an ugly backtrace when it's passed an invalid value to the “--system” or “--target” option. It also adds the “--list-systems” and “--list-targets” options. The manual section about guix system doesn't mention the “--target” option, so add it there. * guix/scripts/system (show-help): Call show-cross-build-options-help and show-native-build-options-help. (%options): Remove own implementation of “system” and “target” options and use the ones in %standard-cross-build-options and %standard-native-build-options. * doc/guix.texi (Invoking guix system): Document “--target” option. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
2022-08-30Revert "reconfigure: Use 'current-channels' to obtain provenance data."宋文武
This fixes <https://issues.guix.gnu.org/57480>. This reverts commit b08439809f0868a74d0bd0e14d45cb3e5dd46a8c.
2022-08-30reconfigure: Use 'current-channels' to obtain provenance data.Ludovic Courtès
Previously, build-time metadata from (guix config) would be ignored when available--e.g., when running /run/current-system/profile/bin/guix. This is a followup to 316fc2acbb112bfa572ae30f95a93bcd56621234. * guix/scripts/system/reconfigure.scm (check-forward-update): Use 'current-channels' rather than 'current-profile' + 'profile-channels'.
2022-08-09channels: Add 'repository->guix-channel'.Ludovic Courtès
* guix/channels.scm (repository->guix-channel): New procedure. * guix/scripts/describe.scm (display-checkout-info): Use it instead of the (git) interface, and adjust accordingly.
2022-08-08style: Add '--whole-file' option.Ludovic Courtès
* guix/scripts/style.scm (format-whole-file): New procedure. (%options, show-help): Add '--whole-file'. (guix-style): Honor it. * tests/guix-style.sh: New file. * Makefile.am (SH_TESTS): Add it. * doc/guix.texi (Invoking guix style): Document it.
2022-08-08read-print: Read and render vertical space.Ludovic Courtès
* guix/read-print.scm (<vertical-space>, vertical-space?) (vertical-space, vertical-space-height): New variables. (combine-vertical-space, canonicalize-vertical-space) (read-vertical-space): New procedures. (read-with-comments): Use it in the #\newline case. (pretty-print-with-comments): Add #:format-vertical-space and honor it. Add case for 'vertical-space?'. * guix/scripts/style.scm (format-package-definition): Pass #:format-vertical-space to 'object->string*'. * tests/read-print.scm ("read-with-comments: list with blank line") ("read-with-comments: list with multiple blank lines") ("read-with-comments: top-level blank lines") ("pretty-print-with-comments, canonicalize-vertical-space"): New tests. Add a couple of additional round-trip tests.
2022-08-08read-print: Introduce <blank> parent class of <comment>.Ludovic Courtès
* guix/read-print.scm (<blank>, blank?): New record type. (<comment>): Redefine using the record interface. (read-with-comments, pretty-print-with-comments): Change some uses of 'comment?' to 'blank?'. * guix/scripts/style.scm (simplify-inputs)[simplify-expressions]: Use 'blank?' instead of 'comment?'.
2022-08-08style: Move reader and printer to (guix read-print).Ludovic Courtès
* guix/scripts/style.scm (<comment>, read-with-comments) (vhashq, %special-forms, %newline-forms, prefix?) (special-form-lead, newline-form?, escaped-string) (string-width, canonicalize-comment, pretty-print-with-comments) (object->string*): Move to... * guix/read-print.scm: ... here. New file. * guix/scripts/import.scm: Adjust accordingly. * tests/style.scm: Move 'test-pretty-print' and tests to... * tests/read-print.scm: ... here. New file. * Makefile.am (MODULES): Add 'guix/read-print.scm'. (SCM_TESTS): Add 'tests/read-print.scm'.
2022-08-08lint: Add '-e'.Ludovic Courtès
* guix/scripts/lint.scm (show-help, %options): Add '-e'. (guix-lint): Call 'specification->package' while traversing OPTS. Add case for 'expression pair. Adjust 'for-each' loop to expect packages. * doc/guix.texi (Invoking guix lint): Document it.
2022-08-05guix system: Remove unused 'read-operating-system' procedure.Ludovic Courtès
* guix/scripts/system.scm (read-operating-system): Remove. * gnu/ci.scm: Remove unused (guix scripts system) import.
2022-08-04environment: Report "command not found" from the child process.Ludovic Courtès
Fixes a bug whereby, for example: guix shell bash -- bash -c xyz would erroneously print: guix shell: error: bash: command not found simply because the parent process could not distinguish that 127 from a "genuine" 127 used by convention for "command not found". * guix/scripts/environment.scm (launch-environment): Before exiting, report a "command not found" error and suggest a command name. (validate-exit-status): Remove. (launch-environment/fork): Remove call (launch-environment/container)[exit/status*]: Remove. Call 'exit/status' instead of it.
2022-08-04guix build: Print hints when -s or --target is passed an invalid string.Ludovic Courtès
* guix/scripts/build.scm (%standard-cross-build-options) (%standard-native-build-options): Print hints when the target/system is not found.
2022-08-01guix gc: '--delete-generations' now deletes old Home generations.Ludovic Courtès
This reverts commit 24c0518dd404cbb3c434fb6704f4f551bbc78693, thereby reinstating ba22560627f848f40891a56355ff26b6de1380bc, with an additional fix in (guix self). Fixes <https://issues.guix.gnu.org/56722>. Reported by "(" <paren@disroot.org>. * guix/scripts/gc.scm (guix-gc)[delete-generations]: Add call to 'home-generation-base'. * guix/self.scm (compiled-guix)[*core-cli-modules*]: Remove (guix scripts gc). * doc/guix.texi (Invoking guix gc): Document the change.
2022-07-17Revert "guix gc: '--delete-generations' now deletes old Home generations."Tobias Geerinckx-Rice
This reverts commit ba22560627f848f40891a56355ff26b6de1380bc.
2022-07-23guix gc: '--delete-generations' now deletes old Home generations.Ludovic Courtès
Previously, 'guix gc -d4m' would ignore Home generations. With this change, they are treated like profiles and generations that match the pattern are deleted. * guix/scripts/gc.scm (guix-gc)[delete-generations]: Add call to 'home-generation-base'. * doc/guix.texi (Invoking guix gc): Document the change.
2022-07-23deploy: Honor '--dry-run'.Ludovic Courtès
* guix/scripts/deploy.scm (%options): Add "dry-run". (show-what-to-deploy): Add #:dry-run? and honor it. (guix-deploy): Honor --dry-run.
2022-07-19import: Enable recursive import for texlive packages.Ricardo Wurmus
* guix/import/texlive.scm (tlpdb->package): Add VERSION argument; include explicit version field in output. (texlive->guix-package): Set default value for VERSION argument; adjust call of tlpdb->package. (texlive-recursive-import): Accept REPO and VERSION keyword arguments. * guix/import/utils.scm (package->definition): Add a clause to deal with output from tlpdb->package. * guix/scripts/import/texlive.scm (%options): Add "recursive" option. (guix-import-texlive): Honor "recursive" option. * doc/guix.texi (Using TeX and LaTeX): Mention "recursive" option.
2022-07-19system: Add -I, --list-installed option.Antero Mejr
* guix/scripts/system.scm (display-system-generation): Add #:list-installed-regex and honor it. (list-generations): Likewise. (show-help, %options): Add "--list-installed". (process-command): For 'describe' and 'list-generation', honor the 'list-installed option. * doc/guix.texi (Invoking Guix System): Add information for --list-installed flag. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-07-19home: Add -I, --list-installed option.Antero Mejr
* guix/scripts/package.scm (list-installed): New procedure. * guix/scripts/home.scm (%options, show-help): Add '--list-installed'. (process-command): For 'describe' and 'list-generations', honor the 'list-installed option. (display-home-environment-generation): Add #:list-installed-regex and honor it. (list-generations): Likewise. * guix/scripts/utils.scm (pretty-print-table): New argument "left-pad". * doc/guix.texi (Invoking Guix Home): Add information and example for --list-installed flag. Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2022-07-15shell: Ignore cached profiles when using '--export-manifest'.Ludovic Courtès
Fixes <https://issues.guix.gnu.org/56539>. Fixes a bug where "guix shell -D pkg --export-manifest" would provide the expansion of PKG's dependencies instead of a call to 'package-development-manifest' if that profile happened to be cached. * guix/scripts/shell.scm (profile-cached-gc-root): Add clause for 'export-manifest?.
2022-07-12style: Gracefully handle failure to locate a source file.Ludovic Courtès
* guix/scripts/style.scm (absolute-location): Raise an error when 'search-path' returns #f.
2022-07-04style: For 'let' and similar forms, emit one binding per line.Ludovic Courtès
Previously, 'let' bindings could be rendered like this: (let ((x 1) (y 2) (z 3)) ...) With this change, each bindings goes in its own line. Partly fixes <https://issues.guix.gnu.org/56297>. Reported by Maxime Devos <maximedevos@telenet.be>. * guix/scripts/style.scm (pretty-print-with-comments)[list-of-lists?]: New procedure. Use it. * tests/style.scm: Add tests with 'let' and 'substitute-keyword-arguments'.
2022-07-04style: Add option '--list-stylings'.Hartmut Goebel
* guix/scripts/style.scm (show-stylings): New procedure. (%options, show-help): Add "--list-stylings". * doc/guix.texi (Invoking guix style): Document "-l".
2022-07-03challenge: Do nothing when passed zero arguments.Ludovic Courtès
Previously, 'guix challenge' without arguments would list live store items that had been locally built. This was deemed confusing, especially since 'list-live' is an expensive operation. * guix/scripts/challenge.scm (guix-challenge): Warn and exit with 0 when FILES is empty. * doc/guix.texi (Invoking guix challenge): Update accordingly.
2022-06-26substitute: Use SRFI-71 instead of SRFI-11.Ludovic Courtès
* guix/scripts/substitute.scm (display-narinfo-data) (open-connection-for-uri/cached) (process-substitution): Use SRFI-71 instead of SRFI-11.
2022-06-23guix system: Inline menu-entries in to bootcfg in perform-action.Christopher Baines
This avoids an exception when generating images, where the reading of boot parameters fails. * guix/scripts/system.scm (perform-action): Inline menu-entries in to bootcfg.
2022-06-22refresh: Repurpose '-L' for '--load-path'.Ludovic Courtès
This incompatible change fixes an inconsistency with other commands where '-L' is short for '--load-path'. * guix/scripts/refresh.scm (%options): Add --load-path option from %STANDARD-BUILD-OPTIONS. Remove #\L shortcut for --list-updaters, and remove --load-path option that lacked the #\L shortcut. (show-help): Update accordingly. * doc/guix.texi (Invoking guix refresh): Update accordingly.
2022-06-22style: Keep values next to their keyword.Ludovic Courtès
This ensures we print '#:key value' rather than insert a newline between '#:key' and 'value' as was the case before. * guix/scripts/style.scm (pretty-print-with-comments)[print-sequence]: When ITEM is a keyword, loop with FIRST? = true. * tests/style.scm: Add test.
2022-06-19challenge: Colorize output.Ludovic Courtès
* guix/scripts/challenge.scm (good-news, bad-news): New procedures. (summarize-report, summarize-report-list): Use them and 'highlight'.
2022-06-16shell: Fix '--export-manifest' for cached profiles and when '-p' is used.Ludovic Courtès
Fixes <https://issues.guix.gnu.org/55521>. * guix/scripts/shell.scm (export-manifest): When computing 'manifest', honor the 'profile key. * tests/guix-shell-export-manifest.sh: Add test.
2022-06-16shell: Do not auto-detect manifest when '-p' is used.Ludovic Courtès
Previous, "guix shell -p /path/to/profile" would have manifest/guix.scm auto-detection turned on. * guix/scripts/shell.scm (auto-detect-manifest)[options-contain-payload?]: Return #t for 'profile.
2022-06-15refresh: Switch to SRFI-71.Ludovic Courtès
* guix/scripts/refresh.scm (update-package): Use SRFI-71 'let' instead of SRFI-11 'let-values'.
2022-06-15challenge: When using '--diff', do not attempt to chmod symlinks.Ludovic Courtès
This is a followup to 2a2856d5ccd9a9b7df8a94333a277b971a39b150. * guix/scripts/challenge.scm (make-directory-writable): Do not call 'make-file-writable' on symlinks.
2022-06-15import: Add hex.pm importer.Hartmut Goebel
hex.pm is a package repository for Erlang and Elixir. * guix/scripts/import.scm (importers): Add "hexpm". * guix/scripts/import/hexpm.scm, guix/import/hexpm.scm, guix/hexpm-download.scm: New files. * guix/import/utils.scm (source-spec->object): Add "hexpm-fetch" to list of fetch methods. * guix/upstream.scm (package-update/hexpm-fetch): New function. (%method-updates) Add it. * Makefile.am: Add them.
2022-06-15pull: Tweak cache directory validation code.Ludovic Courtès
This is a followup to 7c52cad0464175370c44bd4695e4c01a62b8268f. * guix/scripts/pull.scm (guix-pull): Move cache directory validation code to... (validate-cache-directory-ownership): ... here. New procedure. Use SRFI-71 instead of SRFI-11. Use 'formatted-message' for the error message, with ASCII quotation marks, and use Texinfo markup for '&fix-hint'.