Commit Graph

5245 Commits

Author SHA1 Message Date
Ludovic Courtès
d15c7974a2
android-repo-download: Remove unnecessary use of Guile-JSON.
* guix/android-repo-download.scm (android-repo-fetch)[guile-json]: Remove.
[build]: Remove GUILE-JSON from 'with-extensions'.
2020-09-08 00:47:35 +02:00
Mathieu Othacehe
2fbbfe6ff1
git: Export url-cache-directory.
* guix/git.scm (url-cache-directory): Export it.
2020-09-06 15:40:54 +02:00
Efraim Flashner
da09b47b94
scripts: system: Expand some help messages.
* guix/scripts/system.scm (show-help): Add to '--share=SPEC' and
'--expose=SPEC' that it also works for containers.
2020-09-05 22:24:39 +03:00
Danny Milosavljevic
4ff0fed778
android-repo-download: Use parallel-job-count instead of hard-coding job
count.

* guix/build/android-repo.scm (android-repo-fetch): Use parallel-job-count
instead of hard-coding job count.
2020-09-03 00:09:38 +02:00
Danny Milosavljevic
eb924a97bd
android-repo-download: Clean up typos; remove unused imports.
Follow-up to 3feb846420.

* guix/android-repo-download.scm (android-repo-fetch): Fix docstring.
2020-09-03 00:09:38 +02:00
Ludovic Courtès
44c6e6f590
ssh: Fix progress bar crash when there are zero items to send.
* guix/ssh.scm (notify-transfer-progress): Do nothing when TOTAL is
zero.
2020-09-02 23:59:24 +02:00
Ludovic Courtès
de83660dd3
ssh: Fix regression in 'send-files'.
Regression introduced in b03267df6d.
The (take files 20) is a leftover from testing session.

* guix/ssh.scm (send-files): Fix value for 'missing'.
2020-09-02 23:59:24 +02:00
Ludovic Courtès
fe4e770fc1
ui: Attempt to fall back to "en_US.utf8" rather than "C".
* guix/ui.scm (install-locale): Add call to 'setlocale' in 'catch' handler.
2020-09-02 17:17:37 +02:00
Ludovic Courtès
739f630947
store: 'set-build-options' sends LC_MESSAGES, not LC_ALL.
* guix/store.scm (set-build-options): Change #:locale default value
to (setlocale LC_MESSAGES).
2020-09-02 17:17:37 +02:00
Ludovic Courtès
aba8def46d
substitute: Set LC_MESSAGES to the client's locale, not LC_ALL.
Fixes <https://bugs.gnu.org/43039>.
Reported by Adam Griffiths <adam.lw.griffiths@gmail.com>.

Previously, a client could lead 'guix substitute' to run in a non-UTF-8
locale, such as the "C" locale.  Consequently, 'guix substitute' would
now fail to decode UTF-8 file names such as those that appear in the
'nss-certs' package.

* guix/scripts/substitute.scm (guix-substitute): Set LC_MESSAGES, not LC_ALL.
2020-09-02 17:17:36 +02:00
Danny Milosavljevic
3feb846420
Add (guix android-repo-download).
* guix/build/android-repo.scm: New file.
* guix/android-repo-download.scm: New file.
* Makefile.am (MODULES): Add them.
2020-09-02 13:51:38 +02:00
Arun Isaac
4546c0dd2f
import: launchpad: Recognize more URLs.
* guix/import/launchpad.scm (updated-launchpad-url): Recognize more URLs.
2020-09-01 22:45:16 +05:30
Arun Isaac
4322561243
import: launchpad: Recognize the .orig.tar.gz extension.
* guix/import/launchpad.scm (find-extension): Recognize the .orig.tar.gz
extension.
2020-09-01 22:45:16 +05:30
Arun Isaac
8b9b5a7f58
import: launchpad: Handle list of source URLs correctly.
* guix/import/launchpad.scm (updated-launchpad-url): Return updated URL when
package has a list of URLs, not the old URL.
2020-09-01 22:45:02 +05:30
Maxim Cournoyer
a02ad4592c
gexp: computed-file: Prevent mistakenly overriding default option values.
In order to do so, default to an empty options list, and expose options whose
default values are sensitive directly as keyword arguments.

* guix/gexp.scm (computed-file): Extract the LOCAL-BUILD? parameter from the
OPTIONS parameter to make it a stand-alone keyword argument.  Introduce an
OPTIONS* binding which is obtained by combining the LOCAL-BUILD? keyword and
its value with OPTIONS.
* doc/guix.texi (G-Expressions): Adjust doc.

