Commit graph

2172 commits

Author SHA1 Message Date
Lars-Dominik Braun
8bb3bb19c2
import: pypi: Support extracting dependencies from pyproject.toml.
* guix/import/pypi.scm (guess-requirements): Support extracting
dependencies from pyproject.toml.
* tests/pypi.scm: ("pypi->guix-package, no requires.txt, but wheel."):
Renamed from "pypi->guix-package, wheels", remove requires.txt file,
because the current implementation cannot detect invalid files.
("pypi->guix-package, no usable requirement file, no wheel."): Renamed
from "pypi->guix-package, no usable requirement file.".
(test-pyproject.toml): New variable.
("pypi->guix-package, no wheel, no requires.txt, but pyproject.toml"):
New test.
("pypi->guix-package, no wheel, but requires.txt and pyproject.toml"):
Ditto.

Change-Id: Ib525750eb6ff4139a8209420042b28ae3c850764
Reviewed-by: Ludovic Courtès <ludo@gnu.org>
Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
2024-12-16 19:27:43 +00:00
Ludovic Courtès
f8f005815e
packages: Use origin file names as their input labels.
* guix/packages.scm (add-input-label): Rely on 'origin-actual-file-name' for
internal inputs labels.
* tests/packages.scm ("this-package-input, origin"): New test.
* doc/guix.texi (package Reference): Mention origin lookup for
‘lookup-package-input’ & co.
* gnu/packages/base.scm (tzdata)[inputs]: Reintroduce label.
* gnu/packages/tex.scm (texlive-hyphen-complete)[inputs]: Likewise.
(texlive-newverbs)[native-inputs]: Likewise.

Change-Id: I6ba5352b1b1b8ab810da3730b09cb9db61d6429c
Co-authored-by: Simon Tournier <zimon.toutoune@gmail.com>
2024-12-16 00:19:56 +01:00
Janneke Nieuwenhuizen
84de473132
tests: guix-shell-export-manifest: Fix pyproject-build-system python test.
This is a follow-up to commit
    fdc0fefd46
    build-system/pyproject: Use python-sans-pip-wrapper as default-python.

* tests/guix-shell-export-manifest.sh: Grep for python-sans-pip-wrapper, which
is the python now used by the pyproject-build-system.

Change-Id: I5f44e07544f80973fa6b306b2dcdf42ac3b56ad6
2024-12-14 01:28:49 +01:00
Janneke Nieuwenhuizen
4a6ca99824
tests: guix-package: Fix guix package --search test.
This is a follow-up to commit
    6f8c8a86d8
    gnu: Fix synopsis in miscelaneous packages.

Change-Id: I5f44e07544f80973fa6b306b2dcdf42ac3b56ad6

* tests/guix-package.sh: Search for GNU hello's changed synopsis "Example GNU
package".

Change-Id: I79f606afee348cb6d57d9c0d08e15cd9267d5ceb
2024-12-14 00:34:28 +01:00
Lars-Dominik Braun
63cb43d56c
guix: toml: Fix parsing empty strings in arrays.
Change-Id: Id14d4008391a01820ade754fa9c2ca8e88b8c7f9
2024-12-13 20:18:36 +00:00
Lars-Dominik Braun
a163b85444
guix: toml: Add TOML parser.
* guix/build/toml.scm: New file.
* tests/toml.scm: New file.
* Makefile.am: Register new files.
2024-12-13 20:15:42 +00:00
Gabriel Wicki
287be00630
lint: More abbreviations.
* guix/lint.scm: Allow more common abbreviations in double-space-after
sentence check.
* tests/lint.scm: Add tests.

