Commit graph

4871 commits

Author SHA1 Message Date
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
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
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
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
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 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
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