Suggested-by: Ludovic Courtès <ludo@gnu.org>
2020-09-01 00:48:11 -04:00
Julien Lepiller
036f23f053
guix: system: Add `--label' option.
* guix/scripts/system.scm (%options): Add `--label'.
(system-derivation-for-action): Take a #:label key to set volume ID.
(perform-action): Take a #:label key.
(%default-options): Add default label value.
(process-action): Pass label value from command-line to perform-action.
* gnu/system/image.scm (image-with-label): New procedure.
2020-08-31 16:12:16 +02:00
Ludovic Courtès
7e90e28a15
guix system: Clarify what happens where service upgrade fails.
* guix/scripts/system.scm (report-shepherd-error): Use 'warning' instead
of 'report-error'.  Add extra 'warning' and 'display-hint' calls.
2020-08-31 15:50:35 +02:00
Ludovic Courtès
a4e81ff325
guix system: reconfigure: Tell users about 'herd status'.
* guix/scripts/system.scm (perform-action): Mention 'herd status' when
'upgrade-shepherd-services' completes.
2020-08-31 15:50:35 +02:00
Ludovic Courtès
83ec969cc7
packages: <content-hash> printer gracefully handle #f values.
Suggested by Robin Green <greenrd@greenrd.org>.

* guix/packages.scm (print-content-hash): Gracefully deal with cases
with 'content-hash-value' returns #f, as is the case for 'linux-libre'.
2020-08-31 15:50:35 +02:00
Ludovic Courtès
b03267df6d
ssh: 'send-files' displays a progress bar.
* guix/store.scm (export-paths): Add #:start, #:progress, and #:finish
parameters and honor them.
* guix/ssh.scm (prepare-to-send, notify-transfer-progress)
(notify-transfer-completion): New procedures.
(send-files): Pass #:start, #:progress, and #:finish to 'export-paths'.
2020-08-31 15:50:31 +02:00
Lars-Dominik Braun
bc8be17c4d
environment: Set USER and LOGNAME in container
* guix/scripts/environment.scm (launch-environment/container): Set
  username environment variables.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2020-08-30 23:51:03 +02:00
Ludovic Courtès
61fe9ced7d
copy, offload: Explicitly close SSH channels and sessions.
Fixes <https://bugs.gnu.org/42740>.

* guix/scripts/copy.scm (send-to-remote-host): Keep the result of
'connect-to-remote-daemon' in scope, and explicitly close it after the
call to 'send-files'.
(retrieve-from-remote-host): Explicitly close REMOTE and disconnect
SESSION.
* guix/scripts/offload.scm (transfer-and-offload): Explicitly close
STORE and disconnect SESSION upon completion.
2020-08-29 16:24:17 +02:00
Ludovic Courtès
4ec66950f0
derivations: Avoid uses of 'write' in 'write-derivation'.
This leads a 4% improvement on the wall-clock time of:

  guix build -e '(@@ (gnu packages libreoffice) libreoffice)' --no-grafts -d

* guix/derivations.scm (escaped-string): New procedure.
(write-derivation)[write-escaped-string]: New procedure.
[write-string-list, write-output, write-env-var]: Use it.
2020-08-28 23:29:07 +02:00
Ludovic Courtès
3e339c4410
derivations: Avoid uses of 'display' in 'write-derivation'.
This yields a 4% improvement on the wall-clock time of:

  guix build -e '(@@ (gnu packages libreoffice) libreoffice)' --no-grafts -d

* guix/derivations.scm (write-sequence, write-list, write-tuple): Use
'put-char' instead of 'display'.
(write-derivation): Use 'put-string' and 'put-char', and remove unused
'format' binding.
2020-08-28 23:28:56 +02:00
Ludovic Courtès
3d9ea605c8
store: 'with-store' returns as many values as its body.
Fixes <https://bugs.gnu.org/42912>.
Reported by Ricardo Wurmus <rekado@elephly.net>.

* guix/store.scm (call-with-store)[thunk]: Wrap call to PROC in
'call-with-values'.
* tests/store.scm ("with-store, multiple values"): New test.
2020-08-28 23:27:53 +02:00
Ludovic Courtès
0c9d22c13f
pull: Avoid "Migrating profile" message on the first run.
* guix/scripts/pull.scm (ensure-default-profile): Do not call
'migrate-generations' when
%USER-PROFILE-DIRECTORY (~/.config/guix/current) does not exist.  This
avoids a confusing "Migrating profile" message when the user runs 'guix
pull' for the first time.
2020-08-27 19:58:16 +02:00
Ludovic Courtès
4c5edee1ef
lint: Use 'with-error-handling'.
This improves the error message when unable to access ~/.cache as
reported by Jonathan Brielmaier <jonathan.brielmaier@web.de> in
<https://bugs.gnu.org/42859>.