Change-Id: I0eedf73e5fcd0a8c67b3ae3dfa979a57fe0f6253
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2024-12-12 12:52:07 +01:00
Gabriel Wicki
9447629672
lint: Ignore initials from double space check.
Prevent false positives in initials as the are commonly used in names, e.g.
Margaret E. Hamilton - which obviously do not end sentences.  Check whether a
period character `.' is preceded by at least two characters.  This should save
us from false positives when linting.

* guix/lint.scm(check-description-style)[check-end-of-sentence-space] Add
condition.
* tests/lint.scm: Add test case.

Change-Id: I42a1365aaaed2afc7308b88ebd4b0720ad362761
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2024-12-12 12:52:07 +01:00
Gabriel Wicki
27b4c319c0
lint: Prevent false positives in description typo check.
* guix/lint.scm(check-description-style)[check-description-typo]: Add spaces
to match strings to prevent matching false positives, like "allows tokens" or
"prevents torpedoes".
* tests/lint.scm: Add test.

Change-Id: Ifc2ec6167a590b9d2e742dd86fecd798c4bfaa24
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2024-12-12 12:52:07 +01:00
Gabriel Wicki
687f4e22e6
lint: Allow texinfo markup at beginning of synopsis.
* guix/lint.scm(check-synopsis-style)[check-proper-start]: Add condition.
* tests/lint.scm: Add test case.

Change-Id: I2509b3a4e7e51c6a274697ceb5f776c22e27c5f9
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2024-12-12 12:52:07 +01:00
Gabriel Wicki
f28c32089d
lint: Allow texinfo markup at beginning of description.
* guix/lint.scm(starts-with-texinfo-markup?): New function.
(check-description-style)[check-proper-start]: Add condition.
* tests/lint.scm: Add test case.

Change-Id: I674988882265d9e2041d48dba0f9627cd68bf292
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2024-12-12 12:52:07 +01:00
Gabriel Wicki
00879f94ee
lint: Refine description start check logic.
Fix linter warnings for the following:

 - packages that belong to some programming language or ecosystem,
 e.g. python-foo or texlive-bar,
 - packages whose names end in a version distinction, e.g. wlroots-0.16 and
 - packages where the software's real name contains an underscore `_'
 character where our package name replaced that with a hyphen `-',
 e.g. wpa_supplicant and wpa-supplicant-minimal.

* guix/lint.scm (check-description-style)[check-proper-start]: Add conditions.
* tests/lint.scm: New tests.

Change-Id: Ifc9f5cda04db59e460e287cd93afae89c7f17e3c
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2024-12-12 12:52:07 +01:00
Gabriel Wicki
dac3011477
lint: Fix indentation.
* guix/lint.scm(check-synopsis-style): Add white space.
* tests/lint.scm: Fix indentation.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Change-Id: I8e08fa43131c586065b742fc441172c9408877a3
2024-12-12 12:52:06 +01:00
Ricardo Wurmus
8bee3a5910
import: utils: Wrap function names in @code.
* guix/import/utils.scm (beautify-description): Adjust to include "()" in
@code wrapper.
* tests/import-utils.scm ("beautify-description: wrap function names in
@code"): New test.

Change-Id: I2b58728571a18ce8302c1b6f98b0c16dbe5931c3
2024-12-03 16:59:54 +01:00
Ludovic Courtès
58a8d3b180
tests: Adjust ‘guix build -P1’ test to new packages.
Fixes a bug introduced in 794e079437
whereby the grep patterns used in this test would also match
/gnu/store/…-rust-libgit2-sys-0.17.0+1.8.1.drv, thus getting 5 matches
instead of 4.

* tests/guix-build.sh: Refine grep patterns for ‘guix build -P1’ test.

Reported-by: Janneke Nieuwenhuizen <janneke@gnu.org>
Change-Id: Iae35e6ee44b8eca0ef66c1d8ab7f9ff65a59d8d0
2024-12-02 23:18:52 +01:00
Greg Hogan
522732d5c1
packages: 'package-input-rewriting/spec' optionally replace hidden.
Commit eee95b5a87 changed package
rewriting to ignore hidden packages. This patch permits the previous use
by adding an option to rewrite hidden packages.

* guix/packages.scm (package-input-rewriting/spec)[rewrite]: When P is
hidden, return it as-is unless #:replace-hidden? has been enabled.
* tests/packages.scm ("package-input-rewriting/spec, replace hidden
package"): New test.
* doc/guix.texi (Defining Package Variants): Update.

Change-Id: I0a7988cac70e0c6b88b0fe6e27c1036fa723e030
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2024-12-02 12:00:52 +01:00
Ludovic Courtès
dbce5c2d47
transformations: ‘package-with-upstream-version’ can preserve patches.
* guix/transformations.scm (upstream-fetch): New procedure.
(package-with-upstream-version): Add #:preserve-patches? and honor it.

Change-Id: Ib56b84957d8bdad2eebe2551e2a6e477506fc55e
2024-12-01 20:14:16 +01:00
Ludovic Courtès
6b14eb3402
guix build: Add ‘--dependents’.
* guix/scripts/build.scm (show-help, %options): Add ‘--dependents’.
(dependents): New procedure.
(options->things-to-build): Add ‘store’ parameter; honor ‘dependents’
option.
[for-type]: Handle ‘dependents’ type.
(options->derivations): Update call to ‘options->things-to-build’.
* tests/guix-build.sh: Add test.
* doc/guix.texi (Additional Build Options): Document ‘--dependents’.
(Invoking guix refresh): Cross-reference it.
* doc/contributing.texi (Submitting Patches): Mention it.

Change-Id: I00b6d5831e1f1d35dc8b84a82605391d5a8f417c
2024-12-01 20:14:15 +01:00
Ludovic Courtès
a633422371
guix build: Add ‘--development’ option.
* guix/scripts/build.scm (show-help, %options): Add ‘-D’.
(options->things-to-build): Change ‘append-map’ to a loop.  Honor ‘-D’.
* tests/guix-build.sh: Add test.
* doc/guix.texi (Additional Build Options): Document it.

Reviewed-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Change-Id: I99227aadfe861e43c001a4872292bd687b37f5d4
2024-12-01 20:14:15 +01:00
Sebastian Dümcke
ccf72d5074
pack: Add support for AppImage pack format.
* guix/scripts/pack.scm (self-contained-appimage): New procedure.
(%formats, show-formats): Add it.
(guix-pack): Honor it.
* doc/guix.texi: Document AppImage pack.
* tests/pack.scm ("appimage", "appimage + localstatedir"): New tests.

Co-authored-by: Noé Lopez <noelopez@free.fr>
Change-Id: I33ebfec623cff1cfcd6f029d2d3054c23ab1949a
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2024-11-23 16:30:17 +01:00
Maxim Cournoyer
94133452aa
tests: Fix the 'go-module->guix-package' test.
This fixes a regression that would have been introduced by commit
a8b927a562 ("import: go: Add an option to use pinned versions.") which is
already 3 years old (!).

* tests/go.scm (fixtures-go-check-test): Register new URL and data for
http-fetch and http-get mocks.

Change-Id: Ie9d306612971de54ce534563731f52baf64bc8e7
2024-11-17 20:32:50 +09:00
Ludovic Courtès
c62f8ab11f
derivations: ‘derivation-build-plan’ returns builds in topological order.
That makes ‘derivation-build-plan’ directly usable in cases where one
wants to sequentially build derivations one by one, or to report builds
in the right order in the user interface.

* guix/derivations.scm (derivation-build-plan): Wrap ‘loop’ in
‘traverse’.  Perform a depth-first traversal.  Return the list of builds
in topological order.
* tests/derivations.scm ("derivation-build-plan, topological ordering"):
New test.

Change-Id: I7cd9083f42c4381b4213794a40dbb5b234df966d
2024-11-12 23:46:49 +01:00
Ting-Wei Lan
9793403bc0
tests: Fix gremlin.scm for GCC 14
* tests/gremlin.scm: Include stdio.h before using puts since GCC 14 no
longer allows implicit declarations.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2024-11-12 23:40:39 +01:00
Ludovic Courtès
b5303183ef
tests: Make ‘tests/print.scm’ deterministic.
The “package with inputs” test would fail non-deterministically:
sometimes ‘package->code’ would pick the ‘glibc’ symbol, sometimes it
would take ‘glibc/hurd’, which is an alias for ‘glibc’.

* tests/print.scm (pkg-with-inputs)[inputs]: Replace ‘glibc’ with
‘gnu-make’.

Change-Id: Ie192adda98d66546fae820a6bcdd5bb4b9f4dae7
2024-09-28 00:20:18 +02:00
Ludovic Courtès
89413a1162
Revert "import: crate: Emit new-style package inputs."
This reverts commit b8af6694b9, which led
‘guix import crate’ to produce invalid code (missing quasiquote) and
triggered a failure of ‘tests/crate.scm’.

Fixes <https://issues.guix.gnu.org/72939>.

Reported-by: Aleksandr Vityazev <avityazev@disroot.org>
Change-Id: If309caaa594f912788e20007bfa1f55b7d581a93
2024-09-19 12:41:54 +02:00
Ludovic Courtès
7979001c58
tests: Adjust ‘elm’ importer test to expect inputs without labels.
This is a followup af85c38b01.

* tests/elm.scm ("(guix import elm)"): Expect new-style inputs.

Change-Id: If3c6b17b5a5d17ad443c3ddb05f94dc2458ba182
2024-09-17 17:34:58 +02:00
Ludovic Courtès
a7bb45b39d
gexp: ‘imported-files’ does not create symlinks.
Fixes <https://issues.guix.gnu.org/73275>.

This is presumably what e529d46828 meant
to do, except that it wrongfully pass #:symlink? a true value instead,
most likely due to a typo.

* guix/gexp.scm (imported-files): Pass #:symlink? #f.
* tests/gexp.scm ("imported-files does not create symlinks"): New test.

Change-Id: Ic31be56a2adf4dfa55e1ec390c53cc9ba5f8a96c
2024-09-16 00:16:20 +02:00
Richard Sent
f3ea876895
gexp: Add ‘assume-source-relative-file-name’.
* guix/gexp.scm (assume-source-relative-file-name): New macro.
(local-file): Use assume-source-relative-file-name to look up a non-literal
file relative to the current source directory.
* doc/guix.texi (G-expressions): Document it.
* tests/gexp.scm ("local-file, non-literal source relative file name"):
New test.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Change-Id: I18573c8c7a6c87e8351b34412f9d26bb23b068b4
2024-09-04 19:17:00 +02:00
Herman Rimm
c4ce313052
scripts: style: Add 'alphabetical-sort' option.
* guix/scripts/style.scm (show-help): Describe option.
(order-packages): Add procedure.
(format-whole-file): Add 'order?' argument.
(%options): Add 'alphabetical-sort' option.
(guix-style): Alphabetically order packages in files.
* tests/guix-style.sh: Test alphabetical ordering.
* doc/guix.texi (Invoking guix style): Document option.

Change-Id: I4aa7c0bd0b6d42529ae7d304587ffb10bf5f4006
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2024-09-03 13:59:33 +02:00
Nicolas Goaziou
4ab789d441
guix: import texlive: Add UPSTREAM-NAME property when necessary.
* guix/import/texlive.scm (tlpdb->package): Add UPSTREAM-NAME property when necessary.
* tests/texlive.scm ("texlive->guix-package, with upstream-name property"):
Add new test.

Change-Id: I134a065cbe0a7f0ff4d72b0929dba4e4d46cfaeb
2024-08-31 10:45:37 +02:00
Nicolas Goaziou
415ed34860
guix: import texlive: Adjust to generate new source format.
* guix/import/texlive.scm (tlpdb->package): Adjust source according to new format.
* tests/texlive.scm (%fake-tlpdb): Add database revision.
("texlive->guix-package, no docfiles"):
("texlive->guix-package"):
("texlive->guix-package, with catalogue entry, no inputs"):
("texlive->guix-package, multiple licenses"):
("texlive->guix-package, with TeX format"): Update checks.

Change-Id: I60d5fe0f5f8db194c679dcb262f64c824cd19909
2024-08-31 10:45:33 +02:00
Nicolas Goaziou
416b196d74
gnu: TeX Live packages built from TEXLIVE-SOURCE use same version.
* gnu/packages/tex.scm (%texlive-version): New variable.
(texlive-source):
(texlive-libkpathsea)[version]:
(texlive-libptexenc)[version]:
(texlive-bin)[version]:
(texlive-scheme-basic)[version]:
(texlive-scheme-bookpub)[version]:
(texlive-scheme-context)[version]:
(texlive-scheme-full)[version]:
(texlive-scheme-gust)[version]:
(texlive-scheme-medium)[version]:
(texlive-scheme-minimal)[version]:
(texlive-scheme-small)[version]:
(texlive-scheme-tetex)[version]:
(texlive-collection-basic)[version]:
(texlive-collection-bibtexextra)[version]:
(texlive-collection-binextra)[version]:
(texlive-collection-context)[version]:
(texlive-collection-fontsextra)[version]:
(texlive-collection-fontsrecommended)[version]:
(texlive-collection-fontutils)[version]:
(texlive-collection-formatsextra)[version]:
(texlive-collection-games)[version]:
(texlive-collection-humanities)[version]:
(texlive-collection-langarabic)[version]:
(texlive-collection-langchinese)[version]:
(texlive-collection-langcjk)[version]:
(texlive-collection-langcyrillic)[version]:
(texlive-collection-langczechslovak)[version]:
(texlive-collection-langenglish)[version]:
(texlive-collection-langeuropean)[version]:
(texlive-collection-langfrench)[version]:
(texlive-collection-langgerman)[version]:
(texlive-collection-langgreek)[version]:
(texlive-collection-langitalian)[version]:
(texlive-collection-langjapanese)[version]:
(texlive-collection-langkorean)[version]:
(texlive-collection-langother)[version]:
(texlive-collection-langpolish)[version]:
(texlive-collection-langportuguese)[version]:
(texlive-collection-langspanish)[version]:
(texlive-collection-latex)[version]:
(texlive-collection-latexextra)[version]:
(texlive-collection-latexrecommended)[version]:
(texlive-collection-luatex)[version]:
(texlive-collection-mathscience)[version]:
(texlive-collection-metapost)[version]:
(texlive-collection-music)[version]:
(texlive-collection-pictures)[version]:
(texlive-collection-plaingeneric)[version]:
(texlive-collection-pstricks)[version]:
(texlive-collection-publishers)[version]:
(texlive-collection-xetex)[version]: Use new variable.
* guix/import/texlive.scm (tlpdb->package): Always use version from
%TEXLIVE-VERSION.
* tests/texlive.scm ("texlive->guix-package, meta-package"): Test change to
importer.

Since meta-packages are empty, they are not going through an updater.  This
change makes sure they always refer to an up-to-date version when the rest of
TeX Live is updated.

Change-Id: I55445e3337c1dea22158103d9ed952f75c3c4964

texlive-source

Change-Id: I198a361fd6df3c5dd2b4fa376e1ad623937f08cc
2024-08-31 10:45:32 +02:00
Nicolas Goaziou
9dc279e2fd
guix: import texlive: Handle versions.
* guix/import/texlive.scm (texlive-repository):
(texlive-repository-location):
(svn-command):
(version->revision):
(current-day):
(latest-texlive-tag):
(texlive->svn-multi-reference): New variables.
(tlpdb-file) Remove function.
(tlpdb): Add VERSION argument.
* guix/import/texlive.scm (list-upstream-inputs): Add VERSION and DATABASE
arguments.
(tlpdb->package): Do not use fixed version.  Instead, make use of the version
provided as an argument.  Add DATABASE argument for testing.
(texlive->guix-package): Do not memoize.  Allow providing any TeX Live release
tag as version.  Default to latest tag.  Add DATABASE argument for testing.
Improve docstring.

* tests/texlive.scm ("texlive->guix-package, no docfiles"):
("texlive->guix-package"):
("texlive->guix-package, with METAFONT files"):
("texlive->guix-package, with catalogue entry, no inputs"):
("texlive->guix-package, multiple licenses"):
("texlive->guix-package, meta-package"):
("texlive->guix-package, with TeX format"):
("texlive->guix-package, execute but no TeX format"):
("texlive->guix-package, translate dependencies"):
("texlive->guix-package, lonely `hyphen-base' dependency and ARCH"):
("texlive->guix-package, single script, no extension"):
("texlive->guix-package, multiple scripts, with extensions"):
("texlive->guix-package, script with associated input"):
("texlive->guix-package, propagated binaries, no script"):
("texlive->guix-package, propagated binaries and scripts"):
("texlive->guix-package, with skipped propagated binaries"): Update tests.

