Commit Graph

5196 Commits

Author SHA1 Message Date
Raghav Gururajan 47f82b310e
guix: edit: Make nano the default editor.
* guix/scripts/edit.scm: Make nano the default editor.

Nano is sensible default, as it is installed by base system.
For development, user can set custom value for $EDITOR.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2020-04-27 23:29:40 +02:00
Ludovic Courtès 5fbc753ab5
import: crate: Gracefully handle non-existent crates.
Fixes <https://bugs.gnu.org/40891>.
Reported by Hartmut Goebel <h.goebel@crazy-compilers.com>.

* guix/import/crate.scm (crate->guix-package): Wrap value of
'version-number' and 'version*' in (and crate ...).
2020-04-27 23:29:40 +02:00
Ludovic Courtès ccbc427f9a
channels: Use a declarative profile.
* guix/channels.scm (package-cache-file): Use 'profile' instead of
'profile-derivation'.
2020-04-26 22:49:49 +02:00
Ludovic Courtès 45c84c8f6f
pack: Use a declarative profile.
* guix/scripts/pack.scm (guix-pack): Use a declarative profile instead
of 'profile-derivation'.
2020-04-26 22:49:48 +02:00
Ludovic Courtès ef674a24c5
profiles: Add lowerable <profile> record type.
* guix/profiles.scm (<profile>): New record type.
* tests/profiles.scm ("<profile>"): New test.
2020-04-26 22:49:48 +02:00
Christopher Baines 928dc1bb1c
substitute: Close port at the end of http-multiple-get.
* guix/scripts/substitute.scm (http-multiple-get): Add close-port call.
2020-04-26 19:37:25 +01:00
Christopher Baines d5abb3049e
substitute: Make http-multiple-get batch size configurable.
* guix/scripts/substitute.scm (http-multiple-get): Add batch-size parameter.
2020-04-26 19:37:24 +01:00
Christopher Baines 121191f23a
substitute: Use the same port for multiple request batches.
In http-multiple-get.

* guix/scripts/substitute.scm (http-multiple-get): Switch port to p in one
occurrence.
2020-04-26 19:37:22 +01:00
Marius Bakke c57d649de3
Merge branch 'master' into core-updates 2020-04-24 17:28:11 +02:00
Marius Bakke 962554ddcf
guix package: Export 'search-path-environment-variables'.
...because Emacs-Guix uses it.

* guix/scripts/package.scm (search-path-environment-variables): Export.
2020-04-24 15:15:50 +02:00
Mathieu Othacehe 1597613488
Revert "licenses: Export license record."
This reverts commit f0779922ff. We do not want
to export the license record, see:
https://lists.gnu.org/archive/html/guix-commits/2020-04/msg01923.html.
2020-04-24 09:10:35 +02:00
Ludovic Courtès 12da5162e4
compile: Pre-load the compiler outside 'with-target'.
* guix/build/compile.scm (compile-files): Move call to 'compile' before
'with-target'.  Failing to do that, if the target has a different word
size than the host, the first call to 'compile-file' fails with:

  ice-9/eval.scm:293:34: In procedure load-thunk-from-memory: ELF file does not have native word size

while attempting loading 'language/spec.go'.
2020-04-23 23:59:22 +02:00
zimoun f0779922ff
licenses: Export license record.
* guix/licenses.scm (<license>): Export it.

Signed-off-by: Mathieu Othacehe <m.othacehe@gmail.com>
2020-04-23 16:28:39 +02:00
Jakub Kądziołka e84d9dcd5b
git-version: Raise a condition instead of an error.
* guix/git-download.scm (git-version): Replace ERROR with RAISE
  and CONDITION.

This is a follow-up to commit bbf6bc1acc.
2020-04-23 14:23:03 +02:00
Marius Bakke 030f6f489f
Merge branch 'master' into core-updates
Conflicts:
	etc/news.scm
	gnu/local.mk
	gnu/packages/bootloaders.scm
	gnu/packages/linphone.scm
	gnu/packages/linux.scm
	gnu/packages/tls.scm
	gnu/system.scm