* guix/scripts/lint.scm (guix-lint): Wrap body in 'with-error-handling'.
2020-08-26 00:51:56 +02:00
Maxim Cournoyer
4b5a6fbc9b
offload: Modify the build-machine record to accept multiple systems.
* guix/scripts/offload.scm (<build-machine>)[systems]: New field.
[system]: Accessor changed to %build-machine-system.  Default to #f.
* guix/scripts/offload.scm (build-machine-system): Wrap %build-machine-system
with a deprecation warning.
(build-machine-systems): Access the new systems field or fallback to use
build-machine-system, for backward compatibility.
(machine-matches?): Adjust.
* tests/offload.scm: Add tests...
* Makefile.am (SCM_TESTS): ...and register them.
* doc/guix.texi (Daemon Offload Setup): Update doc.
2020-08-25 13:45:27 -04:00
Mathieu Othacehe
755f365b02
linux-libre: Support module compression.
This commit adds support for GZIP compression for linux-libre kernel
modules. The initrd modules are kept uncompressed as the initrd is already
compressed as a whole.

The linux-libre kernel also supports XZ compression, but as Guix does not have
any available bindings for now, and the compression time is far more
significant, GZIP seems to be a better option.

* gnu/build/linux-modules.scm (modinfo-section-contents): Use
'call-with-gzip-input-port' to read from a module file using '.gz' extension,
(strip-extension): new procedure,
(dot-ko): adapt to support compression,
(ensure-dot-ko): ditto,
(file-name->module-name): ditto,
(find-module-file): ditto,
(load-linux-module*): ditto,
(module-name->file-name/guess): ditto,
(module-name-lookup): ditto,
(write-module-name-database): ditto,
(write-module-alias-database): ditto,
(write-module-device-database): ditto.
* gnu/installer.scm (installer-program): Add "guile-zlib" to the extensions.
* gnu/machine/ssh.scm (machine-check-initrd-modules): Ditto.
* gnu/services.scm (activation-script): Ditto.
* gnu/services/base.scm (default-serial-port): Ditto,
(agetty-shepherd-service): ditto,
(udev-service-type): ditto.
* gnu/system/image.scm (gcrypt-sqlite3&co): Ditto.
* gnu/system/linux-initrd.scm (flat-linux-module-directory): Add "guile-zlib"
to the extensions and make sure that the initrd only contains
uncompressed module files.
* gnu/system/shadow.scm (account-shepherd-service): Add "guile-zlib" to the
extensions.
* guix/profiles.scm (linux-module-database): Ditto.
2020-08-25 11:53:20 +02:00
Maxim Cournoyer
54a87b2a0c
offload: Update help string.
* guix/scripts/offload.scm (guix-offload): Update help string.
2020-08-24 16:41:08 -04:00
Jakub Kądziołka
7ba7d50f92
guix upgrade: Allow using --do-not-upgrade.
* guix/scripts/upgrade.scm (%options): Add "do-not-upgrade" to list of
  options inherited from guix package.