Change-Id: I7576b6e31e9ec3ff84258b71d0c4dd180d2b5c38
2024-08-31 10:45:32 +02:00
Nicolas Goaziou
b4ce7359fb
guix: import texlive: Propagate binaries when necessary.
* guix/import/texlive.scm (no-bin-propagation-packages): New variable.
(list-binfiles): New function.
(linked-scripts): Renamed to...
(list-linked-scripts): ... this.  Now always return a list.
(tlpdb->package): Handle binary propagation.
* tests/texlive.scm (%fake-tlpdb): Add data for new tests.
("texlive->guix-package, propagated binaries, no script"):
("texlive->guix-package, propagated binaries and scripts"):
("texlive->guix-package, with skipped propagated binaries"): New tests.

Change-Id: I707ba33a10aa98ad27151724d3ecc4158db6b7cc
2024-08-31 10:45:30 +02:00
Sarah Morgensen
af85c38b01
import: go: Emit new-style package inputs.
Since PACKAGE-NAMES->PACKAGE-INPUTS is used by both the go and crate
importers, give the crate importer a copy of the original so it
continues to use old-style inputs until it is updated.

* guix/import/utils.scm (package-names->package-inputs)[make-input]:
Return new-style package inputs.
(maybe-inputs): Wrap PACKAGE-INPUTS in 'list' instead of 'quasiquote'.
* guix/import/crate.scm (package-names->package-inputs): New variable.
* tests/go.scm ("go-module->guix-package"): Adjust to new-style package
inputs.

Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
2024-08-31 10:44:36 +02:00
Sarah Morgensen
b8af6694b9
import: crate: Emit new-style package inputs.
* guix/import/crate.scm (maybe-cargo-development-inputs)
(maybe-cargo-inputs): Wrap PACKAGE-INPUTS in unquoted 'list'.
* tests/crate.scm ("crate->guix-package")
("cargo-recursive-import")
("cargo-recursive-import-honors-existing-packages"): Adjust accordingly.

Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Modified-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Change-Id: I4dfb745272ecbc893926446872514fb815c07236
2024-08-31 10:44:36 +02:00
Ludovic Courtès
949ee85019
profiles: Use C.UTF-8 instead of ‘glibc-utf8-locales’ where possible.
This is a followup to 1cebc334a7.

