summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2020-05-25channels: 'latest-channel-instances' guards against non-forward updates.Ludovic Courtès
* guix/channels.scm (latest-channel-instance): Add #:starting-commit and pass it to 'update-cached-checkout'. Return the commit relation as a second value. (ensure-forward-channel-update): New procedure. (latest-channel-instances): Add #:current-channels and #:validate-pull. [current-commit]: New procedure. Pass #:starting-commit to 'latest-channel-instance'. When the returned relation is true, call VALIDATE-PULL. (latest-channel-derivation): Add #:current-channels and #:validate-pull. Pass them to 'latest-channel-instances*'. * tests/channels.scm ("latest-channel-instances #:validate-pull"): New test.
2020-05-25git: 'update-cached-checkout' returns the commit relation.Ludovic Courtès
* guix/git.scm (update-cached-checkout): Add #:starting-commit parameter. Call 'commit-relation' when #:starting-commit is true. Always return the relation or #f as the third value. (latest-repository-commit): Adjust accordingly. * guix/import/opam.scm (get-opam-repository): Likewise. * tests/channels.scm ("latest-channel-instances includes channel dependencies") ("latest-channel-instances excludes duplicate channel dependencies"): Update mock of 'update-cached-checkout' accordingly.
2020-05-25git: Add 'commit-relation'.Ludovic Courtès
* guix/git.scm (commit-relation): New procedure. * tests/git.scm ("commit-relation"): New test.
2020-05-23guix package: Support multiple profiles with '--list-installed'.zimoun
* guix/scripts/package.scm (process-query): List installed multiple profiles. * tests/guix-package-net.sh: Test it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2020-05-23tests: Use a #:prefix for (gcrypt hash).Ludovic Courtès
* tests/packages.scm: Use #:prefix instead of #:hide for (gcrypt hash). This accomodates for 'sha512' syntax literal matches with Guile-Gcrypt 0.3.0, which exports 'sha512' in addition to 'sha256'.
2020-05-22packages: Introduce <content-hash> and use it in <origin>.Ludovic Courtès
* guix/packages.scm (<content-hash>): New record type. (define-content-hash-constructor, build-content-hash) (content-hash): New macros. (print-content-hash): New procedure. (<origin>): Rename constructor to '%origin'. [sha256]: Remove field. [hash]: New field. Adjust users. (origin-compatibility-helper, origin): New macros. (origin-sha256): New deprecated procedure. (origin->derivation): Adjust accordingly. * tests/packages.scm ("package-source-derivation, origin, sha512"): New test. * guix/tests.scm: Hide (gcrypt hash) 'sha256' for proper syntax matching. * tests/challenge.scm: Add #:prefix for (gcrypt hash) and adjust users. * tests/derivations.scm: Likewise. * tests/store.scm: Likewise. * tests/graph.scm ("bag DAG, including origins"): Provide 'sha256' field with the right length. * gnu/packages/aspell.scm (aspell-dictionary) (aspell-dict-ca, aspell-dict-it): Use 'hash' and 'content-hash' for proper syntax matching. * gnu/packages/bash.scm (bash-patch): Rename 'sha256' to 'sha256-bv'. * gnu/packages/bootstrap.scm (bootstrap-executable): Rename 'sha256' to 'bv'. * gnu/packages/readline.scm (readline-patch): Likewise. * gnu/packages/virtualization.scm (qemu-patch): Rename 'sha256' to 'sha256-bv'. * guix/import/utils.scm: Hide (gcrypt hash) 'sha256'.
2020-05-22guix hash, guix download: Support base64 format.Ludovic Courtès
* guix/scripts/download.scm (show-help, %options): Support "base64" format. * guix/scripts/hash.scm (show-help, %options): Likewise. * tests/guix-hash.sh: Test it. * doc/guix.texi (Invoking guix hash): Document it.
2020-05-22guix hash, guix download: Add '--hash'.Ludovic Courtès
* guix/scripts/download.scm (%default-options): Add 'hash-algorithm'. (show-help, %options): Add "--hash". (guix-download): Honor it. * guix/scripts/hash.scm (%default-options): Add 'hash-algorithm'. (show-help, %options): Add "--hash". (guix-hash): Honor it. * tests/guix-hash.sh: Test '-H sha512'. * doc/guix.texi (Invoking guix download): Document it. (Invoking guix hash): Document it.
2020-05-22tests: Test fixed-output derivations with several hash algorithms.Ludovic Courtès
* tests/derivations.scm ("fixed-output derivation"): Test several hash algorithms.
2020-05-22tests: Test 'add-to-store' with several hash algorithms.Ludovic Courtès
* tests/store.scm ("add-to-store"): New test.
2020-05-20bootloader: grub: Allow booting from a Btrfs subvolume.Maxim Cournoyer
* gnu/bootloader/grub.scm (strip-mount-point): Remove procedure. (normalize-file): Add procedure. (grub-configuration-file): New BTRFS-SUBVOLUME-FILE-NAME parameter. When defined, prepend its value to the kernel and initrd file names, using the NORMALIZE-FILE procedure. Adjust the call to EYE-CANDY to pass the BTRFS-SUBVOLUME-FILE-NAME argument. Normalize the KEYMAP file as well. (eye-candy): Add a BTRFS-SUBVOLUME-FILE-NAME parameter, and use it, along with the NORMALIZE-FILE procedure, to normalize the FONT-FILE and IMAGE nested variables. Adjust doc. * gnu/bootloader/depthcharge.scm (depthcharge-configuration-file): Adapt. * gnu/bootloader/extlinux.scm (extlinux-configuration-file): Likewise. * gnu/system/file-systems.scm (btrfs-subvolume?) (btrfs-store-subvolume-file-name): New procedures. * gnu/system.scm (operating-system-bootcfg): Specify the Btrfs subvolume file name the store resides on to the `operating-system-bootcfg' procedure, using the new BTRFS-SUBVOLUME-FILE-NAME argument. * doc/guix.texi (File Systems): Add a Btrfs subsection to document the use of subvolumes. * gnu/tests/install.scm (%btrfs-root-on-subvolume-os) (%btrfs-root-on-subvolume-os-source) (%btrfs-root-on-subvolume-installation-script) (%test-btrfs-root-on-subvolume-os): New variables.
2020-05-20file-systems: Add helpers for parsing the options string into an alist.Maxim Cournoyer
* gnu/system/file-systems.scm (file-system-options->alist) (alist->file-system-options): New procedures. * tests/file-systems.scm: New tests. * doc/guix.texi (File Systems): Add note about the newly added procedures.
2020-05-16gexp: Add 'let-system'.Ludovic Courtès
* guix/gexp.scm (<system-binding>): New record type. (let-system): New macro. (system-binding-compiler): New procedure. (default-expander): Add 'self-quoting?' case. (self-quoting?): New procedure. (lower-inputs): Add 'filterm'. Pass the result of 'mapm/accumulate-builds' through FILTERM. (gexp->sexp)[self-quoting?]: Remove. * tests/gexp.scm ("let-system", "let-system, target") ("let-system, ungexp-native, target") ("let-system, nested"): New tests. * doc/guix.texi (G-Expressions): Document it.
2020-05-14pack: Add relocation via ld.so and fakechroot.Ludovic Courtès
* gnu/packages/aux-files/run-in-namespace.c (HAVE_EXEC_WITH_LOADER): New macro. (bind_mount): Rename to... (mirror_directory): ... this. Add 'firmlink' argument and use it instead of calling mkdir/open/close/mount directly. (bind_mount, make_symlink): New functions. (exec_in_user_namespace): Adjust accordingly. (exec_with_loader) [HAVE_EXEC_WITH_LOADER]: New function. (exec_performance): New function. (engines): Add them. * guix/scripts/pack.scm (wrapped-package)[fakechroot-library] [audit-module]: New procedures. [audit-source]: New variable. [build](elf-interpreter, elf-loader-compile-flags): New procedures. (build-wrapper): Use them. * tests/guix-pack-relocatable.sh: Test with 'GUIX_EXECUTION_ENGINE=fakechroot'. * doc/guix.texi (Invoking guix pack): Document the 'performance' and 'fakechroot' engines. * gnu/packages/aux-files/pack-audit.c: New file. * Makefile.am (AUX_FILES): Add it.
2020-05-14pack: Wrapper honors 'GUIX_EXECUTION_ENGINE' environment variable.Ludovic Courtès
* gnu/packages/aux-files/run-in-namespace.c (struct engine): New type. (exec_default): New function. (engines): New variable. (execution_engine): New function. (main): Use it instead of calling 'exec_in_user_namespace' and 'exec_with_proot' directly. * tests/guix-pack-relocatable.sh: Add test with 'GUIX_EXECUTION_ENGINE'. * doc/guix.texi (Invoking guix pack): Document 'GUIX_EXECUTION_ENGINE'.
2020-05-14store: 'mapm/accumulate-builds' preserves '%current-target-system'.Ludovic Courtès
Fixes <https://bugs.gnu.org/41182>. * guix/store.scm (mapm/accumulate-builds): Pass #:system and #:target to 'run-with-store'. * tests/store.scm ("mapm/accumulate-builds, %current-target-system"): New test. * tests/guix-pack.sh: Add 'guix pack -d --target' test.
2020-05-14packages: Ensure bags are insensitive to '%current-target-system'.Ludovic Courtès
Fixes a bug whereby a bag's transitive dependencies would depend on the global '%current-target-system' value. Partly fixes <https://issues.guix.gnu.org/41182>. * guix/packages.scm (bag-transitive-inputs) (bag-transitive-build-inputs, bag-transitive-target-inputs): Parameterize '%current-target-system'. * tests/packages.scm ("package->bag, sensitivity to %current-target-system"): New test.
2020-05-14syscalls: Add 'getxattr'.Jan (janneke) Nieuwenhuizen
* guix/build/syscalls.scm (getxattr): New procedure. * tests/syscalls.scm ("getxattr, setxattr"): Test it, together with setxattr.
2020-05-11guix graph: Add '--path'.Ludovic Courtès
* guix/scripts/graph.scm (display-path): New procedure. (%options, show-help): Add '--path'. (guix-graph): Handle it. * tests/guix-graph.sh: Add tests. * doc/guix.texi (Invoking guix graph): Document it. (Invoking guix size): Mention it.
2020-05-11graph: Add 'shortest-path'.Ludovic Courtès
* guix/graph.scm (shortest-path): New procedure. * tests/graph.scm ("shortest-path, packages + derivations") ("shortest-path, reverse packages") ("shortest-path, references"): New tests.
2020-05-11graph: reference/referrer node types work with graph traversal.Ludovic Courtès
The graph traversal procedures in (guix graph) assume that nodes can be compared with 'eq?', which was not the case for nodes of %REFERENCE-NODE-TYPE and %REFERRER-NODE-TYPE (strings). * guix/scripts/graph.scm (intern): New procedure. (ensure-store-items, references*) (%reference-node-type, non-derivation-referrers) (%referrer-node-type): Use it on all store items. * tests/graph.scm ("node-transitive-edges, references"): New test.
2020-05-11tests: Test 'guix show' with multiple packages.Ludovic Courtès
* tests/guix-package-aliases.sh: Test 'guix show' with multiple packages.
2020-05-07channels: Add mechanism to patch checkouts of the 'guix channel.Ludovic Courtès
* guix/channels.scm (<patch>): New record type. (apply-patches): New procedure. (latest-channel-instance)[dot-git?]: New procedure. Use 'update-cached-checkout' and 'add-to-store' instead of 'latest-repository-commit'. Call 'apply-patches' when CHANNEL is the 'guix channel. (%patches): New variable. * guix/git.scm (url+commit->name): Make public. * tests/channels.scm ("latest-channel-instances includes channel dependencies") ("latest-channel-instances excludes duplicate channel dependencies"): Mock 'update-cached-checkout' instead of 'latest-repository-commit'. Wrap body in 'with-store' and pass the store to 'latest-channel-instances'.
2020-05-05Merge branch 'master' into core-updatesMarius Bakke
2020-05-04openpgp: Add 'string->openpgp-packet'.Ludovic Courtès
* guix/openpgp.scm (string->openpgp-packet): New procedure. * tests/openpgp.scm ("verify-openpgp-signature, missing key") ("verify-openpgp-signature, good signatures") ("verify-openpgp-signature, bad signature"): Use it.
2020-05-04openpgp: 'lookup-key-by-{id,fingerprint}' return the key first.Ludovic Courtès
Previously, 'lookup-key-by-{id,fingerprint}' would always return the list of packets where the primary key is first. Thus, the caller would need to use 'find' to actually find the requested key. * guix/openpgp.scm (keyring-insert): Always add KEY to PACKETS. (lookup-key-by-id, lookup-key-by-fingerprint): Change to return the key as the first value. (verify-openpgp-signature): Remove now unneeded call to 'find'. * tests/openpgp.scm ("get-openpgp-keyring"): Adjust accordingly.
2020-05-04openpgp: 'verify-openpgp-signature' looks up by fingerprint when possible.Ludovic Courtès
* guix/openpgp.scm (verify-openpgp-signature): Use 'lookup-key-by-fingerprint' when SIG contains a fingerprint. Honor FINGERPRINT in the 'find' predicate. Upon missing-key, return FINGERPRINT if available. * tests/openpgp.scm ("verify-openpgp-signature, missing key"): Adjust expected value accordingly.
2020-05-04openpgp: Add 'lookup-key-by-fingerprint'.Ludovic Courtès
* guix/openpgp.scm (<openpgp-keyring>)[table]: Rename to... [ids]: ... this. [fingerprints]: New field. (keyring-insert, lookup-key-by-fingerprint): New procedures. (%empty-keyring): Adjust. (get-openpgp-keyring): Manipulate KEYRING instead of its vhash, use 'keyring-insert'. * tests/openpgp.scm ("get-openpgp-keyring"): Test 'lookup-key-by-fingerprint'.
2020-05-04openpgp: Store the issuer key id and fingerprint in <openpgp-signature>.Ludovic Courtès
* guix/openpgp.scm (<openpgp-signature>)[issuer, issuer-fingerprint]: New fields. (openpgp-signature-issuer, openpgp-signature-issuer-fingerprint): Remove. (verify-openpgp-signature): Use 'openpgp-signature-issuer-key-id'. (get-signature): Initialize 'issuer' and 'issuer-fingerprint'. * tests/openpgp.scm ("get-openpgp-detached-signature/ascii"): Adjust accordingly.
2020-05-04openpgp: Decode the issuer-fingerprint signature subpacket.Ludovic Courtès
* guix/openpgp.scm (SUBPACKET-ISSUER-FINGERPRINT): New variable. (openpgp-signature-issuer-fingerprint): New procedure. (key-id-matches-fingerprint?): New procedure. (get-signature): Look for the 'issuer and 'issuer-fingerprint subpackets. Ensure the issuer key ID matches the fingerprint when both are available. (parse-subpackets): Handle SUBPACKET-ISSUER-FINGERPRINT. * tests/openpgp.scm (%rsa-key-fingerprint) (%dsa-key-fingerprint, %ed25519-key-fingerprint): New variables. * tests/openpgp.scm ("get-openpgp-detached-signature/ascii"): Check the result of 'openpgp-signature-issuer-fingerprint'.
2020-05-04Add (guix openpgp).Ludovic Courtès
* guix/openpgp.scm, tests/openpgp.scm, tests/civodul.key, tests/dsa.key, tests/ed25519.key, tests/rsa.key, tests/ed25519.sec: New files. * Makefile.am (MODULES): Add guix/openpgp.scm. (SCM_TESTS): Add tests/openpgp.scm. (EXTRA_DIST): Add tests/*.key and tests/ed25519.sec.
2020-04-30Merge branch 'master' into core-updatesMarius Bakke
Conflicts: gnu/local.mk gnu/packages/backup.scm gnu/packages/emacs-xyz.scm gnu/packages/guile.scm gnu/packages/lisp.scm gnu/packages/openldap.scm gnu/packages/package-management.scm gnu/packages/web.scm gnu/packages/xorg.scm
2020-04-27tests: Remove trailing commas in JSON tests.Ludovic Courtès
These commas are rejected by Guile-JSON 3.5.0. * tests/crate.scm (test-foo-dependencies) (test-root-dependencies, test-intermediate-1-dependencies) (test-intermediate-2-dependencies): Remove trailing commas. * tests/gem.scm (test-bar-json): Likewise. * tests/pypi.scm (test-json): Likewise.
2020-04-26profiles: Add lowerable <profile> record type.Ludovic Courtès
* guix/profiles.scm (<profile>): New record type. * tests/profiles.scm ("<profile>"): New test.
2020-04-24Merge branch 'master' into core-updatesMarius Bakke
2020-04-24pack: 'guix pack -R' wrapper correctly reports exit code.Ludovic Courtès
Fixes <https://bugs.gnu.org/40816>. Reported by Jan (janneke) Nieuwenhuizen <janneke@gnu.org>. * gnu/packages/aux-files/run-in-namespace.c (main): In the 'default' case, check 'WIFEXITED (status)' and exit with the corresponding code in that case. Exit with 255 in other cases. * tests/guix-pack-relocatable.sh: Add test.
2020-04-23Merge branch 'master' into core-updatesMarius Bakke
Conflicts: etc/news.scm gnu/local.mk gnu/packages/bootloaders.scm gnu/packages/linphone.scm gnu/packages/linux.scm gnu/packages/tls.scm gnu/system.scm
2020-04-20tests: Update expected values for package->code.Ricardo Wurmus
Reported by janneke on IRC. * tests/print.scm: Update expected package definitions produced by package->code.
2020-04-11gnu: commencement: Memoize packages as a function of the system.Ludovic Courtès
Previous, things like 'ld-wrapper-boot0' would be memoized with (mlambda () …). However, the definition of 'ld-wrapper-boot0' depends on the result of (%boot0-inputs), which is itself a function of (%current-system). Thus, if one first calls: (parameterize ((%current-system "x86_64-linux")) (ld-wrapper-boot0)) then, in all subsequent calls to 'ld-wrapper-boot0', the value of (%current-system) would be ignored because the result is already memoized. Concretely, 'ld-wrapper-boot0' would always have the dependencies it has on x86_64-linux, even though they are different than those on armhf-linux, say ("bash-mesboot" vs. "bootstrap-binaries"). Fixes <https://bugs.gnu.org/40482>. Reported by Marius Bakke <mbakke@fastmail.com>. * gnu/packages/commencement.scm (define/system-dependent): New macro. (linux-libre-headers-boot0, hurd-core-headers-boot0, ld-wrapper-boot0) (gcc-boot0-intermediate-wrapped, gcc-boot0-wrapped, ld-wrapper-boot3): Define using 'define/system-dependent' instead of 'define' + 'mlambda'. Adjust users so they no longer look like procedure calls. * tests/guix-build.sh: Add test.
2020-04-08Merge branch 'master' into core-updatesMarius Bakke
Conflicts: etc/news.scm gnu/local.mk gnu/packages/check.scm gnu/packages/cross-base.scm gnu/packages/gimp.scm gnu/packages/java.scm gnu/packages/mail.scm gnu/packages/sdl.scm gnu/packages/texinfo.scm gnu/packages/tls.scm gnu/packages/version-control.scm
2020-04-04tests: Adjust '--with-commit' test for tags.Ludovic Courtès
This is a followup to efa578ecaece67366b4b0e2266de7c2faaa4ae54. * tests/guix-build-branch.sh: Adjust '--with-commit=guile-gcrypt=v0.1.0' test to expect the tag ID rather than the commit ID.
2020-04-04store: 'with-store' doesn't close the store upon abort.Ludovic Courtès
Fixes <https://bugs.gnu.org/40428>. Reported by Marius Bakke <mbakke@fastmail.com> and 白い熊. Regression introduced with the first uses of 'with-build-handler' in commit 62195b9a8fd6846117c5d7698842748300d13e31 and subsequent. * guix/store.scm (call-with-store): Use 'catch #t' instead of 'dynamic-wind'. This ensures STORE remains open when a non-local exit other than an exception occurs, such as an abort to the build handler prompt. * tests/store.scm ("with-build-handler + with-store"): New test.
2020-03-31pack: Adjust test to '--dry-run' changes.Ludovic Courtès
This is a followup to 131f50cdc9dbb7183023f4dae759876a9e700bef. * tests/guix-pack.sh: Use '--no-grafts' in conjunction with '-n' and '-d'.
2020-03-31guix package: Do not misdiagnose upgrades when there are propagated inputs.Ludovic Courtès
Fixes <https://bugs.gnu.org/35872>. Reported by Andy Tai <atai@atai.org>. * guix/profiles.scm (list=?, manifest-entry=?): New procedures. * guix/scripts/package.scm (transaction-upgrade-entry): In the '=' case, use 'manifest-entry=?' to determine whether it's an upgrade. * tests/packages.scm ("transaction-upgrade-entry, zero upgrades, propagated inputs"): New test.
2020-03-31guix package: Add 'transaction-upgrade-entry' test.Ludovic Courtès
* tests/packages.scm ("transaction-upgrade-entry, zero upgrades, equivalent package"): New test.
2020-03-31guix package: 'transaction-upgrade-entry' swallows build requests.Ludovic Courtès
Fixes a regression introduced in 131f50cdc9dbb7183023f4dae759876a9e700bef whereby the install/upgrade message would not be displayed: $ guix upgrade -n 2.1 MB would be downloaded: /gnu/store/…-something-1.2 /gnu/store/…-its-dependency-2.3 This is because we'd directly abort from 'transaction-upgrade-entry' to the build handler of 'build-notifier'. * guix/scripts/package.scm (transaction-upgrade-entry): Call 'string=?' expression in 'with-build-handler'. * tests/packages.scm ("transaction-upgrade-entry, grafts"): New test.
2020-03-30Merge branch 'master' into core-updatesMarius Bakke
Conflicts: gnu/packages/admin.scm gnu/packages/commencement.scm gnu/packages/guile.scm gnu/packages/linux.scm gnu/packages/package-management.scm gnu/packages/pulseaudio.scm gnu/packages/web.scm
2020-03-29store: Add 'map/accumulate-builds'.Ludovic Courtès
* guix/store.scm (<unresolved>): New record type. (build-accumulator, map/accumulate-builds, mapm/accumulate-builds): New procedures. * tests/store.scm ("map/accumulate-builds", "mapm/accumulate-builds"): New tests.
2020-03-27Merge branch 'master' into core-updatesMarius Bakke
Conflicts: gnu/packages/icu4c.scm gnu/packages/man.scm gnu/packages/python-xyz.scm guix/scripts/environment.scm guix/scripts/pack.scm guix/scripts/package.scm guix/scripts/pull.scm guix/store.scm
2020-03-25tests: Adjust to 'show-manifest-transaction' changes.Ludovic Courtès
This is a followup to 3e5ab0a7a9399bb098b9ced46bf3cbf4085c6bab. * tests/ui.scm ("show-manifest-transaction"): Update regexp. * tests/guix-package.sh: Adjust Emacs regexp in --with-source test.