Commit graph

8022 commits

Author SHA1 Message Date
Maxim Cournoyer
5af2a0c390
import/pypi: Improve renaming procedure.
A package named upstream like 'tmdb-python' now gets named 'python-tmdb'
instead of 'python-tmdb-python', which is ugly and doesn't match our
convention (info "(guix) Python Modules").

* guix/import/pypi.scm (python->package-name): Turn a -python suffix into a
python- prefix.

Change-Id: I7c0227d569c0afe6b16329d7cedb51728e4365b0
2025-04-14 13:34:00 +09:00
Nicolas Graves via Guix-patches via
d3086f85e0
import: npm-binary: Handle vector of licenses.
* guix/import/npm-binary.scm (<package-revision>)[license]: Handle the
case where a vector of licenses is used.

* tests/npm-binary.scm (foo-json): Redefine as a procedure with
license keyword.
  (test-source-hash): Redefine with direct reference to test-source.
  (foo-sexp): Redefine as a procedure with license keyword.
  (npm-binary->guix-package test): Use foo-json and foo-sexp.
  (npm-binary->guix-package with multiple licenses): Add test.

Change-Id: I9d6adb2ae2820678260fed1a67e91e22feb448b8
Signed-off-by: Jelle Licht <jlicht@fsfe.org>
2025-04-13 14:19:43 +02:00
Nicolas Graves via Guix-patches via
8aca24f41e
import: npm-binary: Improve-style.
* guix/import/binary.scm (resolve-package): Use and-let*.

Change-Id: I41688c319ad4a6e73c04cb5bd4ed70365e6c7e4d
Signed-off-by: Jelle Licht <jlicht@fsfe.org>
2025-04-13 14:19:43 +02:00
Nicolas Graves via Guix-patches via
23e001d9cb
import: npm-binary: Improve npm-package->package-sexp.
* guix/import/npm-binary.scm (npm-package->package-sexp): Use record
matching.

Change-Id: If4e60162a84cb8d9694882eab933afa7028b02d7
Signed-off-by: Jelle Licht <jlicht@fsfe.org>
2025-04-13 14:19:43 +02:00
Nicolas Graves via Guix-patches via
4b47728a6b
import: npm-binary: Fix import.
This is a follow-up to 0881a674cce3af6ebe0c1c85000e2726cbe6fc54.

* guix/import/npm-binary.scm (npm-package->package-sexp): Use modify-json.
* tests/npm-binary.scm (npm-binary->guix-package test): Use modify-json.

Change-Id: I70523a890948b218c0d82d94a6edf8775521473e
Signed-off-by: Jelle Licht <jlicht@fsfe.org>
2025-04-13 14:19:43 +02:00
Nicolas Graves
1f25dff3e1
build-system/tree-sitter: Add guile-json extension.
* guix/build-system/tree-sitter.scm (default-guile-json): New variable.
(tree-sitter-cross-build, tree-sitter-build): Use guile-json extension.

Signed-off-by: Jelle Licht <jlicht@fsfe.org>
Change-Id: Ib6124d7bde26e6c6711905a651858e9d99a61a1f
2025-04-13 14:19:43 +02:00
Nicolas Graves
c48019577c
build-system/tree-sitter: Switch to (json).
* guix/build/tree-sitter-build-system.scm (patch-dependencies,
install): Switch from (guix build json) to (json).

Signed-off-by: Jelle Licht <jlicht@fsfe.org>
Change-Id: I8de71c74475514c932e84303a20f0409419e8527
2025-04-13 14:19:43 +02:00
Nicolas Graves
93d4d16375
build-system/node: Use test-target argument.
* guix/build/node-build-system.scm (check): Use test-target argument.

Signed-off-by: Jelle Licht <jlicht@fsfe.org>
Change-Id: I5b6b273d7c8ad9f9b4d48a5e50e000adcf504402
2025-04-13 14:19:43 +02:00
Nicolas Graves
7cc5ddf763
build-system/node: Add guile-json extension.
* guix/build-system/node.scm (default-guile-json): New variable.
(node-build): Use guile-json extension.

Signed-off-by: Jelle Licht <jlicht@fsfe.org>
Change-Id: I68eb291410fc4943395c876ba702360b4cd7be4f
2025-04-13 14:19:43 +02:00
Daniel Khodabakhsh
3e9e164154
build-system/node: New API for modifying json.
Introduce (modify-json), (delete-fields), and (replace-fields) to node-build-system