* guix/profiles.scm (ca-certificate-bundle)[libc-utf8-locales-for-target]:
Remove.
[build]: Use “C.UTF-8” instead of “en_US.utf8”.
(profile-derivation)[libc-utf8-locales-for-target]: Remove.
[set-utf8-locale]: Rewrite to a gexp that calls ‘setlocale’ for “C.UTF-8”.
* tests/profiles.scm ("profile-derivation, cross-compilation"): Remove
‘locales’ variable and related check.

Change-Id: I7cb148b9149fe5fbe5b9b1b25fdce1002ad1f37e
2024-08-31 10:42:49 +02:00
Maxim Cournoyer
f59df1aa3c
build-systems: gnu: Export %default-gnu-imported-modules and %default-gnu-modules.
Until now users would have to cargo cult or inspect the private
%default-modules variable of (guix build-systems gnu) to discover which
modules to include when extending the used modules via the #:modules argument.

The renaming was automated via the command:

  $ git grep -l %gnu-build-system-modules
    | xargs sed 's/%gnu-build-system-modules/%default-gnu-imported-modules/' -i

* guix/build-system/gnu.scm (%gnu-build-system-modules): Rename to...
(%default-gnu-imported-modules): ... this.
(%default-modules): Rename to...
(%default-gnu-modules): ... this.  Export.
(dist-package, gnu-build, gnu-cross-build): Adjust accordingly.

