1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-08-04 13:11:32 +02:00
Commit Graph

2361 Commits

Author SHA1 Message Date
Phillip Davis 781c25ada9 tests: import: gem: Add test for mixed valid and gibberish licenses.
Verifies that when only one of multiple license strings is recognized,
the resulting list has the correct license followed by one instance
of the symbol 'unknown-license!

* tests/import/gem.scm (test-mixed-licenses-json): New fixture.
  ("gem->guix-package with mixed valid and gibberish licenses"):
  New test.

Change-Id: I33a003d50ba20d30360b52c448ae28ad9d37233b
Merges: https://codeberg.org/guix/guix/pulls/8276
Reviewed-by: Carlo Zancanaro <carlo@zancanaro.id.au>
Signed-off-by: Nguyễn Gia Phong <cnx@loang.net>
2026-05-26 00:09:55 +09:00
Phillip Davis 514b17c58a tests: import: gem: Add test for unrecognized license identifiers.
Exercises the map in 4f78d33f0 where every license
string is unrecognized, so the resulting package should have
(license (list unknown-license! unknown-license!)).

* tests/import/gem.scm (test-gibberish-licenses-json): New fixture.
  ("gem->guix-package with gibberish license identifiers"): New test.

Change-Id: I85cbb0574f9393749a84f4cf5818d4c1083a8476
Reviewed-by: Carlo Zancanaro <carlo@zancanaro.id.au>
Signed-off-by: Nguyễn Gia Phong <cnx@loang.net>
2026-05-26 00:09:43 +09:00
Phillip Davis 3df17cb25a import: gem: Use spdx-string->license for license lookup.
Similar to what was done for the crate importer in 263a267b75.

* guix/import/gem.scm (string->license): Try spdx-string->license first,
  returning symbols instead of license objects.  Fall back
  to the existing hardcoded table for non-SPDX strings.
  (make-gem-sexp): Remove license->symbol calls;
  licenses are now symbols directly.
* tests/import/gem.scm (test-spdx-json): New fixture.
  ("gem->guix-package with SPDX license identifiers"): New test.

Change-Id: I5fa0ebdfd3a3393eab5ef0554ed09887a89bc107
Reviewed-by: Carlo Zancanaro <carlo@zancanaro.id.au>
Signed-off-by: Nguyễn Gia Phong <cnx@loang.net>
2026-05-26 00:09:12 +09:00
Phillip Davis abbf03a2ef import: gem: Fix null at home-page.
The RubyGems API returns "homepage_uri": null for gems with no homepage.
guile-json parses JSON null as the Guile symbol 'null', which passes
through into the generated package sexp as (home-page null)—an unbound
variable error at evaluation time.

* tests/import/gem.scm (test-no-homepage-json): New fixture.
  ("gem->guix-package, bald homepage_uri"): New test.
* guix/import/gem.scm (non-empty-string-or-false): New procedure.
  (<gem>)[home-page]: Use it.
* guix/import/utils.scm (non-empty-string-or-false):
  New exported procedure, moved to here...
* guix/import/gem.scm (non-empty-string-or-false): ...from here...
* guix/import/pypi.scm (non-empty-string-or-false): ...and here.

Change-Id: If8f2ca32834d762c753797067ef87937503ff9f9
Reviewed-by: Carlo Zancanaro <carlo@zancanaro.id.au>
Signed-off-by: Nguyễn Gia Phong <cnx@loang.net>
2026-05-26 00:08:11 +09:00
Nicolas Graves 803e96bf55 guix: build-system: Set pypi-uri in pyproject, drop python module.
After this commit, when both modules are imported:

- if pyproject is imported before, the warning is 'pypi-uri' is
deprecated, use '(@ (guix build-system pyproject) pypi-uri)' instead

