Commit graph

8070 commits

Author SHA1 Message Date
Maxim Cournoyer
3fadea4254
import: Guard against potential type error.
The import-gnu-release could crash with a "Wrong type (expecting pair): ()"
error, as seen when attempting to recursively refresh a package, e.g.:

  $ guix refresh -r xdg-desktop-portal-gnome

It would crash on attempting to refresh 'bash-static'.

* guix/gnu-maintenance.scm (import-gnu-release): Guard against a potentially
empty VERSIONS list.

Change-Id: Ib4edb4b721e6053b09ef144a1b16fe23b35649b0
2025-05-17 13:10:11 +09:00
Ricardo Wurmus
24dd164ead
import/cran: Record more invalid package names.
* guix/import/cran.scm (invalid-packages): Add more bogus names.

Change-Id: I279996db792ed1677bd596fc7a6b5c1886a0ead4
2025-05-13 14:50:05 +02:00
Ricardo Wurmus
3071ef9397
guix: Update to Bioconductor 3.21.
* guix/build-system/r.scm (bioconductor-uri): Update version in URI to 3.21.
* guix/import/cran.scm (%bioconductor-version): Update to 3.21.

Change-Id: I216576d42d013a00310cc2230e89567ffb1487a2
2025-05-12 08:53:55 +02:00
Maxim Cournoyer
18ed22536d
ui: Allow evaluating multi-expressions strings with read/eval.
This can be useful when evaluating a scheme-file store output for example,
which has multiple top level expressions.

* guix/ui.scm (read/eval): Also accept a port object as argument.  Read and
evaluate all expressions from input port or string.

Change-Id: I0213706fa4824c3a8ffe5d93f44f263048cb62c2
2025-05-09 23:05:26 +09:00
Ludovic Courtès
edc799dabf
environment, home: Make /tmp writable.
Fixes <https://issues.guix.gnu.org/78272>.

Fixes a bug caused by commit ce363c1dc7,
which inadvertently made /tmp read-only as well.

* guix/scripts/environment.scm (launch-environment/container)[tmpfs]:
New variable.
Add it to ‘file-systems’.
* guix/scripts/home.scm (spawn-home-container): Add /tmp file system
to #:mounts.
* tests/guix-environment-container.sh: Add test.

Reported-by: Tomas Volf <~@wolfsden.cz>
Change-Id: I5cb449e6d0c213d4b5866cbcbd14990437a7d4c5
2025-05-06 12:22:34 +02:00
Nicolas Goaziou
af54888314
guix: texlive importer: Fix recursive calls.
* guix/import/texlive.scm (texlive-recursive-import): Make sure #:guix-name
value accepts only one argument.

Change-Id: Ie3c7f7cee7860e0d926ba95a708f16e147f4d550
2025-05-06 11:25:07 +02:00
Nicolas Goaziou
df887f679f
guix: texlive importer: Improve output for texlive-biber-ms.
* guix/import/texlive.scm (no-bin-propagation-packages): Add "biber-ms".

Change-Id: Id9dadd2194e8d59d68c395b513e4c94673c97bb2
2025-05-06 11:25:07 +02:00
Nicolas Goaziou
9192c195ff
guix: texlive importer: Fix version error when importing a package.
* guix/import/texlive.scm (texlive->guix-package): Use find-version instead of
returning the first version tag.

Change-Id: Ib144d56c034c9ce3e5a4cddcffb78be58cd05e62
2025-05-06 11:25:07 +02:00
Nicolas Goaziou
3cf3880212
guix: texlive importer: Adjust version for meta packages.
* guix/import/texlive.scm (tlpdb->package): Use (package-version
package-source) instead of %texlive-revision when importing a meta package.
* tests/texlive.scm ("texlive->guix-package, meta-package"): Test it.

Change-Id: I2a5d2eb6529dafe0c888b2a7a5a1b38af1160235
2025-05-06 11:25:06 +02:00
Nicolas Goaziou
9712d8daec
gnu: Make modular TeX Live reproducible.
Fixes: https://issues.guix.gnu.org/73613

