The tests currently fail when run on riscv-linux (affecting the guix package)
because Guile 3 is used as the bootstrap guile. Correcting the package
version seems hard, so I'm just tweaking the tests to use the right effective
version for riscv64-linux.
* tests/gexp.scm (bootstrap-guile-effective-version): New procedure.
("gexp->derivation & with-extensions", "lower-gexp", "lower-gexp,
raw-derivation-file"): Use bootstrap-guile-effective-version.
Change-Id: I3995e1f6b58ada1baf38a8ec55b0173059dd0079
Fixes <https://issues.guix.gnu.org/71979>.
* guix/modules.scm (file-name->module-name): Strip leading “.” component
from FILE.
* tests/modules.scm ("file-name->module-name")
("file-name->module-name, leading dot"): New tests.
Reported-by: Tomas Volf <~@wolfsden.cz>
Change-Id: I3d1b9f3f21448050cac4f3b1aed5f8f03758d4c9
Cached checkouts could end up with stale untracked files, for example
because the checkout was interrupted. As a result, when this happens
for the Guix checkout, users would not get substitutes for ‘guix pull’.
* guix/git.scm (delete-untracked-files): New procedure.
(switch-to-ref): Use it.
* tests/git.scm ("update-cached-checkout, untracked files removed"): New
test.
Co-authored-by: Ricardo Wurmus <rekado@elephly.net>
Change-Id: Iccbe644ade396ad27a037db7e0ef1c2a68ef91ce
* guix/scripts/build.scm (options->derivations)[compute-derivation]:
Pass ‘system’ to ‘package-source-derivation’.
* tests/guix-build.sh: Test ‘-S’ together with ‘-s’.
Change-Id: If35f116285dd9caaf939221163ad0ba831eea993
This is a followup to e5078ff321, which
broke this test:
$ guix system disk-image -n gnu/system/examples/desktop.tmpl
guix system: warning: 'disk-image' is deprecated: use 'image' instead
guix system: error: EFI bootloader required with GPT partitioning
* tests/guix-system.sh: Use ‘guix system image’ instead of ‘guix system
disk-image’. Pass ‘-t efi-raw’ for ‘desktop.tmpl’.
Change-Id: I6877085ab33d9e8b471315b806fed22a7d1241a3
This is a followup to 510ad5d93c.
* tests/import-utils.scm ("beautify-description: transform fragment into
sentence"): Fix.
Change-Id: I331cb38a3460a024a789846772a074ba0b6c857c
* guix/import/utils.scm (beautify-description): Append period to last
words which do not end with one.
* tests/crate.scm: Append period to descriptions.
* tests/elm.scm: Append period to descriptions.
* tests/gem.scm: Append period to descriptions.
* tests/hexpm.scm: Append period to descriptions.
* tests/minetest.scm: Append period to descriptions.
* tests/pypi.scm: Append period to descriptions.
* tests/import-utils.scm ("beautify-description: transform fragment into
sentence"): Likewise.
Change-Id: I0b12c4d94cb26cf62fab5b7cbf7885e66ff6c10f
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This reduces disk usage of sparse files that are substituted such as
Guile object files (ELF files). As of Guile 3.0.9, .go files are sparse
due to ELF sections being aligned on 64 KiB boundaries.
This reduces disk usage reported by “du -sh” by 9% for the ‘guix’
package, by 23% for ‘guile’, and by 35% for ‘guile-git’.
* guix/store/deduplication.scm (hole-size, find-holes): New procedures.
(tee)[seekable?]: New variable.
[read!]: Add case when SEEKABLE? is true.
* tests/store-deduplication.scm (cartesian-product): New procedure.
("copy-file/deduplicate, sparse files (holes: ~a/~a/~a)"): New test set.
Change-Id: Iad2ab7830dcb1220e2026f4a127a6c718afa8964
* tests/syscalls.scm ("terminal-string-width Japanese"): Skip when the
encoding of (current-output-port) is not UTF-8.
Reported-by: Ashvith Shetty <ashvithshetty10@gmail.com>
Change-Id: Ic284dd088d6b148d6fcb457290a28fdb0838b83d
* guix/scripts/git/authenticate.scm (%default-options): Remove
‘keyring-reference’.
(config-value, configured-introduction, configured-keyring-reference)
(configured?, record-configuration, current-branch): New procedures.
(guix-git-authenticate)[missing-arguments]: New procedure.
Use ‘configured-introduction’ when zero arguments are given.
Use ‘configured-keyring-reference’ when ‘-k’ is not passed. Add call to
‘record-configuration’.
* doc/guix.texi (Invoking guix git authenticate): Document it.
Change-Id: I66e111a83f50407b52da71662629947f83a78bbc
These names should be more descriptive.
* guix/store/database.scm (path-id): Rename to select-valid-path-id.
(sqlite-register): Rename to register-valid-path.
(register-items): Update accordingly.
Change-Id: I6d4a14d4cde9d71ab34d6ffdbfbfde51b2c0e1db
Fixes <https://issues.guix.gnu.org/69070>.
* guix/swh.scm (branch-target): Add clause for 'directory and 'alias.
(lookup-origin-revision): Iterate over all the visits of ORIGIN instead
of just the first one. Handle the case where ‘branch-target’ returns
something other than a release or revision.
* tests/swh.scm ("lookup-origin-revision"): New test.
Change-Id: I7f636739a719908763bca1d3e7376341dd62e816
Until now, ‘save-origin’ would be called only when given a
<git-reference>. With this change, ‘save-origin’ gets called for other
version control systems as well.
* guix/lint.scm (swh-response->warning): New procedure, formerly in
‘check-archival’.
(vcs-origin, save-package-source): New procedures.
(check-archival)[response->warning]: Remove.
Call ‘save-package-source’ in both the Git and the non-Git cases.
* tests/lint.scm ("archival: missing svn revision"): New test.
Change-Id: I535e4ec89488faf83bfa544d5e4935fa73ef54fb
While this method is new and nar-sha256 ExtIDs are currently available
only for new visits, it is fundamentally more reliable than the other
methods, which is why it comes first.
* guix/lint.scm (check-archival)[lookup-by-nar-hash]: New procedure.
Call ‘lookup-by-nar-hash’ before the other lookup methods.
* tests/lint.scm ("archival: content available")
("archival: content unavailable but disarchive available")
("archival: missing revision")
("archival: revision available"): Add a 404 response corresponding to
the ‘lookup-external-id’ request.
* tests/lint.scm ("archival: nar-sha256 extid available"): New test.
Change-Id: I4a81d6e022a3b72e6484726549d7fbae627f8e73
This interface was deployed at archive.softwareheritage.org a few days
ago. Our main use case will be looking up directories by “nar-sha256”
hashes.
* guix/swh.scm (<external-id>): New JSON-mapped record type.
(lookup-external-id, lookup-directory-by-nar-hash): New procedures.
* tests/swh.scm (%external-id): New variable.
("lookup-directory-by-nar-hash"): New test.
Change-Id: Ib671c7798aeb6f8132ac78f2b06b9285da8e7bd5
Previously, ‘latest-channel-instances’ would perform a depth-first
traversal of channels. Since dependencies specified in ‘.guix-channel’
are usually less specific that those provided by the user, this would
lead to the use of instances corresponding to those less specific specs,
which in turn might declare dependencies that do not exist for the more
specific instances.
This commit changes ‘latest-channel-instances’ to perform a
breadth-first traversal, thereby giving user-supplied channels higher
precedence over dependencies found via ‘.guix-channel’.
Fixes <https://issues.guix.gnu.org/68822>.
* guix/channels.scm (latest-channel-instances)[ignore?]: Remove.
[instance-name, same-named?, more-specific?]: New procedures.
Rewrite as a breadth-first traversal using a regular loop.
* tests/channels.scm ("latest-channel-instances reads dependencies from most-specific instance"):
New test.
Change-Id: Iba518145cfd209f04293a56246dbfee3b714650b
* tests/channels.scm ("latest-channel-instances excludes duplicate channel dependencies"):
Use ‘equal?’ rather than ‘string=?’ since we can get #f.
Change-Id: I437b9d7e23200cf0c98b1593e68b1d355bc2de01
* guix/scripts/download.scm (git-download-to-store*): Add new variable.
(copy-recursively-without-dot-git): New variable.
(git-download-to-file): Add new variable.
(show-help): Add 'git', 'commit', 'branch' and 'recursive'options
help message.
(%default-options): Add default value for 'git-reference' and
'recursive' options.
(%options): Add 'git', 'commit', 'branch' and 'recursive' command
line options.
(guix-download) [hash]: Compute hash with 'file-hash*' instead of
'port-hash' from (gcrypt hash) module. This allows us to compute
hashes for directories.
* doc/guix.texi (Invoking guix-download): Add @item entries for
`git', `commit', `branch' and `recursive' options. Add a paragraph in
the introduction.
* tests/guix-download.sh: New tests. Move variables and trap definition
to the top of the file.
Change-Id: Ic2c428dca4cfcb0d4714ed361a4c46609339140a
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Reviewed-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
* doc/guix.texi (Invoking guix import): Mention '--allow-yanked'.
* guix/import/crate.scm (make-crate-sexp): Add yanked? argument. For
yanked packages, use the full version suffixed by "-yanked" for
generated variable names and add a comment and package property.
(crate->guix-package): Add allow-yanked? argument and if it is set to #t,
allow importing yanked crates if no other version matching the
requirements exists.
[find-package-version]: Packages previously marked as yanked are only
included if allow-yanked? is #t and then take the lowest priority.
[find-crate-version]: If allow-yanked? is #t, also consider yanked
versions with the lowest priority.
[dependency-name+version]: Rename to ...
[dependency-name+version+yanked] ...this. Honor allow-yanked? and choose
between an existing package and an upstream package. Exit with an error
message if no version fulfilling the requirement is found.
[version*]: Exit with an error message if the crate version is not found.
(cargo-recursive-import): Add allow-yanked? argument.
* guix/read-print.scm: Export <comment>.
* guix/scripts/import/crate.scm: Add "--allow-yanked".
* tests/crate.scm: Add test 'crate-recursive-import-only-yanked-available'.
[sort-map-dependencies]: Adjust accordingly.
[remove-yanked-info]: New variable.
Adjust test 'crate-recursive-import-honors-existing-packages'.
(test-bar-dependencies): Add yanked dev-dependencies.
(test-leaf-bob-crate): Add yanked versions.
(rust-leaf-bob-3.0.2-yanked): New variable.
Signed-off-by: Efraim Flashner <efraim@flashner.co.il>
Change-Id: I175d89b39774e6b57dcd1f05bf68718d23866bb7
* tests/crate.scm: Import only sha256 from (gcrypt hash) as gcrypt-sha256 to
prevent a name collision. Rename test 'cargo-recursive-import' to
'crate-recursive-import' and 'cargo-recursive-import-hoors-existing-packages'
to 'crate-recursive-import-honors-existing-packages'. Mock
find-packages-by-name from (gnu packages). Adjust test to import fake 'bar'
crate instead of doctool.
(test-bar-crate): New variable.
(test-bar-dependencies): New variable.
(test-root-crate): Adjust sha256 -> gcrypt-sha256.
(test-doctool-crate,test-doctool-dependencies): Remove variables.
(rust-leaf-bob-3): New variable.
Signed-off-by: Efraim Flashner <efraim@flashner.co.il>
If --recursive-dev-dependencies is specified, development dependencies
are also included for all recursively imported packages.
* doc/guix.texi (Invoking guix import): Mention --recursive-dev-dependencies.
* guix/import/crate.scm (crate-recursive-import): Add
recursive-dev-dependencies? argument.
* guix/scripts/import/crate.scm (show-help, guix-import-crate): Add
"--recursive-dev-dependencies".
* tests/crate.scm: Test both #f and #t for #:recursive-dev-dependencies?
in the 'cargo-recursive-import' test.
(test-root-dependencies): Add intermediate-c as dev-dependency.
(test-intermediate-c-crate, test-intermediate-c-dependencies): New
variables.
Signed-off-by: Efraim Flashner <efraim@flashner.co.il>
Change-Id: Iae89794681155d77f128733120e60f03bc297717
* guix/import/go.scm (go-package, go.mod-go-version): New procedures.
(go-module->guix-package): Add the #:go keyword in the generated package
definition if the required go is newer than the default go.
* tests/go.scm (mock-http-get): Use gexps for package arguments.
Change-Id: I8d005740a442330ac307a40a53764c803ceffc4f
Fixes a bug whereby ‘package->development-manifest’ would run with the
wrong system in mind, leading to errors like this:
$ guix shell -s i586-gnu -D shepherd --no-grafts
guix shell: error: package linux-libre-headers@5.15.49 does not support i586-gnu
* guix/scripts/environment.scm (options/resolve-packages): Define
‘system’ and pass it to ‘package->development-manifest’.’
* tests/guix-shell.sh: Test it.
Change-Id: I95c471c1918913ab80dec7d3ca64fe38583cce78
Fixes <https://issues.guix.gnu.org/67575>.
* guix/scripts/substitute.scm (process-substitution/fallback): Use
‘report-error’ instead of ‘leave’. Write status line to PORT.
* tests/substitute.scm ("substitute, narinfo is available but nar is
missing"): Adjust accordingly.
Change-Id: Ic7297dbd563c007111ec2167c8d52505a07d4822
* guix/import/cabal.scm (eval-cabal)[eval]: Split imports to a
normalized list before mapping over it.
* tests/hackage.scm: Test it.
Change-Id: I39ece019251b6a23a937c8562d2d4a545a6bc7df
Signed-off-by: Lars-Dominik Braun <lars@6xq.net>
Cabal consideres lines to be part of a layout block if they are indented
at least one space more than the field line the block belongs to.
Previously Guix considered lines to be a part of the block if they were
indented at least as much as the first line in it.
This also makes a workaround that enabled if statements to have multiple
elses redundant and removes it.
Fixes: https://issues.guix.gnu.org/35743
* guix/import/cabal.scm (current-indentation*): Renamed from
current-indentation.
(previous-indentation, current-indentation): New variables.
(make-cabal-parser): Remove outdated comment.
[open]: Use previous-indentation + 1 instead of
current-indentation.
[elif-else]: Split to elif and else to allow only one ELSE in an if
statement.
(read-cabal)[parameterize]: Use current-indentation* and previous-indentation.
* tests/hackage.scm (hackage->guix-package test mixed layout): Expect to
pass.
Change-Id: I3a1495b1588a022fabbfe8dad9f3231e578af4f3
Signed-off-by: Lars-Dominik Braun <lars@6xq.net>
Fixes a test failure introduced in
189525412e.
* guix/progress.scm: Autoload (guix build syscalls).
* tests/gexp.scm ("gexp->derivation, store copy"): Add (guix build
syscalls) to the list of imported modules. Use ‘with-imported-modules’
rather than #:modules.
Change-Id: I8d3fe90f564ef4b1a340f34cee6c08a741f7b836
Fixes a bug whereby ‘guix locate --clear’ would end with the “no files
to search for” error.
Fixes <https://issues.guix.gnu.org/66799>.
* guix/scripts/locate.scm (guix-locate): Do not emit “no files to search
for” error when 'clear? is set in OPTS.
* tests/guix-locate.sh: Test it.
Reported-by: Maciej Kalandyk <m.kalandyk@outlook.com>
Change-Id: Ib8fa125c18481d7f5408bd89df9503713527641d
The test as added in 79ec651a28 had no
effect: first because ‘guix time-machine --commit=X’, not followed by a
command, does nothing, and second because the “! COMMAND” shell stanza
does not have the desired effect (see <https://issues.guix.gnu.org/62406>).
This change rewrites the test to make it effective.
* tests/guix-time-machine.sh: Rewrite.
Change-Id: Ib44a11331c8625e346139a236cffa699cdbd02f2
This is a followup to 1328c4cca5, which
led to failures for tests that were not prepared to cope with that.
* tests/guix-environment-container.sh (hello_drv_nested): Pass “-E
GUIX_BUILD_OPTIONS” so ‘--no-grafts’ is passed.
* tests/guix-pack.sh (GUIX_BUILD_OPTIONS): Add ‘--no-grafts’.
* tests/transformations.scm ("options->transformation, with-graft"):
Skip when ‘glibc-final’ has a replacement.
Change-Id: Ia65c9aeb06f524252815b8290a5ca7bf97ee8136