This change introduces helper procedures (modify-json) which takes in lambdas
 which modify the target json #:file which defaults to package.json
This change also includes (delete-fields) and (replace-fields) to help deleting
 and replacing the value of fields in a package.json file.

* guix/build/node-build-system.scm
(modify-json, modify-json-fields, delete-fields, replace-fields,
delete-dev-dependencies): New API exported procedures.
(with-atomic-json-file-replacement, delete-dependencies): Change
procedures to adapt to the new API.

* gnu/packages/node.scm (node-ms-bootstrap,
node-binary-search-bootstrap, node-debug-boostrap,
node-llparse-builder-bootstrap, node-llparse-frontend-boostrap,
node-llparse-bootstrap): Use new API procedures.

* gnu/packages/node-xyz.scm (node-acorn, node-addon-api,
node-buffer-crc32, node-crx3, node-debug, node-file-uri-to-path,
node-ieee754, node-inherits, node-irc, node-irc-colors, node-minimist,
node-ms, node-nan, node-normalize-path, node-once, node-path-key,
node-pbf, node-protocol-buffers-schema, node-readable-stream,
node-resolve-protobuf-schema, node-safe-buffer,
node-safe-stable-stringify, node-semver, node-serialport,
node-serialport-bindings, node-serialport-stream, node-sqlite3,
node-string-decoder, node-tiddlywiki, node-wrappy, node-yazl): Use new
API procedures.

Change-Id: I957f7ca814078d2136d5261985174820235f1369
Signed-off-by: Jelle Licht <jlicht@fsfe.org>
2025-04-13 14:19:43 +02:00
Daniel Khodabakhsh
86caf257e7
build-system/node: Switch to (json).
Replace (guix build json) with (json) in node-build-system

* guix/build/node-build-system.scm
(jsobject-ref, jsobject-update, jsobject-union, newest,
unkeyed->keyed): Remove unused functions.
(with-atomic-json-file-replacement): Switch to (json) module.  Move
file argument as a second optional argument.
(alist-update): Switch to (json) module.  Remove optional default
argument.
(patch-dependencies, delete-dependencies, build): Switch to (json)
module.  Arguments are unchanged.

* guix/build-system/node.scm (%node-build-system-modules): Switch
to (json) module.

* gnu/packages/node-xyz.scm (node-acorn, node-addon-api,
node-serialport-bindings, node-sqlite3): Adapt package custom
<#:phases> to the replacement.

Change-Id: I9fd5152a98b6a241d414e9a94ab179c9cabcfb85
Signed-off-by: Jelle Licht <jlicht@fsfe.org>
2025-04-13 14:19:34 +02:00
Sergey Trofimov
c705d6e035
man-db: Support mdoc-formatted man pages.
* guix/man-db.scm (man-page->entry): Extract man name and section from
.Dt macro.

Change-Id: I02dc99d73dceecdb077315805025efad9a650e91
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-04-11 12:18:02 +02:00
Sergey Trofimov
80cda80489
man-db: Parse man macro arguments better.
* guix/man-db.scm (man-macro-tokenize): New procedure to parse man
macros.
(man-page->entry): Parse macro line using man-macro-tokenize.

Change-Id: Iea0ffbc65290757df746138e0a6174646b5a3eb8
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-04-11 12:18:02 +02:00
Ludovic Courtès
21221710f2
gexp: ‘local-file’ expands its argument only once.
Fixes a bug whereby (local-file (in-vicinity (getcwd) "xyz")) would
point to different files depending on the current working directory at
the time it is lowered.

* guix/gexp.scm (local-file): Expand FILE only once.
* tests/gexp.scm ("local-file, capture at the right time"): New test.

Change-Id: I2cc23296de3799e68f7d8b7be6061be3043e1176
2025-04-06 11:23:07 +02:00
Maxim Cournoyer
e2f37229e5
download: Remove unreachable mirror URL.
This one was returning 404.

* guix/download.scm (%mirrors) <savannah>: Remove
"https://de.freedif.org/savannah/".

Change-Id: I0fd59ec87cf7c89459f07dafb9cafbbe12c11fd2
2025-04-03 22:28:10 +09:00
Maxim Cournoyer
bfcfd28f9b
least-authority: Preserve systemd LISTEN_* environment variables.
Otherwise, combining make-systemd-constructor with least-authority-wrapper
would not work correctly out of the box.

