Commit Graph

7350 Commits

Author SHA1 Message Date
Simon Tournier
de63efc802
scripts: build: Handle EPIPE errors when displaying help.
* guix/scripts/build.scm (%options): Handle EPIPE errors when displaying help.
2023-10-17 14:51:54 +02:00
Simon Tournier
b53742def3
scripts: archive: Handle EPIPE errors when displaying help.
* guix/scripts/archive.scm (%options): Handle EPIPE errors when displaying
help.
2023-10-17 14:51:53 +02:00
Simon Tournier
b4d1eb53c0
ui: Handle EPIPE errors when displaying Guix version.
Fixes <https://issues.guix.gnu.org/66254>.
Reported by Clément Lassieur <clement@lassieur.org>.

* guix/ui.scm (show-version-and-exit): Handle EPIPE errors when displaying
version.
2023-10-17 14:51:53 +02:00
Sören Tempel
435090fa3f
pack: Allow setting a custom image tag for Docker images
Previously, the image repository name was automatically computed from
the packages in the manifest without allowing the user to set a custom
one. As such, changing the packages in the manifest would result in a
new image name. Thereby requiring updating documentation et cetera when
using `docker load` directory on the resulting image.

Inspired by `docker build -t`, this commit adds a new Docker-specific
option to `guix pack` which allows setting a custom repository name for
the resulting image. If this option is not specified, pack falls back
to computing the name from the manifest. Therefore, this change is
entirely backwards compatible.

Documentation has been added with: 373ec2cf8c.

* guix/scripts/pack.scm (guix-pack): Add --image-tag option.
(%docker-format-options): New constant.
(show-docker-format-options): New procedure.
(show-docker-format-options/detailed): New procedure.
(docker-image): Allow setting a custom
repository name for the created docker image via extra-options.

Signed-off-by: Sören Tempel <soeren@soeren-tempel.net>
Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
2023-10-16 09:08:13 +02:00
Ludovic Courtès
75bdf8e06a
shell: Take grafting into account when caching.
Fixes <https://issues.guix.gnu.org/64856>.

* guix/scripts/shell.scm (profile-file-cache-key)
(profile-spec-cache-key): Take (%graft?) into account.

Reported-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
2023-10-12 18:53:07 +02:00
Ricardo Wurmus
9d4339afb1
build-system/minify: Use esbuild.
* guix/build-system/minify.scm (default-uglify-js): Replace this procedure...
(default-esbuild): ...with this new procedure.
(lower): Use it, and add "esbuild" to build inputs.
* guix/build/minify-build-system.scm (minify): Invoke esbuild instead of
setting up a pipe to uglifyjs.
* gnu/packages/cran.scm (r-shiny)[native-inputs]: Replace node-uglify-js with
esbuild.
* gnu/packages/statistics.scm (r-dt)[native-inputs]: Same.
2023-10-06 16:37:16 +02:00
Ludovic Courtès
762fdbdef5
perform-download: Set PATH before invoking ‘git’.
Fixes <https://issues.guix.gnu.org/66305>.
Reported by Guillaume Le Vaillant <glv@posteo.net>.

* guix/scripts/perform-download.scm (perform-git-download): Add call to
‘setenv’.
2023-10-05 23:14:53 +02:00
Ricardo Wurmus
3fba8cd274
refresh: Fix sorting of updates by file and line number.
* guix/scripts/refresh.scm (guix-refresh): Add cascade-sort procedure and use
it to sort specs by package location.
2023-10-05 15:16:26 +02:00
Maxim Cournoyer
2d8aa104aa
search-paths: Add GCC search paths.
* guix/search-paths.scm ($C_INCLUDE_PATH, $CPLUS_INCLUDE_PATH)
($LIBRARY_PATH, %gcc-search-paths): New variables.
2023-10-04 23:30:41 -04:00
Jean-Pierre De Jesus DIAZ
3ba8f3f0d8
guix: meson-configuration: Fix boolean assigment.
* guix/build/meson-configuration.scm (write-assigment): Print true for
  #t and false for #f.  Previously it was inverting the values.

Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
2023-10-04 14:58:42 +02:00
Nikolaos Chatzikonstantinou
c6eed13c87
archive: Fix ‘--version’ typo.
* guix/scripts/archive.scm (%options): Replace 'build' by 'archive'.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2023-09-28 11:44:09 +02:00
Tobias Geerinckx-Rice
974b04ab80
read-print: Be more mindful of horizontal space in packages.
Perhaps due to their staged nature, packages tend to be ‘lopsided’: deeply
nested, with the most elaborate code on the {build,right-hand-,in}side, in
snippets and phases.

When we indent outer forms too eagerly, we can easily run short on
columns by the time we get to the build code, reducing readability.  A
few strategically-placed newlines early on can make a big difference.