- if python is imported before, the warning is `pypi-uri' imported from
both (guix build-system python) and (guix build-system pyproject)

This seems convenient enough to warn for deprecation in the short term,
while avoiding any breaking changes.

* guix/build-system/pyproject.scm (pypi-uri): Move the procedure from
(guix build-system python) here.

* guix/build-system/python (pypi-uri): Drop definition, import it
from (guix build-system pyproject) and deprecate it.

* gnu/packages/openldap.scm: Reorder modules to get the right warning.

* gnu/packages/pypy.scm: Likewise.

* gnu/packages/*.scm : Drop module (guix build-system python).

* tests/import/pypi.scm: Likewise.

Merges: https://codeberg.org/guix/guix/pulls/7448
Change-Id: Ib42f53bc545052eb7918a25afe9db6d5fc2cb834
Reviewed-by: Nguyễn Gia Phong <cnx@loang.net>
Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
2026-05-24 10:14:45 +01:00
Nicolas Graves aaded718f4 tests: pypi: Switch to pyproject-build-system.
* tests/import/pypi.scm ("package-latest-release"): Switch to
pyproject-build-system.

Change-Id: I8ba5cdd45e793cd2aae7b3025f7598245de6c87e
Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
2026-05-24 10:14:43 +01:00
Nicolas Graves 1147610183 tests: packages: Switch to pyproject-build-system.
* tests/packages.scm ("package-input-rewriting, deep")
("package-input-rewriting/spec, no duplicates"):
Switch to pyproject-build-system.

Change-Id: I428af596a021e16ba6226e55910be24424e4a625
Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
2026-05-24 10:14:43 +01:00
Nicolas Graves 219b12a06a tests: builders: Switch to pyproject-build-system.
* guix/build/pyproject-build-system.scm (set-version): Ensure source
is not #f before using it.

* tests/builders.scm
(make-python-dummy)[build-system]: Switch to pyproject-build-system.
[native-inputs]: Add python-setuptools.
(python-dummy-no-setuptools): Drop it.
(check-build-success, check-build-failure): Refresh tests.
(check-build-failure): Drop python-dummy-no-setuptools.

Change-Id: I892b45c34b506ff27634e2ef706009dc81e831ec
Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
2026-05-24 10:14:42 +01:00
Maxim Cournoyer 3777bf133e machine: hetzner: Fix initial deploy when ssh-key is #f.
This fixes a regression introduced in commit a2ef2bcbfd ("machine: hetzner:
Allow connections using ssh-agent"), where having no ssh-key would cause the
early Hetzner provisioning to fail due to the lack of SSH authentication.

* gnu/machine/hetzner.scm (%hetzner-ssh-key-file): New parameter.
(<hetzner-configuration>) [ssh-public-key]: Compute default according to the
value of the private ssh-key field.  Introduce an indirection via...
(hetzner-configuration-ssh-public-key): ... this new procedure, to honor
%hetzner-ssh-key-file.
(hetzner-configuration-ssh-key): Likewise for the private ssh-key.
(hetzner-configuration-ssh-key-fingerprint): Rename to...
(public-key->fingerprint): ... this, taking just the public key as argument.
Update doc.
(hetzner-configuration-ssh-key-public): Rename to...
(public-key->string-with-type): ...this, for clarity, and accept just a
public-key object.  Update doc.
(hetzner-machine-ssh-key): Exit early with #f when no ssh key is provided.
(temporary-ssh-key-file): New procedure.
(hetzner-machine-ssh-key-create): Assert a public key is defined.  Adjust
calls to renamed procedures, and adjust for the `hetzner-api-server-create'
API change.
(hetzner-machine-enable-rescue-system): Refine doc and fix code path when
ssh-key is #f.
(hetzner-machine-rescue-install-os): Document.
(hetzner-machine-provision): Refine doc. Remove extraneous sleep and #:unwind
argument. Limit ssh-session dynamic scope to where it's needed.
(cleanup-temporary-ssh-key/maybe): New procedure.
(deploy-hetzner): Create and use a temporary SSH key when none is defined, and
clean it up when done or on errors.
* gnu/machine/hetzner/http.scm (hetzner-api-server-create): Make ssh-keys a
keyword argument, and fix execution when it's #f.
(hetzner-api-server-enable-rescue-system): Likewise.
* tests/machine/hetzner.scm ("deploy-machine-mock-with-unprovisioned-server"):
Adjust test.
* tests/machine/hetzner/http.scm (create-server)
("hetzner-api-server-create-unit")
("hetzner-api-server-enable-rescue-system-unit")
("hetzner-api-actions-integration")
("hetzner-api-server-enable-rescue-system-integration"): Likewise.
* doc/guix.texi (Invoking guix deploy): Precise what happens when 'ssh-key' is
 #f in hetzner-configuration, and suggest declaratively authorizing your SSH
key.

Change-Id: I812b348fb553f3b5aebd0bf66850c6ecb9e06653
2026-05-23 13:21:16 +09:00
Sören Tempel 6272f97953 tests: guix-system: Use dhcpcd-service-type instead of ISC dhcp.
dhcp-client-service-type has been deprecated for a while as the
ISC implementation has reached end-of-life upstream in 2022.  This
is the last remaining user of dhcp-client-service-type in the Guix
repository.

* tests/guix-system.sh: Use dhcpcd-service-type.