Change-Id: Idef307fff13cb76f3182d782b26e1cd3a5c757ee
2024-08-31 10:42:16 +02:00
Carlo Zancanaro
994fbc0ac6
build: utils: Raise error in modify-phases upon missing key.
* guix/build/utils.scm (alist-cons-before)
(alist-cons-after): Error with a match failure if the
reference is not found, instead of appending to the alist.
* tests/build-utils.scm: Update tests to match the new behavior.

Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Change-Id: I3044b101bd06231d5cd55a544ac1009e6ce6f9a0
2024-08-31 10:42:06 +02:00
Ludovic Courtès
d921c742b7
cache: Avoid cache cleanup storms from concurrent processes.
Reported by Christopher Baines <guix@cbaines.net>.

* guix/cache.scm (maybe-remove-expired-cache-entries): Define
‘expiry-port’; create it with ‘lock-file’.  Change ‘last-expiry-date’
accordingly.  Write timestamp straight to ‘expiry-port’.
* tests/cache.scm ("maybe-remove-expired-cache-entries, cleanup needed
but lock taken"): New test.

Change-Id: I22441d9d2c4a339d3d3878de131864db5a0ae826
2024-08-21 00:52:39 +02:00
Ludovic Courtès
96cd163c14
syscalls: Add ‘mode’ parameter to ‘lock-file’.
* guix/build/syscalls.scm (lock-file): Add ‘mode’ parameter and honor it.
* tests/syscalls.scm ("lock-file + unlock-file"): New test.

Change-Id: I113fb4a8b35dd8782b9c0991574e39a4b4393333
2024-08-21 00:52:38 +02:00
Christopher Baines
f4aec15f47
tests: gexp: Handle incorrect guile-bootstrap version for riscv.
The tests currently fail when run on riscv-linux (affecting the guix package)
because Guile 3 is used as the bootstrap guile.  Correcting the package
version seems hard, so I'm just tweaking the tests to use the right effective
version for riscv64-linux.

* tests/gexp.scm (bootstrap-guile-effective-version): New procedure.
("gexp->derivation & with-extensions", "lower-gexp", "lower-gexp,
raw-derivation-file"): Use bootstrap-guile-effective-version.

Change-Id: I3995e1f6b58ada1baf38a8ec55b0173059dd0079
2024-08-01 10:32:31 +01:00
Ludovic Courtès
e3dfed59d3
modules: ‘file-name->module-name’ strips leading “./”.
Fixes <https://issues.guix.gnu.org/71979>.

* guix/modules.scm (file-name->module-name): Strip leading “.” component
from FILE.
* tests/modules.scm ("file-name->module-name")
("file-name->module-name, leading dot"): New tests.

Reported-by: Tomas Volf <~@wolfsden.cz>
Change-Id: I3d1b9f3f21448050cac4f3b1aed5f8f03758d4c9
2024-07-18 17:31:19 +02:00
Ludovic Courtès
58e268c2e3
git: Remove untracked files from cached checkouts.
Cached checkouts could end up with stale untracked files, for example
because the checkout was interrupted.  As a result, when this happens
for the Guix checkout, users would not get substitutes for ‘guix pull’.

* guix/git.scm (delete-untracked-files): New procedure.
(switch-to-ref): Use it.
* tests/git.scm ("update-cached-checkout, untracked files removed"): New
test.

Co-authored-by: Ricardo Wurmus <rekado@elephly.net>
Change-Id: Iccbe644ade396ad27a037db7e0ef1c2a68ef91ce
2024-07-18 17:31:19 +02:00
Ludovic Courtès
0553c44471
guix build: Take ‘--system’ into account together with ‘-S’.
* guix/scripts/build.scm (options->derivations)[compute-derivation]:
Pass ‘system’ to ‘package-source-derivation’.
* tests/guix-build.sh: Test ‘-S’ together with ‘-s’.

Change-Id: If35f116285dd9caaf939221163ad0ba831eea993
2024-07-18 17:31:18 +02:00
Lars Bilke
7893b32ef6
pack: Create /tmp in Apptainer images.
Related to <https://bugs.gnu.org/37161> and
<https://git.savannah.gnu.org/cgit/guix.git/commit/?id=7979a287f8eb84cbbfa44629951572408939a756>.

* guix/scripts/pack.scm (squashfs-image)[build]: Add /tmp to the set of
directories created.
* tests/pack.scm ("squashfs-image + localstatedir"): Check for /tmp.

Change-Id: I576aaa6ba8cb8478acf4c3144d492ae5caf411ca
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2024-07-10 16:00:36 +02:00
Ludovic Courtès
af2ca0226f
tests: Adjust ‘guix system’ test for EFI bootloader.
This is a followup to e5078ff321, which
broke this test:

  $ guix system disk-image -n gnu/system/examples/desktop.tmpl
  guix system: warning: 'disk-image' is deprecated: use 'image' instead
  guix system: error: EFI bootloader required with GPT partitioning

* tests/guix-system.sh: Use ‘guix system image’ instead of ‘guix system
disk-image’.  Pass ‘-t efi-raw’ for ‘desktop.tmpl’.

Change-Id: I6877085ab33d9e8b471315b806fed22a7d1241a3
2024-06-13 22:34:00 +02:00
Ludovic Courtès
8355756d1a
tests: Fix ‘beautify-description’ test.
This is a followup to 510ad5d93c.

* tests/import-utils.scm ("beautify-description: transform fragment into
sentence"): Fix.

Change-Id: I331cb38a3460a024a789846772a074ba0b6c857c
2024-06-13 21:47:38 +02:00
Herman Rimm
510ad5d93c
import: utils: End package descriptions with period.
* guix/import/utils.scm (beautify-description): Append period to last
words which do not end with one.
* tests/crate.scm: Append period to descriptions.
* tests/elm.scm: Append period to descriptions.
* tests/gem.scm: Append period to descriptions.
* tests/hexpm.scm: Append period to descriptions.
* tests/minetest.scm: Append period to descriptions.
* tests/pypi.scm: Append period to descriptions.
* tests/import-utils.scm ("beautify-description: transform fragment into
sentence"): Likewise.

Change-Id: I0b12c4d94cb26cf62fab5b7cbf7885e66ff6c10f
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2024-06-03 22:58:53 +02:00
Herman Rimm
e62fd9004b
import: crate: Include a main verb in crate importer descriptions.
* guix/import/crate.scm (make-crate-sexp): Start description with
'This package provides '.
* tests/crate.scm: Set descriptions to "This package provides summary".

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Change-Id: If0f47a68f986b9e878fd5caa3e365c5ad863089a
2024-06-03 22:58:53 +02:00