Commit Graph

4755 Commits

Author SHA1 Message Date
Brendan Tildesley
3e000955cd
guix: lint: Ad scdoc as a suggested native input.
* guix/lint.scm (check-inputs-should-be-native): Add scdoc.

Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org>
2020-03-19 21:10:21 +01:00
Ludovic Courtès
892ca1d92f
guix package: Remove unneeded import.
This is a followup to 55e1dfa4dd.

* guix/scripts/package.scm: Remove unneeded #:use-module.
2020-03-19 15:14:08 +01:00
Ludovic Courtès
1dca6aaafa
inferior: '&inferior-exception' includes a stack trace.
* guix/inferior.scm (port->inferior): Bump protocol to (0 1 1).
(&inferior-exception)[stack]: New field.
(read-repl-response): Recognize 'exception' form for protocol (0 1 1).
* tests/inferior.scm ("&inferior-exception"): Check the value returned
by 'inferior-exception-stack'.
2020-03-19 15:14:08 +01:00
Ludovic Courtès
2b0a370d00
repl: Return stack traces along with exceptions.
* guix/repl.scm (repl-prompt): New variable.
(stack->frames): New procedure.
(send-repl-response)[frame->sexp, handle-exception]: New procedure.
Pass HANDLE-EXCEPTION as a pre-unwind handler.
(machine-repl): Define 'tag'.  Bump protocol version to (0 1 1).
Wrap 'loop' call in 'call-with-prompt'.
2020-03-19 15:14:08 +01:00
Ludovic Courtès
ec0a866172
inferior: Adjust to protocol (0 1).
* guix/inferior.scm (port->inferior): For protocol (0 x ...), where x >= 1,
send the (() repl-version ...) form.
2020-03-19 15:14:08 +01:00
Ludovic Courtès
f06a26f5b5
repl: Allow clients to send their protocol version.
* guix/repl.scm (send-repl-response): Add #:version.
(machine-repl): Make 'loop' an internal define with a
'version' parameter.  Pass VERSION to 'send-repl-response'.
Send (0 1) as the protocol version.
If the first element read from INPUT matches (() repl-version _ ...),
interpret it as the client's protocol version.
2020-03-19 15:14:08 +01:00
Florian Pelz
771c5e155d
store: Fix many guix commands failing on some locales.
Partly fixes <https://bugs.gnu.org/39970>.

At least 'guix environment', 'guix install' and 'guix pull'
on 'az_AZ.utf8' and 'tr_TR.utf8' were affected.

* guix/store.scm (store-path-hash-part): Move base path detection to ...
(store-path-base): ... this new exported procedure.
(store-path-package-name): Use it instead of locale-dependent regexps.
(store-regexp*): Remove.
2020-03-14 07:09:14 +00:00
Mathieu Othacehe
8d003ca344
build-system: linux-module: Break some long lines.
* gnu/build/linux-modules.scm (make-linux-module-builder, lower): Break some
long commentary lines.
2020-03-17 16:51:14 +01:00
Julien Lepiller
06f0453ad2
guix: import: opam: Use a default repository.
* guix/import/opam.scm (opam->guix-package): Use a default value for
`repository`.
2020-03-17 00:06:23 +01:00
Ludovic Courtès
24fb0dc0ab
pack: Do not create a squashfs "recovery file".
Reported by Josh Marshall <Josh.Marshall@jax.org>.

* guix/scripts/pack.scm (squashfs-image)[build](mksquashfs): Always pass
"-no-recovery".
2020-03-13 17:33:38 +01:00
Ludovic Courtès
b829864d74
pack: Make bit-reproducible squashfs images.
Reported by Josh Marshall <Josh.Marshall@jax.org>.

* guix/scripts/pack.scm (squashfs-image)[build](mksquashfs): Always pass
"-all-time", "-mkfs-time", "-force-uid", and "-force-gid" to 'mksquashfs'.
2020-03-13 17:33:37 +01:00
Ludovic Courtès
b24ec85451
pack: Factorize 'mksquashfs' invocations.
* guix/scripts/pack.scm (squashfs-image)[build](mksquashfs): New
procedure.
Replace instances of (invoke "mksquashfs" ...) with (mksquashfs ...).
2020-03-13 17:33:37 +01:00
Ludovic Courtès
a0feabdfdb
weather: '--coverage' filters out non-package objects.
This is a followup to d37b5a1b58.