Change-Id: Iaf8dd4bc888c99815d2d6c8c195fe92644186625
2026-05-16 12:50:11 +02:00
Ludovic Courtès c9dcd203e5 pull, time-machine: ‘--allow-untrusted-channels’ takes an argument.
* guix/scripts/pull.scm (%default-options): Change ‘require-trusted-channels?’
to ‘require-trusted-channels’.
(show-help, %options): Support optional argument to
‘--allow-untrusted-channels’.
(channel-list): Adjust accordingly.
* guix/scripts/time-machine.scm (show-help, %options)
(%default-options): Likewise.
* tests/guix-time-machine.sh: Add test.
* doc/guix.texi (Invoking guix pull)
(Invoking guix time-machine): Adjust accordingly.

Suggested-by: Reepca Russelstein <reepca@russelstein.xyz>
Change-Id: I342ebbcc7355953487a5c6c8ac85048943a5ac46
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2026-05-10 17:01:08 +02:00
Ludovic Courtès f13901f6cb pull, time-machine: Accept content SWHIDs as arguments to ‘--channels’.
* guix/swh.scm (swhid-content-data): New procedure.
(call): Do not close ‘port’ when ‘result’ is the same as ‘port’.
* guix/scripts/pull.scm (swhid-content-data*): New procedure.
(channel-list): Accept ‘file’ as a SWHID.
* tests/guix-time-machine.sh: Add test.
* doc/guix.texi (Invoking guix pull): Document it.
(Invoking guix time-machine): Likewise.

Change-Id: I8145cd8685fe2926b1548d4a2dcd54804d89228a
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2026-05-10 17:01:08 +02:00
Ludovic Courtès 4b81a4df19 pull, time-machine: Support transparent download of channel files.
* guix/scripts/pull.scm (%default-options): Add ‘require-trusted-channels?’.
(show-help, %options): Add ‘--allow-untrusted-channels’.
(trusted-channels, equivalent-channels?, check-trusted-channels): New
procedures.
(channel-list)[require-trusted-channels?]: New variable.
[load-channels]: Honor it and call ‘check-trusted-channels’.
* guix/scripts/time-machine.scm (show-help, %options): Add
‘--allow-untrusted-channels’.
(%default-options): Add ‘require-trusted-channels?’.
* tests/guix-time-machine.sh: Add test.
* doc/guix.texi (Invoking guix pull): Update ‘--channels’ documentation and
document ‘allow-untrusted-channels’.
(Invoking guix time-machine): Likewise.
(Channels with Substitutes): Add example of ‘guix pull’ with a URL.

Change-Id: If0bb6acaedf324e35a21c9c7d285f3e423ae49aa
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2026-05-10 17:01:08 +02:00
Ludovic Courtès 2d4f290e17 ui: ‘load*’ accepts a file name or a port.
* guix/ui.scm (load/isolated): Change ‘file’ parameter to ‘port’ and adjust
accordingly.
(load*): Change ‘file’ to ‘file-or-port’ and adjust accordingly.
* tests/ui.scm ("load/isolated, reading exceeds limits")
("load/isolated, attempt to import module")
("load/isolated, attempt to allocate with 'cons'")
("load/isolated, attempt to allocate with 'make-vector'")
("load/isolated, use of allowed bindings"): New tests.

Change-Id: I0ec8fa2717c02041d409f6dc59b753d4501107f9
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2026-05-10 17:01:08 +02:00
Ludovic Courtès 36d431c051 pull, time-machine: Evaluate channels in a sandbox by default.
* guix/scripts/pull.scm (%default-options): Add
‘isolated-channel-evaluation?’.
(show-help, %options): Add ‘--unsafe-channel-evaluation’.
(%safe-channel-bindings): New variable.
(channel-list): Honor ‘isolated-channel-evaluation?’.
* guix/scripts/time-machine.scm (show-help, %options): Add
‘--unsafe-channel-evaluation’.
(%default-options): Add ‘isolated-channel-evaluation?’.
* tests/guix-time-machine.sh: Test use of unauthorized bindings in channel
files.
* doc/guix.texi (Invoking guix time-machine): Document
‘--unsafe-channel-evaluation’.
(Invoking guix pull): Likewise.
(Channels with Substitutes): Add index entry for
‘channel-with-substitutes-available’.  Mention that it requires
‘--unsafe-channel-evaluation’.

