1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-04-06 13:10:33 +02:00
Commit Graph

2334 Commits

Author SHA1 Message Date
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
Ian Eure
68e9cb0d21 gnu: services: Name xorg tests.
* tests/services/xorg.scm: Name tests.

Change-Id: I7be7438a69a5d55d5904c3b76a2888393291b6bb
Signed-off-by: Efraim Flashner <efraim@flashner.co.il>
2026-01-01 13:36:38 +02:00
Ian Eure
7d4db1a37c gnu: services: Fix xorg configuration merging.
A bug in #21 causes the default configuration to be omitted from the xorg
merging process.  This can cause users not using set-xorg-configuration or
service extensions to end up with a broken configuration.

Fixes #5267.

* tests/services/xorg.scm: Add a regression test.
* gnu/services/xorg.scm (handle-xorg-configuration): Include the
xorg-configuration record from config in merges.

Change-Id: I6bed8c109057cb9b5de36db68b78e3ccc88e6bcb
Signed-off-by: Efraim Flashner <efraim@flashner.co.il>
2026-01-01 13:26:02 +02:00
Ian Eure
a9462997d7 gnu: Merge xorg configurations when extending.
Configuration for xorg is embedded in the various display-manager
configuration records, and extension support is factored out into the
`handle-xorg-configuration' macro.  However, the extension mechanism replaces
the existing xorg-configuration with the supplied one, making it impossible to
compose configuration from multiple sources.  This patch adds a procedure to
merge two xorg-configuration records, and calls it within
handle-xorg-configuration, allowing the config to be built piecemeal.

* gnu/services/xorg.scm (merge-xorg-configurations): New variable.
(handle-xorg-configuration): Merge xorg configs.

Change-Id: I20e9db911eef5d4efe98fdf382f3084e4defc1ba
Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
2025-12-26 13:15:41 +01:00
Ludovic Courtès
0ac2a0fd18 authenticate: Report failure to load keys to the daemon.
Previously, when failing to load a signing key, ‘guix authenticate’ would
print a backtrace and exit with a non-zero code.  That, in turn, would lead
the guix-daemon child process to crash with:

  nix/libutil/serialise.cc:15: virtual nix::BufferedSink::~BufferedSink(): Assertion `!bufPos' failed.

This patch fixes it by reporting the error to the daemon as was intended.

* guix/scripts/authenticate.scm (guix-authenticate): Arrange to call
‘load-key-pair’ from within ‘with-reply’.
* tests/guix-authenticate.sh: Test it.

Fixes: guix/guix#4928
Reported-by: Rutherther <rutherther@ditigal.xyz>
Change-Id: I8654ad6fdfbe18c55e1e85647d0c49f408d0574a
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Merges: #4961
2025-12-22 15:10:52 +01:00
Ludovic Courtès
812fc780d4 tests: Use ‘https’ for ‘home-page’ in ‘guix import pypi’ tests.
Fixes a regression introduced in d66e9698a1.

* tests/import/pypi.scm ("pypi->guix-package, no wheel")
("pypi->guix-package, no wheel, no requires.txt, but pyproject.toml")
("pypi->guix-package, no wheel, but requires.txt and pyproject.toml")
("pypi->guix-package, no requires.txt, but wheel.")
("pypi->guix-package, no usable requirement file, no wheel.")
("pypi->guix-package, package name contains \"-\" followed by digits"): Change
‘home-page’ to ‘https://’.

Fixes: guix/guix#4646
Reported-by: Rutherther <rutherther@ditigal.xyz>
Change-Id: Id3ddac832d9688f2eb8a055c13f62a9642a20766
2025-12-13 23:14:27 +01:00
Giacomo Leidi
fdb46ae7b1 system: Relax subordinate ID validation.
https://codeberg.org/guix/guix/issues/3925 raised the inabilityy of the
subordinate IDs service of handling externally managed sub{u,g}id file
entries. This patch relaxes the checks in place for existing ranges,
by allowing subid-range records lower than %subordinate-id-min, leaving
all the space from subid 0 to %subordinate-id-min - 1 to external
users. Generic ranges are still allocated within %subordinate-id-min and
%subordinate-id-max.