* guix/scripts/weather.scm (guix-weather): Filter PACKAGES passed to
'report-package-coverage'.
2020-03-13 17:33:37 +01:00
Ludovic Courtès
be764b47ad
weather: Exit with non-zero when coverage is below 100%.
* guix/scripts/weather.scm (report-server-coverage): Return the coverage ratio.
(guix-weather): Exit if and only if each server's coverage is 1.
2020-03-13 17:33:37 +01:00
Ludovic Courtès
2843fed0e9
weather: Allow for multiple '--manifest' options.
* guix/scripts/weather.scm (guix-weather)[package-list]: Account for all
the 'manifest entries in OPTS.
* doc/guix.texi (Invoking guix weather): Document it.
2020-03-12 18:32:16 +01:00
Ludovic Courtès
71bb485541
weather: Add '--display-missing'.
* guix/scripts/weather.scm (report-server-coverage): Add
 #:display-missing? and honor it.
(show-help, %options): Add "--display-missing".
(guix-weather): Pass #:display-missing? to 'report-server-coverage'.
* doc/guix.texi (Invoking guix weather): Document it.
2020-03-12 18:32:16 +01:00
Ludovic Courtès
cf2ac04f13
gexp: Add 'with-parameters'.
* guix/gexp.scm (<parameterized>): New record type.
(with-parameters): New macro.
(compile-parameterized): New gexp compiler.
* tests/gexp.scm ("with-parameters for %current-system")
("with-parameters for %current-target-system")
("with-parameters + file-append"): New tests.
* doc/guix.texi (G-Expressions): Document it.
2020-03-12 18:32:15 +01:00
Ludovic Courtès
f7537e30b8
inferior: Distinguish inferior exceptions.
This avoids ambiguities when looking at a backtrace where the exception
was actually thrown by an inferior in a very different context.

* guix/inferior.scm (&inferior-exception): New condition type.
(read-repl-response): Add optional 'inferior' parameter.  Raise
'&inferior-exception' instead of rethrowing to KEY when receiving an
'exception' message.
(read-inferior-response): Pass INFERIOR to 'read-repl-response'.
* tests/inferior.scm ("&inferior-exception"): New test.
2020-03-12 11:52:38 +01:00
Ludovic Courtès
c00ae79cca
import: cpan: Gracefully handle missing projects.
* guix/import/cpan.scm (cpan-fetch): Check whether 'json-fetch' returns #f.
2020-03-12 11:52:38 +01:00
Ludovic Courtès
2d0409a4a2
import: utils: Remove 'assoc-ref*'.
* guix/import/utils.scm (assoc-ref*): Remove.
2020-03-12 11:52:37 +01:00
Ludovic Courtès
7657e61d6b
import: pypi: Rewrite to use 'define-json-mapping'.
* guix/import/pypi.scm (non-empty-string-or-false): New procedure.
(<pypi-project>, <project-info>, <distribution>): New record types.
(pypi-fetch): Call 'json->pypi-project'.
(latest-source-release, latest-wheel-release): Use the new record
accessors instead of 'assoc-ref*'.
(pypi->guix-package, latest-release): Likewise.
* tests/pypi.scm (test-json): Add mandatory fields.
2020-03-12 11:52:37 +01:00
Ludovic Courtès
d8a822f462
download: Remove (web http) workarounds no longer relevant.
* guix/build/download.scm <top level>: Remove workarounds for
<https://bugs.gnu.org/23421> and for
<https://lists.gnu.org/archive/html/guix-devel/2017-11/msg00070.html>.
2020-03-11 18:42:09 +01:00
Ludovic Courtès
3c1ea8dcef
ui: Restore line wrapping for 'package->recutils'.
Fixes a regression introduced when switching to Guile 3.0.0 whereby
monkey-patching 'wrap*' wouldn't have any effects due to inlining.

* guix/ui.scm (%text-width): Define in terms of the '*line-width*' fluid
when it's defined.
<top level>: Set (@@ (texinfo plain-text) wrap*) only when
'*line-width*' is undefined.
2020-03-11 18:42:08 +01:00
Tobias Geerinckx-Rice
df0bb509c2
download: Remove misbehaving kvin.lv mirror.
It issues bogus redirections instead of returning 404.

* guix/download.scm (%mirrors): Remove kvin.lv from CPAN.
2020-03-09 16:01:17 +01:00
Mathieu Othacehe
9a2f99f42f
gexp: Default to current target.
* guix/gexp.scm (lower-object): Set target argument to 'current by default and
look for the current target system at bind time if needed,
(gexp->file): ditto,
(gexp->script): ditto,
(lower-gexp): make sure lowered extensions are not cross-compiled.