* gnu/packages/tex.scm (texlive-aleph):
(texlive-amstex):
(texlive-eplain):
(texlive-hitex):
(texlive-lollipop):
(texlive-mex):
(texlive-mltex):
(texlive-texsis):
(texlive-luatex):
(texlive-xmltex):
(texlive-latex-bin):
(texlive-cslatex):
(texlive-mptopdf):
(texlive-mflua):
(texlive-luajittex):
(texlive-csplain):
(texlive-luahbtex):
(texlive-jadetex):
(texlive-pdftex):
(texlive-optex):
(texlive-context-legacy):
(texlive-everyshi):
(texlive-xetex): Add libfaketime to native inputs.
* guix/build/texlive-build-system.scm (enforce-source-date-epoch): New function.
(create-formats): Wrap format generation within a `faketime' or `datefudge'
call, depending on the system.
(%standard-phases): Add a phase to obey to SOURCE_DATE_EPOCH.

Change-Id: Ieef6adb18b7f4373194e3550d41761f75334e574
2025-05-06 11:25:06 +02:00
Nicolas Goaziou
f6d9057ff2
gnu: texlive-libkpathsea: Enforce ls-R usage by default.
Fixes: https://issues.guix.gnu.org/75893

* gnu/packages/tex.scm (texlive-libkpathsea): Set TEXMF so that ls-R database
is mandatory and must contain the file looked after in the TeX Live tree.
* guix/build/texlive-build-system.scm (configure-texmf): Relax requirements
for "ls-R" database.  Renamed from `set-texmfvar'.
(%standard-phases): Apply phase renaming.
* gnu/packages/python-xyz.scm (python-nbconvert)[native-inputs]: Add TeX Live
packages required for tests to pass since propagated packages are no longer
accessible during build.
* gnu/packages/books.scm (book-sparc)[inputs]: Move TeX Live related inputs
to...
[native-inputs]: ... here, and wrap them within texlive-local-tree for the
same reason as above.

Change-Id: I3430bc84ce35f4aa8f0537b512f472ef88f8e5e9
2025-05-06 11:25:06 +02:00
Nicolas Goaziou
4e04035d36
gnu: profiles.scm: Ignore ls-R databases when building font maps.
* guix/profiles.scm (texlive-font-maps): Ignore ls-R databases when building
font maps.

Change-Id: I942886a89497e94c51e492657150540c6cd35603
2025-05-06 11:25:06 +02:00
Nicolas Goaziou
4df6eda30f
gnu: Rename texlive-updmap.cfg' into texlive-local-tree'.
* doc/build.scm (pdf-manual):
* doc/contributing.texi (Submitting Patches):
* gnu/packages/algebra.scm (pari-gp):
(giac):
* gnu/packages/assembly.scm (asl):
* gnu/packages/audio.scm (chow-tape-model):
* gnu/packages/bioconductor.scm (r-biocstyle):
* gnu/packages/bioinformatics.scm (discrover):
(phyml):
(velvet):
* gnu/packages/chemistry.scm (yaehmop):
* gnu/packages/chez.scm (chez-scheme-for-racket):
(stex-bootstrap):
(chez-web):
(chez-sockets):
* gnu/packages/cran.scm (r-papaja):
(r-prereg):
* gnu/packages/docbook.scm (dblatex):
* gnu/packages/emacs-xyz.scm (emacs-auctex):
* gnu/packages/engineering.scm (fastcap):
* gnu/packages/finance.scm (optionmatrix):
* gnu/packages/fsf.scm (book-faif):
* gnu/packages/gettext.scm (po4a):
(po4a-minimal):
* gnu/packages/graphics.scm (mmg):
* gnu/packages/graphviz.scm (dot2tex):
* gnu/packages/guile-xyz.scm (emacsy):
(guile-cv):
* gnu/packages/lisp.scm (sbcl):
* gnu/packages/maths.scm (cddlib):
(gnuplot):
(itpp):
(octave):
(suitesparse-amd):
(suitesparse-camd):
(suitesparse-cholmod):
(suitesparse-klu):
(suitesparse-ldl):
(suitesparse-mongoose):
(suitesparse-spex):
(suitesparse-spqr):
(suitesparse-umfpack):
(hypre):
* gnu/packages/music.scm (lilypond):
* gnu/packages/ocaml.scm (unison):
(ocaml-bibtex2html):
* gnu/packages/pdf.scm (extractpdfmark):
* gnu/packages/photo.scm (enblend-enfuse):
* gnu/packages/plotutils.scm (asymptote):
* gnu/packages/python-xyz.scm (python-numpy-documentation):
(python-ipython-documentation):
(python-pypandoc):
* gnu/packages/radio.scm (gnuradio):
(libosmo-dsp):
* gnu/packages/scheme.scm (mit-scheme):
* gnu/packages/security-token.scm (yubico-piv-tool):
* gnu/packages/sphinx.scm (python-sphinx):
(python-sphinx-5):
* gnu/packages/statistics.scm (r-with-tests):
(r-spams):
* gnu/packages/tex.scm (texlive-local-tree): Renamed from…
(texlive-updmap.cfg): … this. Deprecate the latter.
(texlive-biblatex-philosophy):
(texlive-bropd):
(texlive-fontsize):
(texlive-poetrytex):
(texlive-reverxii):
(texlive-stix):
(texlive-suftesi):
(texlive-thucoursework):
(texlive-ulqda):
(texlive-yathesis):
(texlive-makecell):
(texlive-robotarm):
(texlive-bbold):
(texlive-babel-romansh):
(texlive-polyglossia):
(texlive-innerscript):
(teximpatient):
(texlive-xkeyval):
(texlive-arabxetex):
(texlive-blox):
(texlive-ecgdraw):
(texlive-gradientframe):
(texlive-everyhook):
(texlive-actuarialangle):
(texlive-actuarialsymbol):
(texlive-autopdf):
(texlive-etaremune):
(texlive-extract):
(texlive-forarray):
(texlive-graphicx-psmin):
(texlive-ha-prosper):
(texlive-namespc):
(texlive-newspaper):
(texlive-powerdot):
(texlive-recipecard):
(texlive-show2e):
(texlive-tablists):
(texlive-ted):
(texlive-xargs):
(texlive-xpeek):
* gnu/packages/xdisorg.scm (xforms):
* gnu/packages/algebra.scm (gap):
* gnu/packages/cpp.scm (jthread):
* guix/lint.scm (check-inputs-should-be-native): Rename `texlive-updmap.cfg' into `texlive-local-tree'.

