Commit Graph

7489 Commits

Author SHA1 Message Date
Oleg Pykhalov
d3d3eedf7f
guix: docker: Build layered images.
* guix/docker.scm (%docker-image-max-layers): New variable.
(size-sorted-store-items, create-empty-tar): New procedures.
(config, manifest, build-docker-image): Build layered images.

Change-Id: I4c8846bff0a3ceccb77e6bdf95d4942e5c3efe41
2024-01-08 21:04:44 +03:00
Graham James Addis
7d5168a2af
guix: pack: Add '--entry-point-argument' option.
* guix/scripts/pack.scm:
(entry-point-argument-spec-option-parser): New procedure.
(docker-image, %default-options, %docker-format-options,
show-docker-format-options/detailed, %options, show-docker-format-options,
guix-pack): Handle '--entry-point-argument' option.
* doc/guix.texi: (Invoking guix pack): Document this

Signed-off-by: Oleg Pykhalov <go.wigust@gmail.com>
Change-Id: I1124feff6af39dcc63c85fd6cc7ad50f398489dc
2024-01-08 21:04:44 +03:00
Ekaitz Zarraga
4cafd86f77
build-system/zig: Add cross-compilation support.
* guix/build/zig-build-system.scm (zig-cross-build): New function
(lower): Add cross-compilation support
* guix/build-system/zig.scm (build): Add --target flag with target input
(check): Disable with cross compilation

Change-Id: I5f42ff897bfe00c92c6576900221a15ef210d669
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2024-01-07 16:56:00 +01:00
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