* tests/gexp.scm: Add cross-compilation test-cases for gexp->script and
gexp->file with a target passed explicitely and with a default target.
2020-03-08 20:28:31 +01:00
Mathieu Othacehe
5d52d10661
store: Add set-current-target procedure.
* guix/store.scm (set-current-target): New exported procedure.
2020-03-08 20:28:31 +01:00
Ricardo Wurmus
c363722e81
import/cran: Add vignette builder to native inputs.
* guix/import/cran.scm (needs-knitr?): New procedure.
(description->package): Use it.
2020-03-07 19:31:47 +01:00
Pierre Neidhardt
1d24cc6de6
scripts: Show disk-space warning when under the min of the thresholds.
Follow-up to 71c3c3df92 which got the logic
wrong.

* guix/scripts.scm (warn-about-disk-space): Compare AVAILABLE to the min of
RELATIVE-THRESHOLD-IN-BYTES and ABSOLUTE-THRESHOLD-IN-BYTES, not the max.
2020-03-06 08:32:01 +01:00
Ludovic Courtès
e7671685a8
weather: Parameterize '%graft?' upfront.
* guix/scripts/weather.scm (guix-weather): Parameterize %GRAFT? upfront.
2020-03-05 16:33:37 +01:00
Ludovic Courtès
f42f39ad68
guix build: Parameterize '%graft?' upfront.
* guix/scripts/build.scm (guix-build): Add 'graft?' variable and
parameterize %GRAFT?.
2020-03-05 16:33:37 +01:00
Ludovic Courtès
d37b5a1b58
weather: Allow non-package objects in manifest.
* guix/scripts/weather.scm (package-outputs)[lower-object/no-grafts]:
New procedure.
Use it instead of 'package->derivation'.
2020-03-05 16:33:37 +01:00
Ludovic Courtès
5a675b2c67
guix build: Allow non-package objects in manifest.
* guix/scripts/build.scm (options->things-to-build)[manifest->packages]:
Remove.
Inline map of 'manifest-entry-item'.
* tests/guix-build.sh: Add test for "guix build -m" with non-package object.
2020-03-05 16:33:37 +01:00
Lars-Dominik Braun
c8abbe1468
import: pypi: Add more licenses
* guix/import/pypi.scm (string->license): Add the BSD 2-clause and MPL 2.0
licenses, and add more strings for BSD 3-clause and Expat license.

Signed-off-by: Leo Famulari <leo@famulari.name>
2020-03-04 14:56:38 -05:00
Maxim Cournoyer
99e676db43
file-systems: Add a 'file-system-device->string' procedure.
* gnu/system/file-systems.scm (file-system-device->string): New procedure.
* gnu/system.scm (bootable-kernel-arguments): Use it.
* gnu/system/vm.scm (operating-system-uuid): Likewise.
* guix/scripts/system.scm (display-system-generation): Likewise.
2020-03-02 23:24:47 -05:00
Leo Prikler
a3b1f878df
build-system: copy-build-system: Keep symlinks symbolic.
guix/build/copy-build-system.scm (install)[install-file]:
Read symlinks as is done in install-simple through copy-recursively.

Signed-off-by: Pierre Neidhardt <mail@ambrevar.xyz>
2020-02-28 09:39:31 +01:00
Ludovic Courtès
c2f9ea2b50
Revert "ui: Only display link in capable terminals."
This reverts commit d7545a6b53.

The commit led to a test failure in 'tests/guix-package-net.sh'.  It
also led to disagreements discussed here:

  https://lists.gnu.org/archive/html/guix-devel/2020-02/msg00353.html

Reverting until these are addressed.
2020-02-28 00:03:34 +01:00
Ludovic Courtès
71c3c3df92
scripts: Adjust disk-space warning functionality.
This is a followup to fb7eec3a84.

* guix/scripts.scm (warn-about-disk-space): Do not multiply
ABSOLUTE-THRESHOLD-IN-BYTES by 2^30.  Compare AVAILABLE to the max of
RELATIVE-THRESHOLD-IN-BYTES and ABSOLUTE-THRESHOLD-IN-BYTES, not the
min.  Display AVAILABLE divided by 2^30.
2020-02-27 23:56:14 +01:00
Ludovic Courtès
6b0653e7ec
guix package: Don't error out when failing to create ~/.guix-profile.
This is a followup to 7842ddcbc1, which
broke tests when 'HOME' is unset.