2020-04-23 13:33:09 +02:00
Jakub Kądziołka bbf6bc1acc
git-version: Handle invalid arguments gracefully
* guix/git-download.scm (git-version): Add a check for commit ID length.
2020-04-23 10:16:49 +02:00
Ludovic Courtès 416f7f4f14
profiles: Add #:name parameter to 'profile-derivation'.
* guix/profiles.scm (profile-derivation): Add #:name and pass it to
'gexp->derivation'.
2020-04-22 19:23:57 +02:00
Ludovic Courtès 34faf63ebc
gexp: Add 'load-path?' field to <scheme-file>.
* guix/gexp.scm (<scheme-file>)[load-path?]: New field.
(scheme-file): Add #:set-load-path? and honor it.
(scheme-file-compiler): Pass #:set-load-path? to 'gexp->file'.
* doc/guix.texi (G-Expressions): Document it.
2020-04-22 19:23:57 +02:00
Ludovic Courtès e1e6491226
self: Build and install 'guix-cookbook.info' and its translations.
* guix/self.scm (translate-texi-manuals)[build]: Translate and install
guix-cookbook.texi.
(info-manual)[build]: Handle "guix-cookbook*.texi".
2020-04-21 23:52:19 +02:00
Ludovic Courtès 84c37e6368
self: translate-texi-manuals: Add 'available-translations'.
* guix/self.scm (translate-texi-manuals)[build](available-translations):
New procedure.
Use it rather than directly calling 'find-files' & co.
2020-04-21 23:52:19 +02:00
Ludovic Courtès cc753650ec
self: translate-texi-manuals: Don't hardcode "guix.texi".
* guix/self.scm (translate-texi-manuals)[build](translate-texi): Add
'prefix' and #:extras parameters and honor them.  Adjust callers.
2020-04-21 23:52:19 +02:00
Ludovic Courtès c8d8f6160e
packages: Recommend against the use of 'package-file'.
* guix/packages.scm (package-file): Recommend against its use in the
docstring.
* doc/guix.texi (The Store Monad): Likewise.
2020-04-21 00:06:40 +02:00
Julien Lepiller fd546bbbee
syscalls: Fix Linux detection in 'readdir*'.
* guix/build/syscalls.scm (readdir*): Fix Linux detection for
`arm-unknown-linux-gnueabihf'.
2020-04-20 16:30:14 +02:00
Marius Bakke 7abe35febe
Merge branch 'master' into core-updates 2020-04-19 16:53:01 +02:00
Ludovic Courtès 3c91f00341
tests: Invoke 'git' with a custom '.gitconfig' and ignore the system config.
Fixes <https://bugs.gnu.org/37679>.
Reported by Gábor Boskovits <boskovits@gmail.com>.

* guix/tests/git.scm (call-with-environment-variables): New procedure.
(with-environment-variables): New macro.
(populate-git-repository)[git]: Wrap (git-command) invocation in
'call-with-temporary-directory' and 'with-environment-variables'.
2020-04-19 13:27:06 +02:00
Ludovic Courtès 04594054d6
status: Remove extra space before ellipsis.
Extra space was introduced in 8fa4ac5be4.

* guix/status.scm (print-build-event): Remove extra space before
ellipsis.
2020-04-19 13:27:06 +02:00
Christopher Baines cef392f393
guix: self: Use guile with libgc-7.
Rather than libgc version 8. This should avoid crashes that can occur,
particularly when loading data in to the Guix Data Service [1].

1: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=40525

* gnu/packages/guile.scm (guile-3.0/libgc-7): New variable.
* guix/self.scm (specification->package): Use guile-3.0/libgc-7 for guile.
2020-04-18 15:49:44 +01:00
Tobias Geerinckx-Rice aa78c596c9
gnupg: Accept revoked keys.
I (nckx) have revoked all RSA subkeys, in favour of my older and
freshly-refreshed ECDSA ones.  This was merely a precaution: to my
knowledge all my RSA private keys have been carefully destroyed and
were never compromised.  This commit keeps ‘make authenticate’ happy.

* guix/gnupg.scm (revkeysig-rx): New variable for revoked keys.
(gnupg-verify): Parse it.
(gnupg-status-good-signature?): Accept it as ‘good’ for our purposes.
* build-aux/git-authenticate.scm (%committers): Clarify nckx's subkeys.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2020-04-17 23:36:47 +02:00
Vincent Legoll 694e10af63
ui: Fix typos, 80-col & grammar in comments & docstrings.
* guix/ui.scm (load*): Fix comment line length.
(leave-on-EPIPE): Fix typo in docstring.
(substitutable-info): Fix typo in comment.
(indented-string): Fix typo in docstring.
(%package-metrics): Fix typo in comment.
(run-guix): Fix grammar in docstring.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2020-04-17 23:18:32 +02:00
TomZ 8fa4ac5be4
status: Allow double-click select of URLs.
Various places while downloading or compiling guix prints
the source URL. This change makes the URL easier to use by
placing a space between the URL and the trailing dots.

Signed-off-by: Marius Bakke <mbakke@fastmail.com>
2020-04-17 17:03:05 +02:00
Ricardo Wurmus 3c0422b9be
import/print: Don't factorize URI if there's no version match.
* guix/import/print.scm (package->code): If FACTORIZE-URI returns just the
unmodified string use that as the URI.
2020-04-16 23:41:52 +02:00
Ricardo Wurmus 3fd4c4c839
import/utils: alist->package: Include arguments.
* guix/import/utils.scm (alist->package): Process arguments field in input
data and include it in the generated package.
2020-04-16 23:41:52 +02:00
Ricardo Wurmus 7cef499bb0
import/json: json->code: Handle files with more than one definition.
* guix/import/json.scm (json->code): Convert JSON arrays to lists of package
definitions.
(json->scheme-file): Write all expressions to the target file.
2020-04-16 23:41:52 +02:00
Ricardo Wurmus 3532fc39ff
import/utils: alist->package: Ignore known inputs.
* guix/import/utils.scm (alist->package): Accept optional list of known
inputs, which are excluded from the specification lookup.
* guix/import/print.scm (package->code)[package-lists->code]: Handle inputs
which are just symbols.
2020-04-16 23:41:52 +02:00
Ricardo Wurmus 86a3b540d0
import/print: package->code: Wrap S-expression in definition.
* guix/import/print.scm (package->code): Return a definition, not just a
package expression.
2020-04-16 23:41:52 +02:00
Ricardo Wurmus c893432320
import/json: Use json->code.
* guix/import/json.scm (json->code): Export procedure.
* guix/scripts/import/json.scm (guix-import-json): Use json->code.
2020-04-16 23:41:52 +02:00
Ricardo Wurmus 4f353c485d
scripts/package: Handle JSON files.
* guix/scripts/package.scm (%options): Support loading from JSON files when
"install-from-file" is used.
2020-04-16 23:41:52 +02:00
Ricardo Wurmus f87e563201
scripts/build: options->things-to-build: Handle .json files.
* guix/scripts/build.scm (options->things-to-build): Handle files that end on
.json.
2020-04-16 23:41:52 +02:00
Ricardo Wurmus 16dd764691
import/json: Add json->scheme-file.
* guix/import/json.scm (json->code, json->scheme-file): New procedures.
2020-04-16 23:41:52 +02:00
Ricardo Wurmus 6269dd567e
import/print: package->code: Wrap build system value in module reference.
* guix/import/print.scm (package->code): Return build system value with
corresponding module.
2020-04-16 23:41:52 +02:00
Ricardo Wurmus 1475d45112
import/print: Return license with prefix.
* guix/import/print.scm (license->code): Prepend license: prefix.
2020-04-16 23:41:49 +02:00
Ludovic Courtès 82d8959e5d
syscalls: 'readdir*' chooses between the Linux and Hurd code at run time.
Partly fixes <https://bugs.gnu.org/40574>.
Reported by Jan Nieuwenhuizen <janneke@gnu.org>.

Previously, we'd choose at expansion time whether to use the Hurd or the
Linux variant, taking the cross-compilation target into account.  This
would lead to the wrong decision when (guix build syscalls) is evaluated
while we're cross-compiling to GNU/Hurd.

This is a followup to 1ab9e48339.

* guix/build/syscalls.scm (define-generic-identifier)
(read-dirent-header, %struct-dirent-header, sizeof-dirent-header):
Remove.
(readdir*): Rename to...
(readdir-procedure): ... this, and add parameters.
(readdir*): Define as a call to 'readdir-procedure' as a function of
%HOST-TYPE.
2020-04-16 18:33:21 +02:00
Marius Bakke bd21acf6c3
Merge branch 'master' into core-updates 2020-04-15 19:26:55 +02:00
Ludovic Courtès b4440de133
Merge branch 'version-1.1.0' 2020-04-15 16:09:18 +02:00
Ludovic Courtès 1ae7a9251b
weather: Delete duplicate entries coming from '--manifest'.
* guix/scripts/weather.scm (load-manifest): Call 'delete-duplicates'.
2020-04-14 16:01:05 +02:00
Marius Bakke fc58cb5bd2
Merge branch 'master' into core-updates 2020-04-13 20:26:21 +02:00
Ludovic Courtès b36217c54d
self: Prevent inlining of internal procedures used by 'doc/build.scm'.
This allows 'doc/build.scm' to keep using '@@' for these.  (This sets a
bad example, don't follow it.)

* guix/self.scm (prevent-inlining!): New macro.
<top level>: Use it for 'file-append*', 'translate-texi-manuals', and
'info-manual'.
2020-04-13 01:21:49 +02:00
nixo 93d5cea57e
build: julia-build-system: Update for new Julia version.
* guix/build/julia-build-system.scm (generate-load-path): Delete function.
(install): Don't set JULIA_LOAD_PATH.
(precompile): Set SOURCE_DATE_EPOCH. Update calculating the
JULIA_LOAD_PATH. Adjust the 'invoke-julia' command.
(check): Set SOURCE_DATE_EPOCH. Adjust JULIA_LOAD_PATH.

Signed-off-by: Efraim Flashner <efraim@flashner.co.il>
2020-04-12 16:15:47 +03:00
Ludovic Courtès 7fa6155b23
database: 'reset-timestamps' can optionally preserve permissions.
* guix/store/database.scm (reset-timestamps): Add
 #:preserve-permissions? and honor it.
2020-04-11 20:48:12 +02:00
Marius Bakke bdb90df764
Merge branch 'master' into core-updates 2020-04-11 00:10:23 +02:00
Ludovic Courtès 92587f8ed6
lint: 'check-patch-file-names' restricts to shorter file names.
* guix/lint.scm (check-patch-file-names): Increase MARGIN.
2020-04-10 16:02:51 +02:00
Efraim Flashner d95252baf9
lint: Check for inappropriate inputs in propagated-inputs too.
* guix/lint.scm (check-inputs-should-be-native): Also check the
propagated inputs of the package.
2020-04-10 00:45:59 +03:00
Diego Nicola Barbato c1d81df93d
download: Use correct system and guile in 'url-fetch/tarbomb' and 'url-fetch/zipbomb'.
Fixes <https://bugs.gnu.org/40115>.

Previously the result of `guix build -s $system $package' would depend on the
system Guix was built for if $package or one of its dependencies used
'url-fetch/tarbomb' or 'url-fetch/zipbomb' as the origin method of its
source (e.g. `guix build -s i686-linux ffmpeg' on i686-linux would build a
different derivation than on x86_64-linux).

This patch fixes this by explicitly passing the correct system and guile to
'gexp->derivation'.

* guix/download.scm (url-fetch/tarbomb): Pass #:system system and
  #:guile-for-build guile to 'gexp->derivation', where guile is the derivation
  of guile for system.
  (url-fetch/zipbomb): Likewise.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2020-04-08 19:35:34 +02:00
Marius Bakke 2778302399
Merge branch 'master' into core-updates
Conflicts:
	etc/news.scm
	gnu/local.mk
	gnu/packages/check.scm
	gnu/packages/cross-base.scm
	gnu/packages/gimp.scm
	gnu/packages/java.scm
	gnu/packages/mail.scm
	gnu/packages/sdl.scm
	gnu/packages/texinfo.scm
	gnu/packages/tls.scm
	gnu/packages/version-control.scm
2020-04-08 13:00:50 +02:00
Jakub Kądziołka 3f3c9fdcd8
build-system/go: Allow providing additional build flags
* guix/build-system/go.scm (build-flags): New argument.
* guix/build/go-build-system.scm (build): Use apply to pass the
  additional arguments to invoke.
2020-04-08 12:24:42 +02:00
Ludovic Courtès a05ad01122
records: Have ABI check work well for cross-compilation.
Reported by Jan (janneke) Nieuwenhuizen <janneke@gnu.org>.

* guix/records.scm (define-record-type*): Use
'target-most-positive-fixnum' on Guile 3 instead of 'most-positive-fixnum'.
2020-04-08 00:05:45 +02:00
Ludovic Courtès 041c3c22dc
compile: Run the load phase within 'with-target'.
* guix/build/compile.scm (compile-files)[build]: Remove 'with-target'.
Wrap body in 'with-target'.
2020-04-08 00:05:45 +02:00
Ludovic Courtès 93add9bf7d
reconfigure: Correctly re-throw SRFI-34 exceptions on Guile 3.
Previously, we'd just print an ugly backtrace when running on Guile 3
because the '%exception throw would not be caught anywhere.

Reported by Arne Babenhauserheide <arne_bab@web.de>
in <https://bugs.gnu.org/40496>.

* guix/scripts/system/reconfigure.scm (install-bootloader-program): In
'catch' handler, match '%exception and use 'raise-exception' instead of
'throw' to rethrow in that case.
2020-04-08 00:05:45 +02:00
Marius Bakke 1c86577d62
Revert "Allow double-click select of URL in status"
As discussed on #guix, this should wait until 1.1.0 is branched off to avoid
having to update translations.

This reverts commit 9f1b787120.
2020-04-07 22:09:14 +02:00
TomZ 9f1b787120
Allow double-click select of URL in status
Various places while downloading or compiling guix prints
the source URL. This change makes the URL easier to use by
placing a space between the URL and the trailing dots.

Signed-off-by: Marius Bakke <mbakke@fastmail.com>
2020-04-07 21:56:30 +02:00
Marius Bakke 9ac6d3785f
lint: 'm4' is a native input.
* guix/lint.scm (check-inputs-should-be-native): Add "m4".
2020-04-07 17:59:00 +02:00
Ludovic Courtès 42a87136f0
channels: Call 'build-self.scm' procedure with a trivial build handler.
Previously, "TESTS=installed-os guix build -m etc/system-tests.scm"
would repeat the "Computing Guix derivation" phase ~5 times due to the
fact that there were several call paths, within a build-accumulator,
leading to (package-derivation store guix).

* guix/channels.scm (with-trivial-build-handler): New procedure.
(build-from-source): Wrap 'build' call in 'with-trivial-build-handler'.
2020-04-06 23:56:24 +02:00
Carl Dong b066c25026
gnu: Move PACKAGES-WITH-*PATCHES to (guix packages)
* gnu/packages/cross-base.scm (package-with-extra-patches,
package-with-patches): Move procedures from here...
* guix/packages.scm (package-with-extra-patches, package-with-patches):
...to here, and export.
2020-04-06 14:02:42 -04:00
Ludovic Courtès 376ba0ce57
store: 'with-store' uses 'with-exception-handler'.
This ensures the stack is not unwound before the exception is re-thrown,
as was the case since 8ed597f4a2, leading
to '&store-protocol-error' being uncaught by 'with-error-handling'
in (guix scripts build) & co.

* guix/store.scm (call-with-store): Define 'thunk'.  Add 'cond-expand'
to use 'with-exception-handler' on 'guile-3' and 'catch' otherwise.
2020-04-05 00:36:44 +02:00
Ludovic Courtès 8ed597f4a2
store: 'with-store' doesn't close the store upon abort.
Fixes <https://bugs.gnu.org/40428>.
Reported by Marius Bakke <mbakke@fastmail.com> and 白い熊.

Regression introduced with the first uses of 'with-build-handler' in
commit 62195b9a8f and subsequent.

* guix/store.scm (call-with-store): Use 'catch #t' instead of
'dynamic-wind'.  This ensures STORE remains open when a non-local exit
other than an exception occurs, such as an abort to the build handler
prompt.
* tests/store.scm ("with-build-handler + with-store"): New test.
2020-04-04 18:52:35 +02:00
Ludovic Courtès f7b5b8cd45
pack: Pass the cross-compilation target to 'run-with-store'.
This ensures '%current-target-system' is correctly bound upfront, which
some packages rely on.

* guix/scripts/pack.scm (guix-pack): Pass #:target to 'run-with-store'.
2020-04-03 23:06:43 +02:00
Ludovic Courtès 73bfb14f8f
guix system: Mention 'herd restart' when reconfigure completes.
* guix/scripts/system.scm (with-shepherd-error-handling): Use 'mbegin'
instead of 'begin'.
(perform-action): Print a message after 'upgrade-shepherd-services'.
That message had disappeared in commit
5c8c8c4554.
2020-04-03 12:58:14 +02:00
Ludovic Courtès 4efbb079b5
guix system: Remove unused procedure.
This procedure was unused since
5c8c8c4554.

* guix/scripts/system.scm (call-with-service-upgrade-info): Remove.
2020-04-03 12:58:14 +02:00
Ludovic Courtès 9fb3ff31c1
reconfigure: Silence Guile warnings.
Fixes <https://bugs.gnu.org/39301>.
Reported by strypsteen@posteo.net.

* guix/scripts/system/reconfigure.scm (switch-to-system)
(upgrade-shepherd-services, install-bootloader): Wrap 'primitive-load'
call in 'parameterize'.
2020-04-03 12:58:14 +02:00
Ludovic Courtès 00a1ebb84a
Revert "reconfigure: Run the effect scripts as separate processes."
This reverts commit 5517750344.
That commit would remove all sorts of error checking when running those
programs.
2020-04-03 12:58:14 +02:00
Ludovic Courtès 5517750344
reconfigure: Run the effect scripts as separate processes.
Fixes <https://bugs.gnu.org/39301>.
Reported by strypsteen@posteo.net.

* guix/scripts/system/reconfigure.scm (switch-to-system)
(upgrade-shepherd-services, install-bootloader): Use 'system*' instead
of 'primitive-load'.
2020-04-02 23:15:12 +02:00
Ludovic Courtès a6850f6827
guix system: Do not import the user's (guix config).
Previously, 'switch-to-system.drv' and 'install-bootloader.drv' would
depend on the user's (guix config) module.  This is no longer the case.

* guix/scripts/system/reconfigure.scm (not-config?): New procedure.
(switch-system-program): Do not import the user's (guix config).  Use
'make-config.scm' instead.
(install-bootloader-program): Likewise.
2020-04-02 23:15:11 +02:00
Ludovic Courtès efa578ecae
git: Don't try to resolve tags with 'tag-lookup'.
Fixes <https://bugs.gnu.org/40377>.
Reported by Brice Waegeneire <brice@waegenei.re>.

* guix/git.scm (switch-to-ref): In the 'tag case, remove call to
'tag-lookup'.
2020-04-02 23:15:11 +02:00
Ludovic Courtès 3b4d7cdccc
bournish: Prevent inlining of run-time support procedures.
On Guile 3, those procedures could be inlined, leading to
unbound-variable errors:

  scheme@(guile-user)> ,bournish
  Welcome to Bournish, a minimal Bourne-like shell!
  To switch back, type `,L scheme'.
  bournish@(guile-user)> ls
  ice-9/boot-9.scm:1669:16: In procedure raise-exception:
  Unbound variable: ls-command-implementation

Reported by Ricardo Wurmus.

* guix/build/bournish.scm (define-command-runtime): New macro.
(ls-command-implementation, wc-command-implementation)
(wc-l-command-implementation, wc-c-command-implementation): Use it
instead of 'define'.
2020-04-02 16:07:08 +02:00
Ludovic Courtès b34ead48dc
gexp: 'lower-references' uses 'mapm/accumulate-builds'.
* guix/gexp.scm (lower-references): Use 'mapm/accumulate-builds' instead
of 'mapm'.
2020-04-02 11:48:25 +02:00
Ludovic Courtès 2ad6eb0568
guix system: Use 'mapm/accumulate-builds'.
* guix/scripts/system.scm (perform-action): Use 'mapm/accumulate-builds'
instead of 'mapm'.
2020-04-02 11:48:24 +02:00
Ludovic Courtès 5c83dd1d64
ui: Clarify "dependencies changed".
Suggested by Leo Famulari <leo@famulari.name>.

* guix/ui.scm (show-manifest-transaction): Change to "dependencies or
package changed".
2020-04-02 11:48:24 +02:00
Ludovic Courtès 4b75a70600
grafts: Simplify access to store item references.
This is a followup to 710854304b.

This also slightly reduces the number of 'query-references' RPCs, for
instance from 176 to 166 from "guix build emacs -d".

* guix/grafts.scm (references-oracle): Remove.
(non-self-references): Remove 'references' parameter and add 'store'.
Add 'references*' procedure and use it instead of 'references'.  Adjust
caller accordingly.
(cumulative-grafts): Remove 'references' parameter and adjust caller
accordingly.
2020-04-02 00:06:26 +02:00
Arne Babenhauserheide ef4b5f2fed
profiles: Compute manual database entries in parallel.
This provides a 36% speedup on an SSD and 4 cores for the 1.5K man pages
in the manual database derivation of:

  guix environment --ad-hoc jupyter python-ipython python-ipykernel

* guix/profiles.scm (manual-database)[build]: Add 'print-string',
'print', and 'compute-entry'.  Change 'compute-entries' to call
'compute-entry' in 'n-par-map'.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2020-03-31 14:55:42 +02:00
Ludovic Courtès 2c33901fb1
ci: Fix 'evaluation-spec' binding.
* guix/ci.scm (<evaluation>)[spec]: Add "specification", which is what
the JSON field is actually called.
2020-03-31 14:55:42 +02:00
Ludovic Courtès a357849f5b
guix package: Do not misdiagnose upgrades when there are propagated inputs.
Fixes <https://bugs.gnu.org/35872>.
Reported by Andy Tai <atai@atai.org>.

* guix/profiles.scm (list=?, manifest-entry=?): New procedures.
* guix/scripts/package.scm (transaction-upgrade-entry): In the '=' case,
use 'manifest-entry=?' to determine whether it's an upgrade.
* tests/packages.scm ("transaction-upgrade-entry, zero upgrades,
propagated inputs"): New test.
2020-03-31 00:06:36 +02:00
Ludovic Courtès 1a9a373eb4
profiles: 'lower-manifest-entry' recurses on dependencies.
* guix/profiles.scm (lower-manifest-entry)[recurse]: New procedure.
Call it on dependencies and set the 'dependencies' field accordingly.
2020-03-31 00:06:36 +02:00
Ludovic Courtès a187cc5628
guix package: 'transaction-upgrade-entry' swallows build requests.
Fixes a regression introduced in
131f50cdc9 whereby the install/upgrade
message would not be displayed:

  $ guix upgrade -n
  2.1 MB would be downloaded:
     /gnu/store/…-something-1.2
     /gnu/store/…-its-dependency-2.3

This is because we'd directly abort from 'transaction-upgrade-entry' to
the build handler of 'build-notifier'.

* guix/scripts/package.scm (transaction-upgrade-entry): Call 'string=?'
expression in 'with-build-handler'.
* tests/packages.scm ("transaction-upgrade-entry, grafts"): New test.
2020-03-31 00:06:36 +02:00
Ludovic Courtès 190ddfe21e
guix package: 'transaction-upgrade-entry' uses 'lower-manifest-entry'.
* guix/profiles.scm (lower-manifest-entry): Export.
* guix/scripts/package.scm (transaction-upgrade-entry)[lower-manifest-entry*]
[upgrade]: New procedures.
Use 'lower-manifest-entry*' instead of 'package-derivation' to compute
the output file name of PKG.
2020-03-31 00:06:36 +02:00
Marius Bakke ae0badf5bb
Merge branch 'master' into core-updates
Conflicts:
	gnu/packages/admin.scm
	gnu/packages/commencement.scm
	gnu/packages/guile.scm
	gnu/packages/linux.scm
	gnu/packages/package-management.scm
	gnu/packages/pulseaudio.scm
	gnu/packages/web.scm
2020-03-30 12:17:33 +02:00
Ludovic Courtès 5a17b9b673
build-system/gnu: Optimize the package graph.
With this change, the output of:

  guix graph -e '(@@ (gnu packages commencement) coreutils-final)' |grep 'label = ' | wc -l

drops from 76 nodes to 68 nodes, and the "add-data-to-store-cache" hit
rate for:

  guix build libreoffice -d --no-grafts

drops from 3.9% to 2.6%.

* guix/build-system/gnu.scm (package-with-explicit-inputs*)[cut?]:
Adjust condition to exclude packages with build systems other than
GNU-BUILD-SYSTEM, such as 'ld-wrapper-boot3'.
2020-03-29 23:14:28 +02:00
Ludovic Courtès 9f78552996
packages: 'package->bag' keys cache by replacement.
* guix/packages.scm (package->bag): When GRAFT? is true, use PACKAGE's
replacement as the cache key.  Remove GRAFT? from the list of
secondary cache keys.
2020-03-29 23:14:28 +02:00
Ludovic Courtès 18c8a4396b
deploy: Use 'map/accumulate-builds'.
* guix/scripts/deploy.scm (guix-deploy): Use 'map/accumulate-builds'
instead of 'for-each'.
2020-03-29 23:14:27 +02:00
Ludovic Courtès d089b23335
deploy: Factorize machine deployment.
* guix/scripts/deploy.scm (deploy-machine*): New procedure.
(guix-deploy): Call it in 'for-each'.
2020-03-29 23:14:27 +02:00
Ludovic Courtès 033df23680
packages: Change 'guile-for-grafts' back to 2.0.
This reverts 2b6fe60599, due to reports of
segfaults of Guile 3.0.2 during grafting.

* guix/packages.scm (guile-for-grafts): Change back to GUILE-2.0.
2020-03-29 15:35:47 +02:00
Ludovic Courtès 131f50cdc9
'--dry-run' no longer implies '--no-grafts'.
* guix/scripts/archive.scm (%options): "dry-run" option no longer adds
'graft? #f to RESULT.
* guix/scripts/environment.scm (%options): Likewise.
* guix/scripts/pack.scm (%options): Likewise.
* guix/scripts/package.scm (%options): Likewise.
* guix/scripts/pull.scm (%options): Likewise.
* guix/scripts/system.scm (%options): Likewise.
2020-03-29 15:32:18 +02:00
Ludovic Courtès 710854304b
grafts: Don't rely on substitute info for missing store items.
Fixes <https://bugs.gnu.org/22990>.

* guix/grafts.scm (references-oracle)[references*]: Remove call to
'substitution-oracle' and to 'references/substitutes'.  Use
'references/cached' and 'build-derivations' right away instead.
2020-03-29 15:32:17 +02:00
Ludovic Courtès c70cf1a724
store: Add 'references/cached'.
* guix/store.scm (references/cached): New procedure.
2020-03-29 15:32:17 +02:00
Ludovic Courtès 25af35fa32
profiles: Use 'mapm/accumulate-builds'.
* guix/profiles.scm (check-for-collisions): Use 'mapm/accumulate-builds'
to lower manifest entries.  Call 'foldm' over the already-lowered entries.
(profile-derivation): Use 'mapm/accumulate-builds' instead of 'mapm'
when calling HOOKS.
2020-03-29 15:32:17 +02:00
Ludovic Courtès 584dfdac37
gexp: 'lower-inputs' uses 'mapm/accumulate-builds'.
This doesn't have an noticeable impact on the run time of
'guix system build desktop.tmp --no-grafts -d'.

* guix/gexp.scm (lower-inputs): Use 'mapm/accumulate-builds' instead of 'mapm'.
2020-03-29 15:32:17 +02:00
Ludovic Courtès 1213ea9bd9
guix build: Use 'map/accumulate-builds'.
* guix/scripts/build.scm (options->derivations): Use
'map/accumulate-builds' instead of 'append-map'.
2020-03-29 15:32:17 +02:00
Ludovic Courtès c40bf5816c
store: Add 'map/accumulate-builds'.
* guix/store.scm (<unresolved>): New record type.
(build-accumulator, map/accumulate-builds, mapm/accumulate-builds): New
procedures.
* tests/store.scm ("map/accumulate-builds", "mapm/accumulate-builds"):
New tests.
2020-03-29 15:32:17 +02:00
Jakub Kądziołka 44fb8cf841
Merge branch 'master' into staging 2020-03-29 00:38:13 +01:00
Marius Bakke 388b432cea
deploy: Remove use of '~*' in format string.
...since 'msgfmt' fails to interpret it.  Reported by Vagrant Cascadian
in <https://lists.gnu.org/archive/html/guix-devel/2020-03/msg00340.html>.
See also <https://bugs.gnu.org/37505>.

* guix/scripts/deploy.scm (show-what-to-deploy): Use ~d instead of ~* when
displaying machines that will be deployed.
2020-03-28 15:55:13 +01:00
Ludovic Courtès 2b6fe60599
packages: Use Guile 3.0 for grafts.
* guix/packages.scm (guile-2.0): Rename to...
(guile-for-grafts): ... this, and adjust callers.  Refer to 'guile-3.0'
instead of 'guile-2.0'.
2020-03-27 19:09:30 +01:00
Marius Bakke 18af687037
Merge branch 'master' into core-updates
Conflicts:
	gnu/packages/icu4c.scm
	gnu/packages/man.scm
	gnu/packages/python-xyz.scm
	guix/scripts/environment.scm
	guix/scripts/pack.scm
	guix/scripts/package.scm
	guix/scripts/pull.scm
	guix/store.scm
2020-03-27 00:12:15 +01:00
Ludovic Courtès 260eae7893
status: Display synthetic information about profiles being built.
* guix/status.scm (print-build-event): Add 'profile case.
* guix/scripts/package.scm (build-and-use-profile): Remove now redundant
message.
2020-03-26 13:07:19 +01:00
Ludovic Courtès e7570ec2da
profiles: 'profile-derivation' sets a 'type' property.
* guix/profiles.scm (profile-derivation): Pass #:properties to
'gexp->derivation'.
2020-03-26 13:07:19 +01:00
Efraim Flashner 6741f543e6
gnu: bootstrap: Add support for the Hurd.
On 3342a1182b
   gnu: make-bootstrap: Use _IOLBF on Guile 2.0 only.

Run
    ./pre-inst-env guix build --target=i586-pc-gnu bootstrap-tarballs --verbosity=1

Producing

    /gnu/store/lhca65c997pvic5cfrpm0dasniwqlg2a-bootstrap-tarballs-0

With guix hash -rx /gnu/store/lhca65c997pvic5cfrpm0dasniwqlg2a-bootstrap-tarballs-0

    07jnq2by98f2a45k8wd2gj62iazvwfa4z7p3w3id4m1g0fdsvc3b

* gnu/packages/bootstrap.scm (%bootstrap-executables): Add entries for the
Hurd.
(bootstrap-executable-url): Use lilypond url for the Hurd.
(bootstrap-guile-url-path): Likewise.
(bootstrap-guile-hash): Add entry for the Hurd.
(%bootstrap-coreutils&co): Likewise.
(%bootstrap-binutils): Likewise.
(%bootstrap-glibc): Likewise.
(%bootstrap-gcc): Likewise.
* guix/packages.scm (%supported-systems): Add i586-gnu.

Co-authored-by: Jan Nieuwenhuizen <janneke@gnu.org>
2020-03-26 12:58:51 +01:00
Ricardo Wurmus 9e17989017
import/cran: Import missing module.
This is a follow-up to commit b005c240bb.

Reported-by: Ludovic Courtès <ludo@gnu.org>

* guix/import/cran.scm: Import (guix ui) module.
2020-03-25 16:28:57 +01:00
Ludovic Courtès c74f19d758
environment: Use 'with-build-handler'.
* guix/scripts/environment.scm (build-environment): Remove.
(guix-environment): Wrap 'with-status-verbosity' in
'with-build-handler'.  Remove 'dry-run?' conditional.  Use
'built-derivations' instead of 'build-environment'.
2020-03-25 16:02:53 +01:00
Ludovic Courtès 2d5ee2c6e8
archive: Use 'with-build-handler'.
* guix/scripts/archive.scm (export-from-store): Remove call to
'show-what-to-build' and dry-run? condition.
(guix-archive): Wrap 'cond' in 'with-build-handler'.
2020-03-25 16:02:53 +01:00
Ricardo Wurmus b005c240bb
import/cran: Support importing from Mercurial repositories.
* guix/import/cran.scm (download): Accept keyword #:method; add case for hg
method.
(fetch-description): Handle hg repository.
(description->package): Add cases for hg repositories and update call of
DOWNLOAD procedure.
(cran->guix-package): Retry importing from Bioconductor when hg import failed.
2020-03-25 09:40:05 +01:00
Christopher Baines 57e12aad6d
scripts: lint: Handle store connections for lint checkers.
Rather than individual checkers opening up a connection to the store for each
package to check, if any checker requires a store connection, open a
connection and pass it to all checkers that would use it. This makes running
the derivation checker much faster for multiple packages.

* guix/scripts/lint.scm (run-checkers): Add a #:store argument, and pass the
store to checkers if they require a store connection.
(guix-lint): Establish a store connection if any checker requires one, and
pass it through to run-checkers.
2020-03-24 19:47:46 +00:00
Christopher Baines 7826fbc02b
lint: Add a #:store argument to check-derivation
This can then be used to avoid opening up a store connection each time a
package needs checking.

* guix/lint.scm (check-derivation): Add a #:store argument, and pull the
handling of the store connection out of the try function.
2020-03-24 19:47:46 +00:00
Christopher Baines d84ad6a24e
lint: Mark the derivation checker as requiring a store connection.
* guix/lint.scm (%local-checkers): Mark the derivation checker as requiring a
store connection.
2020-03-24 19:47:46 +00:00
Christopher Baines 3874dc5ef2
lint: Add a requires-store? field to the checker record.
This can then be used to mark checkers that require a store connection, which
will enable passing a connection in, avoiding the overhead of establishing a
connection inside the check function when it's run for lots of different
packages.

* guix/lint.scm (<lint-checker>): Add requires-store? to the record type.
2020-03-24 19:47:43 +00:00
Ludovic Courtès 637db76d7a
guix system: Fix mistaken 'guix pull' warning upon 'reconfigure'.
Fixes <https://bugs.gnu.org/38196>.
Reported by Florian Pelz <pelzflorian@pelzflorian.de>.

* guix/scripts/system.scm (maybe-suggest-running-guix-pull): Check
whether 'current-profile' returns true instead of checking for the
existence of ~root/.config/guix/current.  That way, "sudo guix system
reconfigure" no longer emits a warning in that case.
2020-03-24 18:54:41 +01:00
Ludovic Courtès 53c594cb3f
pack: Do not store extended attributes in squashfs images.
* guix/scripts/pack.scm (squashfs-image)[build](mksquashfs): Pass "-no-xattrs".
2020-03-24 16:56:19 +01:00
Ludovic Courtès 8465f1f680
ui: 'show-manifest-transaction' tabulates package lists for install/remove.
It also removes the store file name from the output.

* guix/ui.scm (show-manifest-transaction)[package-strings]: Rewrite to
use 'tabulate'.  Remove 'item' parameter and adjust callers.
2020-03-24 15:44:45 +01:00
Ludovic Courtès 3e5ab0a7a9
ui: 'show-manifest-transaction' tabulates upgraded package lists.
This also changes "1.0.0 → 1.0.0" to "(dependencies changed)", which is
probably less confusing.

* guix/ui.scm (tabulate): New procedure.
(show-manifest-transaction)[upgrade-string]: Rewrite to take lists of
names, versions, and outputs instead of single elements.  Use
'tabulate'.  Adjust callers accordingly.
2020-03-24 15:44:45 +01:00
Martin Becze cf2b91aad0
import: crate: Deduplicate dependencies.
* guix/import/crate.scm (crate-version-dependencies): Deduplicate crate dependencies.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2020-03-24 15:44:45 +01:00
Arun Isaac d13d28265f
licenses: Add QWT 1.0 license.
* guix/licenses.scm (qwt1.0): New variable.

Signed-off-by: Guillaume Le Vaillant <glv@posteo.net>
2020-03-24 11:42:41 +01:00
Arun Isaac 5d33e789c2
licenses: Add Open Government Licence for Public Sector Information.
* guix/licenses.scm (ogl-psi1.0): New variable.

Signed-off-by: Guillaume Le Vaillant <glv@posteo.net>
2020-03-24 11:42:40 +01:00
Jakub Kądziołka 927c251846
cargo-build-system: Accept a #:features argument
* guix/build/cargo-build-system.scm (build, install): Pass the features
  to cargo.
  (check): Remove indirection layer for consistency with build and
  install.
* guix/build-system/cargo.scm (cargo-build): New argument; pass it into
  the builder.
* gnu/packages/rust-apps.scm (ripgrep): Use the new argument instead of
  a custom phase.
2020-03-23 19:30:38 +01:00
Ludovic Courtès 1292372725
deploy: Write a message upon successful deployment.
* guix/scripts/deploy.scm (guix-deploy): Write message upon successful
deployment.
2020-03-23 10:48:17 +01:00
Ludovic Courtès 1bb248d0b1
deploy: Show what machines will be deployed.
* guix/scripts/deploy.scm (show-what-to-deploy): New procedure.
(guix-deploy): Call it.
2020-03-23 10:48:17 +01:00
Ludovic Courtès 7b322d3c4c
ui: Add 'indented-string'.
* guix/scripts/pull.scm (display-news-entry): Remove extra space in
format string for 'indented-string'.
(indented-string): Remove.
(display-new/upgraded-packages)[pretty]: Pass #:initial-indent? to
'indented-string'.
* guix/ui.scm (indented-string): New procedure.
2020-03-23 10:48:17 +01:00
Ludovic Courtès 8f53d73493
ssh: 'send-files' reports missing modules on the remote host.
Reported by Mikael Djurfeldt <mikael@djurfeldt.com>
in <https://bugs.gnu.org/40125>.

* guix/ssh.scm (send-files)[inferior-remote-eval*]: New procedure.
[missing]: Use it.  Add an explicit 'resolve-module' call.
(report-inferior-exception): New procedure.
2020-03-23 10:48:17 +01:00
Maxim Cournoyer afc6b1c0b6
build: emacs-utils: Add an option to select scoping for batch eval.
In Emacs 27, --eval now evaluates using lexical scoping.  This change adds an
option to select dynamic scoping, by using a workaround proposed in
<https://bugs.gnu.org/39823>.

* guix/build/emacs-utils.scm (emacs-batch-eval): Add a DYNAMIC? keyword
argument.  Wrap the EXPR with a call to EVAL that makes use of the argument
to select the scoping mode.
(emacs-generate-autoloads): Use it.
2020-03-22 21:17:38 -04:00
Ludovic Courtès 9acacb71c9
Remove workaround for 'time-monotonic' in Guile 2.2.2.
This is a followup to e688c2df39.

* build-aux/hydra/evaluate.scm <top level>: Remove 'time-monotonic'
definition.
* guix/cache.scm: Likewise.
* guix/progress.scm: Likewise.
* guix/scripts/substitute.scm: Likewise.
* guix/scripts/weather.scm: Likewise.
* tests/cache.scm: Likewise.
2020-03-22 16:49:47 +01:00
Mathieu Othacehe c086c5af1c
build-system: linux-module: Fix cross compilation.
* guix/build-system/linux-module.scm (default-kmod, default-gcc): Delete
procedures.
(system->arch): New procedure.
(make-linux-module-builder)[native-inputs]: Move linux...
[inputs]: ...to here.
(linux-module-build-cross): New procedure.
(linux-module-build): Add TARGET.  Pass TARGET and ARCH to build side.
(lower): Allow cross-compilation.  Move "linux" and "linux-module-builder"
to host-inputs.  Add target-inputs.  Call linux-module-build-cross if
TARGET is set, linux-module-build otherwise.
* guix/build/linux-module-build-system.scm (configure): Add ARCH argument.
(linux-module-build): Adjust comment.

Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org>
2020-03-22 13:20:07 +01:00
Danny Milosavljevic 5c79f23863
system: Add kernel-loadable-modules to operating-system.
* gnu/system.scm (<operating-system>): Add kernel-loadable-modules.
(operating-system-directory-base-entries): Use it.
* doc/guix.texi (operating-system Reference): Document
KERNEL-LOADABLE-MODULES.
* gnu/build/linux-modules.scm (depmod): New procedure.
(make-linux-module-directory): New procedure.  Export it.
* guix/profiles.scm (linux-module-database): New procedure.  Export it.
* gnu/tests/linux-modules.scm: New file.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
* gnu/packages/linux.scm (make-linux-libre*)[arguments]<#:phases>[install]:
Disable depmod.  Remove "build" and "source" symlinks.
[native-inputs]: Remove kmod.
2020-03-22 12:51:50 +01:00
Ludovic Courtès 91601790d0
packages: 'package-field-location' handles missing source properties.
This is a followup to f2b24f01f4.

* guix/packages.scm (package-field-location): Check whether
'source-properties->location' returns #f.  This fixes the case where
'source-properties' returns the empty list.
2020-03-22 12:42:52 +01:00
Ludovic Courtès 3e6f65be7a
copy: Use 'with-build-handler'.
* guix/scripts/copy.scm (send-to-remote-host): Remove explicit
'show-what-to-build' call.  Call 'build-derivations' unconditionally.
(guix-copy): Wrap 'with-status-verbosity' in 'with-build-handler'.
2020-03-22 12:42:52 +01:00
Ludovic Courtès 81c0b52bd6
copy: Actually implement '--dry-run'.
* guix/scripts/copy.scm (%options): Add '--dry-run'.
2020-03-22 12:42:52 +01:00
Ludovic Courtès 7473238f7d
copy: Factorize 'with-store' & co.
* guix/scripts/copy.scm (send-to-remote-host): Remove 'with-store' and
'set-build-options-from-command-line' call.  Add 'local' parameter.
(retrieve-from-remote-host): Likewise.
(guix-copy): Wrap 'with-status-verbosity' in 'with-store' and add call
to 'set-build-options-from-command-line'.
2020-03-22 12:42:52 +01:00
Ludovic Courtès 9b771305df
ui: 'build-notifier' invokes continuation when there's nothing to do.
* guix/ui.scm (build-notifier): Call CONTINUE when there's nothing to
build or download, even when DRY-RUN? is true.
2020-03-22 12:42:52 +01:00
Ludovic Courtès 883a1765a6
ui: 'show-what-to-build' returns two values, for builds and downloads.
* guix/ui.scm (show-what-to-build): Return two values.
2020-03-22 12:42:52 +01:00
Ludovic Courtès bec3474107
ui: 'show-what-to-build' returns true when there are grafts to build.
* guix/ui.scm (show-what-to-build): Distinguish between 'build/full' and
'build'.  Return true whe 'build/full' is non-empty, thus taking grafts
into account.
2020-03-22 12:42:52 +01:00
Ludovic Courtès a0f480d623
guix system: Use 'with-build-handler'.
* guix/scripts/system.scm (reinstall-bootloader): Remove call to
'show-what-to-build*'.
(perform-action): Call 'build-derivations' instead of 'maybe-build'.
(process-action): Wrap 'run-with-store' in 'with-build-handler'.
2020-03-22 12:42:51 +01:00
Ludovic Courtès 65ffb9388c
guix package, pull: Use 'with-build-handler'.
* guix/scripts/package.scm (build-and-use-profile): Remove #:dry-run?
and #:use-substitutes?.  Remove call to 'show-what-to-build' and
'dry-run?' special case.
(process-actions): Adjust accordingly.
(guix-package*): Wrap 'parameterize' in 'with-build-handler'.
* guix/scripts/pull.scm (build-and-install): Remove #:use-substitutes?
and #:dry-run? and adjust 'update-profile' call accordingly.  Remove
'dry-run?' conditional.
(guix-pull): Wrap body in 'with-build-handler'.
2020-03-22 12:42:51 +01:00
Ludovic Courtès 5f5e9a5cd6
pack: Use 'with-build-handler'.
* guix/scripts/pack.scm (guix-pack): Wrap 'parameterize' in
'with-build-handler'.  Remove explicit call to 'show-what-to-build'.
Call 'build-derivations' regardless of whether OPTS contains 'dry-run?'.
2020-03-22 12:42:51 +01:00
Ludovic Courtès bdda46a67d
deploy: Use 'with-build-handler'.
Until now, 'guix deploy' would never display what is going to be built.

* guix/scripts/deploy.scm (guix-deploy): Wrap 'for-each' in
'with-build-handler'.
2020-03-22 12:42:51 +01:00
Ludovic Courtès 62195b9a8f
guix build: Use 'with-build-handler'.
Fixes <https://bugs.gnu.org/28310>.
Reported by Andreas Enge <andreas@enge.fr>.

* guix/scripts/build.scm (guix-build): Wrap 'parameterize' in
'with-build-handler'.  Remove explicit call to 'show-what-to-build'.
Call 'build-derivations' regardless of whether OPTS contains 'dry-run?'.
2020-03-22 12:42:51 +01:00
Ludovic Courtès 07ce23e011
ui: Add a notification build handler.
* guix/ui.scm (build-notifier): New variable.
2020-03-22 12:42:51 +01:00
Ludovic Courtès 041b340da4
store: Add 'with-build-handler'.
* guix/store.scm (current-build-prompt): New variable.
(call-with-build-handler, invoke-build-handler): New procedures.
(with-build-handler): New macro.
* tests/store.scm ("with-build-handler"): New test.
2020-03-22 12:42:51 +01:00
Ludovic Courtès 9a067fe7ee
syscalls: 'with-file-lock' re-grabs lock when reentering its dynamic extent.
* guix/build/syscalls.scm (call-with-file-lock)
(call-with-file-lock/no-wait): Initialize PORT in the 'dynamic-wind'
"in" handler.  This allows us to re-enter a captured continuation and
have the lock grabbed anew.
2020-03-22 12:42:51 +01:00
Ludovic Courtès 4a6ec23a97
download: Delete the output file upon failure.
This allows ENOSPC conditions to be properly reported as such rather
than as a hash mismatch due to the availability of a truncated file.

Fixes <https://bugs.gnu.org/39993>.
Reported by Maxim Cournoyer <maxim.cournoyer@gmail.com>.

* guix/build/download.scm (url-fetch): In the failure case, delete FILE.
2020-03-22 00:02:23 +01:00
Marius Bakke d19b14c834
Merge branch 'master' into core-updates 2020-03-21 22:16:02 +01:00
Ludovic Courtès f2b24f01f4
packages: 'package-field-location' preserves the original file name.
Fixes <https://bugs.gnu.org/39425>.
Reported by Alex ter Weele <alex.ter.weele@gmail.com>.

* guix/packages.scm (package-field-location): Remove 'with-fluids' for
'%file-port-name-canonicalization'.  Change the 'file' field of the
resulting location to FILE.
2020-03-20 23:59:31 +01:00
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
Marius Bakke c4d769d359
Merge branch 'master' into core-updates 2020-03-18 19:41:08 +01:00
Ludovic Courtès 39569dbb5f
profiles: 'profile-derivation' uses _IOLBF on Guile 2.0 only.
* guix/profiles.scm (profile-derivation)[builder]: Use _IOLBF on Guile
2.0 only.
2020-03-17 16:10:58 +01:00
Ludovic Courtès b03753d8cc
tests: Fix compilation of 'gnu-make-for-tests'.
* guix/tests.scm (gnu-make-for-tests)[arguments]: Pass
"--disable-dependency-tracking" to #:configure-flags.
2020-03-17 15:49:06 +01:00
Ludovic Courtès d8e98e853c
scripts: Refer to (default-guile) instead of 'guile-2.2'.
This is a followup to b6bee63bed.

* guix/scripts/environment.scm (guix-environment): Use (default-guile)
instead of (canonical-package guile-2.2) when parameterizing
'%guile-for-build'.
* guix/scripts/pack.scm (guix-pack): Likewise.
* guix/scripts/package.scm (guix-package*): Likewise.
* guix/scripts/pull.scm (guix-pull): Likewise.
2020-03-17 15:36:58 +01:00
Ludovic Courtès 2bc1a400ae
gexp: Change default Guile effective version to 3.0.
This is a followup to b6bee63bed.

* guix/gexp.scm (lower-gexp, gexp->derivation): #:effective-version
defaults to "3.0".
2020-03-17 15:32:36 +01:00
Ludovic Courtès b6bee63bed
gnu: Default to Guile 3.0.
This patch changes three things:

  1. package derivations are built using Guile 3.0;

  2. 'gexp->derivation' defaults to Guile 3.0;

  3. "guile3.0-" packages are deprecated aliases for the regular
     package, which now depends on Guile 3.0; "guile2.2-" packages are
     introduced; "guile-next" is renamed to "guile".

* gnu/packages/guile.scm (guile-2.0/fixed): Remove.
(guile-3.0/fixed): New variable.
(package-for-guile-3.0): Remove.
(package-for-guile-2.2): New variable.
(define-deprecated-guile3.0-package): New macro.
(guile-3.0)[name]: Change to "guile".
(guile-json-3)[native-inputs, inputs]: New fields.
(guile2.2-json): New variable.
(guile3.0-json): Deprecate.
(guile-gdbm-ffi)[native-inputs]: Switch to GUILE-3.0.
(guile2.2-gdbm-ffi): New variable.
(guile3.0-gdbm-ffi): Deprecate.
(guile-sqlite3): Switch to GUILE-3.0.
(guile2.2-sqlite3): New variable.
(guile3.0-sqlite3): Deprecate.
(guile-bytestructures): Switch to GUILE-3.0.
(guile2.2-bytestructures): New variable.
(guile3.0-bytestructures): Deprecate.
(guile-git): Switch to GUILE-3.0.
(guile2.2-git): New variable.
(guile3.0-git): Deprecate.
(guile-2.2/bug-fix):
* gnu/packages/ci.scm (cuirass): Switch to GUILE-3.0.
* gnu/packages/emacs-xyz.scm (emacs-guix): Switch to GUILE-3.0.
* gnu/packages/gtk.scm (guile-cairo)[arguments]: New field.
Switch to GUILE-3.0.
(guile2.2-cairo): New variable.
(guile3.0-cairo): Deprecate.
(guile-rsvg): Switch to GUILE-3.0.
(guile2.2-cairo): New variable.
(guile3.0-cairo): Deprecate.
(guile-present): Switch to GUILE-3.0.
(guile2.2-present): New variable.
(guile3.0-present): Deprecate.
(guile-gnome)[propagated-inputs]: Use GUILE2.2-CAIRO and GUILE2.2-LIB.
* gnu/packages/guile-xyz.scm (guile-fibers)[arguments]: Add #:configure-flags.
Switch to GUILE-3.0.
(guile2.2-fibers): New variable.
(guile3.0-fibers): Deprecate.
(guile-syntax-highlight): Switch to GUILE-3.0.
(guile2.2-syntax-highlight): New variable.
(guile3.0-syntax-highlight): Deprecate.
(guile-colorized): Switch to GUILE-3.0.
(guile2.2-colorized): New variable.
(guile3.0-colorized): Deprecate.
(guile-pfds): Switch to GUILE-3.0.
(guile2.2-pfds): New variable.
(guile3.0-pfds): Deprecate.
(guile-simple-zmq): Switch to GUILE-3.0.
(guile2.2-simple-zmq): New variable.
(guile3.0-simple-zmq): Deprecate.
(guile-newt): Switch to GUILE-3.0.
(guile2.2-newt): New variable.
(guile3.0-newt): Deprecate.
(guile-parted): Switch to GUILE-3.0.
(guile2.2-parted): New variable.
(guile3.0-parted): Deprecate.
(guile-config): Switch to GUILE-3.0.
(guile2.2-config): New variable.
(guile3.0-config): Deprecate.
(guile-hall): Switch to GUILE-3.0.
(guile2.2-hall): New variable.
(guile3.0-hall): Deprecate.
(guile-ics): Switch to GUILE-3.0.
(guile2.2-ics): New variable.
(guile3.0-ics): Deprecate.
(guile-wisp)[arguments]: Add 'support-guile-3.0' phase.
Switch to GUILE-3.0.
(guile2.2-wisp): New variable.
(guile3.0-wisp): Deprecate.
(guile-lib): Switch to GUILE-3.0.
(guile2.2-lib): New variable.
(guile3.0-lib): Deprecate.
(guile-minikanren): Switch to GUILE-3.0.
(guile2.2-minikanren): New variable.
(guile3.0-minikanren): Deprecate.
(guile-irregex): Switch to GUILE-3.0.
(guile2.2-irregex): New variable.
(guile3.0-irregex): Deprecate.
(haunt): Switch to GUILE-3.0, and remove GUILE-READER.
(guile2.2-haunt): New variable.
(guile3.0-haunt): Deprecate.
(guile-commonmark): Switch to GUILE-3.0.
(guile2.2-commonmark): New variable.
(guile3.0-commonmark): Deprecate.
(mcron): Switch to GUILE-3.0.
(guile2.0-mcron): New variable.
(guile3.0-mcron): Deprecate.
(guile-picture-language): Switch to GUILE-3.0.
(guile2.2-picture-language): New variable.
(guile3.0-picture-language): Deprecate.
(guile-gi): Switch to GUILE-3.0.
(guile2.2-gi): New variable.
(guile3.0-gi): Deprecate.
(guile-hashing): Switch to GUILE-3.0.
(guile2.2-hashing): New variable.
(guile3.0-hashing): Deprecate.
* gnu/packages/package-management.scm (guix): Switch to GUILE-3.0.
(guile2.2-guix): New variable.
(guile3.0-guix): Deprecate.
(gwl): Replace "guile3.0-" with "guile-".
(guix-jupyter)[source]: Adjust for Guile 3.0.
Switch to GUILE-3.0.
* gnu/packages/ssh.scm (guile-ssh): Switch to GUILE-3.0.
(guile2.2-ssh): New variable.
(guile3.0-ssh): Deprecate.
* gnu/packages/admin.scm (shepherd): Switch to GUILE-3.0.
(guile2.2-shepherd): New variable.
(guile3.0-shepherd): Deprecate.
* gnu/packages/mail.scm (mailutils): Switch to GUILE-3.0.
(guile2.2-mailutils): New variable.
(guile3.0-mailutils): Deprecate.
* gnu/packages/plotutils.scm (guile-charting): Switch to GUILE-3.0.
(guile2.2-charting): New variable.
(guile3.0-charting): Deprecate.
* gnu/packages/version-control.scm (libgit2): Switch to GUILE-3.0.
* gnu/packages/vpn.scm (vpnc-scripts): Switch to GUILE-3.0.
* gnu/packages/web.scm (guix-data-service): Switch to GUILE-3.0.
(hpcguix-web): Switch to GUILE-3.0.
* guix/self.scm (specification->package): Refer to the "guile-" variants
instead of "guile3.0-".
* guix/gexp.scm (default-guile): Change to GUILE-3.0.
* build-aux/build-self.scm (build): #:guile-version defaults to "3.0".
* gnu/packages/commencement.scm (guile-final): Base on GUILE-3.0/FIXED.
2020-03-16 15:44:02 +01:00
Marius Bakke 961d2ee269
Merge branch 'master' into core-updates 2020-03-14 13:13:40 +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
Marius Bakke 50b99c90c8
Merge branch 'master' into core-updates 2020-03-10 20:50:02 +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
Mathieu Othacehe a6bf7a9745
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-06 10:16:51 +01:00
Mathieu Othacehe fdae0fa50a
store: Add set-current-target procedure.
* guix/store.scm (set-current-target): New exported procedure.
2020-03-06 10:16:31 +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
Marius Bakke ebb7cf9e21
Merge branch 'master' into core-updates 2020-03-04 23:16:17 +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
Pierre Neidhardt e90e64049c
build-system: Add copy-build-system.
* guix/build-system/copy.scm: New file.
* guix/build/copy-build-system.scm: New file.
* Makefile.am (MODULES): Add them.
* doc/guix.texi (Build Systems): Document 'copy-build-system'.
2020-02-21 10:53:11 +01:00
Lars-Dominik Braun 35f3511167
ssh: Add Kerberos-support to ssh:// daemon URLs
* guix/ssh.scm (open-ssh-session): Fall back to GSSAPI if public key
authentication does not work

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2020-02-20 11:14:44 +01:00
Maxim Cournoyer adbdf188c2
scripts: system: Do not validate network file systems.
Fixes <https://bugs.gnu.org/39551>.

* guix/scripts/system.scm (check-file-system-availability): Ignore file
systems of the NFS type.
2020-02-18 12:20:17 -05:00
Timothy Sample 9c9407f746
Add (guix build gnu-bootstrap).
* guix/build/gnu-bootstrap.scm: New file.
* Makefile.am (MODULES): Add it.
2020-02-17 23:21:04 +01:00
Danny Milosavljevic 88f8549449
utils: Change 'patch-shebang' to not try to patch Rust source files.
* guix/build/utils.scm (patch-shebang): Match only absolute paths.
2020-02-17 16:52:55 +01:00
Efraim Flashner 1b2b7765a0
build: gnu-build-system: Adjust NOCONFIGURE variable.
This ia a follow-up to 481a0f1a7c.

* guix/build/gnu-build-system.scm (bootstrap): Set NOCONFIGURE for all
bootstrap scripts. Clean up variable after use.
2020-02-16 18:45:37 +02:00
Brendan Tildesley a21bd6d5c2
build-system/gnu: Don't try executing directories in bootstrap phase.
* guix/build/gnu-build-system.scm: (bootstrap): Change the file-exists?
procedure to one that excludes directories, so that we do not mistake it for a
script. For example if the source includes a bootstrap/ directory.

Signed-off-by: Marius Bakke <mbakke@fastmail.com>
2020-02-16 15:48:37 +01:00
Efraim Flashner 481a0f1a7c
build: gnu-build-system: Don't run configure during bootstrap.
* guix/build/gnu-build-system.scm (bootstrap): Add NOCONFIGURE
environment variable before running bootstrap scripts.
2020-02-16 09:05:32 +02:00
Marius Bakke 7edafc884c
Merge branch 'master' into core-updates 2020-02-14 19:05:45 +01:00
Marius Bakke 11415d3506
guix build: Add '--manifest' option.
* guix/scripts/build.scm (show-help): Document --manifest argument.
(options->things-to-build): When given a manifest, evaluate all the entries.
* tests/guix-build.sh: Add test for --manifest.
* doc/guix.texi (Additional Build Options): Mention --manifest.
* etc/completion/bash/guix: Complete file name if 'guix build' argument is
-m.
2020-02-14 17:49:26 +01:00
Ludovic Courtès 89da127035
gnu: cross-base: Switch back to 'CROSS_C_INCLUDE_PATH' & co.
This is a followup to 2073b55e6b.

* gnu/build/cross-toolchain.scm (%gcc-include-paths): Switch back to
'C_INCLUDE_PATH' & co.
* gnu/packages/cross-base.scm (%gcc-include-paths): Likewise.
(cross-gcc-arguments): Remove 'treat-glibc-as-system-header' phase.
(cross-gcc)[native-inputs]: Reorder so that libc comes last.
[search-paths]: Add "include/c++" for 'CROSS_CPLUS_INCLUDE_PATH'.
* guix/build-system/gnu.scm (standard-cross-packages): Have "cross-gcc"
appear both for 'host and 'target.
2020-02-12 20:35:43 +01:00
Jack Hill 46c5c917ba
build: go-build-system: Disable Go module support.
This allows for upgrading the Go compiler without overhauling
go-build-system first.

* guix/build/go-build-system.scm (setup-go-environment): Set GO111MODULE to
off.

Signed-off-by: Alex Griffin <a@ajgrf.com>
2020-02-11 16:52:17 -06:00
Ludovic Courtès a65ffbea50
ui: Fix typo in comment.
Reported by Vincent Legoll <vincent.legoll@gmail.com>.

* guix/ui.scm (call-with-error-handling): Remove "come" in comment.
2020-02-11 17:42:10 +01:00
Ludovic Courtès 1d88470e10
describe: Remove dependency on (guix scripts pull).
Until now, 'guix describe' would perform ~3K stat calls and ~1K openat
calls because it was pulling (guix scripts pull), which in turn pulls in
many (gnu packages …) modules.

* guix/scripts/pull.scm (display-profile-content, %vcs-web-views)
(channel-commit-hyperlink): Move to...
* guix/scripts/describe.scm: ... here.  Remove import of (guix scripts
pull).
2020-02-11 12:33:35 +01:00
Ludovic Courtès 3d2f29382d
swh: Remove 'id' field from <origin>.
The "id" field has been removed upstream:

  https://sympa.inria.fr/sympa/arc/swh-devel/2020-02/msg00005.html

* guix/swh.scm (<origin>)[id]: Remove.
2020-02-11 12:33:35 +01:00
Ludovic Courtès a063bac618
git: Add missing exports for <git-checkout>.
* guix/git.scm (<git-checkout>): Export 'git-checkout-commit' and
'git-checkout-recursive?'.
2020-02-10 23:31:58 +01:00
Marius Bakke 2cbccf7f65
Merge branch 'staging' 2020-02-10 20:11:26 +01:00
Tobias Geerinckx-Rice e813444287
Update e-mail address for Jakob L. Kreuze.
As requested here:
<https://lists.gnu.org/archive/html/guix-devel/2020-02/msg00128.html>.

* .mailmap: Add an entry for Jakob.
* gnu/machine.scm, gnu/machine/digital-ocean.scm, gnu/machine/ssh.scm,
gnu/packages/admin.scm, gnu/packages/i2p.scm, gnu/packages/music.scm,
gnu/packages/web.scm, gnu/tests/reconfigure.scm, guix/scripts/deploy.scm,
guix/scripts/system/reconfigure.scm: Update their e-mail address.
2020-02-09 23:16:45 +01:00
Ludovic Courtès 2073b55e6b
gnu: gcc: Switch back to using 'C_INCLUDE_PATH' instead of 'CPATH'.
Fixes <https://bugs.gnu.org/30756>.
Initially reported by Julien Lepiller <julien@lepiller.eu>.

* gnu/packages/base.scm (make-gcc-libc): Remove
'treat-glibc-as-system-header' phase from 'arguments'.
* gnu/packages/commencement.scm (gcc-final): Likewise.
* gnu/packages/gcc.scm (gcc-4.7)[arguments]: Add "include/c++" to
'CPLUS_INCLUDE_PATH'.
(gcc-6)[native-search-paths]: Remove.
* gnu/packages/make-bootstrap.scm (gcc-for-bootstrap): Remove
'native-search-paths' and 'arguments'.
* gnu/packages/patches/python-2.7-search-paths.patch,
gnu/packages/patches/python-3-search-paths.patch: Replace "CPATH" with
"C_INCLUDE_PATH".
* guix/build-system/cmake.scm (lower): When not cross-compiling, move
INPUTS from the 'host-inputs' field to the 'build-inputs' field of the
bag, right after NATIVE-INPUTS.
* guix/build-system/glib-or-gtk.scm (lower): Likewise.
* guix/build-system/gnu.scm (lower): Likewise.
* guix/build-system/meson.scm (lower): Likewise.
2020-02-06 18:47:15 +01:00
Mathieu Othacehe e3e1a7ba08
git: Remove leftover pk call.
* guix/git.scm (update-cached-checkout): Remove leftover pk call.
2020-02-06 17:14:39 +01:00
Mathieu Othacehe c357474994
git: Add ssh authentication support.
If Guile-Git revision is >= 0.3.0, use SSH agent authentication method for
both clone and fetch calls.

* guix/git.scm (auth-supported?): New variable,
(clone*): set auth-method to ssh-agent if the variable above is true,
(update-cached-checkout): ditto.
2020-02-06 16:10:31 +01:00
Marius Bakke f10921c5ad
Merge branch 'master' into staging 2020-02-05 22:08:06 +01:00
Jakub Kądziołka 9d0dfd9a9a
import: pypi: Support exporting packages with .zip source.
* guix/import/pypi.scm (make-pypi-sexp): Rename test-inputs to
  native-inputs. Restructure the way pypi-uri parameters are generated.
  Use pypi-uri's extension parameter when required. Add "unzip" to
  native inputs when the package source is a zip file.

Signed-off-by: Marius Bakke <mbakke@fastmail.com>
2020-02-05 22:03:35 +01:00
Ludovic Courtès c24fe4a520
import: gem: Deal with unavailable licensing info.
Fixes <https://bugs.gnu.org/39404>.
Reported by Seth <lee.seth@tuta.io>.

* guix/import/gem.scm (<gem>)[licenses]: Adjust for non-vector
licenses.
* tests/gem.scm (test-bar-json): Change "licenses" to 'null'.
("gem-recursive-import"): Adjust accordingly.
2020-02-05 16:18:58 +01:00
Ludovic Courtès 23db833335
import: gem: Rewrite to use a JSON mapping to records.
* guix/import/gem.scm (<gem>, <gem-dependencies>, <gem-dependency>): New
record types with JSON mapping.
(json->gem-dependencies): New procedures.
(rubygems-fetch): Use it.
(hex-string->bytevector): Remove.
(make-gem-sexp): Expect HASH to be a bytevector.
(gem->guix-package): Adjust to use the new <gem> data type instead of an
alist.
(latest-release): Likewise.
2020-02-05 16:18:58 +01:00
Efraim Flashner d54ed69c19
Merge remote-tracking branch 'origin/master' into core-updates 2020-02-04 14:16:23 +02:00
Leo Prikler cb9cb2e89a
licenses: Add Unicode license.
* guix/licenses.scm (unicode): New variable.

Signed-off-by: Ricardo Wurmus <rekado@elephly.net>
2020-02-03 16:32:39 +01:00
Marius Bakke 52665d2b6b
Merge branch 'staging' into core-updates 2020-02-03 15:45:44 +01:00
Pierre Neidhardt 5db7df2eab
guix: Fix missing export for make-desktop-entry-file.
* guix/build/utils.scm: Export make-desktop-entry-file.
2020-01-30 16:53:44 +01:00
Ludovic Courtès 46312064de
derivations: Import modules with 'add-file-tree-to-store'.
This reduces the number of RPCs on "guix build libreoffice -nd" from
2,589 to 2,558 (1%).

* guix/derivations.scm (imported-files): Rewrite to call to
'add-file-tree-to-store'.  Remove #:system and #:guile parameters.
(%imported-modules): Adjust docstring to say that result is a store
item, and adjust 'imported-files' call.
(%compiled-modules): Adjust accordingly.
(imported+compiled-modules): Likewise.
(build-expression->derivation): Likewise.
2020-01-30 01:34:51 +01:00
Ludovic Courtès 68dbd5c9de
gexp: Move 'file-mapping->tree' to (guix store).
* guix/gexp.scm (%not-slash): Remove.
(file-mapping->tree): Move to...
* guix/store.scm (file-mapping->tree): ... here.
2020-01-30 01:17:54 +01:00
Marius Bakke 0895002f68
Merge branch 'master' into staging 2020-01-29 11:12:49 +01:00
Tobias Geerinckx-Rice 4968ea2c92
Use HTTPS for liballeg.org.
* gnu/packages/game-development.scm (allegro-4, allegro)[home-page]:
Use HTTPS.
* guix/licenses.scm (giftware): Likewise.
2020-01-28 17:22:11 +01:00
Hartmut Goebel 8377512e0c
guix: qt-build-system: Add phase `check-setup`.
* guix/build/qt-build-system.scm (check-setup): New function.
  (%standard-phases): Add as new phase `check-setup before `check.
* doc/guix.texi (Build System)[qt-build-system]: Describe the new phase.
2020-01-28 13:03:08 +01:00
Efraim Flashner 61b95c15cf
build: cargo-build-system: Add pkg-config environment variables.
* guix/build/cargo-build-system.scm (configure): Add environment
variables to use system libgit2 and libssh2.
* gnu/packages/crates-io.scm (rust-libgit2-sys-0.10,
rust-libssh2-sys-0.2)[arguments]: Remove LIBGIT2 and LIBSSH2 environment
variable settings.
* gnu/packages/rust-apps.scm (tokei)[arguments]: Same.
2020-01-27 18:39:10 +02:00
Efraim Flashner a13db7e2ab
build: cargo-build-system: Allow patched crates.
* guix/build/cargo-build-system.scm (crate-src?): Don't check for a
gzipped tarball, just make sure it's not a directory.
2020-01-27 18:36:11 +02:00
Julien Lepiller 1e8da4cdef
guix: ocaml: Also replace dune when relevant in package-with-explicit-ocaml.
* guix/build-system/ocaml.scm (package-with-explicit-ocaml): Take a dune
argument and add it to transformed packages when relevant.
2020-01-27 03:55:52 +01:00
Marius Bakke 38746d026c
build-system/cmake: Specify C++ compiler when cross-compiling.
* guix/build/cmake-build-system.scm (configure)[args]: Add
"-DCMAKE_CXX_COMPILER" when cross-compiling.
2020-01-26 13:39:18 +01:00
Marius Bakke 88b263465c
build-system/cmake: Enable parallel tests by default.
* guix/build-system/cmake.scm (cmake-build, cmake-cross-build): Set
the PARALLEL-TESTS? key to #t.
2020-01-26 01:52:55 +01:00
Ludovic Courtès 01e5d63c87
serialization: 'read-byte-string' makes a single read(2) call.
On "guix build libreoffice -nd", this reduces the number of read(2)
system calls from 10,434 to 8092.

* guix/serialization.scm (sub-bytevector): New procedure.
(read-byte-string): Make a single 'get-bytevector-n*' call and use
'sub-bytevector'.
2020-01-24 23:56:43 +01:00
Ludovic Courtès 09238d618a
guix build, archive, graph: Disable absolute file port name canonicalization.
This avoids an 'lstat' storm.  Specifically:

  ./pre-inst-env strace -c guix build -nd libreoffice

goes from 1,711 to 214 'lstat' calls.

* guix/scripts/build.scm (options->things-to-build): When SPEC matches
'derivation-path?', call 'canonicalize-path'.
(guix-build): Remove 'with-fluids' for %FILE-PORT-NAME-CANONICALIZATION.
* guix/scripts/archive.scm (guix-archive): Remove 'with-fluids' for
%FILE-PORT-NAME-CANONICALIZATION.
* guix/scripts/graph.scm (guix-graph): Likewise.
2020-01-24 23:56:42 +01:00
Ludovic Courtès a07d5e558b
ui: Do not display error messages with bare format strings.
On Guile 3, with, say, an error in ~/.guile, we'd get:

  $ guix repl
  guix repl: error: Unbound variable: ~S

* guix/ui.scm (call-with-error-handling): Add
'&exception-with-kind-and-args' case.
2020-01-24 23:56:42 +01:00
Ludovic Courtès 8234fe653e
self: Build with Guile 3.0.
* guix/self.scm (specification->package): Return the "guile3.0-"
variants.
(guix-derivation): Change 'guile' to (specification->package "guile").
Pass "3.0" as #:guile-version.
2020-01-23 23:34:10 +01:00
Ludovic Courtès 370891d565
derivations: Inline 'find' in 'coalesce-duplicate-inputs'.
Previously the first argument to 'find' would show up high in profiles
of 'package-derivation'.  This speeds things up a big, especially on
Guile 3.

* guix/derivations.scm (coalesce-duplicate-inputs)[find]: New
procedure.
2020-01-23 23:34:10 +01:00
Ludovic Courtès 4d52e0f667
compile: Remove incorrect exports.
This is a followup to fed3632812.

* guix/build/compile.scm: Remove exports of '%lightweight-optimizations'
and '%default-optimizations'.
* guix/self.scm: Remove unused (guix build compile) module.
2020-01-23 23:34:09 +01:00
Marius Bakke 12d8adbfc0
Merge branch 'staging' into core-updates 2020-01-23 23:11:11 +01:00
Julien Lepiller 092f815799
guix: ocaml: Reuse package-with-ocaml4.01 with ocaml-4.07.
* guix/build-system/guix.scm (package-with-ocaml4.01)
(strip-ocaml4.01-variant): Rename to...
(package-with-ocaml4.07, strip-ocaml4.07-variant): ... this and rename
internal implementation.
2020-01-22 01:12:09 +01:00
Marius Bakke 8ed9be3fac
Merge branch 'staging' into core-updates 2020-01-21 22:39:42 +01:00
Ludovic Courtès 7842ddcbc1
guix package: Create profiles/per-user/$USER upfront.
Fixes <https://bugs.gnu.org/39194>.
Reported by Matt Wette <matt.wette@gmail.com>.

* guix/scripts/package.scm (build-and-use-profile): Move
'ensure-default-profile' call to...
(process-actions): ... here.
2020-01-19 23:11:37 +01:00
Ludovic Courtès b782688d71
syscalls: Pass the right 'throw' arguments in 'call-with-file-lock/no-wait'.
Reported by Matt Wette <matt.wette@gmail.com>
in <https://bugs.gnu.org/39194>.

* guix/build/syscalls.scm (call-with-file-lock/no-wait): When
re-throwing, pass KEY in addition to ARGS.
2020-01-19 23:11:37 +01:00
Ludovic Courtès 358f66a004
repl: Avoid dependency on high-level package modules.
* guix/scripts/repl.scm: Remove imports of (guix scripts build), (gnu
packages), (guix utils), and (guix packages).
(%options): Define "--load-path" option right here.
2020-01-19 23:11:37 +01:00
Ludovic Courtès eb60253220
repl: Adjust "--listen" help message.
* guix/scripts/repl.scm (show-help): Adjust "--listen" string.
2020-01-19 23:11:37 +01:00
Ludovic Courtès a9f4a7eee3
repl: Add "-q".
* guix/scripts/repl.scm (%options, show-help): Add "-q".
(guix-repl): Add 'user-config' and use it.  Honor 'ignore-dot-guile?'.
2020-01-19 23:11:37 +01:00
zimoun e478fd9747
refresh: Fix internal variable name.
* guix/scripts/refresh.scm (%option): Fix internal variable name.
2020-01-18 13:08:11 +01:00
Ludovic Courtès 36930b2463
packages: 'patch-and-repack' sets the mtime to 1, not 0.
* guix/packages.scm (patch-and-repack)[build]: Pass "--mtime=@1" instead
of "--mtime=@0".
2020-01-17 21:21:07 +01:00
Ludovic Courtès abbb98714b
ui: Ignore 'raise-exception' frames when reporting exceptions.
* guix/ui.scm (last-frame-with-source): Check whether FRAME corresponds
to 'raise-exception' and skip it if it does.
2020-01-17 17:11:34 +01:00
Ludovic Courtès 6f918d69b4
import: texlive: Avoid uses of '@@' in tests.
* guix/import/texlive.scm (fetch-sxml, sxml->package): Export.
* tests/texlive.scm <top level>: Call '%http-server-port'.
("fetch-sxml: returns SXML for valid XML"): Use 'with-http-server' and
set 'current-http-proxy' instead of using 'mock'.
("sxml->package"): Remove use of '@@'.
2020-01-17 14:22:08 +01:00
Ludovic Courtès 282f91790a
import: opam: Avoid uses of '@@' in tests.
* guix/import/opam.scm (string-pat, multiline-string, list-pat)
(dict, condition): Export.
(opam-fetch): Add optional 'repository' parameter.
(opam->guix-package): Add #:repository parameter and pass it to
'opam-fetch'.
* tests/opam.scm ("opam->guix-package"): Remove use of 'mock' and pass
TEST-REPO to 'opam->guix-package' instead.
("parse-strings", "parse-multiline-strings")
("parse-lists", "parse-dicts", "parse-conditions"): Remove uses of '@@',
which are no longer needed.
2020-01-17 14:22:07 +01:00
Ludovic Courtès fcb2318e51
lint: vulnerabilities: Avoid 'mock' in test.
* guix/lint.scm (check-vulnerabilities): Add 'package-vulnerabilities'
optional parameter.
* tests/lint.scm ("cve: one vulnerability"): Use it instead of 'mock'.
2020-01-17 14:22:07 +01:00
Ludovic Courtès fd4c832bdb
lint: derivation: Adjust exception handling for Guile 3.
This makes sure the "derivation: invalid arguments" test passes on
Guile 3.0.0.  Without this change, the lint warning would only include
the format string instead of the key and arguments.

* guix/lint.scm (exception-with-kind-and-args?): New procedure.
(check-derivation): Use it.
2020-01-17 14:22:07 +01:00
Ludovic Courtès 9d6c6cb20e
import: elpa: Rewrite test to use an HTTP server instead of mocking.
* guix/import/elpa.scm (elpa-url): Add 'gnu/http'.
(elpa->guix-package): Handle it.
* tests/elpa.scm (elpa-package-info-mock, auctex-readme-mock)
(elpa-version->string, package-source-url, ensure-list)
(package-home-page, make-elpa-package): Remove.
<top level>: Call '%http-server-port'.
(eval-test-with-elpa): Remove uses of 'mock'.  Use 'with-http-server'
and parameterize 'current-http-proxy' instead.
2020-01-16 23:14:05 +01:00
Ludovic Courtès cfd1ed8401
import: cran: Avoid uses of '@@' in the tests.
* guix/import/cran.scm (description->alist, description->package): Export.
<top level>: Set! 'listify'.
* tests/cran.scm (description-alist, "description->package"): Remove use
of '@@' to access the relevant bindings.
2020-01-16 23:14:05 +01:00
Ludovic Courtès 72c678af55
import: crate: Export 'string->license'.
* guix/import/crate.scm (string->license): Export.
* tests/crate.scm (string->license): Remove.
2020-01-16 23:14:05 +01:00
Ludovic Courtès 3597c0396b
lzlib: Define 'dictionary-size+match-length-limit'.
* guix/lzlib.scm (%compression-levels): Splice the rest of each element.
(dictionary-size+match-length-limit): New procedure.
(make-lzip-output-port, make-lzip-input-port/compressed): Use it.
* tests/lzlib.scm ("Bytevector of size relative to Lzip internal buffers (2 * dictionary)"):
Use 'dictionary-size+match-length-limit' instead of 'assoc-ref'.
2020-01-16 23:14:05 +01:00
Ludovic Courtès 47212fc763
records: Improve reporting of "invalid field specifier" errors.
Previously users would just see:

  error: invalid field specifier

without source location or hints.

* guix/records.scm (expand): Add optional 'parent-form' parameter and
pass it to 'syntax-violation' when it is true.
(make-syntactic-constructor): Pass S as a third argument to
'report-invalid-field-specifier'.
* guix/ui.scm (report-load-error): For 'syntax-error', show SUBFORM or
FORM in the message.
* tests/records.scm ("define-record-type* & wrong field specifier"): Add
a 'subform' parameter and adjust test accordingly.
("define-record-type* & wrong field specifier, identifier"): New test.
* tests/guix-system.sh: Add test.
2020-01-16 18:30:57 +01:00
Ludovic Courtès 84c5da08dd
guix package: Export 'transaction-upgrade-entry'.
* guix/scripts/package.scm (transaction-upgrade-entry): Add 'store'
parameter and use it instead of (%store).  Export.
* tests/packages.scm ("transaction-upgrade-entry, zero upgrades")
("transaction-upgrade-entry, one upgrade")
("transaction-upgrade-entry, superseded package"): Adjust accordingly.
2020-01-16 18:30:57 +01:00
Ludovic Courtès 4fe01b09ea
publish: Export 'signed-string'.
* guix/scripts/publish.scm (signed-string): Export and improve docstring.
* tests/publish.scm ("/*.narinfo")
("/*.narinfo with properly encoded '+' sign"): Adjust accordingly.
2020-01-16 18:30:57 +01:00
zimoun d14e4745b3
repl: Fix '--help' message.
* guix/scripts/repl.scm: (show-help): Add '--listen' option message.
2020-01-16 15:27:24 +01:00
zimoun e8728862a1
repl: Add '--load-path' option.
* guix/scripts/repl.scm (%option): Add '--load-path' option.
* doc/guix.texi: Document it.
2020-01-16 15:27:24 +01:00
zimoun 3c8396b578
edit: Add '--load-path' option.
* guix/scripts/edit.scm (%option): Add '--load-path' option.
* doc/guix.texi: Document it.
2020-01-16 15:27:24 +01:00
zimoun 21f4fbdd84
refresh: Add '--load-path' option.
* guix/scripts/refresh.scm (%option): Add '--load-path' option.
* doc/guix.texi: Document it.
2020-01-16 15:27:24 +01:00
zimoun 2d4688c1ea
size: Add '--load-path' option.
* guix/scripts/size.scm (%option): Add '--load-path' option.
* doc/guix.texi: Document it.
2020-01-16 15:27:24 +01:00
Pierre Neidhardt ee9a735bc8
graph: Add '--load-path' option.
* guix/scripts/graph.scm (%option): Add '--load-path' option.
* doc/guix.texi: Document it.
* tests/guix-graph.sh: Test it.
2020-01-16 15:27:20 +01:00
Ludovic Courtès 65b510bbc4
clojure-utils: Avoid use of '@@'.
* guix/build/clojure-utils.scm (%doc-regex): Avoid @@, which doesn't
work on Guile 3.
(file-sans-extension): Likewise.
2020-01-15 23:48:33 +01:00
Ludovic Courtès 0aa6b38695
serialize: Export 'dump-port*'.
* guix/serialization.scm (dump): Export as 'dump-port*'.
* guix/scripts/challenge.scm (dump-port*): Remove.
2020-01-15 23:48:33 +01:00
Ludovic Courtès 4aea90b187
import: cpan: Rewrite tests to use an HTTP server instead of mocking.
* guix/import/cpan.scm (%metacpan-base-url): New variable.
(module->dist-name, cpan-fetch): Refer to it instead of the hard-coded URL.
* tests/cpan.scm ("cpan->guix-package"): Use 'with-http-server' instead
of 'mock'.
2020-01-15 18:40:43 +01:00
Ludovic Courtès 69f132554c
import: cpan: Rewrite to use 'define-json-mapping'.
* guix/import/cpan.scm (<cpan-dependency>, <cpan-release>): New
JSON-mapped record types.
(metacpan-url->mirror-url): New procedure.
(cpan-source-url): Rewrite in terms of it.
(cpan-version): Remove.
(cpan-module->sexp): Rewrite to take a <cpan-release> instead of an
alist, and rename 'meta' to 'release'.
[convert-inputs]: Rewrite to use 'cpan-release-dependencies'.
Update calls to 'convert-inputs' to pass a list of symbols.
Replace 'assoc-ref' calls with the appropriate field accessors.
(cpan->guix-package): Rename 'module-meta' to 'release'.
(latest-release): Likewise, and use the appropriate accessors.
* tests/cpan.scm (test-json): Remove "prereqs" record; add "dependency"
list.
("source-url-http", "source-url-https"): Remove.
("metacpan-url->mirror-url, http")
("metacpan-url->mirror-url, https"): New tests.
2020-01-15 18:40:43 +01:00
Ludovic Courtès ea6d962b93
More module autoload adjustments.
This is a followup to 7a0836cffd.

* guix/scripts/package.scm: Adjust binding list of the (guix store roots)
autoload.
* guix/inferior.scm: Adjust binding list of the (guix cache) autoload.
2020-01-15 18:40:43 +01:00
Ludovic Courtès 5a2639f9cb
Avoid warnings for the 'delete' binding of (guix build utils).
On Guile 3, importing (guix build utils) leads to warnings such as:

  WARNING: (gnu packages embedded): imported module (guix build utils) overrides core binding `delete'

* gnu/packages/embedded.scm: Select 'alist-replace' from (guix build utils).
* guix/ui.scm: Hide 'delete' from (guix build utils).
2020-01-15 18:40:43 +01:00
Ludovic Courtès e2922f527e
substitute: 'http-multiple-get' processes each request only once.
Fixes <https://bugs.gnu.org/39090>.
Reported by Gábor Boskovits <boskovits@gmail.com>.
Fixes a regression introduced in 9e3f9ac3c0.

* guix/scripts/substitute.scm (http-multiple-get): In the "Connection: close"
case, pass (drop requests (+ 1 processed)) to 'loop' as the remaining
REQUESTS value.

Previously, we would pass a list containing duplicates, and thus the
final result would also contain duplicates.  When sent to the daemon,
that list would lead to a daemon error:

  got unexpected path `/gnu/store/…' from substituter
2020-01-15 18:40:43 +01:00
Marius Bakke 3cfe76bec0
Merge branch 'master' into core-updates 2020-01-15 00:09:46 +01:00
Marius Bakke cebe07775b
build-system/texlive: Update to texlive-2019.3, revision 51265.
* guix/build-system/texlive.scm (%texlive-tag): Change to "2019.3".
(%texlive-revision): Change to 51265.
2020-01-14 00:18:09 +01:00
Danny Milosavljevic 1e44ae6fe7
lint: Check for more packages which should be native.
* guix/lint.scm (check-inputs-should-be-native): Add gtk-doc.
2020-01-12 23:21:59 +01:00
Guillaume Le Vaillant 6b8f7c397a
build: asdf-build-system: Improve reproducibility.
* guix/build/asdf-build-system.scm (copy-files-to-output): Reset timestamps of
  source files before compiling.
2020-01-12 14:48:30 +01:00
Ludovic Courtès 6e36f1cabd
deprecation: Add a two-element form for simple aliases.
* guix/deprecation.scm (define-deprecated): Add a two-element form for
simple aliases: (define-deprecated old new).
2020-01-12 00:19:09 +01:00
Marius Bakke b7bf02a418
Merge branch 'master' into core-updates 2020-01-11 22:38:24 +01:00
Ludovic Courtès f75243e17e
channels: Provide a hint when the 'guix' channel is lacking.
Fixes <https://bugs.gnu.org/39043>.
Reported by Jesse Gibbons <jgibbons2357@gmail.com>.

* guix/channels.scm (channel-instance-derivations): Raise '&fix-hint'
condition in addition to the '&message' condition.
2020-01-09 23:33:04 +01:00
Danny Milosavljevic bbd9063afc
lint: Check for more packages which should be native.
* guix/lint.scm (check-inputs-should-be-native): Add autoconf, automake,
bison, dejagnu, desktop-file-utils, doxygen, flex, gettext,
gobject-introspection, googletest-source, groff, help2man, libtool, swig,
qmake, qttools, texinfo, xorg-server-for-tests, yelp-tools.
2020-01-09 23:15:04 +01:00
Ludovic Courtès 984efa2b6a
build-system/clojure: Provide only the right modules in scope.
Previously, we used to have a whole bunch of (guix build *-build-system)
modules in scope, which, for example, meant that '%standard-phases' was
clashing.  This change clarifies it.

* guix/build-system/clojure.scm (%default-modules): New variable.
(clojure-build): Change the default value of #:modules and that of
 #:phases.
2020-01-08 23:21:14 +01:00
Guillaume Le Vaillant f98c050c20
build: asdf-build-system: Make sbcl-* Lisp packages reproducible.
The '*.fasl' files produced by SBCL contain the mtime of the source file (see
commit 72843d7ce32bd615f64a0326cf891658b5724ead of SBCL's code repository).
As asdf-build-system makes a copy of the source files before compiling them,
we must set the mtime of these copies to the same date as the originals for
the build to be reproducible.

* guix/build/asdf-build-system.scm (copy-files-to-output): Keep the
  modification time of the original source files.
2020-01-08 15:39:05 +01:00
Ludovic Courtès 058d0251bd
download, git: Refer to the right module in 'module-use!' call.
This fixes a regression introduced in
6a7c4636d4.

* guix/build/download.scm (load-gnutls): Call 'resolve-module' instead
of 'current-module'.
* guix/git.scm (load-git-submodules): Likewise.
2020-01-07 12:25:09 +01:00
Ludovic Courtès 7a0836cffd
More module autoload changes.
This is a followup to 6a7c4636d4.

* guix/scripts/build.scm: Adjust #:autoload clauses.
* guix/scripts/gc.scm: Likewise.
2020-01-07 12:25:09 +01:00
Ludovic Courtès 6a7c4636d4
Adjust module autoloads.
In Guile < 2.9.7, autoloading a module would give you access to all its
bindings.  In future versions, autoloading a module gives access only to
the listed bindings, as per #:select (see <https://bugs.gnu.org/38895>).

This commit adjusts autoloads to the new semantics, allowing Guix to be
built with Guile 2.9.7/2.9.8.

* guix/build/download.scm <top level>: Remove call to 'module-autoload!'.
(load-gnutls): New procedure.
(tls-wrap): Call it.
* guix/git.scm <top level>: Remove call to 'module-autoload!'.
(load-git-submodules): New procedure.
(update-submodules): Call it instead of 'resolve-interface'.
* gnu/bootloader/grub.scm: Replace #:autoload with #:use-module.
* gnu/packages.scm: Likewise.
* gnu/packages/ssh.scm: Likewise.
* gnu/packages/tex.scm: Likewise.
* gnu/services/cuirass.scm: Likewise.
* gnu/services/mcron.scm: Likewise.
* guix/lint.scm: Augment list of bindings in #:autoload.
* guix/scripts/build.scm: Likewise.
* guix/scripts/gc.scm: Likewise.
* guix/scripts/pack.scm: Likewise.
* guix/scripts/publish.scm: Likewise.
* guix/scripts/pull.scm: Likewise.
* guix/utils.scm: Remove unnecessary #:autoload clauses; replace one
of them with #:use-module.
2020-01-06 16:31:54 +01:00