* guix/least-authority.scm (%precious-variables): Add "LISTEN_PID"
"LISTEN_FDS" "LISTEN_FDNAMES" environment variables.

Change-Id: Idd259b15463920965f530e1917d76bf97def3b7b
Reviewed-by: Ludovic Courtès <ludo@gnu.org>
2025-04-03 20:24:15 +09:00
Ludovic Courtès
eb04a0d2c9
lint: cve: Catch HTTP GET errors.
Fixes a bug where ‘guix lint -c cve’ would crash when nvd.nist.gov
returns 503 or similar.

* guix/lint.scm (current-vulnerabilities*): Wrap
‘current-vulnerabilities’ call in ‘guard’ and return the empty list in
case of ‘http-get-error?’.

Change-Id: I76d5f22c260999154af7b73630f783555747aa7a
2025-04-01 14:51:20 +02:00
Nicolas Graves
67d640ef36
guix: scripts: system: Export report-shepherd-error.
* (guix/scripts/system.scm): Export report-shepherd-error.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-04-01 14:49:34 +02:00
Nicolas Graves
b6d89759a7
guix: scripts: reconfigure: Export running-services variable.
* (guix/scripts/reconfigure.scm): Export running-services variable.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-04-01 14:49:34 +02:00
Nicolas Graves
ebb2f7818c
guix: scripts: system: Export profile-boot-parameters function.
* (guix/scripts/system.scm): Export profile-boot-parameters function.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-04-01 14:49:33 +02:00
Evgeny Pisemsky
ea6f4ee097
import: pypi: Fix null at home-page.
Reported in #73314: PyPI importer gives null at home-page for some
packages.

* guix/import/pypi.scm (<project-info>): [home-page]: Apply
NON-EMPTY-STRING-OR-FALSE to make it consistence with similar fields,
covering the case when PyPI's JSON file metadata file does not have the
information.

Change-Id: I501582988cf58b00bd201c12ad47e9b095988fae
Reported-by: Evgeny Pisemsky <mail@pisemsky.site>
Reviewed-by: Simon Tournier <zimon.toutoune@gmail.com>
Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
2025-04-01 08:55:37 +01:00
Ludovic Courtès
ae18b3d9e6
daemon: Allow running as non-root with unprivileged user namespaces.
Many thanks to Reepca Russelstein for their review and guidance on these
changes.

* nix/libstore/build.cc (guestUID, guestGID): New variables.
(DerivationGoal)[readiness]: New field.
(initializeUserNamespace): New function.
(DerivationGoal::runChild): When ‘readiness.readSide’ is positive, read
from it.
(DerivationGoal::startBuilder): Call ‘chown’
only when ‘buildUser.enabled()’ is true.  Pass CLONE_NEWUSER to ‘clone’
when ‘buildUser.enabled()’ is false or not running as root.  Retry
‘clone’ without CLONE_NEWUSER upon EPERM.
(DerivationGoal::registerOutputs): Make ‘actualPath’ writable before
‘rename’.
(DerivationGoal::deleteTmpDir): Catch ‘SysError’ around ‘_chown’ call.
* nix/libstore/local-store.cc (LocalStore::createUser): Do nothing if
‘dirs’ already exists.  Warn instead of failing when failing to chown
‘dir’.
* guix/substitutes.scm (%narinfo-cache-directory): Check for
‘_NIX_OPTIONS’ rather than getuid() == 0 to determine the cache
location.
* doc/guix.texi (Build Environment Setup): Reorganize a bit.  Add
section headings “Daemon Running as Root” and “The Isolated Build
Environment”.  Add “Daemon Running Without Privileges” subsection.
Remove paragraph about ‘--disable-chroot’.
(Invoking guix-daemon): Warn against ‘--disable-chroot’ and explain why.
* tests/derivations.scm ("builder is outside the store"): New test.

Reviewed-by: Reepca Russelstein <reepca@russelstein.xyz>
2025-03-26 17:57:43 +01:00
Christopher Baines
0807035449
build-system: go: Support parallel options for cross builds.
Since these options were added for normal builds, those packages that used
these options couldn't be cross built.  Supporting these options in
go-cross-build restores this functionality.