* guix/read-print.scm (%newline-forms): Add a newline after opening a
<package> source field or an argument list.  Compensate by removing the
base32 special case, which is now unnecessary.
2023-09-24 02:00:00 +02:00
Ludovic Courtès
13b0cf85eb
git-download: Use “builtin:git-download” when available.
Fixes <https://issues.guix.gnu.org/63331>.

Longer-term this will remove Git from the derivation graph when its sole
use is to perform a checkout for a fixed-output derivation, thereby
breaking dependency cycles that can arise in these situations.

* guix/git-download.scm (git-fetch): Rename to…
(git-fetch/in-band): … this.  Deal with GIT or GUILE being #f.
(git-fetch/built-in, built-in-builders*, git-fetch): New procedures.
* tests/builders.scm ("git-fetch, file URI"): New test.
2023-09-26 17:36:58 +02:00
Ludovic Courtès
c4a1d69a69
perform-download: Use the ‘git’ command captured at configure time.
* guix/scripts/perform-download.scm (perform-git-download): Pass #:git-command
to ‘git-fetch-with-fallback’.
2023-09-26 17:36:58 +02:00
Ludovic Courtès
f651a35969
build: Add dependency on Git.
* configure.ac: Check for ‘git’ and substitute ‘GIT’.
* guix/config.scm.in (%git): New variable.
* guix/self.scm (compiled-guix): Define ‘git’ and pass it to
‘make-config.scm’.
(make-config.scm): Add #:git; emit a ‘%git’ variable.
* doc/guix.texi (Requirements): Add it.
2023-09-26 17:36:58 +02:00
Ludovic Courtès
95f2123135
daemon: Add “git-download” built-in builder.
The new builder makes it possible to break cycles that occurs when the
fixed-output derivation for the source of a dependency of ‘git’ would
itself depend on ‘git’.

* guix/scripts/perform-download.scm (perform-git-download): New
procedure.
(perform-download): Move fixed-output derivation check to…
(guix-perform-download): … here.  Invoke ‘perform-download’ or
‘perform-git-download’ depending on what ‘derivation-builder’ returns.
* nix/libstore/builtins.cc (builtins): Add “git-download”.
* tests/derivations.scm ("built-in-builders"): Update.
("'git-download' built-in builder")
("'git-download' built-in builder, invalid hash")
("'git-download' built-in builder, invalid commit")
("'git-download' built-in builder, not found"): New tests.
2023-09-26 17:36:58 +02:00
Ludovic Courtès
9d0e2002a5
perform-download: Remove unused one-argument clause.
Code in ‘builtins.cc’ only ever invokes ‘guix perform-download’ with two
arguments.

* guix/scripts/perform-download.scm (guix-perform-download): Remove
unused one-argument clause.
(perform-download): Make ‘output’ parameter mandatory; remove ‘output*’
variable.
2023-09-26 17:36:58 +02:00
Ludovic Courtès
c7ed1e0160
git-download: Honor the ‘GUIX_DOWNLOAD_FALLBACK_TEST’ environment variable.
* guix/git-download.scm (git-fetch): Honor ‘%download-fallback-test’.
2023-09-26 17:36:58 +02:00
Ludovic Courtès
811b249397
git-download: Move fallback code to (guix build git).
* guix/build/git.scm (git-fetch-with-fallback): New procedure, with code
taken from…
* guix/git-download.scm (git-fetch): … here.
[modules]: Remove modules that are no longer directly used in ‘build’.
[build]: Use ‘git-fetch-with-fallback’.
2023-09-26 17:36:57 +02:00
Simon Tournier
94f3831e5b
git: Restore 'false-if-git-not-found' in 'reference-available?'.
* guix/git/scm (reference-available?): Add 'false-if-git-not-found' for the
case 'commit.
2023-09-25 12:00:18 +02:00
Liliana Marie Prikler
cdbd81ce14
Merge branch 'master' into emacs-team 2023-09-22 23:54:34 +02:00
Simon Tournier
6d33c1f806
git: Avoid touching the network unless needed in 'reference-available?'.
Follow-up of 756e336fa0 fixing the issue.

* guix/git/scm (reference-available?): Address case by case to determine
whether the reference exists in the local Git checkout.
2023-09-22 14:42:56 +02:00
Mathieu Othacehe
e5ed1712da
image: Introduce the mbr-hybrid-raw image type.
Until 209204e23b and
d57cab7641, the default image type used by "guix
system image" was an MBR image with an ESP partition.

Having both an MBR image and an ESP partition is handy because the image will
boot on most x86 based systems using legacy BIOS and/or UEFI.

We now have a distinction between MBR images and EFI images. Introduce a new
MBR hybrid image type and default to it to restore the default behaviour.

