This is a followup to a2c759c830.
* guix/scripts/system/reconfigure.scm (running-services): Fill in the
'transient?' field of <live-service>.
* 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"): Adjust calls to 'live-service'.
* gnu/packages.scm (package-unique-version-prefix): New procedure.
* guix/scripts/package.scm (manifest-entry-version-prefix): Use it.
* tests/packages.scm ("package-unique-version-prefix, gcc@8")
("package-unique-version-prefix, grep"): New tests.
* guix/scripts/home/import.scm (generate-bash-configuration+modules):
Define 'alias-rx'.
[bash-alias->pair]: Use it.
* tests/home-import.scm (match-home-environment-bash-service-with-alias):
New variable.
("manifest->code: Bash service with aliases"): New test.
* guix/scripts/home.scm (show-help, %options): Add '--network',
'--share', and '--expose'.
(not-config?, user-shell, spawn-home-container): New procedures.
(%default-system-profile): New variable.
(perform-action): Add #:file-system-mappings, #:container-command,
and #:network?; honor them.
(process-action): Adjust accordingly.
(guix-home)[parse-sub-command]: Add "container".
[parse-args]: New procedure.
Use it instead of 'parse-command-line'.
* tests/guix-home.sh: Add tests.
* doc/guix.texi (Declaring the Home Environment): Mention 'guix home
container' as a way to test configuration.
(Invoking guix home): Document it.
Until now these two actions were silently ignored.
* guix/scripts/home.scm (show-help, %options): Add "--graph-backend".
(%default-options): Add 'graph-backend' key.
(export-extension-graph, export-shepherd-graph): New procedures.
(perform-action): Add #:graph-backend parameter. Add cases for the
'extension-graph' and 'shepherd-graph' actions.
(process-action): Pass #:graph-backend to 'perform-action'.
* guix/scripts/system.scm (service-node-type)
(shepherd-service-node-type): Export
* tests/guix-home.sh: Add tests.
* doc/guix.texi (Invoking guix home): Document it.
Previously, when reading an incompatible "parameters" file, 'guix
system' would print a warning and then crash with a wrong-type-arg
backtrace because code expects 'read-boot-parameters' to always return a
<boot-parameters> record.
* gnu/system.scm (read-boot-parameters): Upon incompatibility, raise an
error instead of returning #f. Also raise a '&fix-hint' condition.
* tests/boot-parameters.scm ("read, construction, mandatory fields"):
Define 'test-read-boot-parameters' as a macro; expect
'formatted-message?' exceptions rather than #f returns.
Fixes <https://issues.guix.gnu.org/53915>.
Reported by Gordon Quad <gordon@niflheim.info>.
* guix/packages.scm (replace-input): Preserve the outputs of INPUT by
default.
* tests/packages.scm ("modify-inputs, replace, extra output"): New test.
This addresses the following backtrace from
"guix lint -c wrapper-inputs hostapd":
Backtrace:ostapd@2.10 [wrapper-inputs]...
[...]
174:9 3 (gexp->approximate-sexp #<gexp (modify-phases %standard?>)
In srfi/srfi-1.scm:
586:17 2 (map1 (#<gexp-output out> #<gexp-input "pkg-config":o?>))
In guix/gexp.scm:
175:16 1 (_ _)
In ice-9/boot-9.scm:
1685:16 0 (raise-exception _ #:continuable? _)
ice-9/boot-9.scm:1685:16: In procedure raise-exception:
Throw to key `match-error' with args `("match" "no matching pattern" #<gexp-output out>)'.
* guix/gexp.scm (gexp->approximate-sexp): Handle the case where 'reference' is
a <gexp-output>,, by returning (*approximate*).
* tests/gexp.scm ("gexp->approximate-sexp, outputs"): Test it.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This fixes a false-positive in the linter:
guix lint -c 'wrapper-inputs' libaio
* guix/gexp.scm (gexp->approximate-sexp): Allow the 'thing' in <gexp-input> to
be a sexp, without approximation, by testing if it is a record.
* tests/gexp.scm ("unquoted sexp (not a gexp!)"): Test it.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
emacs-build-system sets #:tests? #f by default, so the linter shouldn't warn
if #:tests? #t is set for packages using emacs-build-system. Likewise for
texlive-build-system.
* guix/lint.scm (check-tests-true): Do not warn if the build system
is emacs-build-system or texlive-build-system.
* tests/lint.scm
("tests-true: #:tests? #t acceptable for emacs packages")
("tests-true: #:tests? #t acceptable for texlive packages"): New tests.
Fixes: <https://issues.guix.gnu.org/50299>
Reported-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Fixes <https://issues.guix.gnu.org/54209>.
* guix/derivations.scm (coalesce-duplicate-inputs): Use the output paths
of DRV as a hash table key.
* tests/derivations.scm ("derivation with duplicate fixed-output
inputs"): Expect a single input for FINAL.
("derivation with equivalent fixed-output inputs"): New test.
This version field exposes the (already present) version information of a boot
parameters file.
* gnu/system.scm (%boot-parameters-version): New variable.
(<boot-parameters>)[version]: New field.
(read-boot-parameters): Use it.
(operating-system-boot-parameters-file): Likewise.
* tests/boot-parameters.scm (test-read-boot-parameters): Use
%boot-parameters-version as the default version value in the template.
Fixes <https://issues.guix.gnu.org/51801>.
Reported by Maxim Cournoyer <maxim.cournoyer@gmail.com>.
* guix/scripts/build.scm (options->derivations)[warn-if-unsupported]:
New procedure.
[compute-derivation]: Use it.
* tests/guix-build.sh: Add test.
Previously user-facing commands would happily start building packages
even if they do not support that system. With this change, all the
user-facing commands reject unsupported packages without going further.
* guix/profiles.scm (profile-derivation): Add #:allow-unsupported-packages?.
Define 'check-supported-packages' and honor #:allow-unsupported-packages?.
* tests/guix-pack.sh, tests/guix-package.sh, tests/guix-shell.sh: Ensure
that unsupported packages are rejected.
* tests/guix-system.sh: Pass "--system=armhf-linux" when attempting to
build gnu/system/examples/asus-c201.tmpl.
Previously 'package-transitive-supported-systems' would enter an
infinite loop over the cross-compilation tool chain if
%CURRENT-TARGET-SYSTEM was set.
* guix/packages.scm (package-transitive-supported-systems)[supported-systems-procedure]:
Pass explicit SYSTEM and TARGET parameters.
* tests/packages.scm ("supported-package? vs. %current-target-system"):
New test.
Read hash extensions preserve source location info as source properties
on their result. However, in Guile 3.0.8, that location would be
dismissed, leading 'local-file' to fail to resolve file names relative
to the source directory.
Fixes <https://issues.guix.gnu.org/54003>.
Reported by Aleksandr Vityazev <avityazev@posteo.org>.
* guix/gexp.scm <eval-when> [read-syntax-redefined?, read-procedure]
[read-syntax*]: New variables.
[read-ungexp]: Adjust to expect either sexps or syntax objects.
[read-gexp]: Call 'read-procedure'.
* tests/gexp.scm ("local-file, relative file name, within gexp")
("local-file, relative file name, within gexp, compiled"): New tests.
Fixes a regression whereby, when cross-compiling, 'computed-file' would
use a cross-compiled Guile as its builder, which would fail to run.
Regression introduced in af57d1bf6c (the
problem had always been there but was hidden before behind the (not guile)
condition.)
* guix/gexp.scm (computed-file-compiler): For 'guile', pass #:target #f.
* tests/gexp.scm ("lower-object, computed-file, #:target"): New test.
This will allow mirror operators to alter these non-normative bits of a
narinfo without having to resign narinfos.
* guix/scripts/publish.scm (narinfo-string): Remove
URL/Compression/FileSize from BASE-INFO. Move them after "Signature".
* tests/publish.scm ("/*.narinfo")
("/*.narinfo with properly encoded '+' sign")
("/*.narinfo with lzip + gzip")
("with cache, lzip + gzip"): Adjust accordingly.
* tests/substitute.scm ("query narinfo with signature over relevant subset"):
New test.
Fixes a bug whereby authentication of a commit *not* descending from the
introductory commit could succeed, provided the commit verifies the
authorization invariant.
In the example below, A is a common ancestor of the introductory commit
I and of commit X. Authentication of X would succeed, even though it is
not a descendant of I, as long as X is authorized according to the
'.guix-authorizations' in A:
X I
\ /
A
This is because, 'authenticate-repository' would not check whether X
descends from I, and the call (commit-difference X I) would return X.
In practice that only affects forks because it means that ancestors of
the introductory commit already contain a '.guix-authorizations' file.
* guix/git-authenticate.scm (authenticate-repository): Add call to
'commit-descendant?'.
* tests/channels.scm ("authenticate-channel, not a descendant of introductory commit"):
New test.
* tests/git-authenticate.scm ("authenticate-repository, target not a descendant of intro"):
New test.
* tests/guix-git-authenticate.sh: Expect earlier test to fail since
9549f0283a is not a descendant of
$intro_commit. Add new test targeting an ancestor of the introductory
commit, and another test targeting the v1.2.0 commit.
* doc/guix.texi (Specifying Channel Authorizations): Add a sentence.
These tests mimic similar tests already in 'tests/channels.scm', but
without using the higher-level 'authenticate-channel'.
* tests/git-authenticate.scm ("introductory commit, valid signature")
("introductory commit, missing signature")
("introductory commit, wrong signature"): New tests.
Fixes a regression introduced in
af57d1bf6c whereby tests would end up
building the world.
* guix/gexp.scm (mixed-text-file): Add #:guile parameter and honor it.
* tests/gexp.scm ("mixed-text-file"): Pass #:guile to 'mixed-text-file'.
("file-union"): Pass #:guile to 'file-union'.
("lower-object, computed-file"): Pass #:guile to 'computed-file'.
("lower-object, computed-file + grafts"): Likewise.
* tests/packages.scm ("origin->derivation, single file with snippet"):
Likewise.
* tests/profiles.scm ("profile-derivation, ordering & collisions"):
Likewise.
* guix/tests.scm (test-file): Likewise.
* guix/import/pypi.scm (find-project-url): New function.
(make-pypi-sexp): Use find-project-url.
* tests/pypi.scm (foo-json): New procedure.
(test-json-1, test-json-2): Define in terms of it.
("find-project-url, with numpy", "find-project-url, uWSGI"):
("find-project-url, flake8-array-spacing")
("find-project-url, foo/goo"): New tests.
Co-authored-by: Ludovic Courtès <ludo@gnu.org>
Fixes <https://issues.guix.gnu.org/53267>.
Reported by Tirifto <tirifto@posteo.cz>.
Regression introduced in 65ffb9388c.
In the (unlikely) case where the profile we're targeting with "guix
upgrade -n" or similar is already built, a new profile generation would
be created and linked to despite the use of '-n'. This is because
65ffb9388c assumed that dry-run behavior
would be handled solely by the build handler, which is not the case when
there's nothing to build.
* guix/scripts/package.scm (build-and-use-profile): Reintroduce #:dry-run?
and honor it.
(process-actions): Pass #:dry-run? to 'build-and-use-profile'.
* tests/guix-package-net.sh: Add test.
Fixes: <https://issues.guix.gnu.org/52943>.
* tests/gremlin.scm (file-needed/recursive)[ground-truth]: On aarch64-linux,
remove the dynamic linker from this list.
Fixes a regression introduced in
a773c3142d, which would lead the first
'trap' to be ignored, thereby leaving 't-guix-graph-*' directories
behind it.
* tests/guix-graph.sh: Remove first 'trap' line that had no effect;
replace second 'trap' line.
* Makefile.am (SCM_TESTS): Register new tests.
* guix/import/github.scm
(%github-api): New variable.
(fetch-releases-or-tags): Use the new variable.
* tests/import-github.scm: New file with tests.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* guix/build/utils.scm (wrap-script):
Don't add (car cl) one too many times, cl its self contains it's car.
Split the aguments string with string-tokenize to avoid leaving an empty
string argument when there should be none. These two bugs seemed to
be partially cancelling each other out so that scripts still worked when
ran with no arguments.
* tests/build-utils.scm: Adjust wrap-script to above changes.
Add two tests to ensure the command line arguments appear identical to a
script and its wrapped version.
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
* guix/scripts/style.scm (canonicalize-comment): New procedure.
(pretty-print-with-comments): Add #:format-comment. and honor it.
(object->string*): Add 'args' and honor them.
(format-package-definition): Pass #:format-comment to
'object->string*'.
* tests/style.scm ("pretty-print-with-comments, canonicalize-comment"):
New test.
This allows us to express cases where a newline should be inserted
immediately after the head symbol of a list.
* guix/scripts/style.scm (%newline-forms): New variable.
(newline-form?): New procedure.
(pretty-print-with-comments): Handle "newline forms".
* tests/style.scm: Add test.
* guix/scripts/style.scm (vhashq): New macro.
(%special-forms): New variable.
(special-form?): New procedure.
(pretty-print-with-comments): Add many clauses and tweak existing
rules.
* tests/style.scm (test-pretty-print): New macro.
<top level>: Add 'test-pretty-print' tests.
Fixes <https://issues.guix.gnu.org/52752>.
Reported by Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>.
* tests/gremlin.scm ("file-needed/recursive"): Augment the list of vDSO
names.
Fixes: <https://issues.guix.gnu.org/52940>.
* tests/gremlin.scm (file-needed/recursive): Consider two entries to be
equivalent not when they are the same string, but rather when they refer to
the same file.
[ground-truth]: In addition to strings that begin with "linux-vdso.so", remove
strings that begin with "linux-vdso64.so".
Updaters need to be modified to return 'git-reference' objects.
This patch modifies the 'generic-git' and 'minetest' updater,
but others might need to be modified as well.
* guix/git.scm (git-reference->git-checkout): New procedure.
* guix/upstream.scm (package-update/git-fetch): New procedure.
(<upstream-source>)[urls]: Document it can be a 'git-reference'.
(%method-updates): Add 'git-fetch' mapping.
(update-package-source): Support 'git-reference' sources.
(upstream-source-compiler/url-fetch): Split off from ...
(upstream-source-compiler): ... this, and call ...
(upstream-source-compiler/git-fetch): ... this new procedure if the URL
field contains a 'git-reference'.
* guix/import/git.scm
(latest-git-tag-version): Always return two values and document that the tag
is returned as well.
(latest-git-release)[urls]: Use the 'git-reference' instead of the
repository URL.
* guix/import/minetest.scm (latest-minetest-release)[urls]: Don't wrap the
'git-reference' in a list.
* tests/minetest.scm (upstream-source->sexp): Adjust to new convention.
Co-authored-by: Maxime Devos <maximedevos@telenet.be>
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
specification->package fails on manifest entries with specific outputs,
resulting in an invalid home configuration. This changes the import command
to use specification->package+output instead.
* guix/scripts/home/import.scm (manifest+configuration-files->code): Make sure
manifest entries with specific output are also handled.
* tests/home-import.scm: Specify output in home environment manifest entry.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
All these tests pass, because they only test the old-style input alists with
labels.
* tests/upstream.scm ("changed-inputs returns no changes",
"changed-inputs returns changes to labelled input list",
"changed-inputs returns changes to all labelled input lists"): New tests.
This code duplicates the (gnu system image) and (gnu build image) code. Using
VM for image generation is not needed, not portable and really slow. Remove
all the VM image generation code to make sure that only the image API is used.
* gnu/build/vm.scm: Remove it. Move the qemu-command procedure to ...
* gnu/build/marionette.scm: ... here.
* gnu/local.mk (GNU_SYSTEM_MODULES): Adapt it.
* tests/modules.scm: Ditto.
* gnu/tests/install.scm: Ditto.
* gnu/system/vm.scm: Adapt it and remove expression->derivation-in-linux-vm,
qemu-img, system-qemu-image/shared-store and system-docker-image procedures.
* doc/guix.texi (G-Expressions): Adapt it.
The third key will be used in an upcoming commit.
Rename public keys to .pub.
* guix/tests/gnupg.scm (%ed25519-3-public-key-file): New variable.
(%ed25519-3-secret-key-file): New variable.
(%ed25519-2-public-key-file): Renamed from %ed25519bis-public-key-file.
(%ed25519-2-secret-key-file): Renamed from %ed25519bis-secret-key-file.
* tests/keys/ed25519-3.key: New file.
* tests/keys/ed25519-3.sec: New file.
Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
* guix/import/elpa.scm: (guix-package->elpa-name): New procedure.
(latest-release): Use it.
* tests/elpa.scm ("guix-package->elpa-name: without 'upstream-name' property")
("guix-package->elpa-name: with 'upstream-name' property"): Test it.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
With the switch to "ustar" format in commit
bdf5c16ac0, the maximum file length has
increased.
* guix/lint.scm (check-patch-file-names): Adjust margin used to check for
patch file lengths. Increase allowable patch file length appropriate to new
tar format. Extend warning to explain that long files may break 'make dist'.
* tests/lint.scm: Update tests accordingly.
This follows up on commit 5cd1019488.
* tests/cran.scm (description): Include a very long line.
(description->package): Update the golden description to match the
paragraph filling now performed by BEAUTIFY-DESCRIPTION.
* guix/scripts/hash.scm (git-hash): New procedure.
(%options): Use it.
* tests/guix-hash.sh: Test it.
* doc/guix.texi: Update.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This fixes this use case:
(file-append (let-system ...) ...)
* guix/gexp.scm (file-append-compiler): When BASE lacks an expander,
delegate to LOWERED.
* tests/gexp.scm ("let-system in file-append"): New test.
Fixes <https://issues.guix.gnu.org/46212>.
Reported by Christopher Baines <mail@cbaines.net>.
Previously, the nar size returned by 'guix substitute' would be read as
an 'int'; thus, values above 2^31 - 1 would be read and then stored as
negative integers in the database.
Regression introduced in 9dfa20a22a.
* nix/libstore/build.cc (SubstitutionGoal::finished): Use templatized
'string2Int' instead of 'std::atoi' to get an 'unsigned long long',
which is the type of 'hash.second'.
* tests/store.scm ("substitute and large size"): New test.
Fixes <https://issues.guix.gnu.org/51983>.
Reported by Tobias Geerinckx-Rice <me@tobias.gr>.
* nix/libstore/local-store.cc (LocalStore::querySubstitutablePathInfos):
Expect 'unsigned long long' for 'downloadSize' and 'narSize'.
* tests/store.scm ("substitute query and large size"): New test.
Files smaller than 8 KiB typically represent ~70% of the entries in
/gnu/store/.links but only contribute to ~4% of the space savings
afforded by deduplication.
Not considering these files for deduplication speeds up file insertion
in the store and, more importantly, leaves 'removeUnusedLinks' with
fewer entries to traverse, thereby speeding it up proportionally.
Partly fixes <https://issues.guix.gnu.org/24937>.
* config-daemon.ac: Remove symlink hard link check and CAN_LINK_SYMLINK
definition.
* guix/store/deduplication.scm (%deduplication-minimum-size): New
variable.
(deduplicate)[loop]: Do not recurse when FILE's size is below
%DEDUPLICATION-MINIMUM-SIZE.
(dump-port): New procedure.
(dump-file/deduplicate)[hash]: Turn into...
[dump-and-compute-hash]: ... this thunk.
Call 'deduplicate' only when SIZE is greater than
%DEDUPLICATION-MINIMUM-SIZE; otherwise call 'dump-port'.
* nix/libstore/gc.cc (LocalStore::removeUnusedLinks): Drop files where
st.st_size < deduplicationMinSize.
* nix/libstore/local-store.hh (deduplicationMinSize): New declaration.
* nix/libstore/optimise-store.cc (deduplicationMinSize): New variable.
(LocalStore::optimisePath_): Return when PATH is a symlink or smaller
than 'deduplicationMinSize'.
* tests/derivations.scm ("identical files are deduplicated"): Produce
files bigger than %DEDUPLICATION-MINIMUM-SIZE.
* tests/nar.scm ("restore-file-set with directories (signed, valid)"):
Likewise.
* tests/store-deduplication.scm ("deduplicate, below %deduplication-minimum-size"):
New test.
("deduplicate", "deduplicate, ENOSPC"): Produce files bigger than
%DEDUPLICATION-MINIMUM-SIZE.
* tests/store.scm ("substitute, deduplication"): Likewise.
* guix/tests.scm (file=?): Add optional 'stat' parameter. Add fast
patch comparing inode numbers.
* tests/gexp.scm ("imported-files with file-like objects"): Remove
'file=?' procedure and use the one from (guix tests).
* guix/import/print.scm (package->code)[variable-reference]
[object->code]: New procedures.
[package-lists->code]: Rewrite in terms of 'object->code'.
Pass the 'arguments' field through 'object->code'.
* tests/print.scm (pkg-with-arguments, pkg-with-arguments-source): New
variables.
("package with arguments"): New test.
* guix/import/print.scm (package->code)[source->code]: Handle patches
that are origins.
* tests/print.scm (pkg-with-origin-input): Add 'patches' field.
(pkg-with-origin-patch, pkg-with-origin-patch-source): New variables.
("package with origin patch"): New test.
* guix/import/print.scm (package->code)[factorized-uri-code]: New
procedure.
[source->code]: Use it, and factorize URI when it's a list.
* tests/print.scm (pkg-with-origin-input): Check origin URI to a list.
* guix/import/print.scm (package->code)[source->code]: Check whether
VERSION is true before calling 'factorize-uri'.
[package-lists->code]: Add clause for inputs that are origins.
* tests/print.scm (pkg-with-origin-input, pkg-with-origin-input-source):
New variables.
("package with origin input"): New test.
Previously, 'read-error' exceptions other than "missing closing paren"
would not be reported; instead, we'd directly call (exit 1) without
printing anything.
Fixes <https://issues.guix.gnu.org/51463>.
Reported by Alice BRENON <alice.brenon@ens-lyon.fr>.
* guix/ui.scm (report-load-error): Report the error without re-throwing
upon 'read-error'.
* tests/guix-build.sh: Add test.
This is a followup to e171182a20.
* tests/lint.scm ("description: invalid Texinfo markup")
("synopsis: valid Texinfo markup"): Add call to 'identity' to avoid
triggering a syntax error.
* guix/scripts/home/import.scm (manifest->code): Remove.
(manifest+configuration-files->code): New procedure.
(import-manifest): Use 'manifest+configuration-files->code' instead of
'manifest->code'.
* tests/home-import.scm (eval-test-with-home-environment): Likewise.
(match-home-environment-transformations): New procedure.
("manifest->code: No services, package transformations"): New test.
Set the name of the file to just the basename of the file passed to
‘local-file’.
* guix/scripts/home/import.scm (basename+remove-dots): New procedure.
(generate-bash-configuration+modules): Use it.
* tests/home-import.scm (match-home-environment-bash-service): Adjust
accordingly.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
The previous behavior was confusing: a warning would be printed and
'guix shell' would go on starting an empty environment.
Reported by Tobias Geerinckx-Rice <me@tobias.gr>.
* guix/scripts/shell.scm (auto-detect-manifest): Change "not loading"
case from warning to error.
* tests/guix-shell.sh: Adjust accordingly.
This is a followup to b19250eec6,
providing a proper fix for <https://issues.guix.gnu.org/46756>.
* guix/remote.scm (remote-eval): Revert b19250eec6.
* guix/store.scm (build-accumulator): Turn into a procedure. Call
CONTINUE when the store is not eq? to the initial store.
(map/accumulate-builds): Adjust accordingly.
* tests/store.scm ("map/accumulate-builds and different store"): New test.
* guix/packages.scm (package-development-inputs): New procedure.
* guix/scripts/environment.scm (package-environment-inputs): Use it.
* tests/packages.scm ("package-development-inputs")
("package-development-inputs, cross-compilation"): New tests.
* doc/guix.texi (package Reference): Document it.
Only detecting updates is currently supported. To actually
perform the uppdates, a patch like
<https://issues.guix.gnu.org/50072#4> is required.
* guix/import/minetest.scm
(version-style,minetest-package?,latest-minetest-release): New procedures.
(%minetest-updater): New updater.
* tests/minetest.scm
(upstream-source->sexp,expected-sexp,example-package): New procedure.
(test-release,test-no-release): New macro's.
("same version","new version (dotted)","new version (date)")
("new version (git -> dotted)","dotted->date","date->dotted")
("no commit informaton, no new release")
("minetest is not a minetest mod")
("technic is a minetest mod")
("upstream-name is required"): New tests.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* guix/import/stackage.scm (<stackage-lts>, <snapshot>)
(<stackage-package>): New record types and JSON mappings.
(lts-info-packages, stackage-package-name)
(stackage-package-version): Remove.
(lts-package-version): Rename 'pkgs-info' to 'packages'; assume
'packages' is a list of <stackage-package>.
(stackage->guix-package): Use 'stackage-lts-packages' instead of
'lts-info-packages'. Rename 'packages-info' to 'packages'.
(latest-lts-release): Likewise.
(stackage-package?): Rename to...
(stackage-lts-package?): ... this. Adjust to new API.
(%stackage-updater)[pred]: Update accordingly.
* tests/lint.scm ("haskell-stackage"): Add "snapshot" entry in JSON
snippet.
Previously, when a PyPI package had a “-” followed by one or more digits in
its name, e.g., “AV-98”, the importer would interpret “98” as the version of
the package and thus mistake the “AV-98” package for the “av” package on PyPI.
$ ./pre-inst-env guix refresh av-98
following redirection to `https://pypi.org/pypi/av/json'...
/home/yoctocell/src/guix/gnu/packages/web-browsers.scm:914:13: av-98 would be upgraded from 1.0.1 to 8.0.3
Setting the ‘upstream-name’ property to “AV-98” would solve the problem.
$ ./pre-inst-env guix refresh av-98
/home/yoctocell/src/guix/gnu/packages/web-browsers.scm:914:13: 1.0.1 is already the latest version of av-98
* guix/import/pypi.scm (guix-package->pypi-name): Honor ‘upstream-name’
property.
(make-pypi-sexp): Set ‘upstream-name’ property when appropriate.
* tests/pypi.scm (test-json): Rename to ...
(test-json-1): ... this.
(test-json-2): New variable
("guix-package->pypi-name, honor 'upstream-name'"): New test.
("pypi->guix-package, package name contains \"-\" followed by digits"):
Likewise.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This is a follow-up to commit 9c5e5ca1c0.
The previous package was called “ghc-x” which is not available on Stackage,
instead change it to “ghc-pandoc” which does exist, and adjust its version.
* tests/lint.scm ("haskell-stackage"): Add additional metadata for the
package; change package name to “ghc-pandoc”; and change to version to
“100.0”.
Reported-by: Tobias Geerinckx-Rice <me@tobias.gr>
Signed-off-by: Tobias Geerinckx-Rice <me@tobias.gr>
Fixes <https://issues.guix.gnu.org/50676>.
Reported by Mathieu Othacehe <othacehe@gnu.org>.
Commit a779363b6a was partially incorrect:
references passed to #:allowed-references or #:references-graphs *can*
be lowered as references to grafted elements. This is for example the
case when doing:
(computed-file "partition.img" exp
#:options `(#:references-graphs ,inputs))
Here INPUTS must be lowered as a reference to suitably grafted elements.
Failing to do that, the reference graph will not match the actual
INPUTS.
However, when building a package, those references must indeed refer
only to ungrafted packages. This commit preserves that by having build
systems pass #:graft? #f.
* guix/gexp.scm (lower-reference-graphs, lower-references): Remove uses
of 'without-grafting'. This reverts
a779363b6a.
* guix/build-system/cmake.scm (cmake-build, cmake-cross-build):
Pass #:graft? #f.
* guix/build-system/glib-or-gtk.scm (glib-or-gtk-build)
(glib-or-gtk-cross-build): Likewise.
* guix/build-system/gnu.scm (gnu-build, gnu-cross-build): Likewise.
* guix/build-system/meson.scm (meson-build, meson-cross-build): Likewise.
* guix/build-system/trivial.scm (trivial-build, trivial-cross-build):
Likewise.
* tests/gexp.scm ("lower-object, computed-file + grafts"): New test.
* tests/packages.scm ("trivial with #:allowed-references + grafts"): New
test.
This fixes one of the issues noted at <https://issues.guix.gnu.org/50425#4>.
* guix/import/minetest.scm
(release-version): New procedure.
(%minetest->guix-package): Call new procedure instead of release-title.
* tests/minetest.scm
(make-package-sexp): Allow overriding the version number.
(make-releases-json): Allow overriding the release title.
("conventional version number")
("v-prefixed version number")
("dates as version number"): New tests.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This fixes one of the issues noted in <https://issues.guix.gnu.org/50425#4>.
* guix/import/minetest.scm
(import-dependencies): Call 'delete-duplicates' on the resulting list.
* tests/minetest.scm
("minetest->guix-package, multiple dependencies implemented by one mod"):
New test.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Previously, 'channel-news-entry-commit' would return the tag ID rather
than the commit ID when the news entry was referred to via an annotated
tag.
Reported by Xinglu Chen <public@yoctocell.xyz>.
* guix/channels.scm (resolve-channel-news-entry-tag): Check whether the
reference points to annotated tag; resolve it if it does.
* tests/channels.scm ("channel-news, annotated tag"): New test.
* guix/git.scm (ls-remote-refs): New procedure.
* tests/git.scm ("remote-refs" "remote-refs: only tags"): New tests.
* guix/import/git.scm: New file.
* doc/guix.texi (Invoking guix refresh): Document it.
* tests/import-git.scm: New test file.
* Makefile.am (MODULES, SCM_TESTS): Register the new files.
Co-authored-by: Sarah Morgensen <iskarian@mgsn.dev>
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Fixes a regression introduced in
fc29c80b96, where, since
'get-opam-repository' was no longer mocked, the test would try to access
the actual OPAM repository through a call to 'http-fetch/cached'; this
would lead to a test failure when networking is unavailable.
* tests/opam.scm ("opam->guix-package"): Mock 'get-opam-repository'
again.
Fixes <https://issues.guix.gnu.org/50264>.
Reported by Lars-Dominik Braun <lars@6xq.net>.
This fixes a regression introduced in
fa81971cba whereby 'map/accumulate-builds'
would return REST (the tail of LST) without applying PROC on it. The
effect would be that 'lower-inputs' in (guix gexp) would dismiss those
elements, leading to derivations with correct builders but only a subset
of the inputs they should have had.
* guix/store.scm (map/accumulate-builds): Add #:cutoff parameter and
remove 'accumulation-cutoff' variable. Call PROC on the elements of
REST.
* tests/store.scm ("map/accumulate-builds cutoff"): New test.
* guix/import/cabal.scm (is-id): Accept the location as an argument. Don’t
check if the identifier name is a reserved keyword unless it is the first word
on the line.
(lex-word): Adjust accordingly.
* tests/hackage ("hackage->guix-package tests flag executable"): Expect it to
pass.
Fixes: <https://issues.guix.gnu.org/25138>
Signed-off-by: Lars-Dominik Braun <lars@6xq.net>
Suggested by Maxime Devos <maximedevos@telenet.be>.
* guix/packages.scm (current-definition-location): New syntax parameter.
(define-public*): New macro.
(<package>)[definition-location]: New field.
(package-definition-location): New procedure.
* tests/packages.scm ("package-definition-location"): New test.
This is a followup to 09b002622e, which
changed the dependency of graphviz from guile@2.0 to guile@3.0.
* tests/guix-build.sh: Adjust '--with-input' test.
This is required since the introduction of the OpenSSL graft in the
parent commit so that calling 'package-derivation' in the Python tests
would not trigger a build.
* tests/builders.scm <top level>: Add '%graft?' call.
* guix/import/utils.scm (recursive-import): Skip packages when the
package returned by 'repo->guix-package' is false.
* tests/import-utils.scm: New tests.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Fixes <https://issues.guix.gnu.org/40997>.
* gnu/bootloader.scm (<bootloader-configuration>): New 'targets' field.
(%bootloader-configuration-target): New procedure.
(bootloader-configuration-target): Add deprecation warning.
(bootloader-configuration-targets): New procedure.
* guix/scripts/system.scm (install): Access targets via
bootloader-configuration-targets.
(perform-action)[bootloader-target]: Remove unused argument and update doc.
Access targets via bootloader-configuration-targets and fix indentation.
(process-action): Access targets via bootloader-configuration-targets.
Do not provide the unused BOOTLOADER-TARGET argument when applying
`perform-action'.
* guix/scripts/system/reconfigure.scm (install-bootloader-program): Rename
DEVICE argument to DEVICES. Adjust doc and comment. Apply `installer' and
`disk-installer' for every DEVICES.
(install-bootloader): Access targets via bootloader-configuration-targets and
rename variable from DEVICE to DEVICES.
* gnu/tests/install.scm: Adjust accordingly.
* tests/guix-system.sh: Likewise.
* gnu/tests/reconfigure.scm (run-install-bootloader-test): Adjust the DEVICES
argument so that it is a list.
* doc/guix.texi: Update doc.
* guix/scripts/import/opam.scm: Pass all instances of --repo as a list
to the importer.
* guix/import/opam.scm (opam-fetch): Stop expecting "expanded"
repositories and call get-opam-repository instead to keep values
"symbolic" as long as possible and factorize.
(get-opam-repository): Use the same repository source as CLI opam does
(i.e. HTTP-served index.tar.gz instead of git repositories).
(find-latest-version): Be more flexible on the repositories structure
instead of expecting packages/PACKAGE-NAME/PACKAGE-NAME.VERSION/.
* tests/opam.scm: Update the call to opam->guix-package since repo is
now expected to be a list and remove the mocked get-opam-repository
deprecated by the support for local folders by the actual
implementation.
* doc/guix.texi: Document the new semantics and valid arguments for the
--repo option.
Signed-off-by: Julien Lepiller <julien@lepiller.eu>
Fixes <https://issues.guix.gnu.org/49697>.
Reported by Philippe Swartvagher <philippe.swartvagher@inria.fr>.
* guix/transformations.scm (patched-source): New procedure.
(transform-package-patches)[package-with-extra-patches]: Use it
when (package-source p) is not an origin.
* tests/transformations.scm ("options->transformation, with-commit +
with-patch"): New test.
This reverts commit 4673f81793, which reverted
commit 69dcc24c9f with the fix detailed below.
Thanks to Christopher Baines for reporting the failure and proposing a fix.
* guix/self.scm (compiled-guix) [*system-test-modules*]: Add the test data
files via the 'extra-files' argument.
* gnu/local.mk (dist_patch_DATA): Move the tests/data/jami-dummy-account.dat
file to...
* gnu/local.mk (MODULES_NOT_COMPILED): ... here.
* gnu/services/telephony.scm (string-or-computed-file?)
(string-list?, account-fingerprint-list?): New procedures.
(maybe-string-list, maybe-account-fingerprint-list)
(maybe-boolean, maybe-string, jami-account-list): New configuration field
types.
(serialize-string-list, serialize-boolean, serialize-string)
(jami-account, jami-account->alist, jami-configuration)
(jami-account-list?, jami-account-list-maybe): New procedures.
(%jami-accounts): New variable.
(jami-configuration->command-line-arguments): New procedure.
(jami-dbus-session-activation, jami-shepherd-services): New procedures.
(jami-service-type): New variable.
* gnu/build/jami-service.scm: New file.
* gnu/tests/data/jami-dummy-account.dat: Likewise.
* gnu/tests/telephony.scm: Likewise.
* gnu/local.mk (GNU_SYSTEM_MODULES): Register them.
* Makefile.am (SCM_TESTS): Register the test file.
(dist_patch_DATA): Register the new data file.
* doc/guix.texi (Telephony Services): Document it.
* guix/import/hackage.scm (hackage-module->sexp)[dependencies]
[native-dependencies]: Make into a list of symbols.
[maybe-inputs]: Wrap INPUTS in 'list' instead of 'quasiquote'.
* tests/hackage.scm (match-ghc-foo)
(match-ghc-foo-6)
(match-ghc-foo-revision)
(match-ghc-foo-import): Adjust accordingly.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* guix/import/opam.scm (opam->guix-package): Wrap INPUTS and
NATIVE-INPUTS in 'list' instead of 'quasiquote'.
(dependency-list->inputs): Return a list of symbols.
* tests/opam.scm ("opam->guix-package"): Adjust accordingly.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* guix/import/egg.scm (egg->guix-package): Generate dependency list from
a list of symbols.
[egg-parse-dependency]: Return a list of symbols.
[maybe-inputs]: Wrap INPUTS in 'list' instead of 'quasiquote'.
* tests/egg.scm (match-chicken-foo): Adjust accordingly.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Thanks to Guillem Jover <guillem@debian.org> on the OFTC's #debian-dpkg
channel for helping with troubleshooting.
Letting GNU Tar recursively walk the complete files hierarchy side-steps the
risks associated with providing a list of file names:
1. Duplicated files in the archive (recorded as hard links by GNU Tar)
2. Missing parent directories.
The above would cause dpkg to malfunction, for example by aborting early and
skipping triggers when there were missing parent directories.
* guix/scripts/pack.scm (self-contained-tarball/builder): Do not call
POPULATE-SINGLE-PROFILE-DIRECTORY, which creates extraneous files such as
/root. Instead, call POPULATE-STORE and INSTALL-DATABASE-AND-GC-ROOTS
individually to more precisely generate the file system. Replace the list of
files by the current directory, "." and streamline the way options are passed.
* gnu/system/file-systems.scm (reduce-directories): Remove procedure.
* tests/file-systems.scm ("reduce-directories"): Remove test.
* guix/scripts/pack.scm (self-contained-tarball/builder)
[extra-options]: New argument.
(self-contained-tarball, squashfs-image, docker-image)
(debian-archive): Likewise. Remove two TODO comments. Document
EXTRA-OPTIONS. Use the custom control files when provided.
(%deb-format-options): New variable.
(show-deb-format-options, show-deb-format-options/detailed): New procedures.
(%options): Register new options.
(show-help): Augment with new usage.
(guix-pack): Validate and propagate new argument values.
* doc/guix.texi (Invoking guix pack)[deb]: Document how to list advanced
options. Add an example.
* tests/pack.scm (deb archive...): Provide extra-options to the debian-archive
procedure, and validate that the provided files are embedded in the pack.