* guix/build-system/go.scm (go-cross-build): Support the #:parallel-build? and
 #:parallel-tests? keyword arguments.

Change-Id: I9768c9562246b61c2ea875a3d5a42809924f3a7d
2025-03-25 18:20:53 +00:00
Maxim Cournoyer
2fa43fccb7
search-paths: $Add XDG_DATA_DIRS.
Change-Id: Ibc0202481fd4c2a892312d1941e938f7c1f32aa0
2025-03-18 16:12:38 +09:00
Maxim Cournoyer
e77a676f21
gnu-maintenance: Better fix for 'guix refresh --update'.
The previous fix introduced in commit 8176277487 ("import: Avoid duplicate
trailing '/' in computed import URL.") regressed on the handling of *file*
source URIs:

  $ guix refresh cairo --update

  Starting download of /tmp/guix-file.xUKazf
  From https://cairographics.org/cairo-1.18.4.tar.xz...
  download failed "https://cairographics.org/cairo-1.18.4.tar.xz" 404 "Not Found"

* guix/gnu-maintenance.scm (import-html-release): Revert commit 8176277487,
instead adding a trailing slash only if it doesn't already exist.

Change-Id: I6e3889f14badd8843bbf6436ad62a1594f553afe
2025-03-12 21:32:04 +09:00
Leo Famulari
361a1743df
lint: tzdata and nss-certs should probably not be inputs at all.
* guix/lint.scm (check-inputs-should-not-be-an-input-at-all): Add tzdata and
nss-certs to the list of bad ideas.

Change-Id: I321d6989fc96013565d8be4480ee9928b7784245
2025-03-11 22:29:27 -04:00
Ludovic Courtès
2447880875
gexp: No symlinks for ‘imported-files/derivation’.
Fixes <https://issues.guix.gnu.org/76376>.

This is a followup to 149de38d0a2560277ee9bdda2104fbd45608bcb2, which
did not suitably follow symlinks.  The test case didn’t catch this
because, when using ‘--disable-chroot’, the symlink target is accessible
within the build environment.

* guix/gexp.scm (imported-files/derivation): Call ‘readlink*’ on ‘file-name’.

Co-authored-by: Ryan Sundberg <ryan@arctype.co>
Change-Id: Idc5b59cd8f0c1217e84c7cbfba64d97d5999429f
2025-03-10 15:41:32 +01:00
Brian Kubisiak
60c41183d9
ui: Search channels for guix extensions
* guix/describe.scm (append-channels-to-load-path!): New function.
* gnu/packages.scm (%package-module-path): Call new function. Remove
the code that the function call replaces.
* guix/ui.scm (extension-directories): Call new function. Search
channels for guix extensions.
* guix/self.scm (compiled-guix)[*core-modules*]: Add 'guile-git' to
the list of extensions.

Change-Id: I53af828dc554485ca28389c9e2653ea6b4fb6b7e
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-03-08 17:40:58 +01:00
David Elsing
70c7b4d7f0
packages: Honor system and target system for graft replacements.
Fixes <https://issues.guix.gnu.org/76110>.

Fixes a regression introduced in
28e4018e59 where the system and target
system would be ignored.

* guix/packages.scm (input-graft, input-cross-graft): Wrap graft replacement
in ‘with-parameters’.
* tests/packages.scm ("package-grafts, indirect grafts")
("package-grafts, indirect grafts, propagated inputs")
("package-grafts, same replacement twice")
("package-grafts, dependency on several outputs")
("replacement also grafted"): Adjust accordingly by comparing the replacement
after lowering to a derivation.
("package-grafts, indirect grafts, #:system argument"): New test.

Change-Id: I1663f0cc50842bb9abb53ba4aa9935052022d1f4
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Reported-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
2025-03-08 16:16:02 +01:00
Maxim Cournoyer
ec8e15584c
refresh: Set default value of `key-download' option to 'auto.
This is a follow-up to commit 79a46d6537 ("gnupg: Automatically fallback to
'always policy when non-interactive."), which introduced the following
problem:

  guix refresh --update libvirt
   -> guix refresh: error: invalid key-download policy: #f

* guix/scripts/refresh.scm (%default-options): Set default key-download option
value to 'auto.
(%options): Accept auto as a valid value from the command line.

Change-Id: I45ceee8e07d1a3a3c377e12ed017813f92289565
2025-03-05 22:44:15 +09:00
David Elsing
30e51cb6b4
gexp: ‘with-parameters’ properly handles ‘%graft?’.
Fixes <https://issues.guix.gnu.org/75879>.

* .dir-locals.el (scheme-mode): Remove mparameterize indentation rules.
Add state-parameterize and store-parameterize indentation rules.
* etc/manifests/system-tests.scm (test-for-current-guix): Replace
mparameterize with store-parameterize.
* etc/manifests/time-travel.scm (guix-instance-compiler): Likewise.
* gnu/tests.scm (compile-system-test): Likewise.
* guix/gexp.scm (compile-parameterized): Use state-call-with-parameters.
* guix/monads.scm (mparameterize): Remove macro.
(state-call-with-parameters): New procedure.
(state-parameterize): New macro.
* guix/store.scm (store-parameterize): New macro.
* tests/gexp.scm ("with-parameters for %graft?"): New test.
* tests/monads.scm ("mparameterize"): Remove test.
("state-parameterize"): New test.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
Change-Id: I0c74066ca3f37072815b073fb3039925488a9645
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-03-05 00:28:49 +01:00
Ludovic Courtès
749eb1a2dd
services: ‘shepherd-service-upgrade’ handles canonical name changes.
Partly fixes <https://issues.guix.gnu.org/76315>.

Fixes a bug whereby a service whose canonical name has changed would not
be restarted—e.g., if '(syslogd) has a replacement providing
'(system-log syslogd).

* gnu/services/shepherd.scm (shepherd-service-upgrade)[running?]:
Remove.
[to-restart]: Change to a subset of LIVE.  Look up all the names of each
element of TARGET.
* guix/scripts/system/reconfigure.scm (upgrade-shepherd-services):
TO-RESTART is now a list of <live-service>; adjust accordingly.
* 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"):
("shepherd-service-upgrade: transient service"): Adjust accordingly.
("shepherd-service-upgrade: service has new canonical name"): New test.

Reported-by: Tomas Volf <~@wolfsden.cz>
Change-Id: I7cec495b4e824da5fad5518f039607cf92f935d9
2025-03-05 00:28:49 +01:00
Ludovic Courtès
c92fbc83d4
substitutes: Tolerate GnuTLS push/pull errors when fetching narinfos.
Fixes <https://issues.guix.gnu.org/75679>.

Fixes this infamous error:

  substitute: looking for substitutes on 'https://bordeaux.guix.gnu.org'...   0.0%guix substitute: error: TLS error in procedure 'write_to_session_record_port': Error in the push function.
  guix system: error: `/gnu/store/…-guix-1.4.0-32.5f6fdad/bin/guix substitute' died unexpectedly

* guix/substitutes.scm (call-with-connection-error-handling): Report
‘error/push-error’ and ‘error/pull-error’ as mere warnings.

Reported-by: Timo Wilken <git@twilken.net>
Change-Id: Ibc507cb88b164cbb91dff95aa18d9974c573f7c9
2025-03-05 00:28:49 +01:00
Christopher Baines
b55e3b1a4b
publish: Call (current-processor-count) later.
So that this is evaluated when the main part of the script runs.

I'm looking at this to allow using setaffinity in the publish tests.

* guix/scripts/publish.scm (%default-options): Remove workers default.
(guix-publish): Move the default to here.

Change-Id: I83cd0d048f2641291b5bd8a932b479b23dd92d29
2025-03-03 20:14:54 +00:00
Christopher Baines
15615db61b
build-system: asdf: Don't search and replace inputs when unnecessary.
If the new-name matches the original name, just use the original package.
This avoids situations where there are several packages matching the name and
the behaviour will be inconsistent, occasionally picking different packages.

Since there are multiple glibc packages currently, I'm seeing this behaviour
with cl-posix-mqueue and ecl-cl-posix-mqueue, occasionally they'll use the
hurd glibc variant.

* guix/build-system/asdf.scm (package-with-build-system): Use the original
input packages unless the new-name differs.

Change-Id: I08a1f3ad1290689b5497d31950ada4dc0bfa3a3a
2025-03-03 14:13:52 +00:00
Maxim Cournoyer
3088e5ee53
Extend a few more importers with support for #:partial-version?.
This fixes a few omissions in commit f13f076968 ("refresh: Add support for
partial target versions.").

* guix/gnu-maintenance.scm
(import-kernel.org-release): Add #:partial-version? argument.
* guix/gnu-maintenance.scm (import-savannah-release): Likewise.
(import-xorg-release): Likewise.
(import-kernel.org-release): Likewise.
(latest-sourceforge-release): Likewise (reporting an error).  Use report-error
instead of error directly.

Change-Id: I188fa8fa7250a7165410b8d5c4870f428ea228af
2025-03-03 00:31:46 +09:00
Maxim Cournoyer
8176277487
import: Avoid duplicate trailing '/' in computed import URL.
Unlike for file names, duplicate slashes in URLs matter.  For example
attempting to refresh 'qemu' would previously not find any result because it'd
try to find links from 'https://download.qemu.org//', which is unreachable.

* guix/gnu-maintenance.scm (import-html-release): Use canonicalize-url to join
BASE-URL and DIRECTORY, which handles trailing '/' correctly.

Change-Id: I108a542c4eede85c78a47f62921184273dc1ea01
2025-03-03 00:31:45 +09:00
Efraim Flashner
98be4efdb8
guix build: Honor '--system' with '--manifest'.
* guix/scripts/build.scm (options->things-to-build): Wrap the manifest
build option with the result of the '--system' option.

Change-Id: I1c3ff93af56bb659ddc00e1872c769cfc5e7a0d5
2025-03-02 16:46:59 +02:00
Arun Isaac
b0d3a38f4c
deploy: Add --roll-back option.
* guix/scripts/deploy.scm (guix-deploy): Add the --roll-back option.
(show-what-to-deploy): Add #:roll-back? argument.
(roll-back-machine*): New function.
(show-help): Document the --roll-back option.
* doc/guix.texi (Invoking guix deploy): Document the --roll-back option.

Change-Id: Ic5084f287aefb2d1d28380ca4ba1c6971cb913e7
2025-03-01 00:18:38 +00:00
Ludovic Courtès
6f6a008bb1
download: ‘url-fetch/*bomb’ use ungrafted Guile derivation.
Fixes a bug whereby the derivation of origins using one of these methods
would depend on whether grafts are enabled, in practice causing rebuilds
for anyone keeping grafts enabled—e.g., ‘java-xz’ and its 142
dependents.

* guix/download.scm (url-fetch/tarbomb, url-fetch/zipbomb):
Pass #:graft? #f when computing ‘guile’.

Reported-by: Ricardo Wurmus <rekado@elephly.net>
Change-Id: I75d634fcaf20c9912419c26ca251fff136c528c6
2025-02-28 23:03:36 +01:00
Maxim Cournoyer
f13f076968
refresh: Add support for partial target versions.
* guix/import/utils.scm (find-version): New procedure.
* guix/scripts/refresh.scm (<update-spec>) [partial?]: New field.
(update-spec-partial?): New accessor.
(update-spec): Add a PARTIAL? optional argument.
(update-specification->update-spec) <update-spec>: Call with its new PARTIAL?
optional argument when FALLBACK-VERSION is provided, i.e. when
'--target-version' was used.
(update-package): Remove the PACKAGE and VERSION positional arguments, and
replace them with UPDATE-SPEC.  Update doc.  Call `package-update' with its
new #:partial-version? argument.
(check-for-package-update) <package-latest-release>: Pass the new
 #:partial-version? argument to it.
(guix-refresh) <update-package>: Adjust call accordingly.
(show-help): Udate doc.
* guix/upstream.scm (package-latest-release): Add #:partial-version? argument,
and apply it to the importer call.
(package-update): Add #:partial-version?> argument.  Update doc.  Pass it to
the `package-latest-release' call.
* guix/gnu-maintenance.scm (rewrite-url): Add #:partial-version? argument.
Update doc.  Crawl URL for newer compatible versions when provided.
(import-html-release): Add #:partial-version? argument, and pass it to the
`rewrite-url' call.  Use `find-version' to find the best version.
(import-release, import-ftp-release, import-gnu-release)
(import-release*): Add #:partial-version? argument and honor it.
(import-html-updatable-release): Add #:partial-version? argument, and pass it
to the `import-html-release' call.
* guix/import/gnome.scm (import-gnome-release)
<#:partial-version?>: Add new argument and honor it.
* guix/import/texlive.scm (latest-texlive-tag): Rename to...
(texlive-tags): ... this, and have it return all tags.
(texlive->guix-package): Adjust accordingly.
(latest-release): Add a #:partial-version? argument.  Update doc.
* guix/import/stackage.scm (latest-lts-release): New #:partial-version?
argument.
* guix/import/pypi.scm (import-release): New #:partial-version? argument; pass
it to `pypi-package->upstream-source'.
* guix/import/opam.scm (latest-release): New #:partial-version? argument.
* guix/import/minetest.scm (latest-minetest-release): New #:partial-version?
argument.
(pypi-package->upstream-source): New #:partial-version? argument.  Update doc.
* guix/import/launchpad.scm (latest-released-version): Rename to...
(release-versions): ... this, making it return all versions.
(import-release) <#:partial-version?>: New argument.
* guix/import/kde.scm (import-kde-release)
<#:partial-version?>: New argument.  Update doc.  Refactor to honor argument.
* guix/import/hexpm.scm (lookup-hexpm): Update doc.
(hexpm-latest-release): Rename to...
(hexpm-releases): ... this; return all release strings.
(hexpm->guix-package): Adjust accordingly.
(import-release): Add and honor a #:partial-version? argument.  Update doc.
* guix/import/hackage.scm (import-release): New #:partial-version? argument.
* guix/import/cpan.scm (latest-release): New #:partial-version? argument.
* guix/import/crate.scm (max-crate-version-of-semver): Improve doc.
(import-release): Add a #:partial-version? argument and honor it.
* guix/import/egg.scm (find-latest-version): Rename to...
(get-versions): ... this, returning all versions.
(egg-metadata): Adjust accordingly.
(egg->guix-package): Likewise.
(import-release): Add a new #:partial-version? argument and honor it.
* guix/import/elpa.scm (latest-release):  New #:partial-version? argument.
* guix/import/gem.scm (get-versions): New procedure.
(import-release): Add a new #:partial-version? argument and honor it.
* guix/import/git.scm (version-mapping): Update doc; streamline a bit.
(latest-tag): Rename to...
(get-tags): ... this, dropping the #:version keyword and returning the complete
tags alist.  Update doc.
(latest-git-tag-version): Rename to...
(get-package-tags): ... this, returning the complete tags alist of the
package.  Update doc.
(import-git-release): Add a new #:partial-version? argument and honor it.
Update doc.
* guix/import/github.scm (latest-released-version): Rename to...
(get-package-tags): ... this, returning all tags.  Update doc.
(import-release): Add a new #:partial-version? argument and honor it.
* guix/import/cran.scm (latest-cran-release)
(latest-bioconductor-release): Add #:partial-version? argument.
* guix/import/composer.scm (latest-version): Delete procedure.
(composer-fetch): Add #:partial-version? keyword and honor it.  Update doc.
(import-release): Likewise.
* guix/import/test.scm (import-release): Add #:partial-version? argument.
* tests/guix-refresh.sh: Add test.
* tests/gem.scm (test-foo-versions-json): New variable.
(package-latest-release): Mock new URL.
* tests/import-git.scm (latest-git-tag-version): New procedure.
* tests/gnu-maintenance.scm (libuv-dist-html)
(libuv-dist-1.46.0-html, libuv-dist-1.44.2-html)
(libuv-html-data): New variables.
(mock-http-fetch/cached): New procedure.
("rewrite-url, without to-version"): Rewrite using the above.
("rewrite-url, partial to-version"): New test.
* doc/guix.texi <"Invoking guix refresh">: Update doc.

Series-to: 75871@debbugs.gnu.org
Change-Id: I092a58b57ac42e54a2fa55e7761e8c6993af8ad4
2025-02-28 13:36:44 +09:00
Maxim Cournoyer
79a46d6537
gnupg: Automatically fallback to 'always policy when non-interactive.
Previously to this change, the 'guix refresh' download
policy (--key-download)would default to 'interactive', which would throw a
backtrace when guix was invoked with its stdin not connected to a peusdo
terminal (tty).  This change makes the new default value 'auto' use
interactive only in an interactive environment, with 'always' used as
fallback.

* doc/guix.texi (Invoking guix refresh): Adjust doc.
* etc/completion/fish/guix.fish: Adjust accordingly.
* etc/completion/zsh/_guix (_guix_list_installed_packages): Likewise.
* guix/gnupg.scm (gnupg-verify*): Change default #:key-download argument value
to 'auto.  Update doc.  Validate argument.  Raise an error in case read-line
returns #<eof>.
* guix/import/gnu.scm (gnu-package->sexp): <#:key-download>: Change default
value to 'auto.
* guix/import/gnu.scm (gnu->guix-package): <#:key-download>: Likewise.
* guix/scripts/import/gnu.scm (%options): Add "auto" to accepted
--key-download values.
(%default-options): Set default key-download option to the 'auto value.
(show-help): Update doc.
* guix/scripts/refresh.scm (show-help): Update doc.
(update-package) <#:key-download>: Change default value to 'auto.  Update doc.
* guix/upstream.scm (download-tarball): <#:key-download>: Likewise.
(package-update): Likewise.

Change-Id: Id1ca8fd6d453ca4bc5b372534445e3beab9133a8
Fixes: https://issues.guix.gnu.org/76112
Reviewed-by: Ludovic Courtès <ludo@gnu.org>
2025-02-28 13:36:44 +09:00
Ludovic Courtès
48e0e6a127
git: Really enable timeouts when supported by Guile-Git.
This is a followup to 8bd013011d.

Previously, the call to ‘defined?’ would look for those bindings
in (current-module), where chances were that they would be missing;
consequently timeouts were never enabled.  This fixes that.

* guix/git.scm (set-git-timeouts)[defined?]: New procedure.

Change-Id: Ia14a351fd6d508f760992d7bb68d2f4bb61f8468
2025-02-24 23:33:51 +01:00
Ludovic Courtès
59167a010b
time-machine: Remove unused binding from #:select.
* guix/scripts/time-machine.scm: Remove unused binding from #:select.

Change-Id: I2e6ff09f02659a8967d10f98ad30d638808dbf1c
2025-02-24 23:33:51 +01:00
Maxim Cournoyer
0bda75dd47
derivations: Fix indentation.
* guix/derivations.scm (derivation): Fix indentation.

Change-Id: I2407b59788ce335c21c181d9f9e3f26a359e9bf5
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
2025-02-22 23:55:24 +09:00
Vagrant Cascadian
70353a898b
guix: Fix typos.
* guix/build/kconfig.scm (modify-deconfig): Fix spelling of "abbreviation".
* guix/docker.scm (build-docker-image): Fix spelling of "split".
* guix/scripts/pack.scm (docker-image): Fix spelling of  "split".
2025-02-20 11:54:55 -08:00
Efraim Flashner
e582903481
guix: Fix some misspellings.
Change-Id: Ia036217dadc1624c5f0d59fd44f646d46315c1f3
2025-02-19 11:28:40 +02:00
Efraim Flashner
77ad73b333
guix: lint: Check for more misspelled words in descriptions.
* guix/lint.scm (check-description-style)[check-description-typo]: Add
more common misspellings.

Change-Id: I1342c150e8af809ef954fb5d13f65dd3bd8c8cf3
2025-02-19 11:08:59 +02:00
Tomas Volf
93d49dcd1c
build: glib-or-gtk: Export %glib-or-gtk-build-system-default-modules.
The list of modules used by default was not public, so users of this build
system had to pick between copy&pasting the list, or using
%glib-or-gtk-build-system-modules.  The former is sub-optimal, since it is
hard to keep it in sync.  The latter is just wrong and leads to basically
fall-backing to gnu-build-system.

The solution is to export the default list giving the users option to use it
directly.

* guix/build-system/glib-or-gtk.scm
(%glib-or-gtk-build-system-default-modules): Renamed from %default-modules.
(define-module): Export it.
(glib-or-gtk-build), (glib-or-gtk-cross-build): Use it.

Change-Id: I331b2a3f0bdc3ce14eb9f2f80605e7873369168d
Signed-off-by: Andreas Enge <andreas@enge.fr>
2025-02-17 13:17:48 +01:00
Ekaitz Zarraga
b609498bcf
guix: import: allow empty description
* guix/import/utils.scm (beautify-description)[new-words]: Don't fail
  the `match` when the package has an empty description.

Change-Id: I23e9cfeae1da98bb8705fcfc8ff81906d272d72e
2025-02-16 11:11:15 +01:00