Change-Id: I75f60dba516f42ef62a9d779cde8e2f0a9d0c140
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2026-05-10 17:01:07 +02:00
Ludovic Courtès 94ae360ab4 ui: ‘load*’ takes a list of modules to import.
* guix/ui.scm (load*): Change ‘module’ to ‘imports’.  Define ‘user-module’.
* guix/scripts/build.scm (options->things-to-build): Update to new ‘load*’
calling convention.
* guix/scripts/deploy.scm (load-source-file): Likewise.
* guix/scripts/environment.scm (load-manifest)
(options/resolve-packages): Likewise.
* guix/scripts/home.scm (process-action): Likewise.
(%user-module): Rename to…
(%user-modules): … this, and change to a list of module names.
* guix/scripts/pack.scm (guix-pack): Update ‘load*’ calls.
* guix/scripts/package.scm (load-manifest, %options): Likewise.
* guix/scripts/pull.scm (channel-list): Likewise.
* guix/scripts/refresh.scm (packages-from-manifest): Likewise.
* guix/scripts/system.scm (%user-module): Rename to…
(%user-modules): … this, and change to a list of module names.
(read-operating-system): Adjust accordingly.
(process-action): Likewise.
* guix/scripts/weather.scm (load-manifest): Likewise.
* tests/gexp.scm ("local-file, relative file name, within gexp, compiled"):
Likewise.

Change-Id: Ic838e66719d89de556ac0872c3ce0c8ff6de8790
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2026-05-10 17:01:07 +02:00
Nicolas Graves 8a505cfd48 style: Add ‘remove-input’ and related styling rules.
* guix/scripts/style.scm (input-matches?, package-list->string,
%field-accessors, remove-from-package-field, transform-package-field):
Add variables.
(%options): Add options --remove-input, --remove-native-input,
--remove-propagated-input, and --parameter.
(guix-style): Implement those options.  To keep ony one autoload, use
specification->package+output rather than specification->package.

* tests/style.scm ("remove-input, single input removed",
"remove-input, one of multiple inputs removed",
"remove-input, middle input removed from list",
"remove-input, non-existent input unchanged",
"remove-input, input with output specifier",
"remove-native-input, single input removed",
"remove-native-input, one of multiple inputs removed",
"remove-native-input, does not affect inputs field",
"remove-propagated-input, single input removed",
"remove-propagated-input, one of multiple inputs removed",
"remove-propagated-input, does not affect other fields",
"remove-input from all three fields independently",
"remove-input, dry-run does not modify file"): New tests.
("url-fetch->git-fetch, preserved field"): Drop the use of %patch-path
and %package-module-path, which are not necessary because of -L.
Change the mocked procedure from specification->package to
specification->package+output, as in the implementation.

* doc/guix.texi (Invoking guix style): Add description for guix style
-S remove-*input rules.

Change-Id: I449c87930310a73ad316b4cb5db72d0906ea495d
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Merges: #5862
2026-05-07 17:35:32 +02:00
Danny Milosavljevic 62992295d6 shell: Add --cwd.
* guix/scripts/environment.scm (show-environment-options-help): Document
--cwd.
(%options): Add cwd.
(launch-environment/container): Add cwd parameter.  Implement passing it to
the container.
(guix-environment*): Reject --cwd without --container.
* doc/guix.texi (Invoking guix shell): Document it.
* tests/guix-environment-container.sh: Add tests.
* tests/guix-shell.sh: Add tests.

Fixes: guix/guix# 7825
Change-Id: Iba4ff3d2058e92f504fbcbf688346357ce913213
2026-04-30 02:07:20 +02:00
Dariqq fceb3915d8 tests: toml: Fix nested array-of-tables test.
* tests/toml.scm (parse-toml: Array of tables):
  Adjust the expected value for nested arrays.

Change-Id: I4dbe27c0120f147226f82cda5ae3c27cb2ed6f49
Merges: https://codeberg.org/guix/guix/pulls/3245
Signed-off-by: Nguyễn Gia Phong <cnx@loang.net>
2026-04-29 11:17:05 +09:00
Nicolas Graves fbd8568c22 tests: style: Fix tests for guile > 3.0.9.
* tests/style.scm : Drop the snippet that skipped all tests.
(read-package-field): Return S-expressions with comments rather than a
string.
Rewrite all tests accordingly.

Change-Id: I478611e7c58747a1b80598366c2b5510d9625498
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Merges: #7632
2026-04-24 22:57:49 +02:00
Roman Scherer 6a5005d62e tests: gexp: Fix test shadowing replacement field.
Fixes a regression introduced in a7c8e68dc5.

* tests/gexp.scm (gexp): Rename replacement binding to replacement-pkg in
order to not shadow the replacement field of the package record.

Change-Id: I70ceafc92f52e588b3cac8f74bffa274bf0da352
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Merges: #7846
2026-04-22 16:51:07 +02:00
Andy Tai 2afe7fe09e gnu: time: Update to 1.10.
*  gnu/packages/time.scm (time): Update to 1.10.
* tests/guix-build.sh: Adjust accordingly.

