aboutsummaryrefslogtreecommitdiff
path: root/guix/scripts/environment.scm
Commit message (Collapse)AuthorAge
* environment: Fix type error with ‘-C’ when ‘getpwuid’ fails.Ludovic Courtès12 days
| | | | | | | | | | | Fixes a bug with ‘guix shell -C …’ in cases where ‘getpwuid’ returns #f (for example because nscd isn’t running) and ‘user’ is #f. * guix/scripts/environment.scm (launch-environment/container): Use ‘name’ when building the ‘directory’ value, not ‘user’ since it can be #f. Change-Id: I5da807d982a1edbb4122ac29b5a1e5fc4b0ce1b7
* shell: ‘--development’ honors ‘--system’.Ludovic Courtès2023-12-06
| | | | | | | | | | | | | | Fixes a bug whereby ‘package->development-manifest’ would run with the wrong system in mind, leading to errors like this: $ guix shell -s i586-gnu -D shepherd --no-grafts guix shell: error: package linux-libre-headers@5.15.49 does not support i586-gnu * guix/scripts/environment.scm (options/resolve-packages): Define ‘system’ and pass it to ‘package->development-manifest’.’ * tests/guix-shell.sh: Test it. Change-Id: I95c471c1918913ab80dec7d3ca64fe38583cce78
* environment: Fix typo in error messages.Ludovic Courtès2023-10-28
| | | | | | | * guix/scripts/environment.scm (guix-environment*): Fix typo in error messages. Change-Id: I0b8669cb43267d0456a70f3b157514a6bcc725e8
* environment: Parameterize ‘%graft?’ early on.Ludovic Courtès2023-10-28
| | | | | | | | | | | Previously, ‘%graft?’ would be parameterized after ‘package-derivation’ had been called for ‘%guile-for-build’, which is too late. * guix/scripts/environment.scm (guix-environment*)[with-store/maybe]: Parameterize ‘%graft?’. Remove ‘%graft?’ parameterization from body. Change-Id: I65ef4a8c5f27e19a49196005871e5f7057fabaec
* environment: Honor ‘-s’ for guile-for-build.Ludovic Courtès2023-10-28
| | | | | | | | | | Partly fixes <https://issues.guix.gnu.org/65225>. * guix/scripts/environment.scm (guix-environment*): Pass SYSTEM to ‘package-derivation’ when defining ‘%guile-for-build’. Reported-by: Simon Tournier <zimon.toutoune@gmail.com> Change-Id: I9d883f1e61fac72754fdc9dee9b7c8a3dea32add
* environment: Fix unbound-variable bug with '--symlink'.Ludovic Courtès2023-06-02
| | | | | | | | Fixes <https://issues.guix.gnu.org/63845>. Reported by Maxim Cournoyer <maxim.cournoyer@gmail.com>. * guix/scripts/environment.scm (launch-environment/container): Reference 'evaluate-populate-directive' before calling 'call-with-container'.
* environment: Really auto-load (guix scripts pack).Ludovic Courtès2023-04-19
| | | | | | | | | | | | | Fixes a performance regression on cache hits introduced in b31ea797edb4f6e8c14e8fe790da1319607c5cb1, whereby (guix scripts pack) would be loaded eagerly during startup, leading hundreds of (gnu packages *) modules to be loaded. Fixes <https://issues.guix.gnu.org/62899>. * guix/scripts/environment.scm: Autoload (gnu build install). (%options): Add indirection when calling 'symlink-spec-option-parser' so that (guix scripts pack) is auto-loaded only when needed.
* environment: Add '--nesting'.Ludovic Courtès2023-04-06
| | | | | | | | | | | | | * guix/scripts/environment.scm (show-environment-options-help) (%options): Add '--nesting'. (options/resolve-packages): Handle it. (launch-environment/container): Add #:nesting? and honor it. [nesting-mappings]: New procedure. (guix-environment*): Add support for '--nesting'. * guix/scripts/shell.scm (profile-cached-gc-root): Special-case 'nesting?'. * tests/guix-environment-container.sh: Test it. * doc/guix.texi (Invoking guix shell): Document it.
* environment: Clear 'TERM' when checking environment.Winter2023-03-13
| | | | | | | * guix/scripts/environment.scm (child-shell-environment): Set 'TERM' to the empty string. Co-authored-by: Ludovic Courtès <ludo@gnu.org>
* scripts: environment: Fix ordering issue with CWD and --expose.Josselin Poiret2023-03-06
| | | | | | | | | | Fixes <https://issues.guix.gnu.org/46782>. * guix/scripts/environment.scm (launch-environment/container): Move the CWD mapping to the front of the file system mappings. Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com> Modified-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
* ui: 'display-hint' quotes extra arguments for Texinfo.Ludovic Courtès2023-02-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes <https://issues.guix.gnu.org/61201>. Previously, common practice was to splice arbitrary strings (user names, file names, etc.) into Texinfo snippets passed to 'display-hint'. This is unsafe in the general case because at signs and braces need to be escaped to produced valid Texinfo. This commit addresses that. * guix/ui.scm (texinfo-quote): New procedure. (display-hint): When ARGUMENTS is non-empty, pass it to 'texinfo-quote' and call 'format'. (report-unbound-variable-error, check-module-matches-file) (display-collision-resolution-hint, run-guix-command): Remove explicit 'format' call; pass 'format' arguments as extra arguments to 'display-hint'. * gnu/services/monitoring.scm (zabbix-front-end-config): Likewise. * guix/scripts.scm (warn-about-disk-space): Likewise. * guix/scripts/build.scm (%standard-cross-build-options) (%standard-native-build-options): Likewise. * guix/scripts/describe.scm (display-checkout-info): Likewise. * guix/scripts/environment.scm (suggest-command-name): Likewise. * guix/scripts/home.scm (process-command): Likewise. * guix/scripts/home/edit.scm (service-type-not-found): Likewise. * guix/scripts/import.scm (guix-import): Likewise. * guix/scripts/package.scm (display-search-path-hint): Likewise. * guix/scripts/pull.scm (build-and-install): Likewise. * guix/scripts/shell.scm (auto-detect-manifest): Likewise. * guix/scripts/system.scm (check-file-system-availability): Likewise. (guix-system): Likewise. * guix/scripts/system/edit.scm (service-type-not-found): Likewise. * guix/status.scm (print-build-event): Likewise.
* environment: Fix '--emulate-fhs' option overriding $PATH.John Kehayias2023-01-15
| | | | | | | | | | | | | Fixes <https://issues.guix.gnu.org/60566> where even if "--preserve='^PATH$'" was passed to 'guix shell' it would be replaced by just the FHS directories when '--emulate-fhs' was also set. * gnu/scripts/environment.scm (launch-environment): Add the FHS directories to $PATH rather than overriding $PATH completely. * tests/guix-environment-container.sh: Test that FHS directories are in $PATH in the container and that $PATH can be preserved. Co-authored-by: Ludovic Courtès <ludo@gnu.org>
* environment: Avoid false positive on 'PS1' check.Ludovic Courtès2023-01-05
| | | | | * guix/scripts/environment.scm (validate-child-shell-environment): Do not warn when 'PS1' refers to 'GUIX_ENVIRONMENT'.
* environment: Simplify 'PS1' suggestion on '--check'.Ludovic Courtès2023-01-05
| | | | | * guix/scripts/environment.scm (validate-child-shell-environment): In 'PS1' suggestion, remove 'export' and avoid 'if'.
* environment: '-C' doesn't throw when the NSS is dysfunctional.Ludovic Courtès2022-12-09
| | | | | | | | | | | | Previously, if the name service switch was dysfunctional, as can happen on foreign distros lacking nscd, "guix shell -C" would crash with a backtrace on the uncaught 'getpwuid' exception. To address that, catch the exception and deal with it gracefully. Reported by remsd1 on #guix. * guix/scripts/environment.scm (launch-environment/container): Wrap 'getpwuid' call in 'false-if-exception'.
* shell: Detect --symlink spec problems early.Maxim Cournoyer2022-11-15
| | | | | | | | | | | * guix/scripts/pack.scm (symlink-spec-option-parser): Remove extraneous char-set. Raise an exception when the target is an absolute file name. (guix-pack): Move with-error-handler earlier. * guix/scripts/shell.scm (guix-shell): Likewise. * guix/scripts/environment.scm (guix-environment): Wrap the whole guix-environment* call with the with-error-handling handler. * tests/guix-environment-container.sh: Add tests. * tests/guix-pack.sh: Adjust symlink spec.
* guix: shell: Add '--symlink' option.Maxim Cournoyer2022-11-15
| | | | | | | | | | | | | | | | | * guix/scripts/pack.scm (%options): Extract symlink parsing logic to... (symlink-spec-option-parser): ... here. (self-contained-tarball/builder): Add a comment mentioning why a relative file name is used for the link target. * guix/scripts/environment.scm (show-environment-options-help): Document new --symlink option. (%default-options): Add default value for symlinks. (%options): Register new symlink option. (launch-environment/container): Add #:symlinks argument and extend doc, and create symlinks using evaluate-populate-directive. (guix-environment*): Pass symlinks arguments to launch-environment/container. * doc/guix.texi (Invoking guix shell): Document it. * tests/guix-shell.sh: Add a --symlink (negative) test. * tests/guix-environment-container.sh: Add tests.
* Remove now unnecessary uses of (guix grafts).Ludovic Courtès2022-10-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These modules would use (guix grafts) just to access '%graft?' and related bindings, which are now in (guix store). * gnu/ci.scm, guix/gexp.scm, guix/lint.scm, guix/scripts.scm, guix/scripts/archive.scm, guix/scripts/build.scm, guix/scripts/challenge.scm, guix/scripts/deploy.scm, guix/scripts/environment.scm, guix/scripts/home.scm, guix/scripts/pack.scm, guix/scripts/package.scm, guix/scripts/pull.scm, guix/scripts/size.scm, guix/scripts/system.scm, guix/scripts/weather.scm, tests/builders.scm, tests/channels.scm, tests/cpan.scm, tests/derivations.scm, tests/gexp.scm, tests/graph.scm, tests/guix-daemon.sh, tests/monads.scm, tests/pack.scm, tests/packages.scm, tests/profiles.scm, tests/system.scm: Remove #:use-module (guix grafts).
* environment: Update docstring of 'launch-environment'.Ludovic Courtès2022-10-20
| | | | | | | This is a followup to 78d55b703d155d36520e1c93dc08a6502c56bd55. Reported by Maxim Cournoyer. * guix/scripts/environment.scm (launch-environment): Update docstring.
* guix: Fix typos.Julien Lepiller2022-10-17
| | | | | | | | | | | | | | | | | These typos were found and reported through weblate. * gnu/packages/audio.scm (wildmidi)[description]: Fix typo. * gnu/packages/games.scm (cgoban)[description]: Fix typo. * gnu/services/version-control.scm (gitolite-service-type)[description]: Fix typo. * gnu/installer/newt/substitutes.scm (run-substitutes-page): Remove full stop at end of title. * gnu/machine/ssh.scm (machine-ssh-configuration-system): Move punctuation outside of quotes. * guix/scripts/home.scm (process-action): Remove trailing space before newline. * guix/scripts/system.scm (show-help): Fix typo. * guix/scripts/environment.scm (with-store/maybe): Fix typo.
* shell: Handle '--emulate-fhs' in 'guix shell', not in 'guix environment'.Ludovic Courtès2022-10-13
| | | | | | | | | | | | | | | | | | | 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'.
* environment: Add '--emulate-fhs'.John Kehayias2022-10-13
| | | | | | | | | | | | | | | | | | | | * 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>
* environment: Report "command not found" from the child process.Ludovic Courtès2022-08-04
| | | | | | | | | | | | | | | | | | | | 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.
* scripts: Add --list-systems and --list-targets options.Mathieu Othacehe2022-05-22
| | | | | | | | | | | | | | | | | | | | | | | | | Also factorize the --system and --target build options. Check that the passed system and target arguments are known platforms. * doc/guix.texi (Additional Build Options): Document the new --list-systems and --list-targets options. * guix/scripts/build.scm (show-cross-build-options-help, show-emulated-build-options-help, list-systems, list-targets): New procedures. (%standard-cross-build-options, %standard-emulated-build-options): New variables. (show-help): Remove --system and --target entries and use show-cross-build-options-help and show-emulated-build-options-help procedures instead. (%options): Remove --system and --target entries and use %standard-cross-build-options and %standard-emulated-build-options variables instead. * guix/scripts/archive.scm (show-help, %options): Adapt them. * guix/scripts/environment.scm: Ditto. * guix/scripts/graph.scm: Ditto. * guix/scripts/pack.scm: Ditto. * guix/scripts/pull.scm: Ditto. * guix/scripts/size.scm: Ditto. * guix/scripts/weather.scm: Ditto. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
* environment: Export 'load-manifest'.Ludovic Courtès2022-04-04
| | | | | * guix/scripts/environment.scm (load-manifest): New procedure. (options/resolve-packages): Use it.
* 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.
* 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.
* 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>
* environment: Suggest command upon 'execlp' failure.Ludovic Courtès2021-11-06
| | | | | | | | | * guix/scripts/environment.scm (launch-environment): Call 'primitive-_exit' upon 'system-error. (suggest-command-name, validate-exit-status): New procedures. (launch-environment/fork): Call 'validate-exit-status'. (launch-environment/container)[exit/status*]: New procedure. Use it instead of 'exit/status'.
* environment: Fix broken file-local variable.Zhu Zihao2021-10-28
| | | | | | * guix/scripts/environment.scm (Local Variables): Add missing eval. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* environment: Add '--check'.Ludovic Courtès2021-10-26
| | | | | | | | | | | | * guix/scripts/environment.scm (show-environment-options-help) (%options): Add '--check'. * guix/scripts/environment.scm (child-shell-environment) (validate-child-shell-environment): New procedures. (guix-environment*): Call 'validate-child-shell-environment' when 'check?' key is in OPTS. * doc/guix.texi (Invoking guix shell): Shorten footnote about Bash startup files. Document '--check' and mention startup files. (Invoking guix environment): Document '--check'.
* environment: Autoload some modules.Ludovic Courtès2021-10-25
| | | | | | This further speeds up the 'guix environment -p PROFILE' case. * guix/scripts/environment.scm: Autoload a bunch of modules.
* environment: Do not connect to the daemon when '--profile' is used.Ludovic Courtès2021-10-25
| | | | | | | | | This further speeds up the 'guix environment -p PROFILE' case. * guix/scripts/environment.scm (guix-environment*)[store-needed?]: New variable. [with-store/maybe]: New macro. Use it instead of 'with-store', and remove 'with-build-handler' form.
* environment: Skip derivation computation when '--profile' is used.Ludovic Courtès2021-10-25
| | | | | | * guix/scripts/environment.scm (guix-environment*): Bypass calls to 'package-derivation' and to 'manifest->derivation' when PROFILE is true.
* Add 'guix shell'.Ludovic Courtès2021-10-25
| | | | | | | | | | | | | | | | | | | | | | | * guix/scripts/shell.scm, tests/guix-shell.sh: New files. * Makefile.am (MODULES): Add 'shell.scm'. (SH_TESTS): Add 'tests/guix-shell.sh'. * guix/scripts/environment.scm (show-environment-options-help): New procedure. (show-help): Use it. (guix-environment*): New procedure. (guix-environment): Use it. * po/guix/POTFILES.in: Add it. * doc/guix.texi (Features): Refer to "guix shell" (Invoking guix package): Likewise. (Development): Likewise. (Invoking guix shell): New node. (Invoking guix environment): Add deprecation warning. (Debugging Build Failures): Use 'guix shell' in examples. (Invoking guix container): Refer to 'guix shell'. (Invoking guix processes, Virtualization Services): Adjust examples to use 'guix shell'. * doc/contributing.texi (Building from Git): Refer to 'guix shell'. * etc/completion/bash/guix: Handle "shell".
* profiles: Add 'package->development-manifest'.Ludovic Courtès2021-10-25
| | | | | | | | | * guix/profiles.scm (package->development-manifest): New procedure. * guix/scripts/environment.scm (input->manifest-entry) (package-environment-inputs): Remove. * guix/scripts/environment.scm (options/resolve-packages): Use 'package->development-manifest' instead of 'package-environment-inputs'. * tests/profiles.scm ("package->development-manifest"): New test.
* packages: Add 'package-development-inputs'.Ludovic Courtès2021-10-25
| | | | | | | | * guix/packages.scm (package-development-inputs): New procedure. * guix/scripts/environment.scm (package-environment-inputs): Use it. * tests/packages.scm ("package-development-inputs") ("package-development-inputs, cross-compilation"): New tests. * doc/guix.texi (package Reference): Document it.
* profiles: Add 'load-profile'.Ludovic Courtès2021-06-18
| | | | | | | | | * guix/profiles.scm (%precious-variables): New variable. (purify-environment, load-profile): New procedures. * guix/scripts/environment.scm (%precious-variables) (purify-environment, create-environment): Remove. (launch-environment): Call 'load-profile' instead of 'create-environment'. * tests/profiles.scm ("load-profile"): New test.
* scripts: Commands warn when passed zero arguments.Ludovic Courtès2021-05-28
| | | | | | | | | | | | | | | | This is a followup to 3f8326237df780404c172ef4127195cc20becd66. * guix/scripts/archive.scm (export-from-store): Warn then FILES is empty. * guix/scripts/build.scm (guix-build): Likewise. * guix/scripts/copy.scm (warn-if-empty): New procedure. (send-to-remote-host, retrieve-from-remote-host): Call it. * guix/scripts/edit.scm (guix-edit): Warn when SPECS is empty. * guix/scripts/environment.scm (guix-environment): Warn when MANIFEST has zero entries. * guix/scripts/graph.scm (guix-graph): Warn then ITEMS is empty. * guix/scripts/package.scm (process-actions): Warn when FILES and TRANS are both empty.
* environment: Allow compilation with Guile 2.2.Ludovic Courtès2021-03-01
| | | | | | | | Fixes <https://bugs.gnu.org/46826>. Reported by cage <cage-dev@twistfold.it>. * guix/scripts/environment.scm (guix-environment): Move 'manifest' definition before expression.
* environment: Allow starting from existing profile.Lars-Dominik Braun2021-02-11
| | | | | | | | * guix/scripts/environment.scm (%options): Add -p/--profile switch. (show-help): Document new switch. (guix-environment): Handle new 'profile switch. Signed-off-by: 宋文武 <iyzsong@member.fsf.org>
* 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>
* 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>
* transformations: Show '--help-transform' only where applicable.Ludovic Courtès2020-11-21
| | | | | | | | | | | | | | | | | | | | | | | | Fixes <https://bugs.gnu.org/44773>. Reported by Florian Pelz <pelzflorian@pelzflorian.de>. This fixes a regression introduced in 6701f64f7329cdbeda70bcaf38523c9098e5a938. * guix/transformations.scm (%transformation-options): Add "--help-transform". (show-transformation-options-help): Rename to... (show-transformation-options-help/detailed): ... this. (show-transformation-options-help): New public procedure. * guix/scripts/build.scm (show-build-options-help): Remove "--help-transform". (%standard-build-options): Likewise. (show-help): Call 'show-transformation-options-help'. * guix/scripts/environment.scm (show-help): Likewise. * guix/scripts/graph.scm (show-help): Likewise. * guix/scripts/install.scm (show-help): Likewise. * guix/scripts/pack.scm (show-help): Likewise. * guix/scripts/package.scm (show-help): Likewise. * guix/scripts/upgrade.scm (show-help): Likewise.
* guix build: Move transformation options to (guix transformations).Ludovic Courtès2020-10-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * guix/transformations.scm: New file. * tests/scripts-build.scm: Rename to... * tests/transformations.scm: ... this. * Makefile.am (MODULES): Add 'guix/transformations.scm'. (SCM_TESTS): Adjust to rename. * guix/scripts/build.scm (numeric-extension?) (tarball-base-name, <downloaded-file>, download-to-store*) (compile-downloaded-file, package-with-source) (transform-package-source, evaluate-replacement-specs) (transform-package-inputs, transform-package-inputs/graft) (%not-equal, package-git-url, evaluate-git-replacement-specs) (transform-package-source-branch, transform-package-source-commit) (transform-package-source-git-url, package-dependents/spec) (package-toolchain-rewriting, transform-package-toolchain) (transform-package-with-debug-info, transform-package-tests) (%transformations, transformation-procedure, %transformation-options) (show-transformation-options-help, options->transformation) (package-transformations): Move to (guix transformations). * guix/scripts/environment.scm: Adjust accordingly. * guix/scripts/graph.scm: Likewise. * guix/scripts/install.scm: Likewise. * guix/scripts/pack.scm: Likewise. * guix/scripts/package.scm: Likewise. * guix/scripts/upgrade.scm: Likewise. * po/guix/POTFILES.in: Add 'guix/transformations.scm'.
* guix build: 'options->transformation' no longer takes a 'store' parameter.Ludovic Courtès2020-10-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * guix/scripts/build.scm (transform-package-source) (transform-package-inputs, transform-package-inputs/graft) (transform-package-source-branch, transform-package-source-commit) (transform-package-source-git-url, transform-package-toolchain) (transform-package-with-debug-info, transform-package-tests): Remove 'store' parameter. (options->transformation, options->derivations): Adjust accordingly. * guix/scripts/environment.scm (options/resolve-packages): Likewise. * guix/scripts/graph.scm (guix-graph): Likewise. * guix/scripts/pack.scm (guix-pack): Likewise. * guix/scripts/package.scm (transaction-upgrade-entry): Likewise. (process-actions): Likewise. * tests/scripts-build.scm ("options->transformation, no transformations") ("options->transformation, with-source, replacement"): Adjust tests. ("options->transformation, with-source") ("options->transformation, with-source, with version") ("options->transformation, with-source, PKG=URI"): Use 'lower-object' to compute the store file name of the source. ("options->transformation, with-source, no matches"): Remove 'with-store' and adjust accordingly. ("options->transformation, with-input"): Likewise. ("options->transformation, with-graft"): Likewise. ("options->transformation, with-branch"): Likewise. ("options->transformation, with-commit"): Likewise. ("options->transformation, with-git-url"): Likewise. ("options->transformation, with-git-url + with-branch"): Likewise. ("options->transformation, with-c-toolchain"): Likewise. ("options->transformation, with-c-toolchain twice"): Likewise. ("options->transformation, with-c-toolchain, no effect"): Likewise. ("options->transformation, with-debug-info"): Likewise. ("options->transformation, without-tests"): Likewise.
* guix build: Move package transformation options behind '--help-transform'.Ludovic Courtès2020-10-20
| | | | | | | | | | | | | | | | | This change declutters the '--help' output. * guix/scripts/build.scm (show-build-options-help) (%standard-build-options): Add '--help-transform'. (show-transformation-options-help): Make private. (show-help): Remove call to 'show-transformation-options-help'. * guix/scripts/build.scm (show-help): Likewise. * guix/scripts/environment.scm (show-help): Likewise. * guix/scripts/graph.scm (show-help): Likewise. * guix/scripts/install.scm (show-help): Likewise. * guix/scripts/pack.scm (show-help): Likewise. * guix/scripts/package.scm (show-help): Likewise. * guix/scripts/upgrade.scm (show-help): Likewise. * doc/guix.texi (Package Transformation Options): Mention '--help-transform'.
* environment: Turn "lo" up in network-less containers.Ludovic Courtès2020-10-05
| | | | | | | | This is a followup to 0f53c801b91919380a924b402d1ff822bb1dc6ea. * guix/scripts/environment.scm (launch-environment/container): Add call to 'set-network-interface-up'. * tests/guix-environment-container.sh: Add test.
* environment: Provide /etc/hosts in containers without '--network'.Ludovic Courtès2020-10-02
| | | | | | | | Fixes <https://bugs.gnu.org/43762>. * guix/scripts/environment.scm (launch-environment/container): Create /etc/hosts when NETWORK? is false. * tests/guix-environment-container.sh: Add "localhost" resolution test.
* environment: '--link-profile' uses ~/.guix-profile for environment variables.Ludovic Courtès2020-09-21
| | | | | | | | | | | | | | | | | | | | | | | | Before this patch, we had: $ guix environment -CP --ad-hoc coreutils [env]$ echo $PATH /gnu/store/…-profile/bin [env]$ echo $GUIX_ENVIRONMENT /gnu/store/…-profile After this patch: $ guix environment -CP --ad-hoc coreutils [env]$ echo $PATH /home/ludo/.guix-profile/bin [env]$ echo $GUIX_ENVIRONMENT /home/ludo/.guix-profile * guix/scripts/environment.scm (launch-environment/container): When LINK-PROFILE? is true, pass ~/.guix-profile as the second argument to 'launch-environment'. * tests/guix-environment-container.sh: Adjust test accordingly. * doc/guix.texi (Invoking guix environment): Update accordingly.