Commit Graph

7536 Commits

Author SHA1 Message Date
Ludovic Courtès dc5e9c0130
ui: It’s 2024 now!
* guix/ui.scm (show-version-and-exit): Change year to 2024.

Change-Id: I00fc2754da2b93d8b595a35aacdff087124df706
2024-01-05 17:27:21 +01:00
Efraim Flashner 433b680dd6
gnu: Add target-x32?.
* guix/utils.scm (target-x32?): New procedure.

Change-Id: Ia16c7edce64de01d5ccb126c7bd9a6736f327b5f
Signed-off-by: Efraim Flashner <efraim@flashner.co.il>
2024-01-04 21:48:17 +02:00
Efraim Flashner c69230c81f
gnu: Add support for x86_64-linux-gnux32.
* gnu/packages/bootstrap.scm (glibc-dynamic-linker): Add entry for
x86_64-linux-gnux32.
* gnu/packages/gcc.scm (gcc-configure-flags-for-triplet): Add
configure-flag for x86_64-linux-gnux32.
* guix/platforms/x86.scm (x86_64-linux-gnux32): New variable.
* guix/utils.scm (gnu-triplet->nix-system): Force x86_64-linux-gnux32 to
output a different nix-system than x86_64-linux-gnu.

Change-Id: I519fea2f8357e4b9895ede05fe8a5e373e9b034a
Signed-off-by: Efraim Flashner <efraim@flashner.co.il>
2024-01-04 21:48:13 +02:00
Ricardo Wurmus 513994aead
import/cran: Restore format-inputs.
This fixes a regression introduced in commit
e6223017d9 causing the selected input style to
be ignored.

* guix/import/cran.scm (format-inputs): New procedure.
(maybe-inputs): Use it.

Change-Id: I0d36f972fcb9888ed2be4ec9360bbcab13c25c5d
2024-01-01 14:35:15 +01:00
Ricardo Wurmus 31ccfe9c91
import/cran: Add invalid package.
* guix/import/cran.scm (invalid-packages): Add libR.

Change-Id: I1e06b44785051dfc4fb85ba06062aa8c8e003495
2024-01-01 14:35:13 +01:00
Romain GARBAGE 0a55bf68bb
scripts: download: Fix docstring typo.
* guix/scripts/download.scm (ensure-valid-store-file-name name): Fix
the docstring.

Change-Id: If3fe3a923f514bb69297b566e0642c5e80fe4648
Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
2023-12-27 21:58:16 +01:00
Tobias Geerinckx-Rice 766822aa87
download: Update Apache mirror list.
* guix/download.scm (%mirrors): Remove several vanished hosts and all
FTP URLs.  Use HTTPS where supported.  Add some new HTTPS mirrors.

Change-Id: Ie707e92ae65b8a3287d941e3e6ffb84592417b95
2023-12-17 01:00:00 +01:00
Tobias Geerinckx-Rice 0a7cdaec87
download: Update KDE mirror list.
* guix/download.scm (%mirrors): Update one mirror URL and remove 2 dead
ones.

Change-Id: Ibdc03f0b7df94b73bb5be0fda5a6244b017e747e
2023-12-17 01:00:00 +01:00
Tobias Geerinckx-Rice 970d956128
download: Remove dead SourceForge mirrors.
* guix/download.scm (%mirrors): Remove 2 dead mirror URLs.

Change-Id: I7f0e15ab5499df26fdf0b1702f8bea73c8ec8230
2023-12-17 01:00:00 +01:00
Felix Lechner 7f2583cf55
deprecation: Fix docstring typo.
* guix/deprecation.scm (define-deprecated/public): Fix docstring.

Change-Id: I895b1a86654b2756a9f98e858c622e8e7a6e2c27
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2023-12-22 17:47:15 +01:00
Ludovic Courtès 7578c25b93
least-authority: Add support for changing UIDs/GIDs before exec.
Fixes <https://issues.guix.gnu.org/67175>.

* guix/least-authority.scm (least-authority-wrapper): Add #:user
and #:group.
[code]: Add calls to ‘setgid’ and ‘setuid’ when appropriate.

Change-Id: I2aad8e5686b42b5c92fc306b114c5c60cb8bc551
2023-12-22 00:31:41 +01:00
Ludovic Courtès 11a454f9da
gexp: #:references-graphs accepts and honors <gexp-input> records.
* guix/gexp.scm (lower-reference-graphs)[tuple->gexp-input]: Add
‘gexp-input?’ case.
(gexp->derivation): Update docstring.
* doc/guix.texi (G-Expressions): Adjust accordingly.
* tests/gexp.scm ("references-file, non-default output"): New test.

Reviewed-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Change-Id: I595cb75da0867ab8ab44552887dc06ed1d23315e
2023-12-22 00:31:40 +01:00
Ludovic Courtès d9190abbd2
gexp: Add compiler for <gexp-input>.
* guix/gexp.scm (gexp-input-compiler): New procedure.
* tests/gexp.scm ("gexp references non-existent output")
("gexp-input, as first-class input"): New tests.
* doc/guix.texi (G-Expressions): Document it.

Reviewed-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Change-Id: I95b58d6e4d77a54364026b4324fbb00125a9402e
2023-12-22 00:31:40 +01:00
Ricardo Wurmus ee93015b54
import/cran: Export a few more variables and procedures.
This allows users of this module to provide e.g. caching alternatives to the
download and fetch procedures.

* guix/import/cran.scm (%bioconductor-version, download, fetch-description):
Make these variables public.

Change-Id: I9ce14db9be9b8b3314b06fa9eb50a4e24c5dd718
2023-12-19 14:12:59 +01:00
Ludovic Courtès 6454788a5c
build-system/composer: Do not import host-side Guile-JSON modules.
Importing host-side (json …) modules would make builds dependent on the
Guile-JSON version currently installed by the user.  Use
‘with-extensions’ instead.

* guix/build-system/composer.scm (%composer-build-system-modules):
Remove (json …) modules.
(composer-build)[guile-json]: New variable.
[builder]: Wrap body in ‘with-extensions’.

