Commit graph

8214 commits

Author SHA1 Message Date
Rutherther
7d1d1d1f7c
guix: update-cached-checkout: Fix fetching remote for branches, commits and tags.
Follow up of 66463356ce.

Because of the mentioned change, update-cached-checkout doesn't
update the checkout for branches, commits or tags.

This means `guix pull` with %default-channels no longer pulls
newer versions. `forward-update-check` no longer fetches the
commit to check relations for, leading to an error that
reference is not available.

* guix/git.scm (update-cached-checkout): Fetch remote even if symref-list is
empty.

Change-Id: Ia6bb1c669065cf19a6dd16c2a403e8590bc07613
2025-09-23 13:20:31 -07:00
Yelninei
d9e2ee3e99
packages: Add x86_64-gnu to %cuirass-supported-systems.
* guix/packages.scm (%cuirass-supported-systems): Add x86_64-gnu.

Change-Id: I5aa8bcc511d3e12364a35ce8dac35965e0d9709b
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-09-23 11:13:22 +02:00
Ludovic Courtès
d12c4452a4
shell, inferior: Store GC roots under /var/guix/profiles.
Fixes guix/guix#2410.

Until now, ‘guix shell’ and ‘guix time-machine’ would store GC roots under
~/.cache/guix.  However, this directory is unreadable to guix-daemon when it’s
running without root privileges.  This commit changes ‘guix shell’ and ‘guix
time-machine’ so they store GC roots under /var/guix/profiles/per-user/$USER,
in a world-readable directory.

An added benefit is that, in cluster setups, user homes no longer need to be
mounted on the head node for GC to work (assuming ‘guix build -r’ and similar
are not used).

* guix/inferior.scm (%inferior-cache-directory): Change default value to be
under ‘%profile-directory’.
(%legacy-inferior-cache-directory): New variable.
(cached-channel-instance): Add ‘maybe-remove-expired-cache-entries’ call.
* guix/scripts/environment.scm (launch-environment/container)[nesting-mappings]:
Add /inferiors and /profiles sub-directories of ‘%profile-directory’.  Call
‘mkdir-p’ for these two directories.
* guix/scripts/shell.scm (%profile-cache-directory): Change default value to
be under ‘%profile-directory’.
(%legacy-cache-directory): New variable.
(guix-shell): Add call to ‘maybe-remove-expired-cache-entries’.

Change-Id: Ie7d6c16a55b35c7beb18078c967d6fc902bf68d0
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-09-23 11:13:22 +02:00
Romain GARBAGE
66463356ce
git: Create/update remote references locally when needed.
This allows ‘update-cached-checkout’ to fetch symbolic references such as
those created by the AGit workflow with Forgejo instances.

* guix/git.scm (update-cached-checkout): Create/update remote references
locally.

Change-Id: Ice761d09eebc4f1275381a4eefbdd679d9b95127
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-09-23 11:13:22 +02:00
Romain GARBAGE
0a670987c7
inferior: Use channel-reference to get a Git reference.
* guix/inferior.scm (channel-full-commit): Use channel-reference to get a Git reference.

Change-Id: Ia07f8d202ba1df1497d2763d8d49d547c6955ca6
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-09-23 11:13:22 +02:00
Romain GARBAGE
b6a739465d
channels: Export channel-reference.
* guix/channels.scm: Export channel-reference.

Change-Id: I3da7b8d55c0ab563c1669c9e346bb3bd34e7f1db
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-09-23 11:13:22 +02:00
Ludovic Courtès
e1cf791ddd
Revert "publish: Prevent publication of non-substitutable derivation outputs."
Fixes guix/guix#2450.

This reverts commit b5745a327e, which introduced
discrepancies in how substitutes are served; in particular, narinfos of
non-substitutable items would still be served, and likewise for narinfos and
nars of dependents of non-substitutable items.
2025-09-21 18:47:23 +02:00
Ludovic Courtès
7445776b7e
gc: Open a connection to the daemon only when strictly necessary.
Fixes guix/guix#1901.