Change-Id: I129280807c418e57acbcbda399545ab27a9e0a33
2025-05-06 11:25:06 +02:00
Nicolas Goaziou
f5914d5b2e
gnu: texlive build system: Un-dumbify a comment.
* guix/build/texlive-build-system.scm (build): Clarify a poorly explained
design choice.

Change-Id: Ida4e4ccb3934f8b5cc7a6e36e33cec7a5e5581e8
2025-05-06 11:25:05 +02:00
Ludovic Courtès
e1a0171a56
linux-container: Set up “lo” and generate /etc/hosts by default.
* gnu/build/linux-container.scm (run-container): Add #:loopback-network?
and honor it via #:populate-file-system.
(call-with-container): Add #:loopback-network? and pass it to
‘run-container’.
* guix/scripts/environment.scm (launch-environment/container): Remove
call to ‘set-network-interface-up’ and remove generation of /etc/hosts.
* guix/scripts/home.scm (spawn-home-container): Likewise.

Change-Id: I5933a4e8dc6d8e19235a79696b62299d74d1ba21
2025-05-05 14:34:00 +02:00
Ludovic Courtès
3aa132e8c3
syscalls: Add ‘get-user-ns’.
* guix/build/syscalls.scm (NS_GET_USERNS): New variable.
(get-user-ns): New procedure.

Change-Id: I0cfba6a7cdf2ab64ef658b0f821ba4e7c6c89eab
2025-05-05 14:34:00 +02:00
Ludovic Courtès
ce363c1dc7
environment: Add ‘--writable-root’ and default to read-only root.
This is an incompatible change where the root file system in
‘guix shell -C’ is now read-only by default.