Change-Id: Ibe565572d60481b31292d73c6fa23d42aa3ceecb
2023-12-18 23:16:57 +01:00
Nicolas Graves 9dab758791
build-system: Add ‘composer-build-system’.
* guix/build-system/composer.scm: New file.
* guix/build/composer-build-system.scm: New file.
* gnu/packages/aux-files/findclass.php: New file.
* Makefile.am: Add them.
* doc/guix.texi (Build Systems): Document it.

Co-authored-by: Julien Lepiller <julien@lepiller.eu>
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Change-Id: Ie6a05b42ff04d3ad774a0a20278a77e4820bb8f6
2023-12-18 23:16:55 +01:00
Nicolas Graves b7e3945283
guix: import: Add composer importer.
* guix/import/composer.scm: New file.
* guix/scripts/import/composer.scm: New file.
* guix/tests/composer.scm: New file.
* Makefile.am: Add them.
* guix/scripts/import.scm: Add composer importer.
* doc/guix.texi (Invoking guix import): Mention it.

Change-Id: I44a89b8cc80ef5b4a3cd15e8fbba4a18c1cea0b1

Co-authored-by: Julien Lepiller <julien@lepiller.eu>
Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2023-12-18 23:16:28 +01:00
Pierre-Henry Fröhring e0e6d659b5
build-system: Add mix-build-system.
* guix/build-system/mix.scm: New file.
* guix/build/mix-build-system.scm: New file.

Change-Id: I8066d00f7ada4a384621bf541e679bc512e93435
Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
2023-12-17 22:22:30 +01:00
Efraim Flashner 6aade039e1
guix: import: Report go version for go importer.
* guix/import/go.scm (go-package, go.mod-go-version): New procedures.
(go-module->guix-package): Add the #:go keyword in the generated package
definition if the required go is newer than the default go.
* tests/go.scm (mock-http-get): Use gexps for package arguments.

Change-Id: I8d005740a442330ac307a40a53764c803ceffc4f
2023-12-16 18:05:58 +02:00
Efraim Flashner e35dd13d8a
guix: import: Don't include indirect dependencies in go.
* guix/import/go.scm (parse-go.mod)[define-peg-patern require]: Adjust
the peg pattern to reject lines with the 'indirect' comment in them.

Change-Id: I9618bbaa1cb8c6549ced875e3c8d32afc72c3b9b
2023-12-16 18:05:58 +02:00
Ludovic Courtès 8662741531
build-system/zig: Do not import (guix build syscalls).
* guix/build-system/zig.scm (%zig-build-system-modules): Remove (guix
build syscalls), which is unused.

Change-Id: Ie91c46c68787e0a8ffa3cbde2c5fd2294b82ed15
2023-12-14 23:12:23 +01:00
MarcoFalke d5ca4d4fd7
syscalls: Define riscv64 syscall ID for clone.
* guix/build/syscalls.scm (clone): Add an entry for riscv64.

This allows the use of --container on riscv64.

Change-Id: I12b3cb5e2aa248266d006b6e456082f4ddc70e62
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2023-12-13 12:58:43 +01:00
Efraim Flashner c9e1a72cc2
Merge branch 'rust-team'
Change-Id: Iee33d7b9067d2180fd4b2e28d81716a251a53a01
2023-12-13 09:28:20 +02:00
Ludovic Courtès 4348947c74
weather: Report unauthorized substitute servers.
The goal is to make it easier to diagnose substitute
misconfiguration (where we’re passing a substitute URL whose
corresponding key is not authorized).

Suggested by Emmanuel Agullo.

* guix/scripts/weather.scm (check-narinfo-authorization): New procedure.
(report-server-coverage): Use it.
* doc/guix.texi (Invoking guix weather): Document it.
(Getting Substitutes from Other Servers): Add “Troubleshooting” frame.

Change-Id: I0a049c39eefb10d6a06634c8b16aa86902769791
2023-12-11 23:19:04 +01:00
Ludovic Courtès 7e11369586
weather: Use the same substitute URLs as guix-daemon.
* guix/scripts/weather.scm (%default-options): Remove ‘substitute-urls’.
(guix-weather): Call ‘substitute-urls’ when OPTS doesn’t have it.  Warn
when ‘substitute-urls’ returns #f.
* doc/guix.texi (Invoking guix weather): Adjust accordingly.

Change-Id: I3e9100074f2ad559e5c408660db70430d64f2bef
2023-12-11 23:19:00 +01:00
Ludovic Courtès f63a8c5ca2
challenge: Use the same substitute URLs as guix-daemon.
* guix/scripts/challenge.scm (%default-options): Remove ‘substitute-urls’.
(guix-challenge): Call ‘substitute-urls’ when OPTS doesn’t have it.  Warn
when ‘substitute-urls’ returns #f.

Change-Id: I49be0e89404c1889970a3430967fbb3498d35d99
2023-12-11 23:18:57 +01:00
Ludovic Courtès 1e47148f46
daemon: Implement ‘substitute-urls’ RPC.
* nix/libstore/worker-protocol.hh (PROTOCOL_VERSION): Bump.
(WorkerOp): Add ‘wopSubstituteURLs’.
* nix/nix-daemon/nix-daemon.cc (performOp): Implement it.
* guix/store.scm (%protocol-version): Bump.
(operation-id): Add ‘substitute-urls’.
(substitute-urls): New procedure.
* tests/store.scm ("substitute-urls, default")
("substitute-urls, client-specified URLs")
("substitute-urls, disabled"): New tests.

Change-Id: I2c0119500c3a1eecfa5ebf32463ffb0f173161de
2023-12-11 23:18:53 +01:00
Efraim Flashner 34eaf5714e
Merge remote-tracking branch 'origin/master' into rust-team
Change-Id: Ic45f7071abd6a02c2ccad411500e5103c8272ffb
2023-12-10 13:25:47 +02:00
Efraim Flashner 55faf486c7
build: cargo: Use correct config file for cargo config.
* guix/build/cargo-build-system.scm (configure): Use .cargo/config as
the config file.  Add a note.