Change-Id: Ia21a99e992f7b4b6e940756918ce7d11b9602a4f
Signed-off-by: Efraim Flashner <efraim@flashner.co.il>
2026-04-19 10:54:06 +03:00
Giacomo Leidi 0b8e838208 services: configuration: Add environment variable serializer.
This patch implements a general API to serialize configuration records
to list of pairs representing environment variables. The car of each
pair represents the variable name and the cdr the variable value.

* gnu/services/configuration/environment-variables.scm: New file.
(serialize-string-environment-variable)
(serialize-maybe-string-environment-variable)
(serialize-boolean-environment-variable)
(serialize-maybe-boolean-environment-variable)
(serialize-number-environment-variable)
(serialize-maybe-number-environment-variable): New variables.
(serialize-environment-variables): New variable.
* gnu/services/configuration/utils.scm: New file.
(uglify-snake-case): New variable.
* tests/services/configuration.scm: Add tests for environment serializer.
(wrong type for a field): Adjust error location.
* doc/guix.texi: Document it.

Change-Id: I81a166576f94d3c8f5bf78c82a02183689a3091c
Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
2026-04-12 17:23:42 +02:00
Noé Lopez 1078e42a60 tests: Fix non-deterministic AppImage tests.
The tested AppImages were not actually relocatable and would rely on items
being available on the environment’s store (apart from glibc).

* guix/scripts/pack.scm (wrapped-manifest): New function.
(guix-pack): Extract relocatable manifest to wrapped-manifest.
* tests/pack.scm: Use relocatable profiles in AppImage tests.

Fixes: <https://issues.guix.gnu.org/76850>
Change-Id: Ib3123054913fce903d215dc0629d806e9fceebc7
Reported-by: Reepca Russelstein <reepca@russelstein.xyz>
Signed-off-by: Vagrant Cascadian <vagrant@debian.org>
2026-04-10 18:24:56 -07:00
Nicolas Graves b361ab8ceb tests: openpgp: Migrate to (srfi srfi-71).
* tests/openpgp.scm ("read-radix-64", "get-openpgp-keyring")
  ("verify-openpgp-signature, missing key")
  ("verify-openpgp-signature, good signatures")
  ("verify-openpgp-signature, bad signature"):
  Migrate tests to from (srfi srfi-11) to (srfi srfi-71).