This also fixes the images section of (gnu ci) that was trying to install a
BIOS bootloader on an EFI, GPT image and failing to do so.

Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
2023-09-20 09:38:36 +02:00
Janneke Nieuwenhuizen
15c5f1a2c2
self: Compile guix-packages-base in chunks of 10 files.
This fixes or greatly increases the chances for `guix pull' to succeed on the
Hurd, see <https://issues.guix.gnu.org/65456>.

* guix/self.scm (compiled-modules)[process-directory]: Move hardcoded size to
keyword parameter #:size.  Set it to 10 when compiling "guix-packages-base".
2023-09-19 11:01:14 +02:00
Janneke Nieuwenhuizen
658de25e99
self: Build directories in chunks of max 25 files at a time.
This increases the chances of a successful `guix pull' on the Hurd,
see <https://issues.guix.gnu.org/65456>.

* guix/self.scm (compiled-modules)[process-directory]: Split building of
directories into chunks of max 25 files.  Also call gc.
2023-09-18 06:46:03 +02:00
Jean-Pierre De Jesus DIAZ
19b6173708
transformations: tuned-package: Use target on cross-compile.
* guix/transformations.scm (tuned-package): Use either bag-target if
  available or bag-system to select the CPU architecture of the package
  that is going to be tuned.  This enables the tuning of cross-compiled
  packages.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2023-09-17 15:31:03 +02:00
Liliana Marie Prikler
94ca5b4357
Merge branch 'master' into emacs-team 2023-09-09 12:22:14 +02:00
Janneke Nieuwenhuizen
1ef4974be9
guix: shell: Don't whitelist / by typo in `shell-authorized-directories'.
Fixes <https://issues.guix.gnu.org/65832>.

* guix/scripts/shell.scm (authorized-shell-directory?): After warning,
continue LOOP to return valid query result for DIRECTORY.
2023-09-08 22:51:25 +02:00
Maxime Devos
96eda590e1
lint: Check that (cc-for-target) and friends are used.
"CC=gcc" is almost always incorrect; people often just don't
notice the incorrectness because they are compiling natively.
For an exception, see tzdata.

"guix style" partially made things worse, so I partially ignored it.

* guix/lint.scm (check-compiler-for-target): New linter.
* tests/lint.scm
("compiler-for-target: unconditional CC=gcc is unacceptable")
("compiler-for-target: looks through G-expressions")
("compiler-for-target: (cc-for-target) is acceptable")
("compiler-for-target: CC=gcc is acceptable when target=#false"):
Test it.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2023-09-08 19:12:15 +02:00
Hilton Chain
4a00fa9bea
build: emacs-utils: Adjust ‘emacs-compile-directory’ for Emacs 29.
* guix/build/emacs-utils.scm (emacs-compile-directory): After native
compilation, write the bytecode file with ‘comp-write-bytecode-file’.

Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
2023-09-07 20:25:06 +02:00
Simon Tournier
d552c2508f
guix: packages: Support package/inherit by package-field-location.
Fixes <https://issues.guix.gnu.org/65236>.

* guix/packages.scm (package-field-location): Add package/inherit case.

Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Reported-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Modified-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
2023-09-06 16:41:06 -04:00
Maxim Cournoyer
87dab3e36b
gnu-maintenance: Do not error when there are no candidates.
Fixes <https://issues.guix.gnu.org/65773>.

* guix/gnu-maintenance.scm (rewrite-url): Do not error when there are no
candidates.  This may well be possible, depending on the site.
2023-09-06 01:03:27 -04:00
Maxim Cournoyer
a87d722570
git: Fix typo in reference-available? comment.
* guix/git.scm (reference-available?): Fix typo.
2023-09-05 23:04:26 -04:00
Maxim Cournoyer
c3d48d024b
time-machine: Also validate the reference from a channels file.
* guix/scripts/time-machine.scm (guix-time-machine)
<validate-guix-channel>: Update doc.  Fall-back to use the Guix channel
reference when REF is #f.

Reported-by: Simon Tournier <zimon.toutoune@gmail.com>
Co-authored-by: Simon Tournier <zimon.toutoune@gmail.com>
2023-09-05 19:52:20 -04:00
Maxim Cournoyer
756e336fa0
Revert "guix: git: Avoid touching the network unless needed in 'reference-available?'."
This reverts commit a789dd5865, which broke
e.g.:

  guix time-machine -C <(echo %default-channels) -- describe

Add an explanatory comment as suggested.

Reported-by: Ludovic Courtès <ludo@gnu.org>
2023-09-05 19:52:20 -04:00
Maxim Cournoyer
fd09e7b053
gnu-maintenance: Do not crash on refresh when origin URI is a list.
Updating the simh package would fail with:

  ice-9/boot-9.scm:1685:16: In procedure raise-exception: In procedure
  string-prefix?: Wrong type argument in position 2 (expecting
  string): ("http://simh.trailing-edge.com/sources/simhv312-4.zip"
  "http://simh.trailing-edge.com/sources/archive/simhv312-4.zip")

