summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)AuthorFilesLines
2025-11-20guix: toml: Fix keys with embedded escape codes.Lars-Dominik Braun1-0/+6
Quoted keys are treated by the specification like ordinary strings, so escape codes must be handled as well. * guix/build/toml.scm (eval-value): Move string escape handling… (eval-value): …here. (eval-toml-file): Un-escape quoted keys. * tests/toml.scm ("parse-toml: Quoted keys with escapes"): New testcase. Fixes: guix/guix#2414 Change-Id: I612e415cc93207bbdd18b6ec8279255fee16670a Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
2025-11-18gnu-maintenance: ‘generic-html’ recognizes ‘release-file-regexp’ ↵Ludovic Courtès1-2/+56
property. * guix/gnu-maintenance.scm (package-release-file?): New procedure. (tarball->version): Add optional parameter and honor it. (import-html-release): Use ‘package-release-file?’ and pass second argument to ‘tarball->version’. * tests/gnu-maintenance.scm ("latest-html-release, 'release-file-regexp' property") ("latest-html-release, invalid 'release-file-regexp' property"): New tests. * doc/guix.texi (Invoking guix refresh): Document it. Change-Id: Ia9328418fdd2faf118e4ec9d5fbde4a279e100ed Reviewed-by: Maxim Cournoyer <maxim@guixotic.coop>
2025-11-15tests: style: Fix insufficient number of lines read.Martin Schitter1-1/+1
* tests/style.scm ("url-fetch->git-fetch, preserved field"): The 9th line of origin, where the patches field is located, was never read. (broken test since a1b0fde434)
2025-11-14lint: Fix regressions in tests.Maxim Cournoyer1-4/+4
This fixes a regression introduced with commit 7752580a33 ("guix: lint: Check end of sentences for a period."). * guix/lint.scm (check-description-style): Do not emit warning when the description is empty or ends with trailing whitespace. * tests/lint.scm ("description: invalid Texinfo markup") ("description: may start with texinfo markup") ("description: may not contain trademark signs: ™") ("description: may not contain trademark signs: ®"): Add period. Fixes: #4222 Change-Id: Ib10bcf324cb55b39a88c0c67875a40a59c1d4c18
2025-11-05guix: lint: Check end of sentences for a period.jgart1-0/+7
* guix/lint.scm (check-description-style): Check that sentences end with a period. Change-Id: Ic10161f8093351dce440e19802a71f03bc849638 Signed-off-by: jgart <jgart@dismail.de>
2025-11-03profiles: package->manifest-entry: Filter packages.Hilton Chain1-0/+11
The new Rust packaging model moves sources to inputs and there'll be possiblity to have sources in propagated-inputs as well. * guix/profiles.scm (package->manifest-entry): Filter packages. * tests/profiles.scm ("package->manifest-entry, origin in propagated inputs"): New test. Change-Id: Id5b9ceb693a35760289b04cd9b8f208b4cbf2e35
2025-10-30Revert "syscalls: Add mmap support."Maxim Cournoyer1-69/+1
This reverts commit e1994a021437b3fd73089c08d7e8db876fad698d.
2025-10-30Revert "Use mmap for the elf parser, reducing memory usage."Maxim Cournoyer2-102/+103
This reverts commit 2c1fe0df11ae0f66392b8abb6f62430d79305538.
2025-10-30Revert "elf: Remove bundled Guile source."Maxim Cournoyer2-6/+8
This reverts commit 11cf5b2fe4882f123cd5e9eb385a773703dfe872.
2025-10-30elf: Remove bundled Guile source.Maxim Cournoyer2-8/+6
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 Cournoyer2-103/+102
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
2025-10-30syscalls: Add mmap support.Maxim Cournoyer1-1/+69
* guix/build/syscalls.scm (PROT_NONE, PROT_READ, PROT_WRITE, PROT_EXEC) (PROT_SEM, MAP_SHARED, MAP_PRIVATE, MAP_FAILED) (MS_ASYNC, MS_INVALIDATE, MS_SYNC) (%mmap-guardian, %unmapped-bytevectors): New variables. (unmapped-bytevector?, pump-mmap-guardian, %mmap, mmap, %munmap, munmap) (%msync, msync): New procedures. * guix/build/io.scm: New file. * Makefile.am: Register it. * tests/syscalls.scm (strace-output): New variable. ("mmap and munmap", "file->bytevector, reading", "file->bytevector, writing") ("manual munmap does not lead to double free"): New tests. Change-Id: I19ec687899eda635559e91200dd8d98669b0e35f
2025-10-29tests: New ld-wrapper test.Maxim Cournoyer1-0/+56
* tests/ld-wrapper.scm: New file. * Makefile.am (SCM_TESTS): Register it. Change-Id: I3cef5ff363226a3ceee2599d4906f107d6ae7151 Reviewed-by: Ludovic Courtès <ludo@gnu.org>
2025-10-29build/syscalls: Introduce new safe-clone and use it.Maxim Cournoyer1-1/+35
* guix/build/syscalls.scm (without-automatic-finalization): Accept multiple expressions. (without-garbage-collection): New syntax. (without-threads): Likewise. (ensure-signal-delivery-thread, safe-clone): New procedures. * tests/syscalls.scm: ("clone and unshare triggers EINVAL") ("safe-clone and unshare succeeds"): New tests. * gnu/build/linux-container.scm (run-container): Adjust to use 'safe-clone'. Relates-to: #1169 Change-Id: I044c11a899e24e547a7aed97f30c8e7250ab5363
2025-10-29Reinstate "linux-container: Remove #:lock-mounts? and related code."Maxim Cournoyer1-4/+29
This reverts commit e0e64be8de3d220a12612b3a2e4aee428277d865.
2025-10-24style: Add git-source rule.Nicolas Graves1-37/+195
* guix/scripts/style.scm (transform-to-git-fetch) (url-fetch->git-fetch): New procedures. * doc/guix.texi: Add entry for git-source. * tests/style.scm: Add tests for url-fetch->git-fetch. Change-Id: I6192fba4d84619b81fbc75850542b9dbd2326d4a Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-10-24import: utils: Add generate-git-source procedure.Nicolas Graves1-0/+42
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 Graves1-0/+24
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 Yerden1-0/+31
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 Schitter1-1/+1
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 Schitter4-4/+4
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ès1-0/+23
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ès1-29/+4
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 Russelstein2-24/+39
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 Cournoyer1-0/+1
* tests/guix-system.sh: Add test. Change-Id: I26c90741f17257dc50757b7cb5210ea4e645ecce
2025-10-08import: gem: Move tests to tests/import/gem.scm.Nicolas Graves1-0/+0
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 Vincent1-1/+13
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 Milosavljevic1-63/+248
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 Graves1-0/+0
* 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 Graves1-0/+0
* 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 Graves1-0/+0
* 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 Graves1-0/+0
* 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 Graves1-0/+0
* 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 Graves1-0/+0
* 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 Graves1-0/+0
* 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 Graves1-0/+0
* 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 Graves1-0/+0
* 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 Graves1-0/+0
* 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 Graves1-0/+0
* 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 Graves1-0/+0
* 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 Graves1-0/+0
* 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 Graves1-0/+0
* 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 Graves1-0/+0
* 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 Graves1-0/+0
* 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 Graves1-0/+0
* 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 Graves1-0/+0
* 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 Graves1-0/+0
* 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 Cournoyer1-16/+7
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 Cournoyer1-0/+1
* 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 via2-13/+12
* 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>