Change-Id: I5c4939dd5217fc15f5c1071c4223ecb194a693b3
Merges: https://codeberg.org/guix/guix/pulls/6794
Reviewed-by: Danny Milosavljevic <dannym@friendly-machines.com>
Signed-off-by: Nguyễn Gia Phong <cnx@loang.net>
2026-04-10 15:03:18 +09:00
Nicolas Graves 4c7a7a1d49 tests: keys: Moving to openpgp subdirectory.
* tests/keys/*.(pub|sec): Move to tests/keys/openpgp/*.(pub|sec)
* build-aux/test-env.in: Adapt accordingly.
* Makefile.am: Likewise.
* guix/tests/gnupg.scm: Likewise.
* tests/guix-authenticate.sh: Likewise.
* tests/openpgp.scm: Likewise.

Change-Id: If8897cec9851cc51a4ebadcc5927dc0e0520b881
Reviewed-by: Danny Milosavljevic <dannym@friendly-machines.com>
Signed-off-by: Nguyễn Gia Phong <cnx@loang.net>
2026-04-10 14:55:04 +09:00
Nicolas Graves 4cbd5f883d guix: openpgp: Refactor openpgp-fingerprint->bytevector.
Both (guix channel) and (guix git-authenticate) use similar procedures.
To refactor the one in (guix git-authenticate), move the procedure
to (guix openpgp).

* guix/channels.scm: Replace autoloaded import
  openpgp-public-key-fingerprint with openpgp-fingerprint->bytevector.
  (openpgp-fingerprint->bytevector):
  Move function definition from here...
* guix/openpgp.scm (openpgp-fingerprint->bytevector): ...to here.
* guix/git-authenticate.scm (read-authorizations):
  Use openpgp-fingerprint->bytevector.
* guix/scripts/git/authenticate.scm:
  Avoid using the (guix channels) module.
* tests/git-authenticate.scm : Likewise.

Change-Id: Ifd20588fcfaab601990098bd8575ee985e87394a
Reviewed-by: Danny Milosavljevic <dannym@friendly-machines.com>
Signed-off-by: Nguyễn Gia Phong <cnx@loang.net>
2026-04-10 14:46:59 +09:00
Ludovic Courtès f0e22ae62c records: Warn about shadowing due to inherited field value bindings.
This is a followup to a7c8e68dc5: this commit
introduced a new binding in the body of field values, which could silently
shadow outer bindings.  This new warning catches potentially unwanted
shadowing.

* guix/records.scm (make-syntactic-constructor)[check-shadowing]: New
procedure.
[wrap-field-value]: Use it.
* tests/records.scm ("define-record-type* & inherited value shadowing"): New
test.

Change-Id: I81ad14cf10da7213e9f8db987c8b0bd4c41acba2
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Merges: #7424
2026-03-29 22:32:57 +02:00
Ludovic Courtès 0a8acc0059 tests: Pass ‘User-Agent’ header when downloading from www.gnu.org.
This test had been failing for a few months in part due to this change at
www.gnu.org.

* tests/derivations.scm ("fixed-output derivation, network access, external host"):
Pass #:headers to ‘http-get’.

Change-Id: Ife54e65b2665704af433df669df0d4010b49884c
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Merges: #7470
2026-03-29 22:20:59 +02:00
Yarl Baudig 785f4c6ed9 gexp: improve &gexp-input-error with &error-location.
* guix/gexp.scm (gexp->sexp): raise &error-location along &gexp-input-error.
* guix/ui.scm (call-with-error-handling): use this.
* tests/gexp.scm (lower-gexp, invalid input location): New test.

Change-Id: Iee761e5f99502065182d9e6fc8d21399e99ec6c3
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Merges: #7538
2026-03-29 22:11:38 +02:00
Ludovic Courtès ea827812f2 channels: Resolve dependencies recursively.
* guix/channels.scm (closure): New procedure.
(resolve-dependencies): Use it.
* tests/channels.scm ("channel-instance-dependency-resolver"): New test.

Fixes: https://issues.guix.gnu.org/68797
Change-Id: Iaba4f54261e33e18bd57a0a319aa099f259b8570
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Merges: #7137
2026-03-25 23:51:26 +01:00
Sergio Pastor Pérez cf2a11b966 derivations: Let ‘map-derivation’ correctly handle directories.
The 'map-derivation' procedure was trying to process directories as files.
When a derivation had a 'module import' directory as input, it threw an
exception since it tried to open it as a file.

* guix/derivations.scm (map-derivation): In ‘sources’, add
‘file-is-directory?’ case.
* tests/derivations.scm ("map-derivation, modules"): New test.

Fixes: https://issues.guix.gnu.org/71941
Change-Id: I9b766f9aaa03ea9307f73e8abb36bc347af4b5e6
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2026-03-20 22:43:11 +01:00
Ludovic Courtès a7c8e68dc5 records: Let thunked fields refer to their inherited value.
* guix/records.scm (make-syntactic-constructor)[field-index]: New procedure.
[wrap-field-value]: Add optional argument ‘parent’.  When it is true, bind F
to the inherited field value.
[field-bindings/inheritance]: New procedure.
Use it.
* tests/records.scm ("define-record-type* & thunked & no inherited value")
("define-record-type* & thunked & inherited value")
("define-record-type* & thunked & inherited value & this-record"): New tests.
* doc/guix.texi (Defining Package Variants): Update ‘modify-inputs’ example to
refer to ‘inputs’.
(Writing Manifests): Likewise.
* doc/guix-cookbook.texi (Package Variants): Likewise for
‘substitute-keyword-arguments’.

Fixes: https://issues.guix.gnu.org/50335
Change-Id: If4e18155ce203637ff9e116ee8098f8997bfebe2
2026-03-20 13:27:15 +01:00
Hugo Buddelmeijer 7e355ddb3a tests: Fix guix-build-branch.sh.
* tests/guix-build-branch.sh: Use main branch instead of master after
move of guile-gcrypt to codeberg.

Merges guix/guix!6832

Change-Id: I6699cc20440a05d733d7d2bc93d820ca3a162e30
Signed-off-by: Cayetano Santos <csantosb@inventati.org>
2026-03-17 18:45:40 +01:00
Ludovic Courtès 78ddf62bfe style: git-source: Handle more URLs.
* guix/import/utils.scm (tarball-url->git-repository-url): New procedure.
* guix/scripts/style.scm (url-fetch->git-fetch)[transform-source]: Add
‘repository-url’ parameter.
Use ‘tarball-url->git-repository-url’ when ‘home-page’ is not a Git URL.
(transform-to-git-fetch): Rename ‘home-page’ to ‘repository-url’.
* tests/import/utils.scm ("tarball-url->git-repository-url, guile"): New test.
* tests/style.scm ("url-fetch->git-fetch, mirror:// URL"): New test.

Change-Id: I4f8ca7c67a58f917d69380678b62c00962b0f9cd
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2026-03-10 22:53:54 +01:00
jgart f2ead3989e guix: import: cpan: Fill in description field in template.
* guix/import/cpan.scm (cpan-module->sexp): Fill in description field in
template.
* tests/import/cpan.scm (test-source): Update test to account for change in
description text.

Change-Id: I3bc3e4c2cc90f7a1f1f0d56e9213b6a1d0b8e841
Signed-off-by: jgart <jgart@dismail.de>
2026-03-08 11:04:33 -04:00
Ricardo Wurmus ee0a9f27b9 import/cran: Fix import of packages in single quotes.
* guix/import/cran.scm (import-pattern): Also match on single quotes.
(needed-vignettes-inputs-in-directory): Use EXTRACT-IMPORTS.
* tests/import/cran.scm: Add test.

Change-Id: Ie69027992519bd8d886860346f4a359514d8e822
2026-03-07 11:57:24 +01:00
Reepca Russelstein 865cb0188c daemon: Actually remove unreadable directories.
Fixes a regression introduced in 7173c2c0ca.  Additional discussion at
https://codeberg.org/guix/guix/pulls/5977.

* nix/libutil/util.cc (_deletePathAt): chmod directory and retry open when it
  fails with EACCES.  Do this using an O_PATH file descriptor referenced via
  /proc/self/fd whenever possible to avoid it being replaced by a
  non-directory immediately before being chmod'ed.
* nix/libutil/util.hh (deletePath): document TOCTTOU race on non-linux systems
  where hardlinks aren't protected.
* tests/derivations.scm ("unreadable directories in build tree can be
  removed"): new test.

Fixes: guix/guix#5891
Reported-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
Change-Id: I749127fe5254ebabc8387a2f0ef47e3c116bfcc5
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Merges: #6460
2026-02-27 23:54:00 +01:00
Ludovic Courtès 6e2fe68cb0 tests: Do not refer to ‘texlive’ package.
This is a followup to 7f46cd4bec, which broke
this test.

* tests/guix-package.sh: Replace ‘texlive’ with ‘tzdata’.

Change-Id: Ib7fadfaa4f6a19845064ba8dd737b65a16e93064
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Merges: #6332
2026-02-12 23:03:31 +01:00
David Elsing 96bd726277 gexp: Add 'delayed-object'.
* guix/gexp.scm (<delayed-object>): New record type.
(delayed-object): New macro.
(delayed-object-compiler): New gexp compiler.
* tests/gexp.scm ("delayed-object"): New test.
* doc/guix.texi (G-Expressions): Document it.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2026-02-10 23:46:34 +01:00
Yarl Baudig a06c9b0ff7 store: Make derivation-path? use direct-store-path?.
* guix/store.scm (derivation-path?): Use direct-store-path? instead of
store-path?.
* tests/store.scm (derivation-path?): New test.

Change-Id: Ib54b9e2045f19f26039cf072eeb79dab8f0195be
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Merges: #6192
2026-02-10 11:36:16 +01:00
Nicolas Graves 483ee41756 import: pypi: Fix tests.
* guix/import/pypi.scm (unzip-command): Use invoke instead of
system*.
(read-wheel-metadata): Adapt accordingly.
(guess-requirements-from-wheel): Improve readability.

* tests/import/pypi.scm (parse-wheel-metadata): Add test (used to
isolate the issue in another test).
(pypi->guix-package, no wheel): Remove python-wheel from the result.
(pypi->guix-package, no usable requirement file, no wheel.): Likewise.
(pypi->guix-package, package name contains \"-\" followed by digits):
Likewise.
(package-latest-release): Likewise.
(pypi->guix-package, no requires.txt, but wheel): Likewise. Also
improve readability.

Change-Id: I49e6ae549437a068acd85fa0f13471bc0af5a399
Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
2026-02-07 12:28:41 +01:00
Nicolas Graves 5e22e9b3aa import: pypi: Ignore pypi-ignored-inputs.
* guix/import/pypi.scm (pypi-ignored-inputs): New variable.
  (compute-inputs): Use it.

* tests/pypi.scm (parse-requires.txt): Add ignored input to test the
  feature.

* guix/lint.scm (check-inputs-should-be-native): Adapt list.
  (check-inputs-should-not-be-an-input-at-all): Use pypi-ignored-list.

Change-Id: I297793b71f9ffdfbe7cc4e883777f8823941adf0
Modified-by: Sharlatan Hellseher <sharlatanus@gmail.com>
Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
2026-02-07 12:28:37 +01:00
Łukasz Stelmach 8813f8ba34 tests: Fix (getcwd) failing without chroot.
In case chroot and unshare are not available, $test_directory remains the
current directory.  When the directory gets removed (line 119), ‘guix pack’ on
line 121 fails due to (getcwd) failing with ENOENT.

The bug was already present in 272c070962.

* tests/guix-pack.sh: Always do “cd -”.

Change-Id: Ib02bf3714f0c6706b5e759dbb28cf86edf0f1317
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Merges: #6013
2026-02-06 20:49:01 +01:00
Maxim Cournoyer f3d73553cd transformations: Fix recursive?' inheritance for with-git-url'.
* guix/transformations.scm (transform-package-source-git-url): Use the second
value of `package-git-url+recursive?'.
* tests/transformations.scm
("options->transformation, with-git-url, recursive? inheritance"): New test.

Change-Id: Ifd89bf1b0267f2b080b872cc7b318b9ae3706422
2026-01-29 13:51:06 +09:00
Christopher Baines 1c230ec96e scripts: substitute: Default to fast decompression.
This changes the behaviour for the first one or few nars the substitute script
downloads, with uncompressed and zstd compressed nars prefered rather than
picking by file size.

* guix/scripts/substitute.scm: (%default-fast-decompression?): Change to #t.
* tests/substitute.scm ("substitute, preferred nar URL is 404, other is 200"):
Adjust test.

Change-Id: I89202f084cd6b9d506bcb3d46f75de690c6986b5
2026-01-28 17:45:33 +00:00
Ludovic Courtès 0c5d65d540 transformations: Add ‘--amd-gpu’ transformation option.
* guix/transformations.scm (split-on-commas): New procedure, moved from…
(transform-package-toolchain): … here.
(package-amd-gpu-specialization, transform-package-amd-gpu-targets): New
procedures.
(%transformations, %options): Add ‘amd-gpu’.
* tests/transformations.scm ("options->transformations, amd-gpu")
("options->transformations, amd-gpu, not applicable")
("options->transformations, amd-gpu, missing clang-rocm input")
("options->transformations, amd-gpu, wrong GPU"): New tests.
* doc/guix.texi (Package Transformation Options): Document it.

Change-Id: I56bf0dffbf12bc08cf6318fe56952473b395c303
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Merges: #5583
Signed-off-by: Rutherther <rutherther@ditigal.xyz>
2026-01-25 21:25:40 +01:00
Ludovic Courtès d118a89d62 tests: Adjust to Guile 3.0.10+.
Guile 3.0.11 introduced a new implementation of (srfi srfi-34) with subtle
changes wrt. exceptionm handling.  This adjusts to these changes.

Changes in ‘tests/style.scm’ are due to the new output of (ice-9 pretty-print)
in 3.0.10.

* tests/file-systems.scm ("btrfs-store-subvolume-file-name (subvolid)"):
Specify the exception type.
* tests/services/file-sharing.scm ("transmission-password-hash, salt value too short")
("transmission-password-hash, salt value too long"): Likewise.
* tests/store.scm ("store-path-package-name #f"): Change to ‘test-error’
with #t as the exception type.
* tests/style.scm: Skip all the tests on Guile > 3.0.9.
* tests/toml.scm <top level>: Set ‘raise’ in (guix build toml).
("parse-toml: No key"): Use ‘test-error’ instead of ‘test-equal’.
("parse-toml: Assignment to non-table"): Likewise.
("parse-toml: Invalid assignment to implicit table"): Change exception type
to #t
("parse-toml: Assignment to statically defined array"): Likewise.

Change-Id: I54ea77f22d3e95f72dad90690631876e7f013054
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Signed-off-by: Rutherther <rutherther@ditigal.xyz>
2026-01-25 21:23:25 +01:00
Danny Milosavljevic 811ee1ab9f import: nuget: Add tests and documentation.
* guix/import/nuget.scm: Prevent optimizing small functions away completely.
* tests/import/nuget.scm: New file.
* doc/guix.texi (nuget): Document it.
* Makefile.am (SCM_TESTS): Add reference to it.

Fixes: guix/guix#5483
Change-Id: Id58932fe404a11a03e61a91d3b6177b39548f1bc
2026-01-19 19:21:52 +01:00
Hilton Chain 01b97dff35 import: crate: Generate comments with ‘TODO REVIEW:’ prefix.
This distinguishes them from manually added ones.  When committing changes,
these ‘TODO REVIEW’ comments should be addressed and removed first.

If you're working with Rust packaging, please update your local Guix to this
commit to apply the change.

* guix/import/crate.scm (cargo-lock->expressions): Generate comments with
‘TODO REVIEW:’ prefix.
* tests/import/crate.scm ("crate-lockfile-import"): Don't check the exact
comment string.
* doc/guix-cookbook.texi (Common Workflow for Rust Packaging),
* gnu/packages/rust-crates.scm: Adjust accordingly.

Change-Id: I76b914b49be46d04cc61b101b6bc9e31cadb7f07
Signed-off-by: Rutherther <rutherther@ditigal.xyz>
Merges: #4567
2026-01-18 10:13:38 +01:00