summaryrefslogtreecommitdiff
path: root/guix/scripts
AgeCommit message (Collapse)Author
2026-05-16pull: Add ‘guix-channel?’ to the set of bindings when loading channel files.Ludovic Courtès
* guix/scripts/pull.scm (%safe-channel-bindings): Add ‘guix-channel?’. Reported-by: Tomas Volf <~@wolfsden.cz> Change-Id: I5c1d06f540b85ebf96390ac4eaf10ff45e13123d Signed-off-by: Ludovic Courtès <ludo@gnu.org> Merges: #8562
2026-05-10pull, time-machine: ‘--allow-untrusted-channels’ takes an argument.Ludovic Courtès
* guix/scripts/pull.scm (%default-options): Change ‘require-trusted-channels?’ to ‘require-trusted-channels’. (show-help, %options): Support optional argument to ‘--allow-untrusted-channels’. (channel-list): Adjust accordingly. * guix/scripts/time-machine.scm (show-help, %options) (%default-options): Likewise. * tests/guix-time-machine.sh: Add test. * doc/guix.texi (Invoking guix pull) (Invoking guix time-machine): Adjust accordingly. Suggested-by: Reepca Russelstein <reepca@russelstein.xyz> Change-Id: I342ebbcc7355953487a5c6c8ac85048943a5ac46 Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2026-05-10pull, time-machine: Accept content SWHIDs as arguments to ‘--channels’.Ludovic Courtès
* guix/swh.scm (swhid-content-data): New procedure. (call): Do not close ‘port’ when ‘result’ is the same as ‘port’. * guix/scripts/pull.scm (swhid-content-data*): New procedure. (channel-list): Accept ‘file’ as a SWHID. * tests/guix-time-machine.sh: Add test. * doc/guix.texi (Invoking guix pull): Document it. (Invoking guix time-machine): Likewise. Change-Id: I8145cd8685fe2926b1548d4a2dcd54804d89228a Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2026-05-10pull, time-machine: Support transparent download of channel files.Ludovic Courtès
* guix/scripts/pull.scm (%default-options): Add ‘require-trusted-channels?’. (show-help, %options): Add ‘--allow-untrusted-channels’. (trusted-channels, equivalent-channels?, check-trusted-channels): New procedures. (channel-list)[require-trusted-channels?]: New variable. [load-channels]: Honor it and call ‘check-trusted-channels’. * guix/scripts/time-machine.scm (show-help, %options): Add ‘--allow-untrusted-channels’. (%default-options): Add ‘require-trusted-channels?’. * tests/guix-time-machine.sh: Add test. * doc/guix.texi (Invoking guix pull): Update ‘--channels’ documentation and document ‘allow-untrusted-channels’. (Invoking guix time-machine): Likewise. (Channels with Substitutes): Add example of ‘guix pull’ with a URL. Change-Id: If0bb6acaedf324e35a21c9c7d285f3e423ae49aa Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2026-05-10perform-download: Use ‘read/safe’ from (guix ui).Ludovic Courtès
* guix/scripts/perform-download.scm (read/safe): Remove. Change-Id: I941e1ab299dc1e82b2587ae58fc9f44aa9187653 Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2026-05-10pull, time-machine: Evaluate channels in a sandbox by default.Ludovic Courtès
* guix/scripts/pull.scm (%default-options): Add ‘isolated-channel-evaluation?’. (show-help, %options): Add ‘--unsafe-channel-evaluation’. (%safe-channel-bindings): New variable. (channel-list): Honor ‘isolated-channel-evaluation?’. * guix/scripts/time-machine.scm (show-help, %options): Add ‘--unsafe-channel-evaluation’. (%default-options): Add ‘isolated-channel-evaluation?’. * tests/guix-time-machine.sh: Test use of unauthorized bindings in channel files. * doc/guix.texi (Invoking guix time-machine): Document ‘--unsafe-channel-evaluation’. (Invoking guix pull): Likewise. (Channels with Substitutes): Add index entry for ‘channel-with-substitutes-available’. Mention that it requires ‘--unsafe-channel-evaluation’. Change-Id: I75f60dba516f42ef62a9d779cde8e2f0a9d0c140 Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2026-05-10ui: ‘load*’ takes a list of modules to import.Ludovic Courtès
* guix/ui.scm (load*): Change ‘module’ to ‘imports’. Define ‘user-module’. * guix/scripts/build.scm (options->things-to-build): Update to new ‘load*’ calling convention. * guix/scripts/deploy.scm (load-source-file): Likewise. * guix/scripts/environment.scm (load-manifest) (options/resolve-packages): Likewise. * guix/scripts/home.scm (process-action): Likewise. (%user-module): Rename to… (%user-modules): … this, and change to a list of module names. * guix/scripts/pack.scm (guix-pack): Update ‘load*’ calls. * guix/scripts/package.scm (load-manifest, %options): Likewise. * guix/scripts/pull.scm (channel-list): Likewise. * guix/scripts/refresh.scm (packages-from-manifest): Likewise. * guix/scripts/system.scm (%user-module): Rename to… (%user-modules): … this, and change to a list of module names. (read-operating-system): Adjust accordingly. (process-action): Likewise. * guix/scripts/weather.scm (load-manifest): Likewise. * tests/gexp.scm ("local-file, relative file name, within gexp, compiled"): Likewise. Change-Id: Ic838e66719d89de556ac0872c3ce0c8ff6de8790 Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2026-05-07style: Add ‘remove-input’ and related styling rules.Nicolas Graves
* guix/scripts/style.scm (input-matches?, package-list->string, %field-accessors, remove-from-package-field, transform-package-field): Add variables. (%options): Add options --remove-input, --remove-native-input, --remove-propagated-input, and --parameter. (guix-style): Implement those options. To keep ony one autoload, use specification->package+output rather than specification->package. * tests/style.scm ("remove-input, single input removed", "remove-input, one of multiple inputs removed", "remove-input, middle input removed from list", "remove-input, non-existent input unchanged", "remove-input, input with output specifier", "remove-native-input, single input removed", "remove-native-input, one of multiple inputs removed", "remove-native-input, does not affect inputs field", "remove-propagated-input, single input removed", "remove-propagated-input, one of multiple inputs removed", "remove-propagated-input, does not affect other fields", "remove-input from all three fields independently", "remove-input, dry-run does not modify file"): New tests. ("url-fetch->git-fetch, preserved field"): Drop the use of %patch-path and %package-module-path, which are not necessary because of -L. Change the mocked procedure from specification->package to specification->package+output, as in the implementation. * doc/guix.texi (Invoking guix style): Add description for guix style -S remove-*input rules. Change-Id: I449c87930310a73ad316b4cb5db72d0906ea495d Signed-off-by: Ludovic Courtès <ludo@gnu.org> Merges: #5862
2026-04-30shell: Add --cwd.Danny Milosavljevic
* guix/scripts/environment.scm (show-environment-options-help): Document --cwd. (%options): Add cwd. (launch-environment/container): Add cwd parameter. Implement passing it to the container. (guix-environment*): Reject --cwd without --container. * doc/guix.texi (Invoking guix shell): Document it. * tests/guix-environment-container.sh: Add tests. * tests/guix-shell.sh: Add tests. Fixes: guix/guix# 7825 Change-Id: Iba4ff3d2058e92f504fbcbf688346357ce913213
2026-04-27home: Run child as pid 2.Johannes Christ
To test, use a sample home configuration and a command such as: guix home container home.scm -- sleep 10 Before this commit, hitting `^C` would not have any effect, as `sleep` does not explicitly register a signal handler for `SIGINT`. With this commit, `guix home container` forwards the signal to `sleep`, which then exits. * guix/scripts/home.scm (spawn-home-container): Instruct `eval/container` to not run our child directly as pid 1 in the spawned container, as it may not expect to run as an init process. Change-Id: Ib997a0386d0851978d197fbd2dfb139141d13065 Signed-off-by: Ludovic Courtès <ludo@gnu.org> Merges: #8051
2026-04-27environment: Run child as PID 2.Johannes Christ
* guix/scripts/environment.scm (launch-environment/container): Instruct `call-with-container` to not run the child as PID 1, which sets up a simple signal proxying parent process to properly forward signals such as `SIGINT` to the child. Co-authored-by: Ludovic Courtès <ludo@gnu.org> Change-Id: I8d435357f54b092562b461e0913aa58e63ecdbf9 Fixes: #7600 Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2026-04-24publish: Ignore ‘--advertise’ and warn when listening to localhost.Ludovic Courtès
* guix/scripts/publish.scm (run-publish-server): Write lower-case message. (localhost?): New procedure. (guix-publish): Warn when ‘advertise?’ is true but ‘address’ is localhost. Adjust #:advertise? argument to ‘run-publish-server’ accordingly. Reported-by: Sergio Pastor Pérez <sergio.pastor-perez@inria.fr> Change-Id: I7166528d11ead67882326defcf5151af28e4253a Signed-off-by: Ludovic Courtès <ludo@gnu.org> Merges: #7790
2026-04-15guix: scripts: gc: Give better error reporting when attempting to vacuum.jgart
* guix/scripts/gc.scm (%options): Error out when a non-root user tries to vacuum the database. Change-Id: Iee7d626c43980640aa91a3ceeb95675016932c55 Signed-off-by: jgart <jgart@dismail.de>
2026-04-10tests: Fix non-deterministic AppImage tests.Noé Lopez
The tested AppImages were not actually relocatable and would rely on items being available on the environment’s store (apart from glibc). * guix/scripts/pack.scm (wrapped-manifest): New function. (guix-pack): Extract relocatable manifest to wrapped-manifest. * tests/pack.scm: Use relocatable profiles in AppImage tests. Fixes: <https://issues.guix.gnu.org/76850> Change-Id: Ib3123054913fce903d215dc0629d806e9fceebc7 Reported-by: Reepca Russelstein <reepca@russelstein.xyz> Signed-off-by: Vagrant Cascadian <vagrant@debian.org>
2026-04-10gnu: appimage-type-2-runtime: Update to continuous-1.caf24f9.Noé Lopez
The runtime-fuse3 binary was renamed to runtime. * gnu/packages/appimage.scm (appimage-type2-runtime): Update to continuous-1.caf24f9. * guix/scripts/pack.scm (self-contained-appimage): [runtime-path]: Use new runtime name. Change-Id: Ibbb1fcb6ca914764c37addb62c8234b49cc93bd5 Signed-off-by: Vagrant Cascadian <vagrant@debian.org>
2026-04-10guix: openpgp: Refactor openpgp-fingerprint->bytevector.Nicolas Graves
Both (guix channel) and (guix git-authenticate) use similar procedures. To refactor the one in (guix git-authenticate), move the procedure to (guix openpgp). * guix/channels.scm: Replace autoloaded import openpgp-public-key-fingerprint with openpgp-fingerprint->bytevector. (openpgp-fingerprint->bytevector): Move function definition from here... * guix/openpgp.scm (openpgp-fingerprint->bytevector): ...to here. * guix/git-authenticate.scm (read-authorizations): Use openpgp-fingerprint->bytevector. * guix/scripts/git/authenticate.scm: Avoid using the (guix channels) module. * tests/git-authenticate.scm : Likewise. Change-Id: Ifd20588fcfaab601990098bd8575ee985e87394a Reviewed-by: Danny Milosavljevic <dannym@friendly-machines.com> Signed-off-by: Nguyễn Gia Phong <cnx@loang.net>
2026-04-04guix system: Make ‘--save-provenance’ effective for images.Ludovic Courtès
Previously ‘--save-provenance’ would be silently ignored for ‘guix system image’. * guix/scripts/system.scm (image-with-provenance): New procedure. (process-action): In ‘transform’, add case for ‘image?’, and emit a warning in the default case. Change-Id: I5020a4b3dacbe7a0820a3c4779b7d86a8133bd60 Signed-off-by: Ludovic Courtès <ludo@gnu.org> Merges: #7485
2026-03-10style: git-source: Show package name in message.Ludovic Courtès
* guix/scripts/style.scm (url-fetch->git-fetch)[transform-source]: Show package name in informative message. Change-Id: I4533dfcd7abf12c2406c981bcb80b3e634d339bc Signed-off-by: Ludovic Courtès <ludo@gnu.org> Merges: #6894
2026-03-10style: git-source: Gracefully handle failure to checkout version tag.Ludovic Courtès
Previously, when the version tag could not be cloned, ‘generate-git-source’ would return #f leading ‘guix style’ to crash with a type error. Now, a warning about the Git error is printed and ‘guix style’ keeps going. * guix/scripts/style.scm (transform-to-git-fetch): Wrap ‘match’ clause in ‘catch’ and return #f on ‘git-error’. Change-Id: If66b1c5f8e0a44155b96f3c54bab7c58aae406f8 Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2026-03-10style: git-source: Handle more URLs.Ludovic Courtès
* guix/import/utils.scm (tarball-url->git-repository-url): New procedure. * guix/scripts/style.scm (url-fetch->git-fetch)[transform-source]: Add ‘repository-url’ parameter. Use ‘tarball-url->git-repository-url’ when ‘home-page’ is not a Git URL. (transform-to-git-fetch): Rename ‘home-page’ to ‘repository-url’. * tests/import/utils.scm ("tarball-url->git-repository-url, guile"): New test. * tests/style.scm ("url-fetch->git-fetch, mirror:// URL"): New test. Change-Id: I4f8ca7c67a58f917d69380678b62c00962b0f9cd Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2026-03-09scripts: pack: Use correct Debian architecture for armhf-linux.Efraim Flashner
Fixes guix/guix#6989. * guix/scripts/pack.scm (debian-archive): When creating a Debian package for an armhf-linux machine match our architecture to the closest one of Debian's supported architectures. Change-Id: I596db1087c507e61cc31f0808ebd9e39b4956c49
2026-02-26build: Patch the git-lfs hooks shebangs in `git-fetch'.Maxim Cournoyer
This reverts commit b6a070d2a3c059c1a574dc4048fb8f942e008799, which patched git-lfs so its hooks would refer to a 'sh' from the store, but this reference was at risk of going stale since the hooks are installed and preserved outside the store. The shebangs are now patched in the `git-fetch' procedure directly. * guix/scripts/perform-download.scm (perform-git-download): Expand comment. * guix/git-download.scm (bash-package): New variable. (git-fetch/in-band*): Add #:bash argument. (git-fetch-builder): Add it to `inputs', so that it gets added to PATH. * guix/build/git.scm (git-fetch): Substitute /bin/bash in the post-checkout git-lfs hook shebang. Fixes: https://codeberg.org/guix/guix/issues/5616 Reported-by: Simon Josefsson <simon@josefsson.org> Change-Id: Ife81737705bef5d0a1edad307ed77a479af4609e
2026-01-28scripts: substitute: Default to fast decompression.Christopher Baines
This changes the behaviour for the first one or few nars the substitute script downloads, with uncompressed and zstd compressed nars prefered rather than picking by file size. * guix/scripts/substitute.scm: (%default-fast-decompression?): Change to #t. * tests/substitute.scm ("substitute, preferred nar URL is 404, other is 200"): Adjust test. Change-Id: I89202f084cd6b9d506bcb3d46f75de690c6986b5
2026-01-28substitutes: Add #:keep-alive? keyword argument to download-nar.Christopher Baines
To be consistent with other procedures that make network requests. * guix/substitutes.scm (download-nar): Add #:keep-alive? option. * guix/scripts/substitute.scm (process-substitution/fallback) (process-substitution): Call download-nar with #:keep-alive? #t. Change-Id: I83b27d0c3a0916d058fbbbeb7aa77dbb8a742768
2026-01-28substitutes: Move download-nar from substitutes script to here.Christopher Baines
From the substitutes script. This makes it possible to use download-nar in the the Guile guix-daemon. * guix/scripts/substitute.scm (%fetch-timeout): Move down to where it's now used. (%random-state, with-timeout, catch-system-error, http-response-error?, download-nar): Move to… * guix/substitutes.scm: …here. Change-Id: I8c09bf4b33cb5c6d042057d4d9adeb36c24c11dc
2026-01-28scripts: substitute: Don't enforce cached connections in download-nar.Christopher Baines
This is in preparation for moving the download-nar procedure out of the script. As well as calling open-connection-for-uri/cached, with-cached-connection adds a single retry to the expression passed in, in the case of a exception that suggests there's a problem with the cached connection. This is important because download-nar/http-fetch doesn't check if a connection used for multiple requests should be closed (because the servers set the relevant response header). To make download-nar more generic, have it take open-connection-for-uri as a keyword argument, and replicate the with-cached-connection single retry by closing the port in the case of a network error, and recalling open-connection-for-uri. This will work fine in the case when connection caching is not in use, as well as when open-connection-for-uri/cached is used, since open-connection-for-uri/cached will open a new connection if the cached port is closed. * guix/scripts/substitute.scm (kind-and-args-exception?): Remove and inline where necessary. (call-with-cached-connection): Remove procedure. (with-cached-connection): Remove syntax rule. (http-response-error?): New procedure. (download-nar): Add new #:open-connection-for-uri keyword argument and use it, also replace with-cached-connection. (process-substitution/fallback,process-substitution): Pass #:open-connection-for-uri open-connection-for-uri/cached to download-nar. Change-Id: I277b1d8dfef79aa1711755b10b9944da7c19157c
2026-01-28http-client: Add network-error? from the substitute script.Christopher Baines
Plus remove http-get-error? from network-error? as http-get-error? doesn't indicate a network error. * guix/scripts/substitute.scm (process-substitution/fallback) (process-substitution): Use http-get-error? with network-error?. (system-error?, network-error?): Move from here… * guix/http-client.scm: …to here, and also don't use http-get-error?. Change-Id: I61ee9e5fbf90ebb76a34aa8b9ec8f5d74f8a3c54
2026-01-28scripts: substitute: Extract script specific output from download-nar.Christopher Baines
As this moves download-nar in a direction where it could be used outside the substitute script. * guix/scripts/substitute.scm (download-nar): Return expected and actual hashes and move status-port output to guix-substitute. (process-substitution/fallback): Remove port argument, and move output to port to guix-substitute. (process-substitution): Return hashes from download-nar or process-substitution/fallback, plus the narinfo. (guix-substitute): Don't pass the reply-port in to process-substitution and implement the messages to the reply-port here. Change-Id: Icbddb9a47620b3520cdd2e8095f37a99824c1ce0
2026-01-28scripts: substitute: Untangle selecting fast vs small compressions.Christopher Baines
Pulling the logic up to the script makes this code more portable and not reliant on setting a global variable. * guix/scripts/substitute.scm (%prefer-fast-decompression?): Rename to… (%default-fast-decompression?): this. (call-with-cpu-usage-monitoring): Use multiple values to return the results from the thunk as well as the cpu usage. (display-narinfo-data): Update accordingly. (download-nar): Add fast-decompression? as a keyword argument, remove code to set! it and monitor the cpu-usage. (process-substitution, process-substitution/fallback): Accept and pass through fast-decompression? to download-nar. (guix-substitute): Move the cpu usage monitoring and fast decompression switching logic here. Change-Id: I4e80b457b55bcda8c0ff4ee224dd94a55e1b24fb
2026-01-28http-client: Alter http-fetch to return the response.Christopher Baines
Rather than just the port and response-content-length. I'm looking at using the response headers within the substitute script to work out when to close the connection. * guix/http-client.scm (http-fetch): Return the response as the second value, rather than the response-content-length. * guix/build/download-nar.scm (download-nar): Adapt accordingly. * guix/build/download.scm (url-fetch): Adapt accordingly. * guix/scripts/substitute.scm (process-substitution): Adapt accordingly. * guix/scripts/challenge.scm (call-with-nar): Adapt accordingly. Change-Id: I490ecf7cef1f5ebbf1e6ed026f6a8fc9dacc56be
2026-01-28scripts: substitute: Simplify with-timeout usage.Christopher Baines
To reduce the codepaths in download-nar. * guix/scripts/substitute.scm (with-timeout): Accept a #f duration and don't set a timeout. (download-nar): Remove the if for fetch-timeout. Change-Id: I4e944a425a8612e96659dd84dd0e315012f080ab
2026-01-22Merge branch 'version-1.5.0'Rutherther
Change-Id: Id73c0c74600a3da3373b3a37236b505af65bfe31
2026-01-19import: nuget: Add tests and documentation.Danny Milosavljevic
* guix/import/nuget.scm: Prevent optimizing small functions away completely. * tests/import/nuget.scm: New file. * doc/guix.texi (nuget): Document it. * Makefile.am (SCM_TESTS): Add reference to it. Fixes: guix/guix#5483 Change-Id: Id58932fe404a11a03e61a91d3b6177b39548f1bc
2026-01-14guix: Spelling corrections.Efraim Flashner
* guix/gnupg.scm, guix/import/composer.scm, guix/import/cpan.scm, guix/import/crate/cargo-lock.scm, guix/import/hackage.scm, guix/import/json.scm, guix/licenses.scm, guix/packages.scm, guix/scripts/import.scm, guix/ui.scm: Fix misspellings in comments and doc strings. Change-Id: I8e922f8e980214e345a42a995788a7c4adb9184d
2026-01-04scripts: package: Encourage unsetting GUIX_PROFILE.Rutherther
GUIX_PROFILE should typically be unset, to prevent issues when sourcing etc/profile of other profiles. So encourage it by showing it in the hint. Followup of 50a2d73eac1577e35b526d3fc91423b97e581aef. * guix/scripts/package.scm (display-search-path-hint): Add unset GUIX_PROFILE to displayed hint. Change-Id: Ie1564750017dde8bf896c79e463067699df709eb Signed-off-by: Rutherther <rutherther@ditigal.xyz> Merges: #5118 Signed-off-by: Rutherther <rutherther@ditigal.xyz>
2026-01-04scripts: package: Encourage unsetting GUIX_PROFILE.Rutherther
GUIX_PROFILE should typically be unset, to prevent issues when sourcing etc/profile of other profiles. So encourage it by showing it in the hint. Followup of 50a2d73eac1577e35b526d3fc91423b97e581aef. * guix/scripts/package.scm (display-search-path-hint): Add unset GUIX_PROFILE to displayed hint. Change-Id: Ie1564750017dde8bf896c79e463067699df709eb Signed-off-by: Rutherther <rutherther@ditigal.xyz> Merges: #5118
2025-12-22archive: Make /etc/guix/signing-key.* readable by ‘guix-daemon’.Ludovic Courtès
The manual suggests running ‘guix archive --generate-key’ as root, but that would lead to root-owned /etc/guix/signing-key.{pub,sec}, with the secret key unreadable by the unprivileged guix-daemon. This fixes it. Reported in guix/guix#4844. * guix/scripts/archive.scm (generate-key-pair)[ensure-daemon-ownership]: New procedure. Use it for ‘%public-key-file’, ‘%private-key-file’, and their parent directory. Reported-by: Rutherther <rutherther@ditigal.xyz> Change-Id: I7ae980bfd40078fb7ef27a193217b15f366d5d50 Signed-off-by: Ludovic Courtès <ludo@gnu.org> Merges: #4958
2025-12-22authenticate: Report failure to load keys to the daemon.Ludovic Courtès
Previously, when failing to load a signing key, ‘guix authenticate’ would print a backtrace and exit with a non-zero code. That, in turn, would lead the guix-daemon child process to crash with: nix/libutil/serialise.cc:15: virtual nix::BufferedSink::~BufferedSink(): Assertion `!bufPos' failed. This patch fixes it by reporting the error to the daemon as was intended. * guix/scripts/authenticate.scm (guix-authenticate): Arrange to call ‘load-key-pair’ from within ‘with-reply’. * tests/guix-authenticate.sh: Test it. Fixes: guix/guix#4928 Reported-by: Rutherther <rutherther@ditigal.xyz> Change-Id: I8654ad6fdfbe18c55e1e85647d0c49f408d0574a Signed-off-by: Ludovic Courtès <ludo@gnu.org> Merges: #4961
2025-12-22authenticate: Improve error replies.Ludovic Courtès
* guix/scripts/authenticate.scm (guix-authenticate)[send-reply]: Wrap guard in ‘with-fluids’. Call ‘string-trim-right’ on the message string of ‘c’. Change-Id: I6ab5f645f2dc9d6f53bb57eabb4de1df8212892f Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-12-22scripts: system: Do not pull checkouts for same commit.Rutherther
In case a user reconfigures to the same commit, do not update cached checkout unnecessarily. * guix/scripts/system/reconfigure.scm (channel-relations): Return early for matching old and new commits. Change-Id: Ia4b7300bbce40f7d809946dd3514715b74cd17f9 Signed-off-by: Rutherther <rutherther@ditigal.xyz>
2025-12-19environment: Do not attempt to map GID 0 when invoked as root.Ludovic Courtès
* guix/scripts/environment.scm (launch-environment/container): Set ‘gid’ to 1000 when ‘getgid’ returns zero. Fixes: guix/guix#4234 Reported-by: Maxim Cournoyer <maxim@guixotic.coop> Change-Id: I781f2939dfd3cda23373d2fa03e288995bce9eb9
2025-12-05shell: Create cached profile directory once connected to the daemon.Ludovic Courtès
Fixes a regression introduced in d12c4452a49b355369636de1dfc766b5bad6437b, where ‘guix shell’, on a fresh installation, would attempt to create the cached profile directory under /var/guix/profiles/per-user/$USER, which only guix-daemon can do, on the user’s first connection. * guix/scripts/shell.scm (options-with-caching): Remove ‘mkdir-p’ call for ROOT’s parent directory. Add ‘create-gc-root-directory?’ key to the result. * guix/scripts/environment.scm (guix-environment*): Honor ‘create-gc-root-directory?’ key. Fixes: guix/guix#126 Reported-by: Maxim Cournoyer <maxim@guixotic.coop> Change-Id: I782461c80c254467108c6b8d676d269866795746
2025-11-24shell: Ensure graft? is used in profile cache key.Rutherther
Fixes #2932. Pass graft? to cache-key functions to not forget about it again, like with the (%graft?) parameter. * guix/scripts/shell.scm (profile-file-cache-key): Accept graft? argument instead of %graft? parameter. (profile-spec-cache-key): Likewise. (profile-cached-gc-root): Pass graft? argument from opts to profile-file-cache-key and profile-spec-cache-key. Change-Id: I9654bb2c59864d39ba7070ea0f19d922513ef024 Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-11-03publish: Explicitly update the atime for cache expiry.Ludovic Courtès
Mounting file systems with ‘noatime’ is common. Thus, avoid relying on the atime. * guix/scripts/publish.scm (render-narinfo/cached): Add ‘utime’ call on cache hit. Use ‘stat’ instead of ‘file-exists?’. (bake-narinfo+nar): Update comment. Change-Id: Id8c68d3b793922fdadca8cbd02b50368b418bb67
2025-11-03shell: Don’t rely on atime for caching.Ludovic Courtès
Relying on atime was fine even on ‘noatime’ file systems because the atime was explicitly updated. However, on file systems with atime enabled, cache items were potentially retained for too long since scanning the cache directory could update atimes. * guix/scripts/shell.scm (options-with-caching): In ‘utime’ call, change both the mtime and the atime. (guix-shell)[entry-expiration]: Use ‘file-expiration-time’ with ‘stat:mtime’. Change-Id: Ibe2aedae41a1018a95c2efe7f2dcf08bd1caae2a
2025-11-01pull: Remove old code to migrate generations to /var/guix/profiles.Ludovic Courtès
This code was added in 2018 (commit 795d430d90e41eb172315bfccf79c9f13fc0ebfa) to move profile generations created before that from ~/.config/guix to /var/guix/profiles. It has long become useless. * guix/scripts/pull.scm (migrate-generations): Remove. (ensure-default-profile): Remove call to ‘migrate-generations’. Change-Id: I43d3860995be300a065814db6c0482514035bda9
2025-10-30Revert "Use mmap for the elf parser, reducing memory usage."Maxim Cournoyer
This reverts commit 2c1fe0df11ae0f66392b8abb6f62430d79305538.
2025-10-30Revert "elf: Remove bundled Guile source."Maxim Cournoyer
This reverts commit 11cf5b2fe4882f123cd5e9eb385a773703dfe872.
2025-10-30elf: Remove bundled Guile source.Maxim Cournoyer
This module has been included in Guile as (system vm elf) since around version 2.1. * guix/elf.scm: Delete file. * CODEOWNERS: De-register module. * Makefile.am (MODULES): Likewise. * etc/teams.scm (core): Likewise. * gnu/build/linux-modules.scm: Adjust imports. * gnu/packages/gnuzilla.scm (icecat-minimal) [modules]: Likewise. * gnu/packages/librewolf.scm (librewolf): Likewise. * gnu/packages/sequoia.scm (sequoia): Likewise. * gnu/packages/tor-browsers.scm (make-torbrowser): Likewise. * gnu/packages/version-control.scm (hg-commitsigs): Likewise. * guix/build/debug-link.scm: Likewise. * guix/build/gnu-build-system.scm: Likewise. * guix/build/gremlin.scm: Likewise. * guix/build/meson-build-system.scm: Likewise. * guix/grafts.scm (graft-derivation/shallow): Likewise. * guix/scripts/pack.scm (wrapped-package): Likewise. * tests/debug-link.scm: ("elf-debuglink", "set-debuglink-crc"): Likewise. * tests/gremlin.scm: Likewise. * guix/build-system/gnu.scm (%default-gnu-imported-modules): Remove (guix elf). Change-Id: I86ac4237fdd820a6b54dc0fe7a7d10403a290ef9
2025-10-30Use mmap for the elf parser, reducing memory usage.Maxim Cournoyer
The `file->bytevector' new procedure uses a memory mapped bytevector, so parsing the ELF file reads only the sections needed, not the whole file. * guix/scripts/pack.scm (wrapped-package): Use file->bytevector. * guix/build/gremlin.scm (file-dynamic-info): Likewise. (validate-needed-in-runpath): Likewise. (strip-runpath): Likewise, and write to bytevector directly, avoiding a port. (set-file-runpath): Likewise. * tests/gremlin.scm (read-elf): Delete procedure. ("elf-dynamic-info-needed, executable"): Use file-dynamic-info. ("strip-runpath"): Likewise. ("elf-dynamic-info-soname"): Likewise. guix/build/debug-link.scm (set-debuglink-crc): Use file->bytevector. * tests/debug-link.scm (read-elf): Delete procedure. ("elf-debuglink"): Rename to... ("elf-debuglink, no .gnu_debuglink section"): ... this. ("elf-debuglink", "set-debuglink-crc"): Use external store, and adjust to use file->bytevector. * gnu/packages/gnuzilla.scm (icecat-minimal) [#:phases] {build-sandbox-whitelist}: Use `file-runpath'. * gnu/packages/librewolf.scm (librewolf): Likewise. Fixes: <https://issues.guix.gnu.org/59365> Fixes: #1262 Change-Id: I43b77ed0cdc38994ea89d3d401e0d136aa6b187a