* gnu/build/accounts.scm (<unused-id-range>)[min]: Change default value
to 0, allowing subid-ranges with a start lesser than
%subordinate-id-min.
(allocate-generic-range): Allocate generic ranges starting from
%subordinate-id-min, leaving ranges starting before %subordinate-id-min.
(allocate-specific-range): Move bounds check to...
(allocate-subids): ...here. Now bound validation is applied only to user
provided ranges.
* tests/accounts.scm: Test new behavior.

Fixes: guix/guix#3925
Change-Id: Id923b122c97a20f148684f5fb144fd9422810612
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Merges: #4235
2025-12-11 15:43:16 +01:00
Giacomo Leidi
c425bac93d Update Giacomo's email address.
The change was automated via:

git grep -l goodoldpaul@autistici.org |
    xargs sed -i 's/goodoldpaul@autistici.org/therewasa@fishinthecalculator.me/g'

* .mailmap: New entry.

Change-Id: I1629388334695d221647afe6a14faf61af5fe0d6
Signed-off-by: Maxim Cournoyer <maxim@guixotic.coop>
2025-12-03 14:38:09 +09:00
Ricardo Wurmus
b215cb2027 import/cran: Detect library references in "check_installed".
* guix/import/cran.scm (import-pattern): Add case for "check_installed".
* tests/import/cran.scm: Add test.

Change-Id: Id69371158eecaeb371056e6954a3109687346c22
2025-11-29 12:19:09 +01:00
Ricardo Wurmus
ad87b718ed import/cran: Reduce false positives in extracting imports.
* tests/import/cran.scm: Add tests for extract-imports.
* guix/import/cran.scm (extract-imports): New procedure, extracted from...
(needed-test-inputs-in-directory): ...this procedure, which now uses it.
(import-pattern): Update regex pattern.

Change-Id: I07ac3f685ff08a0fa7da3c25cf1f63fbca18b95f
2025-11-29 12:19:08 +01:00
Rutherther
d5b980cfa1 gnu: Remove store path occurrences.
When running `make dist`, it is checked that there are no store paths in
the resulting dist folder. Specifically through the
`assert-no-store-file-names` target.

I think that this target makes sense and this commit has workarounds for
currently embedded store paths. Two of those are comments. Maybe the
target could be changed to ignore those in the future. But the hash is
not important, so just replace it with <hash>.

As for crate tests, I decided to split the string instead of removing
it, although it seems to me it might safely be removed, but I am not
completely sure about the intent here.

* gnu/packages/astronomy.scm (python-jplephem-2.22): Remove store hash
from comment.
* gnu/packages/golang-build.scm (golang-org-x-exp): Likewise.
* tests/import/crate.scm (temp-file): Split store path's hash.

Change-Id: I709f29a9dfab626d194c41d12e53e0380a148217
Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
2025-11-22 15:32:22 +00:00
Andreas Enge
17d9d3436b gnu: Remove lsh.
* gnu/packages/ssh.scm (lsh): Delete and redefine as deprecated and
replaced by openssh.
* gnu/packages/patches/lsh-fix-x11-forwarding.patch: Remove file.
* gnu/packages/ssh.scm (dist_patch_DATA): Unregister file.
* tests/guix-gc.sh: Use hello instead of lsh.

Change-Id: Ic2a31dc79a777f9b6569e220620ecfc14fb75722
2025-11-21 14:38:44 +01:00
Lars-Dominik Braun
d111a6a60d guix: toml: Fix keys with embedded escape codes.
Quoted keys are treated by the specification like ordinary strings,
so escape codes must be handled as well.

* guix/build/toml.scm (eval-value): Move string escape handling…
(eval-value): …here.
(eval-toml-file): Un-escape quoted keys.
* tests/toml.scm ("parse-toml: Quoted keys with escapes"): New testcase.

Fixes: guix/guix#2414
Change-Id: I612e415cc93207bbdd18b6ec8279255fee16670a
Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
2025-11-20 01:06:32 +00:00
Ludovic Courtès
1ce270fb85 gnu-maintenance: ‘generic-html’ recognizes ‘release-file-regexp’ property.
* guix/gnu-maintenance.scm (package-release-file?): New procedure.
(tarball->version): Add optional parameter and honor it.
(import-html-release): Use ‘package-release-file?’ and pass second argument to
‘tarball->version’.
* tests/gnu-maintenance.scm ("latest-html-release, 'release-file-regexp' property")
("latest-html-release, invalid 'release-file-regexp' property"): New tests.
* doc/guix.texi (Invoking guix refresh): Document it.