* guix/scripts/environment.scm (show-environment-options-help)
(%options): Add ‘--writable-root’.
* guix/scripts/environment.scm (setup-fhs): Invoke /sbin/ldconfig; moved
from…
(launch-environment): … here.
(launch-environment/container): Add #:writable-root? and pass it to
‘call-with-container’.  Move root file system setup to #:populate-file-system.
(guix-environment*): Honor ‘--writable-root’.
* tests/guix-environment-container.sh: Test it.
* doc/guix.texi (Invoking guix shell): Document ‘--writable-root’.
(Debugging Build Failures): Mention it before “rm /bin/sh”.

Change-Id: I2e8517d6f01eb8093160bffc0f9f56071ad6fee6
Reviewed-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
2025-05-05 14:33:59 +02:00
Ludovic Courtès
7d28e6512c
guix home: ‘container’ provides a read-only root file system.
* guix/scripts/home.scm (spawn-home-container): Move creation of
accounts, /etc/hosts, /tmp, and HOME-DIRECTORY from the first argument
of ‘eval/container’ to #:populate-file-system.  Remove #:writable-root?.
* tests/guix-home.sh: Test that the root file system is read-only.

Change-Id: Icda54706321d51b95b563c86c3fb2238cc65ee20
2025-05-05 14:33:59 +02:00
Ludovic Courtès
a391394a22
linux-container: Support having a read-only root file system.
Until now, the read-only file system set up by ‘call-with-container’
would always be writable.  With this change, it can be made read-only.
With this patch, only ‘least-authority-wrapper’ switches to a read-only
root file system.

* gnu/build/linux-container.scm (remount-read-only): New procedure.
(mount-file-systems): Add #:writable-root? and #:populate-file-system
and honor them.
(run-container): Likewise.
(call-with-container): Likewise.
* gnu/system/linux-container.scm (container-script): Pass #:writable-root?
to ‘call-with-container’.
(eval/container): Add #:populate-file-system and #:writable-root? and
honor them.
* guix/scripts/environment.scm (launch-environment/container):
Pass #:writable-root? to ‘call-with-container’.
* guix/scripts/home.scm (spawn-home-container): Likewise.
* tests/containers.scm ("call-with-container, mnt namespace, read-only root")
("call-with-container, mnt namespace, writable root"): New tests.

Change-Id: I603e2fd08851338b737bb16c8af3f765e2538906
2025-05-05 14:33:59 +02:00
Ludovic Courtès
acc4215644
guix home: ‘container’ explicitly mounts $HOME and /run/user/1000.
* guix/scripts/home.scm (spawn-home-container): Pass #:mounts to
‘eval/container’.

Change-Id: I1986c1411711cebaf623f97897d91436d8167037
2025-05-05 14:33:59 +02:00
Tomas Volf
a2282c68ff
environment: Restore action for SIGPIPE.
Code in `ui.scm' in `initialize-guix' procedure changes the handling of
SIGPIPE to SIG_IGN.  So restore the handling to SIG_DFL so that process
executed will have the usual action.  Technically we should record what the
handling was, and restore it to the previous value, but that would be much
more invasive change.

Always setting it to SIG_DFL is at least less surprising than always setting
to SIG_IGN.

* guix/scripts/environment.scm (launch-environment): Restore default action
for SIGPIPE.

Change-Id: Ifabae1d3e71aa44e63078cea5bd3824b8f61ba14
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-05-05 12:15:55 +02:00
Romain GARBAGE
79bc4ebb33
transformations: Git source transformations honour RECURSIVE?.
* guix/transformations.scm (package-git-url+recursive?): New variable.
(package-git-url): Remove variable.
(evaluate-git-replacement-specs): Use package-git-url+recursive?.
(transform-package-source-branch, transform-package-source-commit, transform-package-source-git-url): Update
according to changes above.
* doc/guix.texi (Package Transformation Options): Update documentation.
* tests/transformations.scm: Update tests. Add tests for RECURSIVE?
inheritance with WITH-COMMIT and WITH-SOURCE.