Change-Id: Ice006c11184d4c8e1bdb765c3998b06ad299e55b
2023-11-28 12:58:36 +02:00
Efraim Flashner e604972d9c
build/cargo-build-system: Enable cross-compiling.
* guix/build-system/cargo.scm (default-rust): Accept an argument.
(default-rust-sysroot, cargo-cross-build): New procedures.
(lower): Accept a rust-sysroot.
[private-kewords]: Add rust-sysroot.  Remove target if cross-compiling.
[bag]: Allow cross-compiling.  In host-inputs only have inputs when
cross-compiling, move crate sources to here, remove standard-packages.
In build-inputs add the inputs when not cross-compiling, add the
standard-cross-packages when cross-compiling, add the standard-packages
to here.  Add target-inputs with the standard-cross-packages and
rust-sysroot when cross-compiling.
* guix/build/cargo-build-system.scm (configure): Accept target argument.
When cross-compiling set some environment variables.  Adjust the
.config/cargo.toml to have configure options for cross-compiling.

Change-Id: I388d1e1f48943e45ff01f55af8efc0746f383b4a
2023-11-28 07:59:43 +02:00
Efraim Flashner 63ccceb976
build: cargo-build-system: Pack crates reproducibly.
This fixes reproducibility in rust crates from the package phase, again,
see <https://issues.guix.gnu.org/50015>.

Reported by: Christopher Baines (in person).

* guix/build/cargo-build-system.scm (package): When repacking the crate
tarball use standard reproducibility flags.

Change-Id: Ifb1440a023226bf0718e99ce9f95ef981e510cbc
2023-11-28 07:59:07 +02:00
Ludovic Courtès d98a0203b7
shell: ‘--development’ honors ‘--system’.
Fixes a bug whereby ‘package->development-manifest’ would run with the
wrong system in mind, leading to errors like this:

  $ guix shell -s i586-gnu -D shepherd --no-grafts
  guix shell: error: package linux-libre-headers@5.15.49 does not support i586-gnu

* guix/scripts/environment.scm (options/resolve-packages): Define
‘system’ and pass it to ‘package->development-manifest’.’
* tests/guix-shell.sh: Test it.

Change-Id: I95c471c1918913ab80dec7d3ca64fe38583cce78
2023-12-06 23:50:04 +01:00
Ludovic Courtès 3178b1a442
monad-repl: Add REPL commands to inspect package arguments.
* guix/monad-repl.scm (keyword-argument-value, package-argument-command):
New procedures.
(phases, configure-flags, make-flags): New REPL commands.
* doc/guix.texi (package Reference): Link to “Using Guix Interactively”.
(Defining Package Variants): Add “Tips” quotation.
(Build Phases): Add “Tip” quotation.
(Using Guix Interactively): Document the new REPL commands.

Change-Id: I7049c1d8aa9241e07d7c921aa396e578a1b4ef16
2023-12-04 22:26:38 +01:00
Ludovic Courtès 06b9c1260c
substitute: Do not exit when failing to find a nar.
Fixes <https://issues.guix.gnu.org/67575>.