Change-Id: Ia9328418fdd2faf118e4ec9d5fbde4a279e100ed
Reviewed-by: Maxim Cournoyer <maxim@guixotic.coop>
2025-11-18 13:05:49 +01:00
Martin Schitter
944c20e171 tests: style: Fix insufficient number of lines read.
* tests/style.scm ("url-fetch->git-fetch, preserved field"):

The 9th line of origin, where the patches field is located,
was never read. (broken test since a1b0fde434)
2025-11-15 15:53:15 +09:00
Maxim Cournoyer
4932444387 lint: Fix regressions in tests.
This fixes a regression introduced with commit 7752580a33 ("guix: lint: Check
end of sentences for a period.").

* guix/lint.scm (check-description-style): Do not emit warning when the
description is empty or ends with trailing whitespace.
* tests/lint.scm ("description: invalid Texinfo markup")
("description: may start with texinfo markup")
("description: may not contain trademark signs: ™")
("description: may not contain trademark signs: ®"): Add period.

Fixes: #4222
Change-Id: Ib10bcf324cb55b39a88c0c67875a40a59c1d4c18
2025-11-14 16:42:16 +09:00
jgart
7752580a33 guix: lint: Check end of sentences for a period.
* guix/lint.scm (check-description-style): Check that sentences end with a period.

Change-Id: Ic10161f8093351dce440e19802a71f03bc849638
Signed-off-by: jgart <jgart@dismail.de>
2025-11-05 10:25:01 -06:00
Hilton Chain
2142fce056 profiles: package->manifest-entry: Filter packages.
The new Rust packaging model moves sources to inputs and there'll be
possiblity to have sources in propagated-inputs as well.

* guix/profiles.scm (package->manifest-entry): Filter packages.
* tests/profiles.scm ("package->manifest-entry, origin in propagated inputs"):
New test.

Change-Id: Id5b9ceb693a35760289b04cd9b8f208b4cbf2e35
2025-11-03 20:06:14 +08:00
Maxim Cournoyer
3ae5c9f2a7 Revert "syscalls: Add mmap support."
This reverts commit e1994a0214.
2025-10-30 16:19:51 +09:00
Maxim Cournoyer
0f39db9c19 Revert "Use mmap for the elf parser, reducing memory usage."
This reverts commit 2c1fe0df11.
2025-10-30 16:19:50 +09:00
Maxim Cournoyer
9d60fdf6a2 Revert "elf: Remove bundled Guile source."
This reverts commit 11cf5b2fe4.
2025-10-30 16:19:49 +09:00
Maxim Cournoyer
11cf5b2fe4 elf: Remove bundled Guile source.
This module has been included in Guile as (system vm elf) since around version
2.1.

* guix/elf.scm: Delete file.
* CODEOWNERS: De-register module.
* Makefile.am (MODULES): Likewise.
* etc/teams.scm (core): Likewise.
* gnu/build/linux-modules.scm: Adjust imports.
* gnu/packages/gnuzilla.scm (icecat-minimal) [modules]: Likewise.
* gnu/packages/librewolf.scm (librewolf): Likewise.
* gnu/packages/sequoia.scm (sequoia): Likewise.
* gnu/packages/tor-browsers.scm (make-torbrowser): Likewise.
* gnu/packages/version-control.scm (hg-commitsigs): Likewise.
* guix/build/debug-link.scm: Likewise.
* guix/build/gnu-build-system.scm: Likewise.
* guix/build/gremlin.scm: Likewise.
* guix/build/meson-build-system.scm: Likewise.
* guix/grafts.scm (graft-derivation/shallow): Likewise.
* guix/scripts/pack.scm (wrapped-package): Likewise.
* tests/debug-link.scm: ("elf-debuglink", "set-debuglink-crc"): Likewise.
* tests/gremlin.scm: Likewise.
* guix/build-system/gnu.scm (%default-gnu-imported-modules): Remove (guix elf).

Change-Id: I86ac4237fdd820a6b54dc0fe7a7d10403a290ef9
2025-10-30 16:13:03 +09:00
Maxim Cournoyer
2c1fe0df11 Use mmap for the elf parser, reducing memory usage.
The `file->bytevector' new procedure uses a memory mapped bytevector, so
parsing the ELF file reads only the sections needed, not the whole file.

* guix/scripts/pack.scm (wrapped-package): Use file->bytevector.
* guix/build/gremlin.scm (file-dynamic-info): Likewise.
(validate-needed-in-runpath): Likewise.
(strip-runpath): Likewise, and write to bytevector directly, avoiding a port.
(set-file-runpath): Likewise.
* tests/gremlin.scm (read-elf): Delete procedure.
("elf-dynamic-info-needed, executable"): Use file-dynamic-info.
("strip-runpath"): Likewise.
("elf-dynamic-info-soname"): Likewise.
 guix/build/debug-link.scm (set-debuglink-crc): Use file->bytevector.
* tests/debug-link.scm (read-elf): Delete procedure.
("elf-debuglink"): Rename to...
("elf-debuglink, no .gnu_debuglink section"): ... this.
("elf-debuglink", "set-debuglink-crc"): Use external store, and adjust to use
file->bytevector.
* gnu/packages/gnuzilla.scm (icecat-minimal) [#:phases]
{build-sandbox-whitelist}: Use `file-runpath'.
* gnu/packages/librewolf.scm (librewolf): Likewise.

Fixes: <https://issues.guix.gnu.org/59365>
Fixes: #1262
Change-Id: I43b77ed0cdc38994ea89d3d401e0d136aa6b187a
2025-10-30 16:13:03 +09:00
Maxim Cournoyer
e1994a0214 syscalls: Add mmap support.
* guix/build/syscalls.scm (PROT_NONE, PROT_READ, PROT_WRITE, PROT_EXEC)
(PROT_SEM, MAP_SHARED, MAP_PRIVATE, MAP_FAILED)
(MS_ASYNC, MS_INVALIDATE, MS_SYNC)
(%mmap-guardian, %unmapped-bytevectors): New variables.
(unmapped-bytevector?, pump-mmap-guardian, %mmap, mmap, %munmap, munmap)
(%msync, msync): New procedures.
* guix/build/io.scm: New file.
* Makefile.am: Register it.
* tests/syscalls.scm (strace-output): New variable.
("mmap and munmap", "file->bytevector, reading", "file->bytevector, writing")
("manual munmap does not lead to double free"): New tests.

Change-Id: I19ec687899eda635559e91200dd8d98669b0e35f
2025-10-30 16:13:03 +09:00
Maxim Cournoyer
79dcb79e1f tests: New ld-wrapper test.
* tests/ld-wrapper.scm: New file.
* Makefile.am (SCM_TESTS): Register it.

Change-Id: I3cef5ff363226a3ceee2599d4906f107d6ae7151
Reviewed-by: Ludovic Courtès <ludo@gnu.org>
2025-10-29 11:51:24 +09:00
Maxim Cournoyer
1eccea7ffb build/syscalls: Introduce new safe-clone and use it.
* guix/build/syscalls.scm (without-automatic-finalization): Accept multiple
expressions.
(without-garbage-collection): New syntax.
(without-threads): Likewise.
(ensure-signal-delivery-thread, safe-clone): New procedures.
* tests/syscalls.scm: ("clone and unshare triggers EINVAL")
("safe-clone and unshare succeeds"): New tests.
* gnu/build/linux-container.scm (run-container): Adjust to use 'safe-clone'.

Relates-to: #1169
Change-Id: I044c11a899e24e547a7aed97f30c8e7250ab5363
2025-10-29 11:34:28 +09:00
Maxim Cournoyer
10edda5aa5 Reinstate "linux-container: Remove #:lock-mounts? and related code."
This reverts commit e0e64be8de.
2025-10-29 11:34:28 +09:00
Nicolas Graves
a1b0fde434 style: Add git-source rule.
* guix/scripts/style.scm (transform-to-git-fetch)
(url-fetch->git-fetch): New procedures.
* doc/guix.texi: Add entry for git-source.
* tests/style.scm: Add tests for url-fetch->git-fetch.

Change-Id: I6192fba4d84619b81fbc75850542b9dbd2326d4a
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-10-24 16:42:54 +02:00