summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2025-05-09tests: Fix typo.Maxim Cournoyer
* tests/guix-build.sh: Fix typo.
2025-05-09ui: Allow evaluating multi-expressions strings with read/eval.Maxim Cournoyer
This can be useful when evaluating a scheme-file store output for example, which has multiple top level expressions. * guix/ui.scm (read/eval): Also accept a port object as argument. Read and evaluate all expressions from input port or string. Change-Id: I0213706fa4824c3a8ffe5d93f44f263048cb62c2
2025-05-06environment, home: Make /tmp writable.Ludovic Courtès
Fixes <https://issues.guix.gnu.org/78272>. Fixes a bug caused by commit ce363c1dc7bd63a74dcf7788d340819f6d5db89f, which inadvertently made /tmp read-only as well. * guix/scripts/environment.scm (launch-environment/container)[tmpfs]: New variable. Add it to ‘file-systems’. * guix/scripts/home.scm (spawn-home-container): Add /tmp file system to #:mounts. * tests/guix-environment-container.sh: Add test. Reported-by: Tomas Volf <~@wolfsden.cz> Change-Id: I5cb449e6d0c213d4b5866cbcbd14990437a7d4c5
2025-05-06guix: texlive importer: Adjust version for meta packages.Nicolas Goaziou
* guix/import/texlive.scm (tlpdb->package): Use (package-version package-source) instead of %texlive-revision when importing a meta package. * tests/texlive.scm ("texlive->guix-package, meta-package"): Test it. Change-Id: I2a5d2eb6529dafe0c888b2a7a5a1b38af1160235
2025-05-05linux-container: Lock mounts by default.Ludovic Courtès
This makes it impossible to unmount or remount things from within ‘call-with-container’. * gnu/build/linux-container.scm (initialize-user-namespace): Add #:host-uid and #:host-gid. and honor them. (run-container): Add #:lock-mounts?. Honor it by calling ‘unshare’ followed by ‘initialize-user-namespace’. (call-with-container): Add #:lock-mounts? and pass it down. (container-excursion): Get the user namespace owning the PID namespace and join it, then join the remaining namespaces. * tests/containers.scm ("call-with-container, mnt namespace, locked mounts"): New test. ("container-excursion"): Pass #:lock-mounts? #f. Change-Id: I13be982aef99e68a653d472f0e595c81cfcfa392
2025-05-05environment: Add ‘--writable-root’ and default to read-only root.Ludovic Courtès
This is an incompatible change where the root file system in ‘guix shell -C’ is now read-only by default. * guix/scripts/environment.scm (show-environment-options-help) (%options): Add ‘--writable-root’. * guix/scripts/environment.scm (setup-fhs): Invoke /sbin/ldconfig; moved from… (launch-environment): … here. (launch-environment/container): Add #:writable-root? and pass it to ‘call-with-container’. Move root file system setup to #:populate-file-system. (guix-environment*): Honor ‘--writable-root’. * tests/guix-environment-container.sh: Test it. * doc/guix.texi (Invoking guix shell): Document ‘--writable-root’. (Debugging Build Failures): Mention it before “rm /bin/sh”. Change-Id: I2e8517d6f01eb8093160bffc0f9f56071ad6fee6 Reviewed-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
2025-05-05guix home: ‘container’ provides a read-only root file system.Ludovic Courtès
* guix/scripts/home.scm (spawn-home-container): Move creation of accounts, /etc/hosts, /tmp, and HOME-DIRECTORY from the first argument of ‘eval/container’ to #:populate-file-system. Remove #:writable-root?. * tests/guix-home.sh: Test that the root file system is read-only. Change-Id: Icda54706321d51b95b563c86c3fb2238cc65ee20
2025-05-05linux-container: Support having a read-only root file system.Ludovic Courtès
Until now, the read-only file system set up by ‘call-with-container’ would always be writable. With this change, it can be made read-only. With this patch, only ‘least-authority-wrapper’ switches to a read-only root file system. * gnu/build/linux-container.scm (remount-read-only): New procedure. (mount-file-systems): Add #:writable-root? and #:populate-file-system and honor them. (run-container): Likewise. (call-with-container): Likewise. * gnu/system/linux-container.scm (container-script): Pass #:writable-root? to ‘call-with-container’. (eval/container): Add #:populate-file-system and #:writable-root? and honor them. * guix/scripts/environment.scm (launch-environment/container): Pass #:writable-root? to ‘call-with-container’. * guix/scripts/home.scm (spawn-home-container): Likewise. * tests/containers.scm ("call-with-container, mnt namespace, read-only root") ("call-with-container, mnt namespace, writable root"): New tests. Change-Id: I603e2fd08851338b737bb16c8af3f765e2538906
2025-05-05transformations: Git source transformations honour RECURSIVE?.Romain GARBAGE
* guix/transformations.scm (package-git-url+recursive?): New variable. (package-git-url): Remove variable. (evaluate-git-replacement-specs): Use package-git-url+recursive?. (transform-package-source-branch, transform-package-source-commit, transform-package-source-git-url): Update according to changes above. * doc/guix.texi (Package Transformation Options): Update documentation. * tests/transformations.scm: Update tests. Add tests for RECURSIVE? inheritance with WITH-COMMIT and WITH-SOURCE. Change-Id: Id6a5e6957a9955c8173b06b3e14f2986c6dfc4bc Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-04-27upstream: Do not update to same version.Maxim Cournoyer
Previously, 'guix refresh --update' would do actually rewrite the file with the same version/hash information when the target version was the same as the current version: guix refresh --update idutils=4.6 idutils.scm: warning: downgrading 'idutils' from 4.6 to 4.6 [...] idutils.scm: idutils: updating from version 4.6 to version 4.6... This changes handles this case so that it does and prints nothing. * guix/upstream.scm (package-update): Use `version-compare' to distinguish the equal versions case. Change-Id: I079e030d573f5968725ef13b3f626e2f8d02cb2f Signed-off-by: Christopher Baines <mail@cbaines.net>
2025-04-25daemon: Use the guest GID in /etc/group.Ludovic Courtès
Partly fixes <https://issues.guix.gnu.org/77862>. Fixes a bug whereby, when running guix-daemon unprivileged, /etc/group would contain the wrong GID for the “nixbld” group. This inconsistency would lead to failures in the Coreutils test suite, for instance. * nix/libstore/build.cc (DerivationGoal::startBuilder): Use ‘guestGID’ when writing /etc/group. * tests/store.scm ("/etc/passwd and /etc/group"): New test. Reported-by: keinflue <keinflue@posteo.net> Change-Id: I739bc96c4c935fd9015a45e2bfe5b3e3f90554a9
2025-04-21machine: hetzner: Allow attaching existing public IPs.Sergey Trofimov
* gnu/machine/hetzner.scm (hetzner-configuration): Add ipv4 and ipv6 fields. Export accessors. * gnu/machine/hetzner/http.scm (hetnzer-api-primary-ips): New function. (<hetzner-primary-ip>): New json mapping. (hetzner-api-server-create): Pass IP addresses in request. * doc/guix.texi (Invoking guix deploy): Document it. Change-Id: I44509cc98e041762dc483e876566e79bde85b26a Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-04-20syscalls: Add ‘unshare’.Ludovic Courtès
* guix/build/syscalls.scm (unshare): New procedure. Change-Id: I344273b8bdeaa9366334e6e20ee7efc37eb6c8f7
2025-04-15import/utils: beautify-description: Validate argument.Morgan Smith
* guix/import/utils.scm (beautify-description): Fix broken check for non-strings. Add a check for empty strings. * tests/import-utils.scm: Add two tests. Change-Id: Idf86df02aeb850fcc8808b7c9251082c1f816656 Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-04-15tests: Update ‘guix build -P1’ test.Ludovic Courtès
Fixes a regression introduced with 63b635e073415f544177159fbbcf07cb327b1d77. * tests/guix-build.sh: Replace libgit2 by libgcrypt in ‘-P1’ example. Change-Id: Idb2a18dd8455ee6bfda14284834a6f37ccec6a05
2025-04-13import: npm-binary: Handle vector of licenses.Nicolas Graves via Guix-patches via
* guix/import/npm-binary.scm (<package-revision>)[license]: Handle the case where a vector of licenses is used. * tests/npm-binary.scm (foo-json): Redefine as a procedure with license keyword. (test-source-hash): Redefine with direct reference to test-source. (foo-sexp): Redefine as a procedure with license keyword. (npm-binary->guix-package test): Use foo-json and foo-sexp. (npm-binary->guix-package with multiple licenses): Add test. Change-Id: I9d6adb2ae2820678260fed1a67e91e22feb448b8 Signed-off-by: Jelle Licht <jlicht@fsfe.org>
2025-04-13import: npm-binary: Fix import.Nicolas Graves via Guix-patches via
This is a follow-up to 0881a674cce3af6ebe0c1c85000e2726cbe6fc54. * guix/import/npm-binary.scm (npm-package->package-sexp): Use modify-json. * tests/npm-binary.scm (npm-binary->guix-package test): Use modify-json. Change-Id: I70523a890948b218c0d82d94a6edf8775521473e Signed-off-by: Jelle Licht <jlicht@fsfe.org>
2025-04-11daemon: Do not make chroot root directory read-only.Ludovic Courtès
Fixes <https://issues.guix.gnu.org/77570>. Commit 40f69b586a440d0397fa3dfe03b95a0f44e4d242 made chroot root directory read-only; as a consequence, build processes attempting to write to the root directory would now get EROFS instead of EACCES. It turns out that a number of test suites (Go, Ruby, SCons, Shepherd) would fail because of this observable difference. To restore previous behavior in build environments while still preventing build processes from exposing their root directory to outside processes, this patch (1) keeps the root writable but #o555 by default, thereby restoring the EACCES behavior, and (2) ensures that the parent of the chroot root directory is itself user-accessible only. * nix/libstore/build.cc (class DerivationGoal)[chrootRootTop]: New field. (DerivationGoal::startBuilder): Initialize ‘chrootRootTop’ and make it ‘AutoDelete’. Replace ‘mount’ call that made the root directory read-only by a mere ‘chmod_’ call. * tests/store.scm ("build root cannot be made world-readable"): Remove. ("writing to build root leads to EACCES"): New test. Reported-by: Ada Stevenson <adanskana@gmail.com> Reported-by: keinflue <keinflue@posteo.net> Suggested-by: Reepca Russelstein <reepca@russelstein.xyz> Change-Id: I5912e8b3b293f8242a010cfc79255fc981314445
2025-04-06gexp: ‘local-file’ expands its argument only once.Ludovic Courtès
Fixes a bug whereby (local-file (in-vicinity (getcwd) "xyz")) would point to different files depending on the current working directory at the time it is lowered. * guix/gexp.scm (local-file): Expand FILE only once. * tests/gexp.scm ("local-file, capture at the right time"): New test. Change-Id: I2cc23296de3799e68f7d8b7be6061be3043e1176
2025-03-26tests: Run in a chroot and unprivileged user namespaces.Ludovic Courtès
* build-aux/test-env.in: Pass ‘--disable-chroot’ only when unprivileged user namespace support is lacking and warn in that case. * tests/store.scm ("build-things, check mode"): Use ‘gettimeofday’ rather than a shared file as a source of entropy. ("symlink is symlink") ("isolated environment", "inputs are read-only") ("inputs cannot be remounted read-write") ("build root cannot be made world-readable") ("/tmp, store, and /dev/{null,full} are writable") ("network is unreachable"): New tests. * tests/processes.scm ("client + lock"): Skip when ‘unprivileged-user-namespace-supported?’ returns true. Change-Id: I3b3c3ebdf6db5fd36ee70251d07b893c17ca1b84
2025-03-26tests: Add missing derivation inputs.Ludovic Courtès
These missing inputs go unnoticed when running ‘guix-daemon --disable-chroot’ but are immediately visible otherwise. * tests/derivations.scm ("fixed-output derivation"): Add %BASH to #:sources. ("fixed-output derivation: output paths are equal"): ("fixed-output derivation, recursive"): ("derivation with a fixed-output input"): ("derivation with duplicate fixed-output inputs"): ("derivation with equivalent fixed-output inputs"): ("build derivation with coreutils"): Likewise. * tests/packages.scm (bootstrap-binary): New procedure. ("package-source-derivation, origin, sha512"): Use it instead of ‘search-bootstrap-binary’ and add BASH to #:sources. ("package-source-derivation, origin, sha3-512"): Likewise. Change-Id: I4c9087df23c47729a3aff15e9e1435b7266e36e2
2025-03-26daemon: Allow running as non-root with unprivileged user namespaces.Ludovic Courtès
Many thanks to Reepca Russelstein for their review and guidance on these changes. * nix/libstore/build.cc (guestUID, guestGID): New variables. (DerivationGoal)[readiness]: New field. (initializeUserNamespace): New function. (DerivationGoal::runChild): When ‘readiness.readSide’ is positive, read from it. (DerivationGoal::startBuilder): Call ‘chown’ only when ‘buildUser.enabled()’ is true. Pass CLONE_NEWUSER to ‘clone’ when ‘buildUser.enabled()’ is false or not running as root. Retry ‘clone’ without CLONE_NEWUSER upon EPERM. (DerivationGoal::registerOutputs): Make ‘actualPath’ writable before ‘rename’. (DerivationGoal::deleteTmpDir): Catch ‘SysError’ around ‘_chown’ call. * nix/libstore/local-store.cc (LocalStore::createUser): Do nothing if ‘dirs’ already exists. Warn instead of failing when failing to chown ‘dir’. * guix/substitutes.scm (%narinfo-cache-directory): Check for ‘_NIX_OPTIONS’ rather than getuid() == 0 to determine the cache location. * doc/guix.texi (Build Environment Setup): Reorganize a bit. Add section headings “Daemon Running as Root” and “The Isolated Build Environment”. Add “Daemon Running Without Privileges” subsection. Remove paragraph about ‘--disable-chroot’. (Invoking guix-daemon): Warn against ‘--disable-chroot’ and explain why. * tests/derivations.scm ("builder is outside the store"): New test. Reviewed-by: Reepca Russelstein <reepca@russelstein.xyz>
2025-03-08packages: Honor system and target system for graft replacements.David Elsing
Fixes <https://issues.guix.gnu.org/76110>. Fixes a regression introduced in 28e4018e59d30efb3d52aa950ce2261f11b69b33 where the system and target system would be ignored. * guix/packages.scm (input-graft, input-cross-graft): Wrap graft replacement in ‘with-parameters’. * tests/packages.scm ("package-grafts, indirect grafts") ("package-grafts, indirect grafts, propagated inputs") ("package-grafts, same replacement twice") ("package-grafts, dependency on several outputs") ("replacement also grafted"): Adjust accordingly by comparing the replacement after lowering to a derivation. ("package-grafts, indirect grafts, #:system argument"): New test. Change-Id: I1663f0cc50842bb9abb53ba4aa9935052022d1f4 Signed-off-by: Ludovic Courtès <ludo@gnu.org> Reported-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
2025-03-05gexp: ‘with-parameters’ properly handles ‘%graft?’.David Elsing
Fixes <https://issues.guix.gnu.org/75879>. * .dir-locals.el (scheme-mode): Remove mparameterize indentation rules. Add state-parameterize and store-parameterize indentation rules. * etc/manifests/system-tests.scm (test-for-current-guix): Replace mparameterize with store-parameterize. * etc/manifests/time-travel.scm (guix-instance-compiler): Likewise. * gnu/tests.scm (compile-system-test): Likewise. * guix/gexp.scm (compile-parameterized): Use state-call-with-parameters. * guix/monads.scm (mparameterize): Remove macro. (state-call-with-parameters): New procedure. (state-parameterize): New macro. * guix/store.scm (store-parameterize): New macro. * tests/gexp.scm ("with-parameters for %graft?"): New test. * tests/monads.scm ("mparameterize"): Remove test. ("state-parameterize"): New test. Co-authored-by: Ludovic Courtès <ludo@gnu.org> Change-Id: I0c74066ca3f37072815b073fb3039925488a9645 Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-03-05services: ‘shepherd-service-upgrade’ handles canonical name changes.Ludovic Courtès
Partly fixes <https://issues.guix.gnu.org/76315>. Fixes a bug whereby a service whose canonical name has changed would not be restarted—e.g., if '(syslogd) has a replacement providing '(system-log syslogd). * gnu/services/shepherd.scm (shepherd-service-upgrade)[running?]: Remove. [to-restart]: Change to a subset of LIVE. Look up all the names of each element of TARGET. * guix/scripts/system/reconfigure.scm (upgrade-shepherd-services): TO-RESTART is now a list of <live-service>; adjust accordingly. * tests/services.scm ("shepherd-service-upgrade: one unchanged, one upgraded, one new"): ("shepherd-service-upgrade: service depended on is not unloaded"): ("shepherd-service-upgrade: obsolete services that depend on each other"): ("shepherd-service-upgrade: transient service"): Adjust accordingly. ("shepherd-service-upgrade: service has new canonical name"): New test. Reported-by: Tomas Volf <~@wolfsden.cz> Change-Id: I7cec495b4e824da5fad5518f039607cf92f935d9
2025-03-03tests: publish: Constrain guix-publish thread use.Christopher Baines
On systems with more than 64 processors. Otherwise starting so many threads during the test will trip resource limits and lead to a spurious failure with SIGABRT. I'm seeing this on a 128 core system running Guix, and limiting to just 64 processors seems sufficient. * tests/publish.scm: Call setaffinity when the current processor count exceeds 64. Change-Id: Id4c6d7dcc9ae8dd8dafa2587def98f538061425c
2025-02-28machine: hetzner: Fix deployment on smaller instances.Roman Scherer
* gnu/machine/hetzner.scm (hetzner-machine-rescue-install-os): Avoid out of disk space error by bind mounting /mnt/tmp/gnu/store to /gnu/store. * tests/machine/hetzner.scm: Test with smaller instances. * doc/guix.texi (Invoking guix deploy): Mention unsupported instance. Change-Id: If8bfb6733de493b51813b3e82e255849192f7cba Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-02-28refresh: Add support for partial target versions.Maxim Cournoyer
* guix/import/utils.scm (find-version): New procedure. * guix/scripts/refresh.scm (<update-spec>) [partial?]: New field. (update-spec-partial?): New accessor. (update-spec): Add a PARTIAL? optional argument. (update-specification->update-spec) <update-spec>: Call with its new PARTIAL? optional argument when FALLBACK-VERSION is provided, i.e. when '--target-version' was used. (update-package): Remove the PACKAGE and VERSION positional arguments, and replace them with UPDATE-SPEC. Update doc. Call `package-update' with its new #:partial-version? argument. (check-for-package-update) <package-latest-release>: Pass the new #:partial-version? argument to it. (guix-refresh) <update-package>: Adjust call accordingly. (show-help): Udate doc. * guix/upstream.scm (package-latest-release): Add #:partial-version? argument, and apply it to the importer call. (package-update): Add #:partial-version?> argument. Update doc. Pass it to the `package-latest-release' call. * guix/gnu-maintenance.scm (rewrite-url): Add #:partial-version? argument. Update doc. Crawl URL for newer compatible versions when provided. (import-html-release): Add #:partial-version? argument, and pass it to the `rewrite-url' call. Use `find-version' to find the best version. (import-release, import-ftp-release, import-gnu-release) (import-release*): Add #:partial-version? argument and honor it. (import-html-updatable-release): Add #:partial-version? argument, and pass it to the `import-html-release' call. * guix/import/gnome.scm (import-gnome-release) <#:partial-version?>: Add new argument and honor it. * guix/import/texlive.scm (latest-texlive-tag): Rename to... (texlive-tags): ... this, and have it return all tags. (texlive->guix-package): Adjust accordingly. (latest-release): Add a #:partial-version? argument. Update doc. * guix/import/stackage.scm (latest-lts-release): New #:partial-version? argument. * guix/import/pypi.scm (import-release): New #:partial-version? argument; pass it to `pypi-package->upstream-source'. * guix/import/opam.scm (latest-release): New #:partial-version? argument. * guix/import/minetest.scm (latest-minetest-release): New #:partial-version? argument. (pypi-package->upstream-source): New #:partial-version? argument. Update doc. * guix/import/launchpad.scm (latest-released-version): Rename to... (release-versions): ... this, making it return all versions. (import-release) <#:partial-version?>: New argument. * guix/import/kde.scm (import-kde-release) <#:partial-version?>: New argument. Update doc. Refactor to honor argument. * guix/import/hexpm.scm (lookup-hexpm): Update doc. (hexpm-latest-release): Rename to... (hexpm-releases): ... this; return all release strings. (hexpm->guix-package): Adjust accordingly. (import-release): Add and honor a #:partial-version? argument. Update doc. * guix/import/hackage.scm (import-release): New #:partial-version? argument. * guix/import/cpan.scm (latest-release): New #:partial-version? argument. * guix/import/crate.scm (max-crate-version-of-semver): Improve doc. (import-release): Add a #:partial-version? argument and honor it. * guix/import/egg.scm (find-latest-version): Rename to... (get-versions): ... this, returning all versions. (egg-metadata): Adjust accordingly. (egg->guix-package): Likewise. (import-release): Add a new #:partial-version? argument and honor it. * guix/import/elpa.scm (latest-release): New #:partial-version? argument. * guix/import/gem.scm (get-versions): New procedure. (import-release): Add a new #:partial-version? argument and honor it. * guix/import/git.scm (version-mapping): Update doc; streamline a bit. (latest-tag): Rename to... (get-tags): ... this, dropping the #:version keyword and returning the complete tags alist. Update doc. (latest-git-tag-version): Rename to... (get-package-tags): ... this, returning the complete tags alist of the package. Update doc. (import-git-release): Add a new #:partial-version? argument and honor it. Update doc. * guix/import/github.scm (latest-released-version): Rename to... (get-package-tags): ... this, returning all tags. Update doc. (import-release): Add a new #:partial-version? argument and honor it. * guix/import/cran.scm (latest-cran-release) (latest-bioconductor-release): Add #:partial-version? argument. * guix/import/composer.scm (latest-version): Delete procedure. (composer-fetch): Add #:partial-version? keyword and honor it. Update doc. (import-release): Likewise. * guix/import/test.scm (import-release): Add #:partial-version? argument. * tests/guix-refresh.sh: Add test. * tests/gem.scm (test-foo-versions-json): New variable. (package-latest-release): Mock new URL. * tests/import-git.scm (latest-git-tag-version): New procedure. * tests/gnu-maintenance.scm (libuv-dist-html) (libuv-dist-1.46.0-html, libuv-dist-1.44.2-html) (libuv-html-data): New variables. (mock-http-fetch/cached): New procedure. ("rewrite-url, without to-version"): Rewrite using the above. ("rewrite-url, partial to-version"): New test. * doc/guix.texi <"Invoking guix refresh">: Update doc. Series-to: 75871@debbugs.gnu.org Change-Id: I092a58b57ac42e54a2fa55e7761e8c6993af8ad4
2025-02-24read-print: Adjust test for keyword alignment.Ludovic Courtès
This is a followup to f7744227699d27045e87be9eac3464c2f62ff7e3, which changed the rule without updating the test. * tests/read-print.scm ("keyword-value-same-line"): Adjust. Change-Id: Ie802ef3d2e577cb0647158baed0606c958394c06
2025-02-22tests: Remove extraneous 'with-store' in derivations test.Maxim Cournoyer
* tests/derivations.scm ("derivation fails but keep going"): Remove extraneous 'with-store'. Change-Id: If30c2d457504b8524cd167f1a145fbbea61b513c Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
2025-02-11import/utils: Wrap terms starting with @ in descriptions.Ricardo Wurmus
* tests/import-utils.scm ("beautify-description: escape @stuff"): Add test. * guix/import/utils.scm (beautify-description): Also wrap terms in @code{...} that start with an escaped @. Change-Id: I424f626635b821af6f4c16c97b8724cdaf99de45
2025-02-11import/utils: Escape @ in synopses.Ricardo Wurmus
* tests/import-utils.scm ("beautify-synopsis: escape @"): Add tests. * guix/import/utils.scm (beautify-synopsis): Replace @ with @@. Change-Id: I011d61687a098b5b50f44c1acd6f0a4eea06e9f0
2025-02-09machine: Implement 'hetzner-environment-type'.Roman Scherer
* Makefile.am (SCM_TESTS): Add test modules. * doc/guix.texi: Add documentation. * gnu/local.mk (GNU_SYSTEM_MODULES): Add modules. * gnu/machine/hetzner.scm: Add hetzner-environment-type. * gnu/machine/hetzner/http.scm: Add HTTP API. * po/guix/POTFILES.in: Add Hetzner modules. * tests/machine/hetzner.scm: Add machine tests. * tests/machine/hetzner/http.scm Add HTTP API tests. Change-Id: I276ed5afed676bbccc6c852c56ee4db57ce3c1ea Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-02-09scripts: style: Sort more kinds of package definitions.Herman Rimm
* guix/scripts/style.scm (order-packages): Match comments before package S-exp. and its fields. Match in let. Match package/inherit. * tests/guix-style.sh: Add pkg-baz variable and package/inherit to test. Change-Id: I48a5976930501c20415b5413966b5294958bc23b Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-02-09tests: crate: Add build dependency.Herman Rimm
* tests/crate.scm ("crate-recursive-import"): Add rust-leaf-bob-3 to rust-root-1 cargo-inputs. (test-root-dependencies): Add leaf-bob 3 build dependency. Change-Id: I1285fc6b36429f754d54def0b14f821306ba366d Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-02-09import: crate: Comment out missing dependencies.Herman Rimm
* guix/import/crate.scm (package-names->package-inputs): Emit comments. (make-crate-sexp): Make input into comment if missing. (crate->guix-package): Take #:mark-missing? argument. [dependency-name+missing+version+yanked]: Mark as missing. Rename from dependency-name+version+yanked. [sort-map-dependencies]: Adjust. [remove-missing+yanked-info]: Remove missing info. Rename from remove-yanked-info. * guix/scripts/import/crate.scm (show-help): Explain --mark-missing. (%options): Add mark-missing option. (guix-import-crate): Pass mark-missing option as #:mark-missing?. * doc/guix.texi (Invoking guix import): Document --mark-missing. * tests/crate.scm ("crate->guix-package-marks-missing-packages"): Add test. Change-Id: I065d394e1c04fdc332b8f7f8b9fcbd87c14c6512 Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-01-28grafts: Allow file-like objects in the ‘replacement’ field of <graft>.Ludovic Courtès
This is a followup to and simplification of 3331d675fbf5287e8cbe12af48fb2de14f1ad8bc. * guix/grafts.scm (graft-derivation/shallow)[mapping]: Wrap origin and replacement in ‘with-parameters’. (cumulative-grafts)[finalize-graft]: Remove, and remove its sole user. * guix/packages.scm (input-graft, input-cross-graft): Add ‘replacement’ straight into the ‘replacement’ field of <graft>. * tests/packages.scm ("package-grafts, indirect grafts") ("package-grafts, indirect grafts, propagated inputs") ("package-grafts, same replacement twice") ("package-grafts, dependency on several outputs") ("replacement also grafted"): Adjust accordingly. Suggested-by: David Elsing <david.elsing@posteo.net> Change-Id: I286fceae53df9d3051137bbca5f944d51d0c92f3
2025-01-28gexp: ‘with-parameters’ accepts plain store items in its body.Ludovic Courtès
* guix/gexp.scm (compile-parameterized): Return ‘obj’ as-is when it’s not a struct. * tests/gexp.scm ("with-parameters + store item"): New test. Change-Id: I5b5348b98bce923d07f6fa39b2f0948723011db8
2025-01-26tests: crate: Adjust for change in imported yanked crates.Efraim Flashner
This is a follow-up to 67950f46ef2c08a0873f7d08f61fdc14758e3ae5. * tests/crate.scm (crate-import-only-yanked-available): Adjust the imported crates to match the change in the importer. Change-Id: I9657838e51062861299fb10bc25ad0c05cb75f5a
2025-01-24tests: pack: Improve AppImage tests.Noé Lopez
* tests/pack.scm: Improve AppImage tests. Change-Id: I7890b902f65a2944ae8fa03db8a964deda3c725c Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-01-24lint: Adjust ‘check-inputs-should-not-be-an-input-at-all’ tests for Python.Ludovic Courtès
This is a followup to bea2914b3d1b06cc8cc1d9cff88c0dd7d8ebb1be, which removed ‘python-setuptools’ from the list of “unauthorized” inputs. * tests/lint.scm ("inputs: python-pip should not be an input at all (input)") ("inputs: python-pip should not be an input at all (native-input)") ("inputs: python-pip should not be an input at all (propagated-input)"): New tests, with s/python-setuptools/python-pip/. Change-Id: Ic575825da5c64052d3d573b37b458bd61547bae1
2025-01-20guix: toml: Fix evaluation of empty inline tables.Lars-Dominik Braun
* guix/build/toml.scm (eval-toml-file): Add pattern for empty inline table. * tests/toml.scm ("parse-toml: Empty inline table"): New testcase. Change-Id: I69663af2a861716acfb801fad4474e029e102a1b
2025-01-19grafts: Only compute necessary graft derivations.David Elsing
* guix/packages.scm (input-graft, input-cross-graft): Store the monadic value of the replacement in the 'replacement' field of <graft> instead of unwrapping it. (cumulative-grafts): Turn monadic values in the 'replacement' field of applicable grafts into derivations. * tests/packages.scm ("package-grafts, indirect grafts") ("package-grafts, indirect grafts, propagated inputs") ("package-grafts, same replacement twice") ("package-grafts, dependency on several outputs") ("replacement also grafted"): Do not compare <graft> records directly, compare the relevant fields instead, calling ‘run-with-store’ on the ‘replacement’ field. Co-authored-by: Ludovic Courtès <ludo@gnu.org> Change-Id: Idded0a402b8974df1ef2354f1a88c308b9b99777
2025-01-16home: Define ‘%base-home-services’.Ludovic Courtès
* gnu/home.scm (%base-home-services): New variable. (<home-environment>)[services]: Change default to ‘%base-home-services’. * guix/scripts/home/import.scm (manifest+configuration-files->code): Use ‘%base-home-services’ by default. * tests/home-import.scm (match-home-environment-no-services) (match-home-environment-transformations) (match-home-environment-no-services-nor-packages) (match-home-environment-bash-service) (match-home-environment-bash-service-with-alias): Adjust accordingly. * doc/he-config-bare-bones.scm: Use ‘%base-home-services’. * doc/guix.texi (Declaring the Home Environment): Add index entry for ‘%base-home-services’. Change-Id: Id95ede62b97a976aad138bfc4b63fc0bdf37c7de
2025-01-12import: git: Do not search pre-release words in tag prefix.宋文武
This fixes tags like 'xfce4-dev-tools-4.20.0'. * tests/import-git.scm ("latest-git-tag-version: prefix contains pre-release words"): New test. * guix/import/git.scm (latest-tag): Don't filter out pre-releases tags. (version-mapping): Filter out pre-releases tags from versions. * gnu/packages/xfce.scm (garcon, thunar-archive-plugin, xfce4-dev-tools): Remove FIXME comments for the 'generic-git' updater. Change-Id: I7683200fa451d7fad153aa08fa9d5761688de01d
2025-01-08upstream: Define ‘preferred-upstream-source’.Ludovic Courtès
* guix/upstream.scm (preferred-upstream-source): New procedure. * tests/upstream.scm ("preferred-upstream-source"): New test. Change-Id: I4b48b44f1aa233d2e99bfe2e1359a670297efae8
2025-01-07syscalls: Remove wrong syscall ID for ‘kexec_load_file’ on i686.Ludovic Courtès
Fixes <https://issues.guix.gnu.org/75205>. * guix/build/syscalls.scm (kexec-load-file): Remove syscall ID for i686. * tests/syscalls.scm ("kexec-load-file"): Accept ENOSYS in addition to EPERM. Reported-by: Dariqq <dariqq@posteo.net> Change-Id: I83fe25636addb57533ed88cbfb40107d265b13a7
2024-12-30channels: Adjust tests for new #:verify-certificate? parameter.Ludovic Courtès
This is a followup to 9544a0441145b9d404bb52edbdaf11666008731c. * tests/channels.scm ("latest-channel-instances includes channel dependencies") ("latest-channel-instances excludes duplicate channel dependencies"): Add #:verify-certificate? parameter to ‘update-cached-checkout’ mock. Change-Id: Ia795b965c564e5552525327d1d748635dc66d5fd
2024-12-30import: pypi: Adjust test to new setuptools and wheel requirements.Ludovic Courtès
This is a followup to c904350a81f9ff47cc025bc9d0d48f1bd2ead30e and d7890af335ed046ba245137fb13031be964d03f5, which led to adding ‘setuptools’ and ‘wheel’ to ‘native-inputs’ in many (most?) cases. * tests/pypi.scm ("pypi->guix-package, no wheel") ("pypi->guix-package, no requires.txt, but wheel.") ("pypi->guix-package, no usable requirement file, no wheel."): Add ‘python-setuptools’ and ‘python-wheel’ to the native inputs. ("package-latest-release"): Add ‘setuptools’ and ‘wheel’ to the expected result. Change-Id: I4d1001b0ad332836fe7d1d9ecd07d4adc32330af
2024-12-30daemon: Explicitly unlock output path in the has-become-valid case.Reepca Russelstein
Fixes <https://issues.guix.gnu.org/31785>. Similar to <https://github.com/NixOS/nix/issues/178>, fixed in <https://github.com/NixOS/nix/commit/29cde917fe6b8f2e669c8bf10b38f640045c83b8>. We can't rely on Goal deletion to release our locks in a timely manner. In the case in which multiple guix-daemon processes simultaneously try producing an output path path1, the one that gets there first (P1) will get the lock, and the second one (P2) will continue trying to acquire the lock until it is released. Once it has acquired the lock, it checks to see whether the path has already become valid in the meantime, and if so it reports success to those Goals waiting on its completion and finishes. Unfortunately, it fails to release the locks it holds first, so those stay held until that Goal gets deleted. Suppose we have the following store path dependency graph: path4 / | \ path1 path2 path3 P2 is now sitting on path1's lock, and will continue to do so until path4 is completed. Suppose there is also a P3, and it has been blocked while P1 builds path2. Now P3 is sitting on path2's lock, and can't acquire path1's lock to determine that it has been completed. Likewise P2 is sitting on path1's lock, and now can't acquire path2's lock to determine that it has been completed. Finally, P3 completes path3 while P2 is blocked. Now: - P1 knows that path1 and path2 are complete, and holds no locks, but can't determine that path3 is complete - P2 knows that path1 and path3 are complete, and holds locks on path1 and path3, but can't determine that path2 is complete - P3 knows that path2 and path3 are complete, and holds a lock on path2, but can't determine that path1 is complete And none of these locks will be released until path4 is complete. Thus, we have a deadlock. To resolve this, we should explicitly release these locks as soon as they should be released. * nix/libstore/build.cc (DerivationGoal::tryToBuild, SubstitutionGoal::tryToRun): Explicitly release locks in the has-become-valid case. * tests/store-deadlock.scm: New file. * Makefile.am (SCM_TESTS): Add it. Change-Id: Ie510f84828892315fe6776c830db33d0f70bcef8 Signed-off-by: Ludovic Courtès <ludo@gnu.org>