Change-Id: Id6a5e6957a9955c8173b06b3e14f2986c6dfc4bc
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-05-05 12:15:47 +02:00
Hilton Chain
415e3d98d6
scripts: home: Support extracting home-environment from Guix System declaration.
* guix/scripts/home.scm (process-action): Handle operating-system declaration
and extract home environment for current user.
* doc/guix.texi (Guix Services)[Guix Home Service]: Document it.

Change-Id: I995f79c2549e6edc76322542d0422159e0b79996
Reviewed-by: Maxim Cournoyer <maxim.cournoyer@gmail>
2025-05-03 15:53:46 +08:00
Maxim Cournoyer
f87204b2b2
build/cmake: Add #:implicit-inputs? and #:implicit-cross-inputs? arguments.
* guix/build-system/cmake.scm (lower) <#:implicit-inputs?>
<#:implicit-cross-inputs?>: New arguments.

Change-Id: I1f077f78f5836ce325827e7ef8d58ba554a8ed4f
Reviewed-by: Greg Hogan <code@greghogan.com>
2025-05-02 09:53:54 +09:00
Rutherther
d47379b8dc
profiles: gtk-icon-themes: Fix build error for when there are no icon themes.
* guix/profiles.scm (gtk-icon-themes): Always create the output directory.

Change-Id: I2aa5ab0023c9c584182c67f79102fb66b46a3a7d
Signed-off-by: 宋文武 <iyzsong@member.fsf.org>
2025-04-28 21:03:42 +08:00
Nicolas Graves
ac026164be
build-system: android-ndk: Improve style.
Like in other build-systems, make proper procedures to resolve the
build-system build-inputs bindings.

* guix/build-system/android-ndk.scm (default-android-build,
default-android-googletest): Add procedures.
(lower): Use them.

Signed-off-by: Christopher Baines <mail@cbaines.net>
2025-04-28 07:55:06 +01:00
Nicolas Graves
97a25bb484
build-system: ruby: Improve ruby-cross-build style.
* guix/build-system/ruby.scm
(ruby-cross-build): Use with-imported-modules around the
ruby-cross-build builder gexp.

Change-Id: I1051124f034f2082ccef531e9bcf37913d5a9449
Signed-off-by: Christopher Baines <mail@cbaines.net>
2025-04-28 07:55:06 +01:00
Nicolas Graves
9092b1f59b
build-system: waf: Improve waf-build style.
* guix/build-system/waf.scm
(waf-build): Use with-imported-modules around the waf-build builder gexp.

Change-Id: Id242046eb4bfef90dba60d7c3b1b68597ddf502e
Signed-off-by: Christopher Baines <mail@cbaines.net>
2025-04-28 07:55:06 +01:00
Nicolas Graves
4c4e29cebb
build-system: glib-or-gtk: Improve glib-or-gtk-cross-build style.
* guix/build-system/glib-or-gtk.scm
(glib-or-gtk-cross-build): Use with-imported-modules around the
glib-or-gtk-cross-build builder gexp.

Change-Id: I8eaa032ffc0a3f8dbf02c96a4ecee85475c32111
Signed-off-by: Christopher Baines <mail@cbaines.net>
2025-04-28 07:55:06 +01:00
Nicolas Graves
aa7b1abf2c
build-system: gnu: Improve gnu-cross-build style.
* guix/build-system/gnu.scm
(gnu-cross-build): Use with-imported-modules around the
gnu-cross-build builder gexp.

Change-Id: I47246571b1d84a82a67a8c289fd5ad4b5a3b5aeb
Signed-off-by: Christopher Baines <mail@cbaines.net>
2025-04-28 07:55:06 +01:00
Maxim Cournoyer
a369932d04
upstream: Do not update to same version.
Previously, 'guix refresh --update' would do actually rewrite the file with
the same version/hash information when the target version was the same as the
current version:

  guix refresh --update idutils=4.6
  idutils.scm: warning: downgrading 'idutils' from 4.6 to 4.6
  [...]
  idutils.scm: idutils: updating from version 4.6 to version 4.6...

This changes handles this case so that it does and prints nothing.