Previously, ‘guix gc --list-busy’ (which is invoked by ‘guix-daemon’) would
open a connection to the daemon, which in turn attempts to create
/var/guix/profiles/per-user/$USER.  However, when ‘guix-daemon‘ is running as
an unprivileged user, creating that directory fails with EPERM.  Because of
this, garbage collection would always fail when running the unprivileged
daemon on Guix System.

* guix/scripts/gc.scm (guix-gc): Remove upfront call to ‘open-connection’.
Instead, use ‘with-store’ only for operations that require it.

Change-Id: I1fbfd97cf7ba9e3087f7287b4776ea2f6623400d
2025-09-18 12:14:34 +02:00
Maxim Cournoyer
10482f731e
Reapply "Update Maxim's email address."
This reverts commit a7db92d9b3, this time with
the more careful command, to avoid a world rebuild:

grep -rl --exclude-dir=build --exclude-dir=patches --exclude=ld-wrapper.in \
  --exclude=sitecustomize.py --exclude=guix-emacs.el maxim.cournoyer@gmail.com |
  xargs sed -i 's/maxim.cournoyer@gmail.com/maxim@guixotic.coop/g'

Change-Id: I0871f5cf9ace79e34e78e24154d0da6ea95a3a91
2025-09-18 13:44:12 +09:00
Maxim Cournoyer
a7db92d9b3
Revert "Update Maxim's email address."
This reverts commit d0d87a744d. Oops! This
caused a world rebuild.

Change-Id: I25fff644b2b61d0ee93d69b457b04c72b5b74d15
2025-09-18 12:07:31 +09:00
Maxim Cournoyer
d0d87a744d
Update Maxim's email address.
The change was automated via:

  git grep -l maxim.cournoyer@gmail.com |
    xargs sed -i 's/maxim.cournoyer@gmail.com/maxim@guixotic.coop/g'

* .mailmap: New entry.

Change-Id: Iaa88b1e51c94159c49138fb43910badb990eb169
2025-09-18 08:05:19 +09:00
Ludovic Courtès
75e45d4eea
home: Adjust file system mount options.
* guix/scripts/home.scm (spawn-home-container): Add ‘options’ field to
the /run/user/$UID and ‘home-directory’ file systems.

Change-Id: Ic6d987fe186f9c49718f15c71867953a20f2fb68
2025-09-17 11:55:14 +02:00
Ludovic Courtès
c52a9cee53
linux-container: Export ‘%writable-/tmp’ and use it.
Fixes guix/guix#1994.

* gnu/build/linux-container.scm (%writable-/tmp): New variable.
* guix/scripts/environment.scm (launch-environment/container): Remove ‘tmpfs’
and use it.  Adjust ‘file-system’ declaration for /run/user/$UID.
* guix/scripts/home.scm (spawn-home-container): Likewise.

Reported-by: Romain GARBAGE <romain.garbage@inria.fr>
Change-Id: Ia8289fb5386971738caf2ccc1e815daa6ac28459
2025-09-17 11:55:13 +02:00
Ludovic Courtès
a5ac56f883
packages: ‘package-field-location’ returns a <location> for atoms.
Fixes guix/guix#1975.

When using ‘read’, ‘package-field-location’ would not get source location for
atoms such as symbols, typically making it impossible to get the location of
the value of a field list (build-system gnu-build-system).  This fixes that.

* guix/packages.scm (field-value-location): New procedure.
(package-field-location): Use it instead of inline code.
* tests/packages.scm ("package-field-location"): Test the ‘build-system’
field.