* guix/scripts/substitute.scm (process-substitution/fallback): Use
‘report-error’ instead of ‘leave’.  Write status line to PORT.
* tests/substitute.scm ("substitute, narinfo is available but nar is
missing"): Adjust accordingly.

Change-Id: Ic7297dbd563c007111ec2167c8d52505a07d4822
2023-12-04 22:26:36 +01:00
Efraim Flashner 1d2d6aaeaf
Revert "build/go: Don't use set!"
This causes too many rebuilds.

This reverts commit 0a4b6fd51a.
2023-12-04 13:19:53 +02:00
Efraim Flashner 0a4b6fd51a
build/go: Don't use set!
This causes build failures on powerpc-linux.

* guix/build/go-build-system.scm (unpack): When the unpack-path is unset
use the import-path but don't redefine the unpack-path.

Change-Id: I2b5a36eb738abb14307941d388038139dbaf2bdf
2023-12-04 11:52:22 +02:00
Ludovic Courtès 2447c1b608
packages: Honor target system for the inputs to ‘patch-and-repack’.
* guix/packages.scm (%standard-patch-inputs): Add ‘system’ parameter.
Parameterize ‘%current-system’.
(patch-and-repack): Pass SYSTEM to ‘%standard-patch-inputs’.

Change-Id: Ic8ad93303332fd1eefba0a93a314f99db782eda6
2023-12-03 23:55:08 +01:00
Ludovic Courtès 3dda74a546
grafts: Use the right locale package.
This is a followup to b0715d7cd2, fixing
builds of grafts on i586-gnu.

* guix/grafts.scm (graft-derivation/shallow)[glibc-locales]: Choose
symbol as a function of ‘target-hurd?’.

Change-Id: I05e50c0ed74a64986a0cea9c6302d1b5592b898d
2023-12-03 23:55:08 +01:00
Saku Laesvuori ab8612d99e
guix: import: Fix parsing Cabal files that import many stanzas
* guix/import/cabal.scm (eval-cabal)[eval]: Split imports to a
normalized list before mapping over it.
* tests/hackage.scm: Test it.

Change-Id: I39ece019251b6a23a937c8562d2d4a545a6bc7df
Signed-off-by: Lars-Dominik Braun <lars@6xq.net>
2023-12-03 16:15:29 +01:00
Saku Laesvuori 5bd00bb542
guix: import: Parse cabal layout blocks correctly
Cabal consideres lines to be part of a layout block if they are indented
at least one space more than the field line the block belongs to.
Previously Guix considered lines to be a part of the block if they were
indented at least as much as the first line in it.

This also makes a workaround that enabled if statements to have multiple
elses redundant and removes it.

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

* guix/import/cabal.scm (current-indentation*): Renamed from
current-indentation.
(previous-indentation, current-indentation): New variables.
(make-cabal-parser): Remove outdated comment.
[open]: Use previous-indentation + 1 instead of
current-indentation.
[elif-else]: Split to elif and else to allow only one ELSE in an if
statement.
(read-cabal)[parameterize]: Use current-indentation* and previous-indentation.
* tests/hackage.scm (hackage->guix-package test mixed layout): Expect to
  pass.

Change-Id: I3a1495b1588a022fabbfe8dad9f3231e578af4f3
Signed-off-by: Lars-Dominik Braun <lars@6xq.net>
2023-12-03 09:11:29 +01:00
Saku Laesvuori acef524961
guix: import: stackage: Fix crash on recursive import
* guix/import/stackage.scm (lts-package-version): Call
  stackage-package-version only when the package is found.

Change-Id: Ic8d7c1b7a42a9c1a6cbba567e148706507a53ee3
Signed-off-by: Lars-Dominik Braun <lars@6xq.net>
2023-12-03 09:11:29 +01:00
Saku Laesvuori 160385c013
guix: import: hackage: Fix crash on recursive import
Fixes: https://issues.guix.gnu.org/64734

* guix/import/hackage.scm (hackage-module->sexp): Return package names
  instead of <upstream-input> records.

Change-Id: Id428a8b903b4b59d44205ca366324a0a69a4e05b
Signed-off-by: Lars-Dominik Braun <lars@6xq.net>
2023-12-03 09:11:29 +01:00
Ekaitz Zarraga 2cc6e09a03
transformations: Add support for zig.
* guix/transformations.scm (tuning-compiler): Add support for zig.

Change-Id: I40bd28071c97c0dd0a907c704072b52b26d2de28
Signed-off-by: Efraim Flashner <efraim@flashner.co.il>
2023-12-03 09:58:34 +02:00
Janneke Nieuwenhuizen b0715d7cd2
gnu: Use ‘libc-utf8-locales-for-target’.
* guix/packages.scm (%standard-patch-inputs): Use
‘libc-utf8-locales-for-target’ instead of ‘glibc-utf8-locales’.
* guix/self.scm (%packages): Likewise.
* gnu/home/services/ssh.scm (file-join): Likewise
* gnu/installer.scm (build-compiled-file): Likewise.
* gnu/packages/chromium.scm (ungoogled-chromium/wayland): Likewise.
* gnu/packages/gnome.scm (libgweather4, tracker): Likewise.
* gnu/packages/javascript.scm (js-mathjax): Likewise.
* gnu/packages/package-management.scm (guix, flatpak): Likewise.
* gnu/packages/raspberry-pi.scm (raspi-arm64-chainloader): Likewise.
* gnu/packages/suckless.scm (svkbd): Likewise.
* gnu/services.scm (cleanup-gexp): Likewise.
* gnu/services/base.scm (guix-publish-shepherd-service): Likewise.
* gnu/services/guix.scm (guix-build-coordinator-shepherd-services)
(guix-build-coordinator-agent-shepherd-services): Likewise.
* gnu/services/guix.scm (guix-build-coordinator-queue-builds-shepherd-services):
(guix-data-service-shepherd-services)
(nar-herder-shepherd-services)
(bffe-shepherd-services): Likewise.
* gnu/services/web.scm (anonip-shepherd-service)
(mumi-shepherd-services): Likewise.
* gnu/system/image.scm (system-disk-image, system-iso9660-image)
(system-docker-image, system-tarball-image): Likewise.
* gnu/system/install.scm (%installation-services): Likewise.
* guix/profiles.scm (info-dir-file): Likewise.
(ca-certificate-bundle, profile-derivation): Likewise.
* guix/scripts/pack.scm (store-database, set-utf8-locale): Likewise.
* tests/pack.scm: Likewise.
* tests/profiles.scm ("profile-derivation, cross-compilation"):
Likewise.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
Co-authored-by: Christopher Baines <mail@cbaines.net>
Change-Id: I24239f427bcc930c29d2ba5d00dc615960a6c374
2023-12-02 12:25:45 +01:00
Maciej Kalandyk ce74e02078
locate: Gracefully handle busy-database error conditions.
* guix/scripts/locate.scm (SQLITE_BUSY): New variable.
(call-with-database): Catch 'sqlite-error and call ‘leave’ upon
SQLITE_BUSY.

Change-Id: Iebe76c75d45e70317bd18d2c176dcdeaf9d6964c
Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2023-11-26 23:34:48 +01:00
Efraim Flashner 25b9d6c149
build-system/vim: Add missing keywords.
* guix/build-system/vim.scm (vim-build): Add missing build-system flags.

Change-Id: Ie0094bb0579987e8432750f883eb56bae8ccd845
2023-11-26 09:51:29 +02:00
Skyler Ferris 13bc0633e7
build-system/meson: Add #:substitutable? argument to build system.
This implemented the same as in gnu-build-system. The gexp->derivation
calls did not need to be modified because they already
passed #:substitutable?, which did not cause an error due to the
procedure exported by the (guix store) module with the same name.

* guix/build-system/meson.scm (meson-build, meson-cross-build): Add
  #:substitutable? argument

Change-Id: I2d56c8130f785a2d6af456ef9f9bfc1b10dc2a50
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2023-11-25 16:29:26 +01:00
Skyler Ferris c43077076f
build-system/guile: Add #:substitutable? argument to build system.
This is implemented the same as in gnu-build-system.

* guix/build-system/guile.scm (guile-build, guile-cross-build): Add
  #:substitutable? argument

Change-Id: I04babb81ff1f322833f7ff22cd7580c048b26102
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2023-11-25 16:29:26 +01:00
Ludovic Courtès 9b48cf8cdd
tests: Import (guix build syscalls) when (guix build store-copy) is used.
Fixes a test failure introduced in
189525412e.

* guix/progress.scm: Autoload (guix build syscalls).
* tests/gexp.scm ("gexp->derivation, store copy"): Add (guix build
syscalls) to the list of imported modules.  Use ‘with-imported-modules’
rather than #:modules.

Change-Id: I8d3fe90f564ef4b1a340f34cee6c08a741f7b836
2023-11-25 16:29:25 +01:00
Ludovic Courtès a14dafaa01
syscalls: Add fallback case for ‘terminal-string-width’.
This makes ‘terminal-string-width’ synonymous with ‘string-length’ when
running one a statically-linked Guile, as is the case in some unit
tests, instead of throwing ENOSYS.

* guix/build/syscalls.scm (terminal-string-width): Use ‘dynamic-func’
and ‘pointer->procedure’ instead of ‘syscall->procedure’.  Return
‘string-length’ when one of the ‘dynamic-func’ calls fails.

Change-Id: Icf55c9e7c34b46fac91b665fb4a2ecb02160f22e
2023-11-25 16:29:25 +01:00
Ludovic Courtès 5283d24062
shell: Disable caching for ‘guix shell -f guix.scm’.
Fixes <https://issues.guix.gnu.org/64858>.

* guix/scripts/shell.scm (profile-cached-gc-root): Distinguish the two
‘load’ cases; return #f and #f for (load ad-hoc-package _).

Reported-by: Pierre-Henry Fröhring <phfrohring@deeplinks.com>.
Change-Id: I00282fbd41aeed09fb927690945cf65e1f9efe4d
2023-11-22 23:55:12 +01:00
Felix Lechner 762be40098
shell: Correct cache key for ‘guix shell -f guix.scm’.
Partially fixes <https://issues.guix.gnu.org/64858>.

Fixes a bug whereby ‘guix shell -f guix.scm’ would use the same cache
key as ‘guix shell’ in an empty directory (meaning: no packages
specified) and would ignore the mtime of ‘guix.scm’.

* guix/scripts/shell.scm (profile-cached-gc-root): In ‘load’ case,
recognize both the ‘package’ and ‘ad-hoc-package’ tags.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
Change-Id: Ice6d0ac43e1dc6bb335a17963364c2cc6bcd076d
2023-11-22 23:55:12 +01:00
Ludovic Courtès b150c546b0
git: Shell out to ‘git gc’ when necessary.
Fixes <https://issues.guix.gnu.org/65720>.

This fixes a bug whereby libgit2-managed checkouts would keep growing as
we fetch.

* guix/git.scm (packs-in-git-repository, maybe-run-git-gc): New
procedures.
(update-cached-checkout): Use it.
2023-11-22 16:51:47 +01:00
Ludovic Courtès 2c5fb13a05
read-print: Properly indent ‘parameterize’.
Fixes <https://issues.guix.gnu.org/65427>.

* guix/read-print.scm (%special-forms): Add ‘parameterize’.
* tests/read-print.scm: Add test.

Reported-by: Maxime Devos <maximedevos@telenet.be>
Change-Id: I922bffc527ade539cf2eb304acb25bc9c705a459
2023-11-22 16:51:46 +01:00
Ludovic Courtès c39c89c11e
style: ‘guix style -f’ warns when passed zero arguments.
* guix/scripts/style.scm (guix-style): When OPTS has ‘whole-file?’ set,
warn when FILES is empty.

Change-Id: I494f52ef5d070510d20006e6dd987a6805161bb4
2023-11-22 16:51:45 +01:00
Christopher Baines 98ae807643
build-system: clojure: Use the standard error regarding cross builds.
Rather than raising an error in the build system.

* guix/build-system/clojure.scm (lower): Return #f for cross builds, rather
than calling error.

Change-Id: Id97c8f5140f55fe2c52ccb0db36fd993922c6a7e
2023-11-20 14:53:59 +00:00
Tomas Volf 3493832260
build-system/guile: Add target-guile-scm+go procedure.
The paths to .scm and .go files can be constructed given a guile version and a
base directory.  However it is few lines of code that needs to be copy&pasted.
This new procedure returns both of them reducing the maintenance cost.

* guix/build/guile-build-system.scm (target-guile-scm+go): New procedure.

Change-Id: I58615f2cfe0ec1e58d3fbb47b738ed5dce1bb252
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2023-11-15 18:29:37 +01:00
Ludovic Courtès 69d9a02094
locate: Accept ‘--clear’ without additional arguments.
Fixes a bug whereby ‘guix locate --clear’ would end with the “no files
to search for” error.

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

* guix/scripts/locate.scm (guix-locate): Do not emit “no files to search
for” error when 'clear? is set in OPTS.
* tests/guix-locate.sh: Test it.

Reported-by: Maciej Kalandyk <m.kalandyk@outlook.com>
Change-Id: Ib8fa125c18481d7f5408bd89df9503713527641d
2023-11-15 18:29:37 +01:00
Efraim Flashner 911c3deb40
guix: platform: Add platform-rust-target.
* guix/platform.scm <platform>: Add rust-target field.
* guix/platforms/arm.scm (armv7-linux, aarch64-linux): Add the system's
rust target triplet.
* guix/platforms/mips.scm (mips64-linux):
* guix/platforms/powerpc.scm (powerpc-linux, powerpc64-linux,
powerpc64le-linux):
* guix/platforms/riscv.scm (riscv64-linux):
* guix/platforms/x86.scm (i686-linux, x86_64-linux, i686-mingw,
x86_64-mingw, i586-pc): Same.

Change-Id: Id9dca0fb8ec2b3bf2b3876b974e4bbaa30dbc6a6
2023-12-11 13:50:48 +02:00
Jean-Pierre De Jesus DIAZ 06587003b8
guix: meson-build-system: Disable PIC for AVR.
* guix/build-system/meson.scm (make-built-in-options-alist): New procedure.
(make-cross-file): Add 'built-in options' section to cross file.

Change-Id: Ifff7f6fb1eb8b0e8ddd04881d22acb863c9e85b2
Signed-off-by: Efraim Flashner <efraim@flashner.co.il>
2023-12-11 13:37:20 +02:00
Jean-Pierre De Jesus DIAZ 119edc3c9b
guix: meson-build-system: Support AVR.
* guix/build-system/meson.scm (make-machine-alist): Add cases for avr
for system, cpu_family and cpu.

Change-Id: Ie47d666099c4c48edd36812f035625dccc4a3900
Signed-off-by: Efraim Flashner <efraim@flashner.co.il>
2023-12-11 13:36:52 +02:00
Jean-Pierre De Jesus DIAZ 520e3d267e
guix: Add target-avr?.
* guix/utils.scm (target-avr?): New procedure.
* tests/utils.scm: Add tests for target-avr? procedure.

Change-Id: Iaa0fa97a2b6bc45d45f907f43157f1548a0ba3fa
Signed-off-by: Efraim Flashner <efraim@flashner.co.il>
2023-12-11 11:53:54 +02:00
Jean-Pierre De Jesus DIAZ be5ec2ebb4
guix: Add avr platform.
* Makefile.am (MODULES): Add avr platform module.
* doc/guix.texi: Add documentation for avr platform.
* guix/platforms/avr.scm (avr): New variable.

Change-Id: I0f425eac61a71390b618e093f5a034ad4205a6f4
Signed-off-by: Efraim Flashner <efraim@flashner.co.il>
2023-12-11 11:53:54 +02:00
Jean-Pierre De Jesus DIAZ b40a44430f
guix: gnu-build-system: Handle missing libc.
* guix/build-system/gnu.scm (standard-cross-packages): Handle the case
  when `cross-libc` returns #f.

Change-Id: I85ee5456f10ff141d521a5f2d91267cd612c5616
Signed-off-by: Efraim Flashner <efraim@flashner.co.il>
2023-12-11 11:53:54 +02:00
Julien Lepiller 28ca80717d
guix: Properly compute progress bar width.
* guix/progress.scm (progress-reporter/bar): Take font width into account to
compute progress bar width.
* guix/git.scm (show-progress): Take font width into account to compute
progress bar width.

Change-Id: I946e447c1ea7c6eb4ff805400280f39e8f1a7c02
2023-11-11 11:07:47 +01:00
Julien Lepiller fd11d7fbf8
guix: syscalls: Add terminal-string-width.
* guix/build/syscalls.scm (terminal-width): New procedure.
* tests/syscalls.scm: Add tests.

Change-Id: I6c2caa9fbaffb1e8f4b8933103399be970d5a8f3
2023-11-11 11:07:27 +01:00
Tristan Cottam 9ce47b6fdd
build: minetest-build-system: Match name more strictly.
Some Minetest mods, such as the hitherto unpackaged minetest-ambience,
have trailing garbage space (e.g. carriage returns) in their name line,
that would otherwise end up as part of the mod's directory name.

* guix/build/minetest-build-system.scm (name-regexp): Only match
graphical characters in the name sub-match.

Change-Id: I95f4c201724991a10efba5c859bfef99779ea495
Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
2023-11-11 06:48:59 +01:00
Julien Lepiller 00ec39a4e4
guix: ant: Optionally build with java modules.
Modules were introduced in Java 9 and are not supported by the default
icedtea compiler, so this feature is disabled by default.

* guix/build-system/ant.scm (ant-build): Add use-java-modules?
parameter.
* guix/build/ant-build-system.scm (default-build.xml)
(configure): Use it.

Change-Id: I3b99238e4cd262332fa5c818be1af5477c7374fd
2023-11-09 19:08:42 +01:00
Jonathan Scoresby 8882ec71dd
build-system: Add vim-build-system.
* guix/build-system/vim.scm,
* guix/build/vim-build-system.scm: New modules.
* Makefile.am (MODULES): Register new files.
* doc/guix.texi: Document it.

Co-authored-by: Efraim Flashner <efraim@flashner.co.il>
Signed-off-by: Efraim Flashner <efraim@flashner.co.il>
2023-11-08 12:03:05 +02:00
Maxim Cournoyer a4db19d8e0
git-download: Add support for Git Large File Storage (LFS).
* guix/build/git.scm (git-fetch) [lfs?]: New argument, doc and setup code.
(git-fetch-with-fallback) [lfs?]: New argument.  Pass it to git-fetch.
* guix/git-download.scm (git-lfs-package): New procedure.
(git-fetch/in-band*): New procedure, made of the logic of git-fetch/in-band,
with new git-lfs specifics, with the following changes:
New #:git-lfs argument.
<inputs>: Remove labels.  Conditionally add git-lfs.
<build>: Read "git lfs?" environment
variable and pass its value to the #:lfs? argument of git-fetch-with-fallback.
Use INPUTS directly; update comment.
<gexp->derivation>: Add "git lfs?" to #:env-vars.
(git-fetch/in-band): Express in terms of git-fetch/in-band*.
(git-fetch/lfs): New procedure.
* doc/guix.texi (origin Reference): Document it.

Change-Id: I5b233b8642a7bdb8737b9d9b740e7254a89ccb25
Reviewed-by: Ludovic Courtès <ludo@gnu.org>
2023-11-07 12:33:26 -05:00
Leo Famulari cfe09c7c36
download: Replace faulty kernel mirror URL with canonical upstream.
This mirror was providing truncated files. See patch ticket #66923 for more
information about this change:

<https://issues.guix.gnu.org/issue/66923>

* guix/download.scm (%mirrors): Replace kernel mirror <uio.no> with <kernel.org>.

Change-Id: I189fc4eaa2bb3fa8b6db028aa837f0d59a460327
2023-07-23 22:26:00 -04:00
Ludovic Courtès 331d858e21
time-machine: Warn when no command is given.
* guix/scripts/time-machine.scm (guix-time-machine): Emit a warning when
COMMAND-LINE is false.

Change-Id: I26e6b608915ecaf6d9372f9b03dc5ebd1b4c68f9
2023-11-05 23:23:23 +01:00
Ludovic Courtès ab13e2be69
time-machine: Make target commit check cheaper.
Commit 79ec651a28 introduced a check to
error out when attempting to use ‘time-machine’ to travel to a commit
before ‘v1.0.0’.

This commit fixes a performance issue with the strategy used in
79ec651a28 (the repository was opened,
updated, and traversed a second time by ‘validate-guix-channel’) as well
as a user interface issue (“Updating channel” messages would be printed
too late).

This patch reimplements the check in terms of the existing #:validate-pull
mechanism, which is designed to avoid extra repository operations.

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

* guix/inferior.scm (cached-channel-instance): Change default value
of #:validate-channels.  Remove call to VALIDATE-CHANNELS; pass it
as #:validate-pull to ‘latest-channel-instances’.
* guix/scripts/time-machine.scm (%reference-channels): New variable.
(validate-guix-channel): New procedure, written as a simplification of…
(guix-time-machine)[validate-guix-channel]: … this.  Remove.
Pass #:reference-channels to ‘cached-channel-instance’.

Reported-by: Simon Tournier <zimon.toutoune@gmail.com>
Change-Id: I9b0ec61fba7354fe08b04a91f4bd32b72a35460c
2023-11-05 23:23:23 +01:00
Christopher Baines aa98a97607
lint: Speed up the formatting linter.
By using go-to-location which caches the number of bytes to seek by to get to
specific lines in a file.

* guix/lint.scm (report-formatting-issues): Use go-to-location.

Change-Id: I34e4d3acfbb1e14e026d2e7f712ba8d22b56c147
Signed-off-by: Christopher Baines <mail@cbaines.net>
2023-11-05 17:51:38 +00:00
Simon Tournier 1eb3133355
scripts: edit: Fix relative file-name with 'load-path' option.
* guix/scripts/edit.scm (search-path*): Return 'file' if exists when
'search-path' fails.

Change-Id: I891d63d0d28577a7d1732fc59435828ecc0a5c5a
2023-11-05 16:11:17 +01:00
Ricardo Wurmus 7a14f9365a
guix: Upgrade to Bioconductor 3.18.
* guix/build-system/r.scm (bioconductor-uri): Bump Bioconductor version to
3.18.
* guix/import/cran.scm (%bioconductor-version): Same.

Change-Id: Ic3fc2e6ab6b5f6f6e55662f81baee67391158c5b
2023-11-03 22:49:10 +01:00
Efraim Flashner 84fbfa82af
build-system/go: Use gccgo when go isn't supported.
* guix/build-system/go.scm (default-gccgo): New variable.
(lower): Only use default-go when it is supported.

Change-Id: I30564d97703344df582accaf741f4fcd159b6be1
2023-10-28 22:02:32 +03:00
Ludovic Courtès 6eb147dc31
environment: Fix typo in error messages.
* guix/scripts/environment.scm (guix-environment*): Fix typo in error
messages.

Change-Id: I0b8669cb43267d0456a70f3b157514a6bcc725e8
2023-10-28 01:23:41 +02:00
Ludovic Courtès 661672a7f8
environment: Parameterize ‘%graft?’ early on.
Previously, ‘%graft?’ would be parameterized after ‘package-derivation’
had been called for ‘%guile-for-build’, which is too late.

* guix/scripts/environment.scm (guix-environment*)[with-store/maybe]:
Parameterize ‘%graft?’.
Remove ‘%graft?’ parameterization from body.

Change-Id: I65ef4a8c5f27e19a49196005871e5f7057fabaec
2023-10-28 01:21:56 +02:00
Ludovic Courtès 344e39c928
profiles: Hooks honor the #:system parameter of ‘profile-derivation’.
Fixes <https://issues.guix.gnu.org/65225>.

* guix/profiles.scm (info-dir-file, package-cache-file)
(info-dir-file, ghc-package-cache-file, ca-certificate-bundle)
(emacs-subdirs, gdk-pixbuf-loaders-cache-file, glib-schemas)
(gtk-icon-themes, gtk-im-modules, linux-module-database)
(xdg-desktop-database, xdg-mime-database, fonts-dir-file)
(manual-database, manual-database/optional): Add optional #:system
parameter and pass it to ‘gexp->derivation’.
(profile-derivation): Pass HOOK a second parameter, SYSTEM.
* gnu/bootloader.scm (efi-bootloader-profile)[efi-bootloader-profile-hook]:
Add optional #:system parameter and pass it to ‘gexp->derivation’.
* guix/channels.scm (package-cache-file): Likewise.
* tests/profiles.scm ("profile-derivation, #:system, and hooks"): New
test.

Reported-by: Tobias Geerinckx-Rice <me@tobias.gr>
2023-10-28 00:17:24 +02:00
Ludovic Courtès 9d4b720e1f
packages: Add ‘system’ parameter for ‘set-guile-for-build’.
* guix/packages.scm (set-guile-for-build): Add ‘system’ parameter.
2023-10-28 00:17:24 +02:00
Ludovic Courtès b3ec2a0d37
environment: Honor ‘-s’ for guile-for-build.
Partly fixes <https://issues.guix.gnu.org/65225>.

* guix/scripts/environment.scm (guix-environment*): Pass SYSTEM to
‘package-derivation’ when defining ‘%guile-for-build’.

Reported-by: Simon Tournier <zimon.toutoune@gmail.com>
Change-Id: I9d883f1e61fac72754fdc9dee9b7c8a3dea32add
2023-10-28 00:17:24 +02:00
Ludovic Courtès 67effc1560
grafts: Fix corner case involving multiple-output derivations.
Fixes a bug that would occur with references to two outputs of the same
derivation, with one of them referring to the other one.

For example, the references of libreoffice include both mariadb:dev and
mariadb:lib; additionally, mariadb:dev refers to mariadb:lib.  In this
case, the glibc graft would not be applied on one of the mariadb paths,
and both the grafted and ungrafted glibc would end up in the closure of
libreoffice.

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

* guix/grafts.scm (non-self-references): Simplify and include references
to outputs of DRV other than OUTPUTS.
(reference-origins): Simplify and possibly return outputs of DRV itself.
(cumulative-grafts)[graft-origin?]: Add OUTPUT parameter and honor it.
[dependency-grafts]: Adjust accordingly.
* tests/grafts.scm ("graft-derivation, multiple outputs need to be replaced"):
New test.

Change-Id: Iac2005024ab7049037537b3af55298696ec90e3c
2023-10-28 00:17:23 +02:00
Zheng Junjie dd3b9e84b9
utils: Add 'strip-for-target'.
* guix/utils.scm (strip-for-target): New procedure.

Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
2023-10-26 15:21:35 +02:00
Sören Tempel dae956e796
syscalls: Consistently use existing linux? definition.
Instead of duplicating this existing logic across the source file. This
will make it easier to add additional linux targets (e.g. linux-musl) in
the future.

* guix/build/syscalls.scm (readdir*, write-socket-address!)
(read-socket-address): Use linux? constant.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Change-Id: I833c1d1630dcb8319584de1ea918cb22696f0058
2023-10-23 11:58:16 +02:00
Sören Tempel 54e6788267
syscalls: Add support for musl libc.
This commit allows using Guix on a foreign distro which uses musl libc,
for example, Alpine Linux. Usage of musl libc is detected via a new
musl-libc? variable using the Guile %host-type.

Using the new musl-libc? variable, we can now implement musl-specific
quirks. The two compatibility problems I encountered in this regard are
that musl dose not export a readdir64 and statfs64 symbol. On musl,
these two functions are implemented as CPP macros that expand to
readdir/statfs. To workaround that, a case-distinction was added.

The existing linux? variable has been modified to return true if the
%host-system contains "linux-" in order to ensure it is true for both
linux-gnu as well as linux-musl host systems.

The patch has been tested on Alpine Linux and is already used for the
downstream Guix package shipped in Alpine Linux's package repository.

* guix/build/syscalls.scm (musl-libc?): New variable.
(linux?): Truth value on any linux system.
(statfs, readdir-procedure): Support musl libc.

Signed-off-by: Sören Tempel <soeren@soeren-tempel.net>
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Change-Id: Icc4101a062381240f977f4550344bde696513c52
2023-10-23 11:56:54 +02:00
Ludovic Courtès 48c1a74b24
build-system/dub: Remove dependency on (guix build syscalls).
The (guix build syscalls) module was unused.

* guix/build-system/dub.scm (%dub-build-system-modules): Remove (guix
build syscalls).
2023-10-23 11:56:54 +02:00
Ludovic Courtès 4b5e31dc5e
build-system/android-ndk: Remove dependency on (guix build syscalls).
The (guix build syscalls) module was unused.

* guix/build-system/android-ndk.scm (%android-ndk-build-system-modules):
Remove (guix build syscalls).
2023-10-23 11:56:54 +02:00
Ludovic Courtès 542c906f16
build-system/ant: Remove dependency on (guix build syscalls).
The module has been unused since
a6343af221.

* guix/build-system/ant.scm (%ant-build-system-modules): Remove (guix
build syscalls).
2023-10-23 11:56:54 +02:00
Efraim Flashner 742554f9b9
guix: import: Don't import yanked rust crates.
* guix/import/crate.scm (<crate-version>): Add yanked? field.
(crate->guix-package)[find-crate-version]: Remove versions which have
been yanked.
* tests/crate.scm: Adjust tests for new yanked? field.
2023-10-22 16:46:39 +03:00
Efraim Flashner e6af40d7b4
Merge remote-tracking branch 'origin/rust-team' 2023-10-21 20:34:46 +03:00
Ekaitz Zarraga e011961f99
build-system: Add zig-build-system.
* guix/build-system/zig.scm: New file.
* guix/build/zig-build-system.scm: New file.
* Makefile.am: Add them.
* doc/guix.texi: Document it.
* etc/snippets/yas/scheme-mode/guix-package (build-system): Add
  zig-build-system.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2023-10-21 00:27:25 +02:00
Efraim Flashner 003dc790fd
Revert "build: cargo-build-system: Disable tests by default."
This reverts commit 37667443074a6de29f7665868f102111d62f0af9.

This change needs more discussion.
2023-10-18 11:36:31 +03:00
Efraim Flashner 0058ed81b0
build: cargo-build-system: Find more pregenerated files.
* guix/build/cargo-build-system.scm (check-for-pregenerated-files): Also
search for MacOS dynamic libraries.
2023-10-18 11:36:21 +03:00
Efraim Flashner d631d901d8
build: cargo-build-system: Disable tests by default.
* guix/build-system/cargo.scm (cargo-build): Disable tests by default.
* gnu/packages/admin.scm (greetd, wlgreet, du-dust),
* gnu/packages/bioinformatics.scm (circtools, python-gseapy),
* gnu/packages/crypto.scm (rust-minisign, b3sum),
* gnu/packages/gnome.scm (librsvg),
* gnu/packages/python-crypto.scm (python-blake3,
python-cryptography-rust),
* gnu/packages/python-xyz.scm (python-orjson),
* gnu/packages/rust-apps.scm (agate, alfis, bat, diffr, drill, dutree,
exa, fd, hexyl, hyperfine, i3status-rust, just, maturin, ripgrep, rot8,
rust-swc, rust-cargo-edit, git-interactive-rebase-tool, rust-cbindgen,
rust-cbindgen-0.24, rust-cbindgen-0.19, sniffglue, tectonic, treefmt,
hex, tokei, vivid, watchexec, rbw, rust-analyzer, rust-cargo-c, rtss,
skim, skim-0.7, svd2rust, swayhide, tealdeer, git-absorb, zoxide, htmlq),
* gnu/packages/sequoia.scm (sequoia-sqv),
* gnu/packages/syndication.scm (newsboat),
* gnu/packages/terminals.scm (alacritty),
* gnu/packages/text-editors.scm (kak-lsp, parinfer-rust),
* gnu/packages/tree-sitter.scm (tree-sitter-cli),
* gnu/packages/video.scm (rav1e),
* gnu/packages/web.scm (monolith, castor)
[arguments]: Enable tests.
2023-10-18 11:36:18 +03:00
Efraim Flashner 163592c843
build: cargo-build-system: Strip enough prefix in package.
* guix/build/cargo-build-system.scm (package): When using the source as
the packaged crate also strip the 'rust-' prefix.
2023-10-18 11:36:16 +03:00
Efraim Flashner fafbad0ce2
build: cargo-build-system: Reset timestamps in crates.
This fixes reproducibility in rust crates from the package phase,
see <https://issues.guix.gnu.org/50015>.

* guix/build/cargo-build-system.scm (package): After running 'cargo
package' on the source unpack the tarball, reset the timestamps and
repack it.
2023-10-18 11:36:16 +03:00
Efraim Flashner c2ac2e3f38
build: cargo-build-system: Check for pregenerated files.
* guix/build/cargo-build-system.scm (check-for-pregenerated-files): New
procedure.
(%standard-phases): Add 'check-for-pregenerated-files phase between
'unpack and 'unpack-rust-crates.
2023-10-18 11:35:40 +03:00
Josselin Poiret dcc5c34504
guix: import: opam: Handle list of licenses.
Fixes <https://issues.guix.gnu.org/issue/66461>.
Reported by Simon Tournier <zimon.toutoune@gmail.com>.

* guix/import/opam.scm (opam->guix-package): Handle lists of licenses.

Signed-off-by: Simon Tournier <zimon.toutoune@gmail.com>
2023-10-17 14:52:06 +02:00
Simon Tournier daaebc6457
scripts: weather: Handle EPIPE errors when displaying help.
* guix/scripts/weather.scm (%options): Handle EPIPE errors when displaying
help.
2023-10-17 14:52:06 +02:00