This is because it expects a scalar value, but lists are allowed for URIs.

* guix/gnu-maintenance.scm (import-html-updatable-release): Check that URI is
a string before checking if it has the mirror:// prefix.
2023-09-05 19:52:19 -04:00
Liliana Marie Prikler
9d074e16c7
Merge branch 'master' into emacs-team 2023-08-26 07:08:03 +02:00
Josselin Poiret
106ad23ae4
graph: Add GraphML backend.
* guix/graph.scm (emit-graphml-prologue, emit-graphml-epilogue,
emit-graphml-node, emit-graphml-edge): New procedures.
(%graphml-backend): New variable.
(%graph-backends): Add %graphml-backend.
2023-08-25 14:24:43 +02:00
Josselin Poiret
d57cab7641
image: Add mbr-raw-image-type and use by default.
* gnu/system/image.scm (mbr-disk-image, mbr-raw-image-type): New variables.
(qcow2-image-type): Inherit mbr-disk-image.
* guix/scripts/system.scm (%default-options): Use mbr-raw-image-type by
default.
* gnu/tests/install.scm (run-install): Use mbr-raw in the tests.
* doc/guix-cookbook.texi (Guix System Image API): Update the list of image
types.
* doc/guix.texi (Invoking guix system, System Images, image-type Reference):
Add mbr-raw and switch documented default to it.
2023-08-25 14:24:21 +02:00
Nicolas Goaziou
738b0e4ccc
guix: profiles: Detect TeX Live packages propagated from non-TeX Live inputs.
This fixes <https://issues.guix.gnu.org/65474>.

* guix/profiles.scm (texlive-font-maps): Also check for TeX Live dependencies
in non "texlive-" prefixed packages.

For example, PYTHON-NBCONVERT propagates TeX Live inputs.  Those need to be
found out when building ".map"" files.

Co-authored-by: Andreas Enge <andreas@enge.fr>
2023-08-24 16:03:18 +02:00
Ludovic Courtès
f4d0d0bd5e
Revert "self: Build gnu/packages/*.go in 26 steps."
This reverts commit 5898b2e8a3, which led
to Guix where many .go files would be missing, as reported in
<https://issues.guix.gnu.org/65456>.
2023-08-22 23:50:53 +02:00
Janneke Nieuwenhuizen
5898b2e8a3
self: Build gnu/packages/*.go in 26 steps.
Similar to the Makefile.am change, this breaks-up gnu/packages into 26 chunks
when building on 32bit.  Also force garbage collection.

* guix/self.scm (compiled-modules)[process-directory]: Split building of
"gnu/packages" into 26 chunks.
2023-08-22 21:21:34 +02:00
Maxim Cournoyer
c655231b72
gnu-maintenance: Improve check for disabled host names.
Found while investigating <https://issues.guix.gnu.org/65304>.

* guix/gnu-maintenance.scm (html-updatable-package?): Tighten predicate.

Reviewed-by: Ludovic Courtès <ludo@gnu.org>
2023-08-22 12:38:50 -04:00
Maxim Cournoyer
91c8bd01f8
download: Add mirrors for Qt.
* guix/download.scm (%mirrors): Augment with qt mirrors.

Series-changes: 2
- Move authoritative mirror last, as it's too slow.
2023-08-22 12:32:19 -04:00
Attila Lendvai
e318b62df3
ssh: Also print the user when authentication fails.
* guix/ssh.scm (open-ssh-session): Show user in error message.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2023-08-22 11:17:53 +02:00
Liliana Marie Prikler
50b2db40ea
guix: emacs-utils: Add ert-number-tests.
* guix/build/utils.scm (ert-number-tests): New variable.
2023-08-19 01:37:20 +02:00
Nicolas Graves
9be28375cf
reconfigure: Use let* from srfi-71.
* guix/scripts/system/reconfigure.scm (upgrade-shepherd-services): Merge
'let' + 'let*' in just 'let*'.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2023-08-12 23:07:40 +02:00
fanquake
bcdafd00a3
platform: Add powerpc64-linux.
* guix/platforms/powerpc.scm (powerpc64-linux): New variable.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2023-08-12 23:02:31 +02:00
Ricardo Wurmus
b6441f7bd0
upstream: Compare symbols to symbols.
The UNCHANGED? comparison would always yield #FALSE, because we have been
comparing lists of strings with lists of symbols.

* guix/upstream.scm (update-package-inputs): Convert string labels to symbols
before comparison.
2023-09-13 22:17:21 +02:00
Maxim Cournoyer
f0e05411bd
search-paths: Add $TZDIR.
* guix/search-paths.scm ($TZDIR): New search path.
2023-09-12 10:03:44 -04:00