* guix/scripts/package.scm (ensure-default-profile): Silently ignore
'symlink' exceptions.
2020-02-27 23:29:30 +01:00
Maxim Cournoyer
9659459f06
emacs-build-system: Byte compile the autoload files.
* guix/build/emacs-build-system.scm (enable-autoloads-compilation)
(validate-compiled-autoloads): Add procedures.
(%standard-phases): Register the new procedures.
* gnu/packages/aux-files/emacs/guix-emacs.el (guix-emacs-find-autoloads):
Remove duplicates in the list of autoload files found.
* guix/build/emacs-utils.scm (expr->string): Add procedure.
(emacs-batch-eval, emacs-batch-edit-file): Use it.
2020-02-27 16:59:07 -05:00
Pierre Neidhardt
fb7eec3a84
scripts: Emit GC hint if free space is lower than absolute and relative threshold.
* guix/scripts.scm (%disk-space-warning-absolute): New variable.
(warn-about-disk-space): Test against %disk-space-warning-absolute.
Fix error in display-hint due to extraneous 'profile' argument.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2020-02-26 22:05:56 +01:00
Danny Milosavljevic
12f0aefd14
build-system/linux-module: Disable depmod.
* guix/build/linux-module-build-system.scm (install): Disable depmod.
2020-02-25 10:22:19 +01:00
Julien Lepiller
c23b42dd55
guix: node-build-system: Do not symlink /bin.
* guix/build/node-build-system.scm (install): Do not add a symlink for
/bin.
2020-02-25 00:27:09 +01:00
Pierre Neidhardt
9ea458c57a
build-system: Fix copy-build-system default install plan.
* guix/build-system/copy.scm (copy-build): Set install-plan default value
  to copy everything from source to the output.
2020-02-24 11:22:02 +01:00
Pierre Neidhardt
9b7f9e6f9b
ui: Don't truncate search output when inside Emacs.
* guix/ui.scm (display-search-results): Loop over all results when
  INSIDE_EMACS is set.
2020-02-24 11:01:52 +01:00
Pierre Neidhardt
672d3d4a87
ui: Don't disable colors when INSIDE_EMACS is set.
* guix/colors.scm (color-output?): Remove INSIDE_EMACS condition.
2020-02-24 11:01:52 +01:00
zimoun
d7545a6b53
ui: Only display link in capable terminals.
* guix/ui.scm (display-generation): Display generation path on new line.
* guix/scripts/describe.scm (channel-commit-hyperlink): Add TRANSFORMER argument.
(display-profile-content): Use TRANSFORMER argument to display URL explicitly
when terminal does not support hyperlinks.
2020-02-24 11:01:52 +01:00
Ludovic Courtès
fa99c4bbc7
ui: (size->number "1.M") is correctly parsed.
Reported by Pierre Neidhardt <mail@ambrevar.xyz>.

* guix/ui.scm (size->number)[unit-pos]: Add #\. to CHAR-SET:DIGIT.
* tests/ui.scm ("size->number, 1.M"): New test.
2020-02-23 12:47:13 +01:00
Jakub Kądziołka
6a3911b88f
swh: Handle absolute URLs being returned by the API.
* guix/swh.scm (swh-url): Don't prepend (%swh-base-url) if a domain is
  already present.

This fixes the "guix lint: warning: while connecting to Software Heritage:
host lookup failure: Name or service not known" error message.
2020-02-23 12:30:18 +01:00
Matt Wette
3d1e42321f
import: github: Use HTTP "Authorization" header for access tokens.
Fixes <https://bugs.gnu.org/39511>.

The "access_token" query parameter is now deprecated:

  https://developer.github.com/changes/2019-11-05-deprecated-passwords-and-authorizations-api/#authenticating-using-query-parameters

* guix/import/github.scm (fetch-releases-or-tags)[headers]: Add
"Authorization" header when (%github-token) is true.
[decorate]: Remove, and remove callers.
2020-02-22 12:17:35 +01:00
Ludovic Courtès
4cb63a564d
deduplication: Use nix-base32 encoding for link names.
Fixes <https://bugs.gnu.org/39725>.

* guix/store/deduplication.scm (deduplicate): Use
'bytevector->nix-base32-string' instead of 'bytevector->base16-string'.
2020-02-22 00:46:06 +01:00