2020-08-24 16:29:07 +02:00
Mathieu Othacehe
4c0c65acfa
Use "guile-zlib" and "guile-lzlib" instead of (guix config).
* Makefile.am (MODULES): Remove guix/zlib.scm and guix/lzlib.scm,
(SCM_TESTS): remove tests/zlib.scm, tests/lzlib.scm.
* build-aux/build-self.scm (make-config.scm): Remove unused %libz variable.
* configure.ac: Remove LIBZ and LIBLZ variables and check instead for
Guile-zlib and Guile-lzlib.
* doc/guix.texi ("Requirements"): Remove zlib requirement and add Guile-zlib
and Guile-lzlib instead.
* gnu/packages/package-management.scm (guix)[native-inputs]: Add "guile-zlib"
and "guile-lzlib",
[inputs]: remove "zlib" and "lzlib",
[propagated-inputs]: ditto,
[arguments]: add "guile-zlib" and "guile-lzlib" to Guile load path.
* guix/config.scm.in (%libz, %liblz): Remove them.
* guix/lzlib.scm: Remove it.
* guix/man-db.scm: Use (zlib) instead of (guix zlib).
* guix/profiles.scm (manual-database): Do not stub (guix config) in imported
modules list, instead add "guile-zlib" to the extension list.
* guix/scripts/publish.scm: Use (zlib) instead of (guix zlib) and (lzlib)
instead of (guix lzlib),
(string->compression-type, effective-compression): do not check for zlib and
lzlib availability.
* guix/scripts/substitute.scm (%compression-methods): Do not check for lzlib
availability.
* guix/self.scm (specification->package): Add "guile-zlib" and "guile-lzlib"
and remove "zlib" and "lzlib",
(compiled-guix): remove "zlib" and "lzlib" arguments and add guile-zlib and
guile-lzlib to the dependencies, also do not pass "zlib" and "lzlib" to
"make-config.scm" procedure,
(make-config.scm): remove "zlib" and "lzlib" arguments as well as %libz and
%liblz variables.
* guix/utils.scm (lzip-port): Use (lzlib) instead of (guix lzlib) and do not
check for lzlib availability.
* guix/zlib.scm: Remove it.
* m4/guix.m4 (GUIX_LIBZ_LIBDIR, GUIX_LIBLZ_FILE_NAME): Remove them.
* tests/lzlib.scm: Use (zlib) instead of (guix zlib) and (lzlib)
instead of (guix lzlib), and do not check for zlib and lzlib availability.
* tests/publish.scm: Ditto.
* tests/substitute.scm: Do not check for lzlib availability.
* tests/utils.scm: Ditto.
* tests/zlib.scm: Remove it.
2020-08-24 13:35:24 +02:00
Mathieu Othacehe
e9f8a7e215
Use guile-zlib extension in build-side code.
* Makefile.am (MODULES): Move guix/build/download-nar.scm to ...
(MODULES_NOT_COMPILED): ... here.
* guix/build/download-nar.scm: Use (zlib) instead of (guix zlib).
* guix/cvs-download.scm (cvs-fetch): Do not stub (guix config) in imported
modules list, instead add "guile-zlib" to the extension list.
* guix/git-download.scm (git-fetch): Ditto.
* guix/hg-download.scm (hg-fetch): Do not stub (guix config) in imported
modules list, instead add "guile-zlib" to the extension list.
2020-08-24 10:41:06 +02:00
Ludovic Courtès
d10474c38d
lint: formatting: Gracefully handle relative file names.
Fixes <https://bugs.gnu.org/42543>.
Reported by Jack Hill <jackhill@jackhill.us>.