* guix/upstream.scm (package-update): Use `version-compare' to distinguish the
equal versions case.

Change-Id: I079e030d573f5968725ef13b3f626e2f8d02cb2f
Signed-off-by: Christopher Baines <mail@cbaines.net>
2025-04-27 13:01:48 +01:00
Rutherther
32575294ee
profiles: gtk-icon-themes: Produce only 'icon-theme.cache' files.
Previously the profile will produce a new symlink for each icon file, now it
will reuse existed ones if possible.

* guix/profiles.scm (gtk-icon-themes): Only install 'icon-theme.cache' files
into the output.  Adjust produce docstring.

Fixes: https://issues.guix.gnu.org/77487

Change-Id: Ia452565768753b8a60baf4fc075f6fe5ebb4fa39
Signed-off-by: 宋文武 <iyzsong@member.fsf.org>
2025-04-27 10:25:00 +08:00
Romain GARBAGE
7e90241586
git: Add support for symbolic references.
The #:refspecs argument was added in Guile-Git 0.10.0.

* guix/git.scm (update-cached-checkout): Define ‘symref-list’.  Pass it
as #:refspecs to ‘remote-fetch’.

Change-Id: Ib7874e2a30f97e51fdfdc2231a3bc5a3b45a177d
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-04-25 20:25:28 +02:00
Romain GARBAGE
f3021149a8
channels: Add symref support.
* guix/channels.scm (channel-reference): Add symref support.

Change-Id: Iea93aa22479ec21900af947c4df79a3ed97b5e62
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Modified-by: Ludovic Courtès <ludo@gnu.org>
2025-04-25 20:25:27 +02:00
Zheng Junjie
1a0f9a3689
packages: Add riscv64-linux to %cuirass-supported-systems.
* guix/packages.scm (%cuirass-supported-systems): Add riscv64-linux.

Change-Id: I81f55613333b8aa2c3f00275cc170dc6c61d303d
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-04-25 20:25:27 +02:00
Ludovic Courtès
182e76d1a9
git: Remove compatibility shim for Guile-Git <= 0.5.2.
Guile-Git 0.5.2 was released in July 2021.

* guix/git.scm (GITERR_HTTP): Remove.

Change-Id: I05b2ee36f786bd83ca91c8989912f83f6dde59c0
2025-04-23 12:25:45 +02:00
Ludovic Courtès
ee6d2a77a3
git: Use ‘graph-descendant?’ from Guile-Git >= 0.10.0 when available.
Fixes <https://issues.guix.gnu.org/66268>.

Fixes a bug whereby ‘commit-relation’ and ‘commit-descendant?’ would
provide an incorrect result when two distinct <commit> objects would
exist for the same commit, which happens when the commit’s metadata is
beyond 4 KiB at least as of libgit2 1.8/1.9.

This, in turn, would lead ‘guix pull’ & co. to wrongfully report an
attempt to downgrade and pull to an unrelated commit.

* guix/git.scm (commit-relation): When (git graph) is available,
rewrite in terms of ‘graph-descendant?’.
(commit-descendant?): Likewise.

Change-Id: Ie52b188a8dfa90c95a73387c3ab2fdd04d2bf3e9
Reported-by: Tomas Volf <~@wolfsden.cz>
2025-04-23 12:25:45 +02:00
Ludovic Courtès
c990405607
syscalls: Add ‘unshare’.
* guix/build/syscalls.scm (unshare): New procedure.

Change-Id: I344273b8bdeaa9366334e6e20ee7efc37eb6c8f7
2025-04-20 18:50:51 +02:00
Ludovic Courtès
efcce99acb
self: Install systemd ‘.service’ files.
This is consistent with the ‘guix’ package and will prove helpful when
people want to replace /etc/systemd/system/guix*.service with newer
versions thereof.

* guix/self.scm (parameterized-file): New procedure, based on…
(selinux-policy): … this. Use ‘parameterized-file’.
(systemd-file): New procedure.
(miscellaneous-files): Add systemd files.

Change-Id: Ia489a955347cf648a86000cc1265769d66c3f0e8
2025-04-20 17:58:11 +02:00
Maxim Cournoyer
b444fc05b5
least-authority: Export default preserved environment variables.
* guix/least-authority.scm (%precious-variables): Rename to...
(%default-preserved-environment-variables): ... this, and export it.
(least-authority-wrapper): Adjust accordingly.

Change-Id: Idd259b15463920965f530e1917d76bf97def3b7b
2025-04-19 21:13:21 +09:00
Yelninei
c9ac6c8715
locate: Request writable db for --clear.
Fixes <https://issues.guix.gnu.org/76141>.

* guix/scripts/locate.scm (guix-locate): Use writable db when --clear is given.

Change-Id: I2e4e945cef022b08dd6af4c252e67c2a4d5bf38c
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-04-16 18:20:44 +02:00
Morgan Smith
0772d36076
import/utils: beautify-description: Validate argument.
* guix/import/utils.scm (beautify-description): Fix broken check for
non-strings.  Add a check for empty strings.
* tests/import-utils.scm: Add two tests.

Change-Id: Idf86df02aeb850fcc8808b7c9251082c1f816656
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-04-15 10:21:33 +02:00
Ludovic Courtès
5b158ddca9
compile: Use ‘-O2 -Ono-letrectify’ for ‘gnu/home/services’.
Partly fixes <https://issues.guix.gnu.org/74748>.

* guix/build/compile.scm (optimization-options): Add ‘gnu/home/services’
alongside ‘gnu/services’.

Reported-by: Tomas Volf <~@wolfsden.cz>
Change-Id: I7140c791e66f062093a32f4baf9199345560de9d
2025-04-15 10:21:01 +02:00
Ludovic Courtès
dfac0a5a95
guix: Avoid ‘fdatasync’ call for caches and regular files.
Fixes <https://issues.guix.gnu.org/77606>.

Calling ‘fdatasync’ for each and every narinfo file created by ‘guix
substitute’ proved to be too expensive on spinning HDDs and/or under
load (from 0.1s to 1.3s for the ‘fdatasync’ call alone).

* guix/git-authenticate.scm (cache-authenticated-commit): Pass #:sync? #f.
* guix/http-client.scm (http-fetch/cached): Likewise.
* guix/scripts/discover.scm (write-publish-file): Likewise.
* guix/scripts/style.scm (format-whole-file): Likewise.
* guix/substitutes.scm (cache-narinfo!): Likewise.

Reported-by: Christopher Baines <mail@cbaines.net>
Change-Id: I82297eae737bc5aae8a3f7604119e9f3d4b625bf
2025-04-14 17:31:50 +02:00
Ludovic Courtès
3271843122
substitutes: Ignore corrupt cached narinfos.
* guix/substitutes.scm (cached-narinfo): Add ‘eof-object?’ clause.

Change-Id: I2d776f64b6521f778b4ab3f956b35cdef2ddb383
2025-04-14 17:31:49 +02:00
Ludovic Courtès
5525315092
utils: Add #:sync? parameter to ‘with-atomic-file-output’.
* guix/utils.scm (with-atomic-file-output): Add #:sync? and honor it.
Add ‘force-output’ call.

Change-Id: I2479778ae55360c0fab3389ac9249045a27b3568
2025-04-14 17:31:49 +02:00
Ludovic Courtès
c44495bb10
cache: Remove unused import.
* guix/cache.scm: Remove unused import.

Change-Id: I06956534aa5342a084ebf71b61518c515ce9288c
2025-04-14 17:31:49 +02:00
Ludovic Courtès
b5e567bb2b
git: Override the user’s ‘core.autocrlf’ settings.
Fixes <https://issues.guix.gnu.org/77214>.

Fixes a bug whereby setting ‘core.autocrlf’ to ‘true’ in ~/.gitconfig
would lead ‘guix pull’ & co. to obtain non-bit-identical files,
including possibly syntactically-invalid Scheme files.

* guix/git.scm (clone*): Set ‘core.autocrlf’ to ‘input’.

Reported-by: Jodi Jodingtonstinski <jodijodingtondev@gmail.com>
Change-Id: I11fb20813a9fc1e14828ca8ebf5092c4b1181e5c
2025-04-14 16:58:44 +02:00
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