Reported-by: Nicolas Graves <ngraves@ngraves.fr>
Change-Id: I98c694bb6f1999fa9ca80e145fa016640067af55
2025-09-11 22:27:47 +02:00
Liliana Marie Prikler
6c41e4d180
build: emacs-utils: Add emacs-makeinfo.
* guix/build/emacs-utils.scm (emacs-makeinfo): New variable.
* gnu/packages/emacs-xyz.scm (emacs-show-font, emacs-mct, emacs-corfu)
(emacs-cape, emacs-embark, emacs-orderless, emacs-consult, emacs-marginalia)
(emacs-logos, emacs-tmr, emacs-beframe, emacs-tempel, emacs-lin, emacs-pulsar)
(emacs-dired-preview, emacs-modus-themes, emacs-org-glossary, emacs-vertico)
(emacs-org-margin, emacs-osm)[#:phases]<makeinfo>: Use it.
Move before ‘install’ if it was previously after ‘install’.
2025-09-11 08:46:53 +02:00
Liliana Marie Prikler
2bd3129039
build-system: emacs: Use new lisp-mnt primitives.
* guix/build/emacs-build-system.scm (ensure-package-description)
[%write-pkg-file-form]: Use ‘lm-summary’ and ‘lm-package-requires’.

Fixes: guix/guix#736 (Missing `*-pkg.el` files).
2025-09-11 08:46:52 +02:00
Liliana Marie Prikler
8030c91dc2
build-system: emacs: Error if package file could not be generated.
* guix/build/emacs-build-system.scm (ensure-package-description)
[%write-pkg-file-form]: Use ‘error’ for error reporting.
2025-09-11 08:46:51 +02:00
Efraim Flashner
1d931e5778
guix: lint: Add codespell hints.
This hides these lines from codespell so it doesn't try to fix the
spelling of these intentional typos.

* guix/lint.scm (check-description-style)[check-description-typo]: Add
codespell hints to ignore some lines.

Change-Id: I002d2ba6079a5dcf9165d3821eda579f6dfa2ecf
Signed-off-by: Efraim Flashner <efraim@flashner.co.il>
2025-09-08 10:03:38 +03:00
Nicolas Graves
4a33614dd9
build-system: Introduce @* macro for lazy module resolution.
* guix/build-system.scm (@*): New macro for runtime module resolution.
* guix/build-system/agda.scm (default-agda): Use @* instead of
resolve-interface and module-ref.
* guix/build-system/android-ndk.scm (default-android-build,
default-android-googletest): Likewise.
* guix/build-system/ant.scm (default-jdk, default-ant, default-zip):
Likewise.
* guix/build-system/cargo.scm (default-rust): Likewise.
* guix/build-system/chicken.scm (default-chicken): Likewise.
* guix/build-system/composer.scm (default-php,
default-composer-classloader): Likewise.
* guix/build-system/dub.scm (default-ldc, default-dub,
default-pkg-config, default-ld-gold-wrapper): Likewise.
* guix/build-system/elm.scm (default-elm, default-elm-core,
default-elm-json): Likewise.
* guix/build-system/emacs.scm (default-emacs): Likewise.
* guix/build-system/glib-or-gtk.scm (default-glib): Likewise.
* guix/build-system/go.scm (default-go, default-gccgo, make-go-std):
Likewise.
* guix/build-system/haskell.scm (default-haskell): Likewise.
* guix/build-system/julia.scm (default-julia): Likewise.
* guix/build-system/linux-module.scm (default-linux): Likewise.
* guix/build-system/luanti.scm (default-optipng, default-luanti,
default-luanti-game, default-xvfb-run): Likewise. Remove otherwise
unused individual plugin accessor functions.
* guix/build-system/maven.scm (default-maven, default-jdk,
default-maven-plugins): Likewise. Remove otherwise unused individual
plugin accessor functions.
* guix/build-system/meson.scm (default-ninja, default-meson):
Likewise.
* guix/build-system/minify.scm (default-esbuild): Use @* instead of
resolve-interface and module-ref.
* guix/build-system/mix.scm (default-elixir-hex,
default-rebar3, default-elixir): Likewise.
* guix/build-system/node.scm (default-node): Likewise.
* guix/build-system/ocaml.scm (default-ocaml, default-findlib,
default-dune-build-system, default-ocaml4.07,
default-ocaml4.07-findlib ,default-ocaml4.07-dune, default-ocaml4.09,
default-ocaml4.09-findlib, default-ocaml4.09-dune, default-ocaml5.0,
default-ocaml5.0-findlib, default-ocaml5.0-dune): Likewise.
* guix/build-system/perl.scm (default-perl): Likewise.
* guix/build-system/pyproject.scm (default-python): Likewise.
* guix/build-system/qt.scm (default-qtbase): Likewise.
* guix/build-system/r.scm (default-r): Likewise.
* guix/build-system/rakudo.scm (default-rakudo, default-prove6,
default-zef): Likewise.
* guix/build-system/rebar.scm (default-rebar3, default-erlang):
Likewise.
* guix/build-system/renpy.scm (default-renpy): Likewise.
* guix/build-system/ruby.scm (default-ruby): Likewise.
* guix/build-system/scons.scm (default-scons): Likewise.
* guix/build-system/texlive.scm (default-texlive-bin,
texlive-latex-bin): Likewise.
* guix/build-system/tree-sitter.scm (default-guile-json,
default-node, default-tree-sitter, default-tree-sitter-cli): Likewise.
* guix/build-system/vim.scm (default-vim, default-neovim): Likewise.
* guix/build-system/zig.scm (default-zig): Likewise.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-09-04 12:19:55 +02:00
Nicolas Graves
97f6cc4389
build-system: rakudo: Clarify private-keywords.
Some arguments used for lower but not for the builder were passed as
arguments to the builders.  Remove this ambiguity.

* guix/build-system/rakudo.scm (lower)[private-keywords]: Add keywords
  with-prove6? and with-zed?,...
  (rakudo-build): ... removed from here.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-09-04 12:19:55 +02:00
Nicolas Graves
fcdcfa149d
build-system: android-ndk: Improve lower configurability.
* guix/build-system/android-ndk.scm (default-android-build,
default-android-googletest): Add and export variables.
  (lower): Add their respective keywords.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-09-04 12:19:55 +02:00
Nicolas Graves
9073a7e410
build-system: tree-sitter: Improve lower configurability.
* guix/build-system/tree-sitter.scm (default-node,
default-tree-sitter, default-tree-sitter-cli): Add and export variables.
  (lower): Add their respective keywords.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-09-04 12:19:55 +02:00
Nicolas Graves
cf05f12cb7
build-system: copy: Remove dead glibc code.
An unused glibc package made its way into the copy-build-system.
It's confusing, so remove it.

* guix/build-system/copy.scm (default-glibc): Remove variable.
  (lower): Remove glibc keyword.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-09-04 12:19:55 +02:00
Nicolas Graves
571509d5fa
size: Improve error message.
Fixes guix/guix#2429

* guix/scripts/size.scm (file-size): Improve error message.

Change-Id: I0e0f6de1eded8a780d2edc07ce1fbc5c7ff73e25
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-09-04 12:19:53 +02:00
Brian Kubisiak
325689d036
build-system/tree-sitter: Build with -std=c11.
* guix/build/tree-sitter-build-system.scm (install): Switch to
building with -std=c11.

Fixes: guix/guix#2215
Change-Id: I04f3ede07aeaaa9cf95272611d6346295f603b69
Signed-off-by: Danny Milosavljevic <dannym@friendly-machines.com>
2025-09-04 02:27:57 +02:00
Ludovic Courtès
1c235670d8
tests: Reduce build timeout to 3 minutes for Scheme tests.
* guix/tests.scm (open-connection-for-tests): Reduce #:timeout to 3mn.
(call-with-external-store): Likewise.

Change-Id: I4375e070618a5f38a82a1d26f8424bf4abb607e6
2025-09-03 12:34:13 +02:00
Reepca Russelstein
9202921e81
perform-download: Use (ice-9 sandbox) for mirrors.
"guix perform-download" is used to implement the daemon's "download" and
"git-download" builtin builders.  Because these are builtins, it runs without
any additional isolation beyond merely running as a build user.  In such a
context, allowing arbitrary user-supplied code to be evaluated will easily
lead to the build user being taken over, which can then be used to corrupt
future builds, enable exploitation of certain vulnerabilities, and in the case
of the rootless daemon completely take over guix-daemon.

Use (ice-9 sandbox) to ensure that only safe bindings are available during the
evaluation of the content-addressed-mirrors file.

* guix/perform-download.scm (%safe-bindings, %sandbox-module): new variables.
  (syntax-noop): new syntax.
  (eval-content-addressed-mirrors, assert-store-file,
   call-with-input-file/no-symlinks): new procedures.
  (perform-download): use assert-store-file to ensure files are in the store
  before being read.  Use call-with-input-file/no-symlinks for opening
  untrusted files.  Use eval-content-addressed-mirrors to evaluate the
  content-addressed-mirrors file.

Change-Id: I8ed27a95d84dbcc7d72d0d75f172d113f8be6c79
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-09-01 16:13:29 +02:00
Reepca Russelstein
f607aaaaaa
download: Handle content-addressed-mirrors returning #f.
* guix/build/download.scm (url-fetch): don't pass the return value from a
  content-addressed-mirror procedure to 'string->uri' if it is #f.

Change-Id: Ic4f94f86fcfebe6f2e60cb3c4330ce57886ab647
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-09-01 16:13:19 +02:00
Reepca Russelstein
2a333541e8
perform-download: Ensure reading never evaluates code.
Since this is used to implement the "download" and "git-download" builtins,
which are run outside of any chroot, this is trusted code with respect to the
user-supplied strings it reads.

* guix/scripts/perform-download.scm (read/safe): new procedure.
  (perform-download, perform-git-download): use it.
  (guix-perform-download): explicitly set 'read-eval?' to #f and
  'read-hash-procedures' to '().  #f is the default value of 'read-eval?' on
  startup, but set it anyway to be certain.

Change-Id: I93cb8e32607a6f9a559a26c1cbd6b88212ead884
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-09-01 16:13:11 +02:00
Nicolas Graves
d431f4620a
cve: Upgrade to JSON 2.0 feeds.
Fixes guix/guix#2213.  The 1.1-formatted-data is no longer available
from NIST.

* guix/cve.scm (string->date*, <cve-item>,
reference-data->cve-configuration, cpe-match->cve-configuration,
configuration-data->cve-configurations, json->cve-items,
yearly-feed-uri, cve-item->vulnerability): Upgrade to JSON 2.0 feeds
schema.
(<cve>): Remove uneeded record.
* tests/cve-sample.json: Update them. Remove CVE-2019-0005 (no value
added, lots of lines).
* tests/cve.scm (%expected-vulnerabilities): Upgrade accordingly.
(json->cve-items, vulnerabilities->lookup-proc tests): Update accordingly.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-08-31 12:39:24 +02:00
Nicolas Graves
8f310b6f27
gnu: mercurial: Add package and rename former to mercurial/pinned.
Mercurial currently has CVEs. IMHO, it's unsafe to carry them around
in a profile.  However, updating mercurial potential leads to a lot of
rebuilds and I don't want to tackle this right now.

As for other packages, the way forward is to add a variant of the
package only used for hg-fetch, here mercurial/pinned.

* gnu/packages/version-control.scm
(mercurial-check-phase): Add helper variable.
(mercurial): Update to 7.1.
[arguments]: Use gexps.
<#:phases>: Refresh them. Add phase 'add-install-to-pythonpath for
running tests. Run tests after install. Add phase 'configure-check.
<#:imported-modules, #:modules>: Add them for
'add-install-for-pythonpath.k
[native-inputs]: Remove python-nose. Add python-setuptools-next,
python-setuptools-scm-next.
(mercurial/pinned): Inherit from mercurial, but build the exact same
derivation as the previous mercurial variable.

* guix/hg-download.scm (hg-package): Use mercurial/pinned.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-08-31 12:21:12 +02:00
Nicolas Graves
6c71c8dc4a
gnu: subversion: Add package and rename former to subversion/pinned.
Subversion currently has CVEs. IMHO, it's unsafe to carry them around
in a profile. However, updating subversion potential leads to a lot of
rebuilds and I don't want to tackle this right now.

As for other packages, the way forward is to add a variant of the
package only used for svn-fetch, here subversion/pinned.

* gnu/packages/version-control.scm (subversion): Update to 1.14.5.
(subversion/pinned): Inherit from subversion, but build the exact same
derivation as the previous subversion variable.

* guix/svn-download.scm (subversion-package): Use subversion/pinned.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-08-31 12:21:09 +02:00
Ludovic Courtès
df763d6a2d
git-authenticate: Print a clear error message for malformed keys.
Fixes guix/guix#1141.

* guix/git-authenticate.scm (load-keyring-from-blob): Change ‘oid’ to
‘entry’ and adjust accordingly.  Raise a ‘&formatted-message’ error when
‘read-radix-64’ returns #f or EOF.
(load-keyring-from-reference): Adjust accordingly.

Change-Id: Ib88c94dac543caf6b1e0855242ba50063c944765
2025-08-23 16:57:21 +02:00
Romain GARBAGE
20077256fa
import: pypi: Use autoload instead of use-module.
* guix/import/pypi.scm: Use autoload instead of use-module.

Change-Id: I67001e41c398250e74782c06937dadea8402d4d9
Reviewed-by: zimoun, ngraves
Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
2025-08-22 19:27:45 +01:00
Romain GARBAGE
0ff24b4037
import: pypi: Resolve unzip package if needed.
Fixes #1066.

* guix/import/pypi.scm (unzip-command): New variable.
(guess-requirements): Use unzip-command.

Change-Id: I1b6b85d0a22836bad77d6c5d050ccf639118d21a
Reviewed-by: zimoun, ngraves
Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
2025-08-22 19:27:13 +01:00
Hilton Chain
92d130e035
import: crate: Stop importing dependencies from crates.io.
* guix/scripts/import/crate.scm (show-help, %options, guix-import-crate)
[--recursive, --recursive-dev-dependencies, --mark-missing]: Remove options.
* doc/guix.texi (Invoking guix import)[crate]: Adjust accordingly.
Mention packaging workflow.
* guix/import/crate.scm (make-crate-sexp): Don't use "rust-" prefix and semver
suffix for package name.
[#:cargo-inputs, #:cargo-development-inputs, #:build?]: Remove arguments.
(crate->guix-package)[#:include-dev-deps?, #:mark-missing?]: Remove arguments.
(<crate-dependency>): Remove data type.
(make-crate-dependency, crate-dependency?, json->crate-dependency)
(crate-version-dependencies, package-names->package-inputs)
(maybe-cargo-inputs, maybe-cargo-development-inputs, maybe-arguments)
(version->semver-prefix, find-package-version, crate-recursive-import): Remove
procedures.
* tests/crate.scm (test-foo-crate, test-bar-crate): Adjust for modified tests.
(test-foo-dependencies, test-bar-dependencies, test-root-crate)
(test-root-dependencies, test-intermediate-a-crate)
(test-intermediate-a-dependencies, test-intermediate-b-crate)
(test-intermediate-b-dependencies, test-intermediate-c-crate)
(test-intermediate-c-dependencies, test-leaf-alice-crate)
(test-leaf-alice-dependencies, test-leaf-bob-crate)
(test-leaf-bob-dependencies, rust-leaf-bob-3, rust-leaf-bob-3.0.2-yanked):
Remove variables.
("crate->guix-package yanked", "crate->guix-package only yanked available"): New
tests.
("crate->guix-package"): Adjust accordingly.
("crate->guix-package-marks-missing-packages", "crate-recursive-import")
("crate-recursive-import-honors-existing-packages")
("crate-import-only-yanked-available"): Remove tests.

Change-Id: Ib1d24511ed0ea1a2373f53de12e06afa7950a7d7
2025-08-21 19:09:04 +08:00
Hilton Chain
efaa3e681e
build-system: cargo: Deprecate #:cargo-inputs and #:cargo-development-inputs.
* guix/build-system/cargo.scm (lower): Emit warning when using #:cargo-inputs
or #:cargo-development-inputs.
* doc/guix.texi (Build Systems)[cargo-build-system]: Deprecate #:cargo-inputs
and #:cargo-development-inputs.

Change-Id: I43ed66e04c55368159aed309367c4ac278d8cc58
2025-08-21 19:09:04 +08:00
Jean-Pierre De Jesus DIAZ
f0560f865a
gnu: tree-sitter: Update to 0.25.3.
* gnu/packages/tree-sitter.scm (tree-sitter): Update to 0.25.3.
[arguments]<#:phases>: Add 'patch-_ts_dup-visibility for linking with Rust
bindings.
(tree-sitter-cli)[source]: Keep files required for building bindings.
[inputs]: Use ‘cargo-inputs’.
[arguments]: Remove #:cargo-inputs, #:cargo-development-inputs.
<#:cargo-test-flags>: Adjust failing tests to skip.
<#:cargo-install-paths>: Add "cli".
<#:phases>: Merge 'patch-node and 'patch-dot into 'patch-references.
Update their references and use ‘search-input-file’.
Remove modification of 'install, #:cargo-install-paths now takes care of the
installation.
* gnu/packages/rust-crates.scm (lookup-cargo-inputs)[tree-sitter-cli]: New
entry.
* guix/build/tree-sitter-build-system.scm
(patch-dependencies): Drop `peerDependencies' from package.json.
(build): Remove deprecated ‘--no-bindings’ option.
(check): Set CC.
(install): Add `src' to include directories in order for external
scanners to find `tree_sitter/parser.h'.

Co-authored-by: Hilton Chain <hako@ultrarare.space>
Change-Id: I3941a1785be8deb60f288fcd5983255f075f9215
Signed-off-by: Hilton Chain <hako@ultrarare.space>
2025-08-21 19:08:32 +08:00
Hilton Chain
12e0b9e9e4
import: crate: Add ‘--lockfile’ option.
* guix/import/crate.scm (cargo-inputs-from-lockfile)
find-cargo-inputs-location, extract-cargo-inputs): New procedures.
* guix/scripts/import/crate.scm (%options): Add ‘--lockfile’ option.
(show-help): Add it.
(guix-import-crate): Use it.
* doc/guix.texi (Invoking guix import): Document it.

Change-Id: I291478e04adf9f2df0bf216425a5e8aeba0bedd9
2025-08-21 19:08:21 +08:00
Hilton Chain
f27fb840c2
import: crate: Add Cargo.lock parser.
* guix/import/crate/cargo-lock.scm: New file.
* Makefile.am (MODULES): Regisiter it.
* etc/teams.scm (rust)[#:scope]: Add it.
* CODEOWNERS: Add it.
* guix/import/crate.scm (cargo-lock->expressions): New procedure.
* tests/crate.scm (temp-file): New variable.
("crate-lockfile-import"): New test.

Co-authored-by: Murilo <murilo@disroot.org>
Co-authored-by: Luis Guilherme Coelho <lgcoelho@disroot.org>
Change-Id: I95421e9e2ba11a671b4bc4e1323c6d31a1b012c5
2025-08-21 19:08:21 +08:00
Hilton Chain
4e8eab6fe4
build/cargo: Accept rust-sysroot from native-inputs.
This is a workaround to support Rust cross-compilation in build systems other
than cargo-build-system.  Since there's no interface for target-inputs, using
native-inputs makes most sense.

* guix/build-system/cargo.scm (lower)[bag]<target-inputs>: Label rust-sysroot
with its package name.
* guix/build/cargo-build-system.scm (configure): Use it.
When cross-compiling, accept rust-sysroot from native-inputs if there's none
in inputs.

Change-Id: I5cb63c8c815d3a2c9f0ece01857254f6d0090dd1
2025-08-21 19:08:21 +08:00
Hilton Chain
765a369c5e
build-system: cargo: Export ‘cargo-triplet’.
This will make Rust cross compilation support in other build systems easier.

* guix/build-system/cargo.scm (cargo-triplet): Export.
Make ‘target’ argument optional.

Change-Id: I226bf4a7d8065eb7911da148d0cdf3352a47bde6
2025-08-21 19:08:21 +08:00
Hilton Chain
b1440e1f37
build-system: cargo: Add ‘cargo-inputs’.
* gnu/packages/rust-crates.scm: New file.
* gnu/packages/rust-sources.scm: New file.
* gnu/local.mk (GNU_SYSTEM_MODULES): Regisiter them.
* guix/build-system/cargo.scm (define-cargo-inputs): New macro.
(crate-source, cargo-inputs): New procedures.
* guix/import/crate.scm: Hide ‘crate-source’ from (guix build-system cargo).
* etc/teams/rust/audit-rust-crates: New file.
* etc/teams/rust/cleanup-crates.sh: New file.
* etc/teams/rust/rust-crates.tmpl: New file.
* etc/teams/rust/unpack-new-crates.sh: New file.

Change-Id: I2f2d705a3e376ed3c646f31b824052a2278d4fb3
2025-08-21 19:08:20 +08:00
Hilton Chain
a51c34a22a
build/cargo: Unconditionally use system gettext.
No special value is required for this environment variable.

* guix/build/cargo-build-system.scm (configure): Set GETTEXT_SYSTEM
unconditionally.

Change-Id: Id40fecaf75fa76c7b7f1404db226fa1ca6a45a5e
2025-08-21 19:08:20 +08:00
Hilton Chain
99dbcf8c4e
build/cargo: Use sytsem oniguruma.
* guix/build/cargo-build-system.scm (configure): Set RUSTONIG_SYSTEM_LIBONIG.

Change-Id: I02624d98ade15d65965f46555e5a210a7630dd5d
2025-08-21 19:08:20 +08:00
Hilton Chain
836b7a05ec
build/cargo: Use system libsqlite3.
* guix/build/cargo-build-system.scm (configure): Set
LIBSQLITE3_SYS_USE_PKG_CONFIG.

Change-Id: I9a8a5818992ee687ec67abadffef67ce1533c6d3
2025-08-21 19:08:20 +08:00
Hilton Chain
9ba78f3ccf
build/cargo: Don't vendor self.
* guix/build/cargo-build-system.scm (crate-src?, configure): Exclude self.
* gnu/packages/gnome.scm (librsvg)[#:phases]: Remove ‘dont-vendor-self’.
* gnu/packages/python-crypto.scm (python-cryptography)[#:arguments]: Likewise.
* gnu/packages/python-xyz.scm (python-libcst)[#:arguments]: Likewise.
* gnu/packages/syndication.scm (newsboat)[#:arguments]: Likewise.
* gnu/packages/antivirus.scm (clamav)[#:arguments]: Likewise.

Change-Id: I5e01721fb705937f5fcf858c21b6d7e27ade6c10
2025-08-21 19:08:20 +08:00
Hilton Chain
a087db5f83
build/cargo: Support directory source inputs.
* guix/build/cargo-build-system.scm (cargo-package?): New procedure.
(crate-src?): Support directory source inputs.
(configure): Likewise.

Change-Id: If2bd318b44ed765baec69309f25d320edceee116

Fixes: https://codeberg.org/guix/guix/issues/753
2025-08-21 19:08:20 +08:00
Efraim Flashner
c8456eff68
build/cargo: Don't try to unpack sanity-check.py.
* guix/build/cargo-build-system.scm (crate-src?): Also don't try to
check python scripts for Cargo.toml.

Change-Id: I001a89b83d2e472706b1263007be45d1153c140f
2025-08-21 19:08:20 +08:00
Hilton Chain
8292d0d477
build/cargo: Set default value of arguments for build phases.
This will make it easier to use these phases in other bulid systems.

* guix/build/cargo-build-system.scm (unpack-rust-crates, configure, build)
(package, install): Set default value for arguments specific to this build
system.

Change-Id: I1dde1b063d8eee57967903abd2fce94574211a0a
2025-08-21 19:08:19 +08:00