* guix/lint.scm (check-formatting): Always return a list (previously we
would return #f when 'search-path' returns #f).  Check whether
LOCATION's file is a relative file name.  Return a warning if not.
* tests/guix-lint.sh: Add test.
2020-08-23 23:05:16 +02:00
Ludovic Courtès
68193624d1
lint: Avoid calls to 'package-field-location' with #f as the field.
* guix/lint.scm (%make-warning): Call 'package-field-location' only when
FIELD is true.
2020-08-23 23:05:16 +02:00
Efraim Flashner
46886728a7
utils: Add version-major+minor+point.
* guix/utils.scm (version-major+minor+point): New procedure.
2020-08-17 07:57:23 +03:00
Ricardo Wurmus
aa1a75cc0e
build-system/haskell: Do not pass "--bindir" during configure.
The "--bindir" option is not as useful as it seems as the configured location
is embedded in the outputs.  Instead of using "--bindir" it seems better to
build a statically linked binary and move the binary to its own output to
avoid references between the "out" and "bin" outputs.

* guix/build/haskell-build-system.scm (configure): Do not pass "--bindir".
2020-08-13 16:44:56 +02:00
Timothy Sample
54a5fd0791
build-system/haskell: Add 'extra-directories' keyword.
See <https://bugs.gnu.org/39309>.

* guix/build-system/haskell.scm (lower): Include the transitive
propagated inputs of 'extra-directories' inputs.
(haskell-build): Add the 'extra-directories' keyword and pass it through
to the builder.
* guix/build/haskell-build-system.scm (configure): Use it to select
which inputs get passed via 'extra-include-dirs' and 'extra-lib-dirs' to
Cabal.
* gnu/packages/haskell-xyz.scm (ghc-alsa-core, ghc-hmatrix,
ghc-hmatrix-gsl, ghc-hslua, ghc-iwlib, ghc-libyaml, ghc-ncurses,
ghc-openglraw, ghc-x11, ghc-x11-xft, ghc-zlib): Set 'extra-directories'.
* gnu/packages/haskell-crypto.scm (ghc-digest, ghc-hsopenssl): Likewise.
2020-08-13 16:44:52 +02:00
Ricardo Wurmus
3f7922cbf5
haskell-build-system: register: Remove references to the doc output.
* guix/build/haskell-build-system.scm (register): Strip references to the doc
output from the generated package config files; move the haddock files from
the "doc" output to the "lib" output.
2020-08-12 14:45:49 +02:00
Ricardo Wurmus
75bda3c648
haskell-build-system: register: Respect lib output.
* guix/build/haskell-build-system.scm (register): Use lib output if it exists.
2020-08-12 14:45:49 +02:00
Ricardo Wurmus
718dc7d4a5
build-system/haskell: Add default output "static".
* guix/build-system/haskell.scm (lower): Add OUTPUTS keyword and add the
"static" output in the common case.
(haskell-build): Set the default value for the OUTPUTS keyword to include the
"static" output.
* guix/build/haskell-build-system.scm (install): Move static libraries to the
"static" output if it exists.
2020-08-12 14:45:48 +02:00
Ricardo Wurmus
9e5496e0ae
build-system/haskell: Configure to link with shared libraries.
* guix/build/haskell-build-system.scm (configure): Add configure flags to
build shared libraries by default, to generate position independent code, and
to set the RUNPATH.
2020-08-12 14:45:48 +02:00
Ricardo Wurmus
0347888a7e
build-system/haskell: Refactor configure step.
* guix/build/haskell-build-system.scm (configure): Replace append
with quasiquotes and splicing.
2020-08-12 14:45:48 +02:00
Ricardo Wurmus
67cb9fa235
build-system/haskell: Support parallel builds.
* guix/build-system/haskell.scm (haskell-build): Add keyword PARALLEL-BUILD?
and pass it on to the builder.
* guix/build/haskell-build-system.scm (build): Accept keyword PARALLEL-BUILD?
and pass the number of parallel jobs to GHC.
2020-08-12 14:45:48 +02:00
Morgan Smith
d98e0a27a7
build-system/emacs: Allow usage of #:parallel-tests? key
* guix/build-system/emacs.scm (emacs-build): Pass parallel-tests? to
  builder.

Signed-off-by: Jakub Kądziołka <kuba@kadziolka.net>
2020-08-09 22:12:40 +02:00
Ludovic Courtès
bc2b1484f7
ssh: Really report Guile setup errors in 'send-files'.
This is a followup to commit 8f53d73493,
which did not have the desired effect: the 'resolve-module' call was
bound to succeed since the inferior runs 'guix repl'.

* guix/ssh.scm (store-import-channel)[import]: Add call to
'resolve-module' and write '(module-error) upon error.  Write
'(importing) when we're ready.
(send-files)[inferior-remote-eval*]: Remove.
[missing]: Remove call to 'resolve-module'.
Call 'handle-import/export-channel-error' when PORT doesn't
return '(importing).
(handle-import/export-channel-error): New procedure.
(retrieve-files*): Use it.
2020-08-07 11:31:58 +02:00
Ludovic Courtès
05f3d34094
ui: Report key-and-arg exceptions correctly.
Fixes <https://bugs.gnu.org/42601>.
Reported by Jan Wielkiewicz <tona_kosmicznego_smiecia@interia.pl>.

Regression introduced in efe037fc5c
whereby errors like 'wrong-type-arg' would be improperly reported:

  guix environment: error: Wrong type argument in position ~A (expecting ~A): ~S

See also commit a07d5e558b.

* guix/ui.scm (call-with-error-handling): Move 'message-condition?'
clause after '&exception-with-kind-and-args' clause.
2020-08-05 22:28:28 +02:00
Ludovic Courtès
898e6d0a07
scripts: Pass #:verbosity to 'build-notifier'.
* guix/scripts/archive.scm (guix-archive): Pass #:verbosity to
'build-notifier'.
* guix/scripts/build.scm (guix-build): Likewise.
* guix/scripts/copy.scm (guix-copy): Likewise.
* guix/scripts/deploy.scm (guix-deploy): Likewise.
* guix/scripts/environment.scm (guix-environment): Likewise.
* guix/scripts/pack.scm (guix-pack): Likewise.
* guix/scripts/package.scm (guix-package*): Likewise.
* guix/scripts/pull.scm (guix-pull): Likewise.
* guix/scripts/system.scm (verbosity-level): New procedure.
(process-action): Pass #:verbosity to 'build-notifier'.
(guix-system): Use 'verbosity-level' for 'with-status-verbosity'.
2020-08-03 17:18:37 +02:00
Ludovic Courtès
a55d83b546
ui: Add #:verbosity to 'show-what-to-build'.
* guix/ui.scm (%default-verbosity): New variable.
(show-what-to-build): Add #:verbosity and honor it.
(build-notifier): Add #:verbosity and pass it to 'show-what-to-build'.
2020-08-03 17:17:41 +02:00
Lars-Dominik Braun
7caa3506ea
guix: lint: Ignore unsupported source URL’s.
* guix/lint.scm (check-source): Add match case for #f.

Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
2020-08-01 08:30:57 +02:00