summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2025-10-24import: utils: Add generate-git-source procedure.Nicolas Graves
This procedure tries to generate a <origin> sexp from a single url and version. * guix/import/utils.scm (generate-git-source): Add procedure. * tests/import/utils.scm: Add tests for generate-git-source. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-10-24import: utils: Fix default-git-error.Nicolas Graves
This function was missing one argument. * guix/import/utils.scm (default-git-error): Add and document location argument. * tests/import/utils.scm: Add tests for default-git-error. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-10-23gexp: Make 'local-file' follow symlinks.Nigko Yerden
Fix <https://lists.gnu.org/archive/html/guix-devel/2024-08/msg00047.html> via making 'current-source-directory' always follow symlinks. * guix/utils.scm (absolute-dirname, current-source-directory): Make them follow symlinks. * tests/gexp.scm ("local-file, load through symlink"): New test. Fixes: guix/guix#3523 Change-Id: Ieb30101275deb56b7436df444f9bc21d240fba59 Signed-off-by: Florian Pelz <pelzflorian@pelzflorian.de>
2025-10-19tests: guix-daemon.sh: Ignore guile locale warning.Martin Schitter
Ignore "guile: warning: failed to install locale" lines in the examined build log file. They are irrelevant for this particular test and cause unexpected errors. This commit contains the following changes: M tests/guix-daemon.sh Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-10-17tests: Increase test timeout and honor ‘GUIX_TESTS_BUILD_TIMEOUT’.Martin Schitter
Rigid build time limits let some unit tests fail on slow hardware. Set default timeout to 5 minutes and make it configurable via `GUIX_TESTS_BUILD_TIMEOUT` environment variable. * guix/tests.scm (%tests-build-timeout): New variable. (open-connection-for-tests, call-with-external-store): Use it. * tests/guix-environment-container.sh, tests/guix-home.sh, tests/guix-pack-localstatedir.sh, tests/guix-pack-relocatable.sh: Use it to define ‘GUIX_BUILD_OPTIONS’. Change-Id: Iab63c2dcf4a3ad311a0cf2f39d7ea2ec158ddbb4 Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-10-16daemon: Attempt to map the “kvm” group inside the build user namespace.Ludovic Courtès
Fixes <https://issues.guix.gnu.org/77862>. Previously, the ‘guix-daemon’ account (for unprivileged execution) would typically have “kvm” as a supplementary group, but that group would not be mapped in the build user namespace. Consequently, attempts to ‘chown’ a file to that supplementary group would fail with EINVAL. The test suites of Coreutils, Python, and Go (among others) exercise this chown-to-supplementary-group behavior, so they would all fail when started by the unprivileged ‘guix-daemon’ even though they succeed when started by ‘guix-daemon’ running as root. Thanks to keinflue <keinflue@posteo.net> and Reepca Russelstein <reepca@russelstein.xyz> for helping out. * nix/libstore/build.cc (initializeUserNamespace): Add ‘extraGIDs’ and ‘haveCapSetGID’ parameters. Invoke ‘newgidmap’ when ‘extraGIDs’ is non-empty and ‘haveCapSetGID’ is false. Honor ‘extraGIDs’ when ‘haveCapSetGID’ is true. (maxGroups, guestKVMGID): New variables. (kvmGIDMapping): New function. (DerivationGoal::startBuilder): Set ‘ctx.lockMountsMapAll’ in the CLONE_NEWUSER case. Pass ‘extraGIDs’ to ‘initializeUserNamespace’. * tests/store.scm ("kvm GID is mapped"): New test. Change-Id: I10ba710fc1b9ca1e3cd3122be1ec8ede5df18b40
2025-10-13linux-container: Remove #:lock-mounts? and related code.Ludovic Courtès
This reverts commits 437bb9ece55f37d4b5a62cafc98c0c3b848a53ce and a57ed987ffd1452ba5a4d70feb54893e99b8e076, which were reported in guix/guix#1169 to occasionally cause errors like: guix shell: error: unshare : 268566528: Invalid argument
2025-10-12tests: don't use 'file://...' URIs for testing git downloads.Reepca Russelstein
While 'url-fetch*' in (guix download) special-cases these URIs, 'git-fetch' does not. Consequently, the recent changes to (guix scripts perform-download) that disallow these URIs cause tests that use builtin:git-download to fail. * guix/tests/git.scm (serve-git-repository, call-with-served-git-repository): new procedures. (with-served-git-repository, with-served-temporary-git-repository): new syntax. * .dir-locals.el (scheme-mode): add indentation information for 'with-served-git-repository'. * tests/builders.scm ("git-fetch, file URI"): use git:// URI with 'with-served-temporary-git-repository'. * tests/derivations.scm ("'git-download' build-in builder, invalid hash", "'git-download' built-in builder, invalid commit", "'git-download' built-in builder, not found"): same. ("'git-download' built-in builder"): same, and use a nonce in the repo contents so that success isn't cached. Change-Id: Id3e1233bb74d5987faf89c4341e1d37f09c77c80 Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-10-11tests: guix-system: Add test for 'guix system container'.Maxim Cournoyer
* tests/guix-system.sh: Add test. Change-Id: I26c90741f17257dc50757b7cb5210ea4e645ecce
2025-10-08import: gem: Move tests to tests/import/gem.scm.Nicolas Graves
Follow-up forgotten in 94df3e6f28e. * tests/gem.scm: Move to tests/import/gem.scm. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-10-06tests: Fix ‘store-deduplication.scm’ on systems with large blocks.Brennan Vincent
Fixes <https://issues.guix.gnu.org/74862>. In particular, this makes it possible to build guix on Asahi, whose tmpfs has 16KiB blocks by default. * tests/store-deduplication.scm ("copy-file/deduplicate, sparse files (holes: ~a/~a/~a)"): Scale hole sizes so the test works with blocks bigger than 4KiB. Change-Id: I92fee04f6f69d4e5bfea7443991303ad68da7b2c Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-10-05grafts: Always depend on all the outputs of the original derivation.Danny Milosavljevic
Fixes <https://bugs.gnu.org/75157>. Fixes problem introduced with commit 482fda2729c3e76999892cb8f9a0391a7bd37119. * guix/grafts.scm (cumulative-grafts): Remove parameter "outputs" and replace it by always all outputs. (graft-derivation): Fix calls of cumulative-grafts. * tests/grafts.scm (graft-derivation with #:outputs): Remove. (graft-derivation, no applicable grafts): Add. (graft-derivation, unused outputs not depended on): Remove. (graft-derivation, multi-output graft determinism): Add. (graft-derivation, consistent cache keys): Add. Change-Id: Ice924a45c483d6fd1acc9221a0ec650abb039610
2025-10-01import: utils: Move tests to tests/import/utils.scm.Nicolas Graves
* tests/utils.scm: Move to tests/import/utils.scm. * Makefile.am: Refresh it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-10-01import: npm-binary: Move tests to tests/import/npm-binary.scm.Nicolas Graves
* tests/npm-binary.scm: Move to tests/import/npm-binary.scm. * Makefile.am: Refresh it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-10-01import: composer: Move tests to tests/import/composer.scm.Nicolas Graves
* tests/composer.scm: Move to tests/import/composer.scm. * Makefile.am: Refresh it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-10-01import: texlive: Move tests to tests/import/texlive.scm.Nicolas Graves
* tests/texlive.scm: Move to tests/import/texlive.scm. * Makefile.am: Refresh it. * CODEOWNERS: Refresh it. * etc/teams.scm: Refresh it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-10-01import: luanti: Move tests to tests/import/luanti.scm.Nicolas Graves
* tests/luanti.scm: Move to tests/import/luanti.scm. * Makefile.am: Refresh it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-10-01import: github: Move tests to tests/import/github.scm.Nicolas Graves
* tests/import-github.scm: Move to tests/import/github.scm. * Makefile.am: Refresh it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-10-01import: print: Move tests to tests/import/print.scm.Nicolas Graves
* tests/print.scm: Move to tests/import/print.scm. * Makefile.am: Refresh it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-10-01import: hexpm: Move tests to tests/import/hexpm.scm.Nicolas Graves
* tests/hexpm.scm: Move to tests/import/hexpm.scm. * Makefile.am: Refresh it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-10-01import: opam: Move tests to tests/import/opam.scm.Nicolas Graves
* tests/opam.scm: Move to tests/import/opam.scm. * Makefile.am: Refresh it. * CODEOWNERS: Refresh it. * etc/teams.scm: Refresh it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-10-01import: elpa: Move tests to tests/import/elpa.scm.Nicolas Graves
* tests/elpa.scm: Move to tests/import/elpa.scm. * Makefile.am: Refresh it. * CODEOWNERS: Refresh it. * etc/teams.scm: Refresh it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-10-01import: cran: Move tests to tests/import/cran.scm.Nicolas Graves
* tests/cran.scm: Move to tests/import/cran.scm. * Makefile.am: Refresh it. * CODEOWNERS: Refresh it. * etc/teams.scm: Refresh it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-10-01import: git: Move tests to tests/import/git.scm.Nicolas Graves
* tests/import-git.scm: Move to tests/import/git.scm. * Makefile.am: Refresh it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-10-01import: elm: Move tests to tests/import/elm.scm.Nicolas Graves
* tests/elm.scm: Move to tests/import/elm.scm. * Makefile.am: Refresh it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-10-01import: egg: Move tests to tests/import/egg.scm.Nicolas Graves
* tests/egg.scm: Move to tests/import/egg.scm. * Makefile.am: Refresh it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-10-01import: go: Move tests to tests/import/go.scm.Nicolas Graves
* tests/go.scm: Move to tests/import/go.scm. * Makefile.am: Refresh it. * CODEOWNERS: Refresh it. * etc/teams.scm: Refresh it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-10-01import: crate: Move tests to tests/import/crate.scm.Nicolas Graves
* tests/crate.scm: Move to tests/import/crate.scm. * Makefile.am: Refresh it. * CODEOWNERS: Refresh it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-10-01import: cpan: Move tests to tests/import/cpan.scm.Nicolas Graves
* tests/cpan.scm: Move to tests/import/cpan.scm. * gnu/packages/admin.scm (ansible): Update comment. * Makefile.am: Refresh it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-10-01import: hackage: Move tests to tests/import/hackage.scm.Nicolas Graves
* tests/hackage.scm: Move to tests/import/hackage.scm. * Makefile.am: Refresh it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-10-01import: pypi: Move tests to tests/import/pypi.scmNicolas Graves
* tests/pypi.scm: Move to tests/import/pypi.scm * CODEOWNERS: Refresh it. * Makefile.am: Refresh it. * etc/teams.scm: Refresh it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-09-30tests/pack: Fix rpm tests.Maxim Cournoyer
The rpm-for-tests would no longer build, due to the parent package having migrated to CMake. Use the --dbpath argument instead of a variant test package. * tests/pack.scm (rpm-for-tests): Delete variable. (rpm archive can be installed/uninstalled): Invoke rpm, not rpm-for-tests, but with the --dbpath location specified. Change-Id: I1b578db3ef8f1309c32c6ef92615814ca49fd22c
2025-09-30tests/builders: Avoid races in unpack tests.Maxim Cournoyer
* tests/builders.scm <gnu-build-system unpack phase, single file>: Add sync call. Change-Id: Iac992e0899fe3b9c9e727bd42860ec564e1dc9a2
2025-09-24import: utils: Add function git->origin.Nicolas Graves via Guix-patches via
* guix/import/utils.scm: (git-origin, git->origin): Add procedures. * guix/import/elpa.scm (download-git-repository): Remove function download-git-repository. (git-repository->origin): Remove function git-repository->origin. (ref): Add function ref. (melpa-recipe->origin): Use functions git->origin and ref. * guix/import/go.scm (git-checkout-hash): Remove function git-checkout-hash. (transform-version): Add function transform-version. (vcs->origin): Use functions git->origin and transform-version. Add optional argument transform-version. * tests/import/go.scm (go-module->guix-package): Adapt test case to changes in guix/import/go.scm. * guix/import/luanti.scm (download-git-repository): Remove function download-git-repository. (make-luanti-sexp): Use function git->origin. * tests/luanti.scm (make-package-sexp): Refresh function accordingly. * guix/import/composer.scm (make-php-sexp): Use function git->origin. Change-Id: Ied05a63bdd60fbafe26fbbb4e115ff6f0bb9db3c Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
2025-09-23tests: Adjust ‘package-transitive-supported-systems’ test.Ludovic Courtès
This test broke with commit 8c9493cb311a994c2565f71fb6270a1b26d8a644. * tests/packages.scm ("package-transitive-supported-systems, implicit inputs"): Change ‘%current-system’ to “riscv64-linux”. Change-Id: Ia6d69f086cffea4144d2f032038b27ec91e904f3
2025-09-23daemon: Restore post-canonicalization permissions after moving.Reepca Russelstein
At this point the value of 'st.st_mode' is from before canonicalization, so restoring to that will undo the permissions aspect of the canonicalization for a top-level directory store item. Fixes #1104, introduced in ae18b3d9e6 (https://codeberg.org/guix/guix/commit/ae18b3d9e6bd0c184505a094851448d08555e23e). * nix/libstore/build.cc (DerivationGoal::registerOutputs): update 'st' with post-canonicalization permissions before making actualPath temporarily-writable. * tests/store.scm ("build outputs aren't writable"): new test. Change-Id: I5e5eaa79fa6b7f81e1d12fd285883c762a22ce5a Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-09-21Revert "publish: Prevent publication of non-substitutable derivation outputs."Ludovic Courtès
Fixes guix/guix#2450. This reverts commit b5745a327e8dae21caaf10b59256dc7b16d54588, which introduced discrepancies in how substitutes are served; in particular, narinfos of non-substitutable items would still be served, and likewise for narinfos and nars of dependents of non-substitutable items.
2025-09-18Reapply "Update Maxim's email address."Maxim Cournoyer
This reverts commit a7db92d9b389cbe565395523882c34c6eff2c21a, this time with the more careful command, to avoid a world rebuild: grep -rl --exclude-dir=build --exclude-dir=patches --exclude=ld-wrapper.in \ --exclude=sitecustomize.py --exclude=guix-emacs.el maxim.cournoyer@gmail.com | xargs sed -i 's/maxim.cournoyer@gmail.com/maxim@guixotic.coop/g' Change-Id: I0871f5cf9ace79e34e78e24154d0da6ea95a3a91
2025-09-18Revert "Update Maxim's email address."Maxim Cournoyer
This reverts commit d0d87a744d724b7e7d5ac013c586039652087bb3. Oops! This caused a world rebuild. Change-Id: I25fff644b2b61d0ee93d69b457b04c72b5b74d15
2025-09-18Update Maxim's email address.Maxim Cournoyer
The change was automated via: git grep -l maxim.cournoyer@gmail.com | xargs sed -i 's/maxim.cournoyer@gmail.com/maxim@guixotic.coop/g' * .mailmap: New entry. Change-Id: Iaa88b1e51c94159c49138fb43910badb990eb169
2025-09-11packages: ‘package-field-location’ returns a <location> for atoms.Ludovic Courtès
Fixes guix/guix#1975. When using ‘read’, ‘package-field-location’ would not get source location for atoms such as symbols, typically making it impossible to get the location of the value of a field list (build-system gnu-build-system). This fixes that. * guix/packages.scm (field-value-location): New procedure. (package-field-location): Use it instead of inline code. * tests/packages.scm ("package-field-location"): Test the ‘build-system’ field. Reported-by: Nicolas Graves <ngraves@ngraves.fr> Change-Id: I98c694bb6f1999fa9ca80e145fa016640067af55
2025-09-03tests: Pass ‘--timeout’ for builds with the host store.Ludovic Courtès
This ensures ‘make check’ doesn’t accidentally start building the world. * tests/guix-environment-container.sh (GUIX_BUILD_OPTIONS): New environment variable. * tests/guix-home.sh (GUIX_BUILD_OPTIONS): Likewise. * tests/guix-pack-localstatedir.sh (GUIX_BUILD_OPTIONS): Likewise. * tests/guix-pack-relocatable.sh (GUIX_BUILD_OPTIONS): Likewise. Change-Id: If8afe9cfc5c0f1f72cd6f3d39dd5d4f6415d1e02
2025-08-31cve: Upgrade to JSON 2.0 feeds.Nicolas Graves
Fixes guix/guix#2213. The 1.1-formatted-data is no longer available from NIST. * guix/cve.scm (string->date*, <cve-item>, reference-data->cve-configuration, cpe-match->cve-configuration, configuration-data->cve-configurations, json->cve-items, yearly-feed-uri, cve-item->vulnerability): Upgrade to JSON 2.0 feeds schema. (<cve>): Remove uneeded record. * tests/cve-sample.json: Update them. Remove CVE-2019-0005 (no value added, lots of lines). * tests/cve.scm (%expected-vulnerabilities): Upgrade accordingly. (json->cve-items, vulnerabilities->lookup-proc tests): Update accordingly. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-08-21import: crate: Stop importing dependencies from crates.io.Hilton Chain
* guix/scripts/import/crate.scm (show-help, %options, guix-import-crate) [--recursive, --recursive-dev-dependencies, --mark-missing]: Remove options. * doc/guix.texi (Invoking guix import)[crate]: Adjust accordingly. Mention packaging workflow. * guix/import/crate.scm (make-crate-sexp): Don't use "rust-" prefix and semver suffix for package name. [#:cargo-inputs, #:cargo-development-inputs, #:build?]: Remove arguments. (crate->guix-package)[#:include-dev-deps?, #:mark-missing?]: Remove arguments. (<crate-dependency>): Remove data type. (make-crate-dependency, crate-dependency?, json->crate-dependency) (crate-version-dependencies, package-names->package-inputs) (maybe-cargo-inputs, maybe-cargo-development-inputs, maybe-arguments) (version->semver-prefix, find-package-version, crate-recursive-import): Remove procedures. * tests/crate.scm (test-foo-crate, test-bar-crate): Adjust for modified tests. (test-foo-dependencies, test-bar-dependencies, test-root-crate) (test-root-dependencies, test-intermediate-a-crate) (test-intermediate-a-dependencies, test-intermediate-b-crate) (test-intermediate-b-dependencies, test-intermediate-c-crate) (test-intermediate-c-dependencies, test-leaf-alice-crate) (test-leaf-alice-dependencies, test-leaf-bob-crate) (test-leaf-bob-dependencies, rust-leaf-bob-3, rust-leaf-bob-3.0.2-yanked): Remove variables. ("crate->guix-package yanked", "crate->guix-package only yanked available"): New tests. ("crate->guix-package"): Adjust accordingly. ("crate->guix-package-marks-missing-packages", "crate-recursive-import") ("crate-recursive-import-honors-existing-packages") ("crate-import-only-yanked-available"): Remove tests. Change-Id: Ib1d24511ed0ea1a2373f53de12e06afa7950a7d7
2025-08-21import: crate: Add Cargo.lock parser.Hilton Chain
* guix/import/crate/cargo-lock.scm: New file. * Makefile.am (MODULES): Regisiter it. * etc/teams.scm (rust)[#:scope]: Add it. * CODEOWNERS: Add it. * guix/import/crate.scm (cargo-lock->expressions): New procedure. * tests/crate.scm (temp-file): New variable. ("crate-lockfile-import"): New test. Co-authored-by: Murilo <murilo@disroot.org> Co-authored-by: Luis Guilherme Coelho <lgcoelho@disroot.org> Change-Id: I95421e9e2ba11a671b4bc4e1323c6d31a1b012c5
2025-07-28guix: lint: Check for misplaced argument flags.Efraim Flashner
* guix/lint.scm (check-misplaced-flags): New procedure. (%local-checkers): Register new lint-checker. * doc/guix.texi (Invoking guix lint): Add entry for misplaced-flags. * tests/lint.scm (misplaced-flags: make-flag is incorrect, misplaced-flags: configure-flag is incorrect, misplaced-flags: cargo feature flags, misplaced-flags: flags without g-exp is incorrect, misplaced-flags: build-type set correctly): New tests. Change-Id: Ia8abbe787e26bffc65ee5c763326c7e271c189a4
2025-07-17guix: lint: Find more hardcoded compiler targets.Efraim Flashner
* guix/lint.scm (check-compiler-for-target): Adjust the logic when checking the make-flags to actually determine if it is a gexp or not. * tests/lint.scm (compiler-for-target: looks through G-expressions): Fix test. Change-Id: I0040cf29c8197d394e63ac90b2fba7ca5bcb5861
2025-07-13gnu: Rename minetest to luanti.Liliana Marie Prikler
* gnu/packages/luanti.scm: New file. (luanti, luanti-server, luanti-topic, luanti-moreores, luanti-sound-api-core) (luanti-basic-materials, luanti-coloredwood, luanti-ethereal) (luanti-homedecor-modpack, luanti-mesecons, luanti-mineclone, luanti-mobs) (luanti-mobs-animal, luanti-mobs-monster, luanti-pipeworks, luanti-technic) (luanti-throwing, luanti-throwing-arrows, luanti-worldedit) (luanti-unifieddyes, luanti-unified-inventory, luanti-advtrains) (luanti-basic-trains, luanti-oneblock, luanti-wielded-light): New variables. * gnu/packages/minetest.scm: (minetest, minetest-server, minetest-topic, minetest-moreores) (minetest-sound-api-core, minetest-basic-materials, minetest-coloredwood) (minetest-ethereal, minetest-homedecor-modpack, minetest-mesecons) (minetest-mineclone, minetest-mobs, minetest-mobs-animal) (minetest-mobs-monster, minetest-pipeworks, minetest-technic) (minetest-throwing, minetest-throwing-arrows, minetest-worldedit) (minetest-unifieddyes, minetest-unified-inventory, minetest-advtrains) (minetest-basic-trains, minetest-oneblock, minetest-wielded-light): Deprecate in favor of the above. (minetest-game): Move to… * gnu/packages/luanti.scm (minetest-game): … here. * gnu/local.mk (GNU_SYSTEM_MODULES): Register luanti.scm. * guix/build-system/luanti.scm: New file. (luanti-mod-build-system): New public variable. * guix/build-system/minetest.scm (minetest-mod-build-system): Deprecate in favor of luanti-mod-build-system. * guix/build/luanti-build-system.scm: New file, renamed from… * guix/build/minetest-build-system.scm: … this. Deprecate in favor of luanti-build-system. * guix/import/luanti.scm: New file, renamed from guix/import/minetest.scm. (%contentdb-api): Switch to “https://content.luanti.org/api/”. (luanti-package?, latest-luanti-release, luanti->guix-package) (luanti-recursive-import, %luanti-updater): New public variables. * guix/import/minetest.scm (minetest-package?, latest-minetest-release) (minetest->guix-package, minetest-recursive-import, %minetest-updater): Deprecate in favor of the luanti variants above. * guix/scripts/import/luanti.scm: New file, renamed from guix/scripts/import/minetest.scm. (guix-import-luanti): New public variable. * guix/scripts/import/minetest.scm (guix-import-minetest): Deprecate in favor of guix-import-luanti. * tests/minetest.scm: Rename to… * tests/luanti.scm: … this. * Makefile.am (MODULES, SCM_TESTS): Adjust accordingly. * etc/teams.scm (games): Adjust accordingly. * CODEOWNERS: Adjust accordingly.
2025-06-26tests: Improve guix-pack-relocatable.sh.Romain GARBAGE
This patch fixes a regression introduced by c9abfacd9f. See https://issues.guix.gnu.org/76240#2. * tests/guix-pack-relocatable.sh (tarball): Improve flaky test. Change-Id: Ife1cbe6b6b9a22f2442e4ecb3a093c4b874bc4e1 Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-06-24daemon: Use slirp4netns to provide networking to fixed-output derivations.Reepca Russelstein
Previously, the builder of a fixed-output derivation could communicate with an external process via an abstract Unix-domain socket. In particular, it could send an open file descriptor to the store, granting write access to some of its output files in the store provided the derivation build fails—the fix for CVE-2024-27297 did not address this specific case. It could also send an open file descriptor to a setuid program, which could then be executed using execveat to gain the privileges of the build user. With this change, fixed-output derivations other than “builtin:download” and “builtin:git-download” always run in a separate network namespace and have network access provided by a TAP device backed by slirp4netns, thereby closing the abstract Unix-domain socket channel. * nix/libstore/globals.hh (Settings)[useHostLoopback, slirp4netns]: new fields. * config-daemon.ac (SLIRP4NETNS): new C preprocessor definition. * nix/libstore/globals.cc (Settings::Settings): initialize them to defaults. * nix/nix-daemon/guix-daemon.cc (options): add --isolate-host-loopback option. * doc/guix.texi: document it. * nix/libstore/build.cc (DerivationGoal)[slirp]: New field. (setupTap, setupTapAction, waitForSlirpReadyAction, enableRouteLocalnetAction, prepareSlirpChrootAction, spawnSlirp4netns, haveGlobalIPv6Address, remapIdsTo0Action): New functions. (initializeUserNamespace): allow the guest UID and GID to be specified. (DerivationGoal::killChild): When ‘slirp’ is not -1, call ‘kill’. (DerivationGoal::startBuilder): Unconditionally add CLONE_NEWNET to FLAGS. When ‘fixedOutput’ is true, spawn ‘slirp4netns’. When ‘fixedOutput’ and ‘useChroot’ are true, add setupTapAction, waitForSlirpReadyAction, and enableRouteLocalnetAction to builder setup phases. Create a /etc/resolv.conf for fixed-output derivations that directs them to slirp4netns's dns address. When settings.useHostLoopback is true, supply fixed-output derivations with a /etc/hosts that resolves "localhost" to slirp4netns's address for accessing the host loopback. * nix/libutil/util.cc (keepOnExec, decodeOctalEscaped, sendFD, receiveFD, findProgram): New functions. * nix/libutil/util.hh (keepOnExec, decodeOctalEscaped, sendFD, receiveFD, findProgram): New declarations. * gnu/packages/package-management.scm (guix): add slirp4netns input for linux targets. * tests/derivations.scm (builder-network-isolated?): new variable. ("fixed-output derivation, network access, localhost", "fixed-output derivation, network access, external host"): skip test case if fixed output derivations are isolated from the network. Change-Id: Ia3fea2ab7add56df66800071cf15cdafe7bfab96 Signed-off-by: John Kehayias <john.kehayias@protonmail.com>