Commit Graph

3235 Commits

Author SHA1 Message Date
Maxim Cournoyer 58b6812fd4
emacs-build-system: Reinstate the check phase.
* guix/build/emacs-build-system.scm (%standard-phases): Reinstate the check
phase from the gnu-build-system.
* guix/build-system/emacs.scm (emacs-build)[tests?]: But do not enable it by default.
[parallel-tests?]: Add argument.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2018-02-05 16:54:27 +01:00
Maxim Cournoyer b7dee6a0b8
emacs-build-system: Add set-emacs-load-path phase.
This generalizes the mechanism by which the Emacs dependencies are made visible,
so that any build phase can make use of them.

* guix/build/emacs-build-system.scm (%legacy-install-suffix): New variable.
(%install-suffix): Redefine in terms of %legacy-install-suffix.
(set-emacs-load-path): Add new phase used for dependency resolution.
(build): Remove ad-hoc dependency discovery mechanism.
(emacs-input->el-directory): Add new procedure.
(emacs-inputs-el-directories): Use it.
(package-name-version->elpa-name-version): Fix typo.
(%standard-phases): Include the new `set-emacs-load-path' phase. Refactor to
make the ordering of the phases clearer.
* guix/build/emacs-utils.scm (emacs-byte-compile-directory): Remove the
optional `dependency-dirs' argument, which is now obsoleted by the
`set-emacs-load-path' phase.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2018-02-05 16:54:27 +01:00
Marius Bakke bee7bb315c
Merge branch 'master' into core-updates 2018-02-01 13:18:47 +01:00
Maxim Cournoyer 8fbc1a2208
download: Fix return value of the url-fetch procedure.
Fixes <https://bugs.gnu.org/30270>.
Regression was introduced by commit 347fa4aebf.

* guix/build/download.scm (url-fetch): Return `file' instead of #t upon success.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2018-01-28 23:14:55 +01:00
Mark H Weaver b89d8a4271
Merge branch 'master' into core-updates 2018-01-26 00:15:26 -05:00
Tobias Geerinckx-Rice 980bcecdab
build-system/dub: Fix typo.
* guix/build/dub-build-system.scm (grep, grep*): Correct ‘occurence’.
2018-01-26 00:09:19 +01:00
Mark H Weaver a102d359a6
Merge branch 'master' into core-updates 2018-01-23 17:01:07 -05:00
Ludovic Courtès 33988f9b58
publish: Restore gzip compression in cache-less mode.
Fixes <https://bugs.gnu.org/30184>.
Regression introduced in 297e04d660.
Reported by Christopher Baines <mail@cbaines.net>.

* guix/scripts/publish.scm (nar-response-port): Add 'compression'
parameter and honor it.
(http-write): Get 'x-nar-compression' from the initial RESPONSE.
2018-01-22 11:15:50 +01:00
Ludovic Courtès 33033a620e
services: shepherd: Make 'shepherd-configuration-file' non-monadic.
Suggested by atw on #guix.

* gnu/services/shepherd.scm (shepherd-service-file): Use 'scheme-file'
instead of 'gexp->file'.
(shepherd-configuration-file): Likewise, and adjust to non-monadic
style.
(shepherd-boot-gexp): Adjust accordingly.
* guix/scripts/system.scm (upgrade-shepherd-services): Use
'lower-object' in addition to 'shepherd-service-file'.
2018-01-21 00:24:02 +01:00
Mark H Weaver e074a655dd
Merge branch 'master' into core-updates 2018-01-19 23:59:20 -05:00
Ludovic Courtès 20fe727105
packages: 'package-mapping' maps replacement.
* guix/packages.scm (package-mapping): Apply PROC to 'replacement' as well.
2018-01-20 00:45:29 +01:00
Tobias Geerinckx-Rice 162a137400
gnu: Consistently Write ‘file system(s)’.
It is the GNU way.

* doc/guix.texi (Build Systems, DNS Services): Write ‘file system(s)’.
* gnu/build/vm.scm (create-ext-file-system, create-fat-file-system):
Likewise.
* gnu/packages/backup.scm (dirvish, rsnapshot)[description]: Likewise.
* gnu/packages/check.scm (python-testpath)[description]: Likewise.
* gnu/packages/disk.scm (pydf)[description]: Likewise.
* gnu/packages/file-systems.scm (disorderfs)[synopsis, description]: Likewise.
(glusterfs)[description]: Likewise.
* gnu/packages/haskell.scm (ghc-directory, ghc-system-fileio-bootstrap)
(ghc-system-fileio)[synopsis]: Likewise.
(ghc-fsnotify)[description]: Likewise.
* gnu/packages/linux.scm (proot)[description]: Likewise.
(jmtpfs)[synopsis, description]: Likewise.
* gnu/packages/mate.scm (caja, caja-extensions)[description]: Likewise.
* gnu/packages/storage.scm (ceph)[description]: Likewise.
* gnu/packages/sync.scm (lsyncd)[description]: Likewise.
* gnu/packages/syncthing.scm (syncthing)[synopsis]: Likewise.
(go-github-com-zillode-notify)[description]: Likewise.
* gnu/services/nfs.scm (pipefs-service-type): Likewise.
* guix/scripts/system.scm (perform-action): Likewise.
2018-01-19 17:28:31 +01:00
Ludovic Courtès 8102cf0b37
gnu: commencement: Memoize 'linux-libre-headers-boot0'.
Fixes <https://bugs.gnu.org/30155>.

The effect can be seen in the package graph produced by:

  guix graph -e '(@@ (gnu packages commencement) static-bash-for-glibc)'

This reduces the number of "duplicate" nodes in this graph, i.e.,
distinct package objects that correspond to the same derivation (objects
that are not 'eq?' but semantically equal.)

* gnu/packages/commencement.scm (linux-libre-headers-boot0): Make an
'mlambda' instead of a 'lambda'.
(hurd-core-headers-boot0): Ditto.
2018-01-18 16:14:06 +01:00
Ludovic Courtès 92423868bc
ui: Disable '%fresh-auto-compile' only for Guile 2.2.3.
Mitigates <https://bugs.gnu.org/29881>.
Reported by Diego Nicola Barbato <dnbarbato@posteo.de>.

* guix/ui.scm (load*): Unset '%fresh-auto-compile' only on Guile 2.2.3.
2018-01-15 23:29:33 +01:00
Ludovic Courtès 309121a113
offload: Look at machine loads for the past minute.
Previously we were looking at the load of the past 5 minutes, which
means that, after a build, we could end up waiting for 5 minutes for
that metric to be low enough.

* guix/scripts/offload.scm (machine-load): Compute RAW based on ONE, not
FIVE.
2018-01-15 23:29:33 +01:00
Danny Milosavljevic b640370d82
ruby-build-system: Fix build error.
* gnu/build/ruby-build-system.scm: Import (ice-9 rdelim).

Follow-up to d9df4bf055.
2018-01-15 16:56:03 +01:00
Christopher Baines 2c2ec3d04a
ruby-build-system: Add a new wrap phase.
Wrap files in bin/ and sbin/ with the location of the gem itself and the
location of any other gems in use (GEM_PATH). This ensures that the bin files
will run with the right environment when executed.

It does however mean that native-inputs will also get wrapped up in any
binaries, which is not good, as it increases the size of the closure, and
risks this code being used at runtime.

* guix/build/ruby-build-system.scm (wrap): New procedure.
  (%standard-phases): Add the wrap phase.
2018-01-14 22:16:20 +00:00
Christopher Baines d9df4bf055
ruby-build-system: Add wrap-ruby-program.
A modified copy of wrap-program from (guix build utils). The wrap-program
procedure doesn't work well for Ruby scripts, as it breaks using the -S flag
with ruby to execute the script, as when -S is passed to ruby, it expects the
script on the PATH to use ruby in the shebang, and not bash.

Therefore, to wrap the program, but keep the shebang as ruby, wrap it with a
ruby script instead.

wrap-ruby-program uses .real/foo rather than .foo-real, as this might be
neater. This procedure also includes a call to Gem.clear_paths to make it
possible to set the GEM_PATH through this method, and for it to take effect.

* gnu/build/ruby-build-system.scm (wrap-ruby-program): New procedure.
2018-01-14 22:16:15 +00:00
Christopher Baines 3cb3fa6747
guix: build: ruby-build-system: Install to the vendor directory
* guix/build/ruby-build-system.scm (install): Install gems to the vendor
  directory, rather than the GEM_HOME. The vendor directory does not include
  the version of ruby used to install the gem in the path, which makes it
  easier to add it to the GEM_PATH for all versions of ruby to use.
  (gem-home): Remove procedure.
* gnu/packages/ruby.scm (ruby, ruby-2.1)[native-search-paths]: Switch to
  lib/ruby/vendor_ruby.
  (ruby-1.8)[native-search-paths]: Remove native-search-paths.
  (gem-directory): Remove procedure.
  (ruby-ansi, ruby-ae)[arguments]: Remove use of gem-directory.
  (ruby-metaclass, ruby-instantiator, ruby-introspection, ruby-mocha,
  ruby-nokogiri, ruby-minitest-tu-shim, ruby-redcloth)[arguments]: Remove use
  of gem-home.
  (ruby-git, ruby-httpclient)[arguments]: Remove use of GEM_HOME.
* gnu/packages/databases.scm (es-dump-restore)[arguments]: Remove use of
  GEM_HOME.
2018-01-14 22:16:08 +00:00
Ludovic Courtès 0dcf675c56
ssh: Switch back to 'get-bytevector-some'.
This mostly reverts 17af5d51de.
Suggested by Andy Wingo <wingo@igalia.com>.

* guix/ssh.scm (remote-daemon-channel)[redirect]: Remove 'read!' FFI
hack.  Use buffered ports.
2018-01-12 23:41:15 +01:00
Ludovic Courtès 4eb0f9ae05
offload: 'test' reports Guile and module errors more nicely.
Fixes <https://bugs.gnu.org/26008>.
Reported by Myles English <mylesenglish@gmail.com>.

* guix/ssh.scm (retrieve-files*): Move error reporting to...
(report-guile-error, report-module-error): ... here.  New procedures.
* guix/scripts/offload.scm (assert-node-repl): Use 'report-guile-error'.
(assert-node-has-guix): Explicitly check for 'use-modules' first.  Use
'report-module-error'.
2018-01-12 23:41:15 +01:00
Ludovic Courtès 5a5e34e358
offload: 'test' gracefully handles 'node-repl-error'.
Fixes <https://bugs.gnu.org/28057>.
Reported by Ricardo Wurmus <rekado@elephly.net>.

* guix/scripts/offload.scm (assert-node-has-guix): Catch
'node-repl-error' and call 'leave'.
2018-01-12 23:41:15 +01:00
Ludovic Courtès 0e3c8528af
ssh: 'retrieve-files' now only retrieves what's missing.
* guix/ssh.scm (retrieve-files): Remove the subset of FILES that is
valid in LOCAL.
(store-export-channel): Add comment.
2018-01-12 23:41:15 +01:00
Ludovic Courtès d06d54e338
offload: Fix regression in file retrieval.
This fixes a regression in 'retrieve-files*' introduced in
896fec476f, whereby (guix scripts offload)
would not read the initial sexp now sent by the remote host via
'store-export-channel'.  This would effectively prevent file retrieval
entirely when offloading.

* guix/ssh.scm (retrieve-files*): New procedure, like former
'retrieve-files' but with an extra #:import parameter.
(retrieve-files): Rewrite in terms of 'retrieve-files*'.
(file-retrieval-port): Make private.
* guix/scripts/offload.scm (transfer-and-offload): Pass #:import to
'retrieve-files*'.
(retrieve-files*): Remove.
2018-01-12 23:41:15 +01:00
Leo Famulari 4adb40bffc
Merge branch 'master' into core-updates 2018-01-11 14:22:50 -08:00
Ludovic Courtès e21888dd0d
derivations: Fix typo in docstring.
* guix/derivations.scm (derivation-prerequisites): Fix typo in docstring.
2018-01-11 00:00:03 +01:00
Ludovic Courtès 55f40fdbcd
ssh: Pass an empty "exceptfds" set to 'select'.
Previously the redirect code could end up exiting prematurely because of
an uninteresting "exceptional condition" on the socket (info "(libc)
Waiting for I/O").

* guix/ssh.scm (remote-daemon-channel): Pass the empty list as the third
argument to 'select'.  It was a mistake to pass a non-empty list there
in the first place.
2018-01-11 00:00:03 +01:00
Ludovic Courtès 39d1e9654c
store: Fix potential over-reads in 'import-paths'.
Previously 'process-stderr' would always pass a bytevector of MAX-LEN to
then daemon in the %stderr-read case (i.e., 'import-paths'), instead of
LEN (where LEN <= MAX-LEN).

In practice the extra bytes didn't cause a protocol violation or
anything because they happen at the end of the stream, which typically
contains the canonical sexp of the signature, and the extra zeros were
just ignored.

* guix/serialization.scm (write-bytevector): Add optional 'l' parameter
and honor it.
* guix/store.scm (process-stderr): Pass LEN to 'write-bytevector'.
2018-01-11 00:00:02 +01:00
Ludovic Courtès 17af5d51de
ssh: Work around 'get-bytevector-some' bug.
This works around <https://bugs.gnu.org/30066> and noticeably improves
performance when using GUIX_DAEMON_SOCKET=ssh://HOST (the redirect code
was transferring data to guix-daemon one byte at a time!).

* guix/ssh.scm (remote-daemon-channel)[redirect]: Define 'read!' and use
it instead of 'get-bytevector-some'.
2018-01-11 00:00:02 +01:00
Tobias Geerinckx-Rice 8286215326
gnu: Use one spelling for ‘copyright’.
* gnu/packages/gtk.scm: Standardise on ‘copyright’ spelling in
file headers.
* gnu/packages/pdf.scm: Likewise.
* gnu/packages/perl-check.scm: Likewise.
* gnu/packages/perl.scm: Likewise.
* guix/import/gem.scm: Likewise.
* guix/import/hackage.scm: Likewise.
2018-01-10 18:21:20 +01:00
Ludovic Courtès 297e04d660
publish: Remove "Guix-Nar-Compression" header from responses.
This was harmless but non-compliant and unnecessary.

* guix/scripts/publish.scm <top level>: Rename "Guix-Nar-Compression" to
"X-Nar-Compression" as should have always been.
(render-nar, nar-response-port): Adjust accordingly.
(strip-headers): New procedure.
(sans-content-length, with-content-length): Use it.
2018-01-09 23:39:02 +01:00
Ludovic Courtès 1e63ecee0b
import: crate: Gracefully deal with missing license info.
Reported by Fis Trivial <ybbs.daans@hotmail.com>.
Fixes <https://bugs.gnu.org/28987>.

* guix/import/crate.scm (crate-fetch): Check whether the "license" info
is present.
2018-01-08 11:45:35 +01:00
Ludovic Courtès c04ffadbed
publish: Publish build logs.
* guix/scripts/publish.scm (render-log-file): New procedure.
(make-request-handler): Add "log" case.
* tests/publish.scm ("/log/NAME")
("/log/NAME not found"): New tests.
* doc/guix.texi (Invoking guix publish): Document /log URLs.
2018-01-07 23:51:46 +01:00
Ludovic Courtès 152b7beeac
publish: Use 'x-raw-file' internal response header.
This adjusts the workaround for <http://bugs.gnu.org/21093> so that it's
not limited to a single content-type.

* guix/scripts/publish.scm (render-nar/cached): Add the 'x-raw-file'
header on the response.
(render-content-addressed-file): Likewise.
(with-content-length): Remove the 'x-raw-file' header.
(http-write): Instead of dispatching on 'application/octet-stream',
check whether 'x-raw-file' is set to determine whether to spawn a
thread.
2018-01-07 23:47:22 +01:00
Ludovic Courtès 29a6866886
daemon: Add gzip log compression.
* nix/nix-daemon/guix-daemon.cc (GUIX_OPT_LOG_COMPRESSION): New macro.
(options): Mark "disable-log-compression" as hidden and add
"log-compression".
(parse_opt): Handle GUIX_OPT_LOG_COMPRESSION.
* nix/libstore/build.cc (DerivationGoal): Add 'gzLogFile'.
(openLogFile): Initialize it when 'logCompression' is COMPRESSION_GZIP.
(closeLogFile, handleChildOutput): Honor 'gzLogFile'.
* nix/libstore/globals.hh (Settings)[compressLog]: Remove.
[logCompression]: New field.
(CompressionType): New enum.
* nix/libstore/globals.cc (Settings::Settings): Initialize it.
(update): Remove '_get' call for 'compressLog'.
* nix/local.mk (guix_daemon_LDADD, guix_register_LDADD): Add -lz.
* guix/store.scm (log-file): Handle '.gz' log files.
* tests/guix-daemon.sh: Add test with '--log-compression=gzip'.
* doc/guix.texi (Invoking guix-daemon): Adjust accordingly.
* config-daemon.ac: Check for libz and zlib.h.
2018-01-07 23:47:22 +01:00
Ludovic Courtès 896fec476f
ssh: Improve error reporting when retrieving files.
'guix copy --from' now reports messages much more useful than "failed to
retrieve files".

* guix/ssh.scm (store-export-channel)[export]: Wrap 'use-modules' in
'catch' and 'with-store' in 'guard'.  Check for invalid items.  Write a
status sexp on stdout.
(raise-error): New macro.
(retrieve-files): Read the initial status sexp and report errors
accordingly.
2018-01-07 23:46:39 +01:00
Ludovic Courtès 4a8d536ffe
ui: Display hints that come along with '&message' conditions.
* guix/ui.scm (call-with-error-handling): Add case for message and
fix-hint?.
2018-01-07 23:46:39 +01:00
Ludovic Courtès f396611776
publish: Save bandwidth on narinfo 404s.
This saves 18 bytes on each 404 narinfo response.

* guix/scripts/publish.scm (render-narinfo): Pass #:phrase to
'not-found'.
(render-narinfo/cached): Likewise.
2018-01-06 14:43:45 +01:00
Leo Famulari 4ed41f472b
Merge branch 'master' into core-updates 2018-01-03 14:18:01 -05:00
Ludovic Courtès 92f36323c4
ui: It's 2018 now!
* guix/ui.scm (show-version-and-exit): Change year to 2018.
2018-01-01 18:22:28 +01:00
Danny Milosavljevic d1a08062c6
build-system/glib-or-gtk: Don't generate 'icon-theme.cache'.
* guix/build-system/glib-or-gtk.scm (glib-or-gtk-build): Don't generate
'icon-theme.cache'.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2018-01-01 18:09:05 +01:00
Efraim Flashner 23de2e1d5f
Merge remote-tracking branch 'origin/master' into core-updates 2017-12-31 14:10:25 +02:00
Danny Milosavljevic 6a1a69679d
build: dub-build-system: Make builds reproducible.
* guix/build/dub-build-system.scm (build): Make reproducible.
(check): Make reproducible.
2017-12-31 00:29:59 +01:00
Ludovic Courtès 3e30cdf1c3
guix build: Support '--with-source=PACKAGE@VERSION=URI'.
* guix/scripts/build.scm (numeric-extension?, tarball-base-name): New
procedures, formerly in 'package-with-source'.
(transform-package-source)[new-sources]: Look for '=' in URI.  Each
element of the list of now a (PKG VERSION SOURCE) tuple.
Pass VERSION to 'package-with-source'.
(package-with-source): Add 'version' parameter and honor it.
* tests/scripts-build.scm ("options->transformation, with-source, PKG=URI")
("options->transformation, with-source, PKG@VER=URI"): New tests.
* doc/guix.texi (Package Transformation Options): Document the new
forms.
2017-12-23 00:05:05 +01:00
Ludovic Courtès 893d0b0bf3
guix system: Check mapped devices upon 'init' and 'reconfigure'.
* guix/scripts/system.scm (check-mapped-devices): New procedure.
(perform-action): Add call to 'check-mapped-devices'.
2017-12-22 09:48:41 +01:00
Ricardo Wurmus 47ebb1a850
guix: Exclude broken symlinks from man files.
* guix/man-db.scm (man-files): Remove broken symlinks from list of man pages.
2017-12-22 00:06:37 +01:00
Leo Famulari f76fc96866
Merge branch 'master' into core-updates 2017-12-21 13:58:35 -05:00
Ludovic Courtès d2b5ede053
build-system/gnu: Check whether the cross-libc has a "static" output.
This is a followup to 614fffe427, which
broke cross-compilation to i686-w64-mingw32.

* guix/build-system/gnu.scm (standard-cross-packages): Add
"cross-libc:static" only when LIBC has a "static" output.
2017-12-21 10:46:24 +01:00
Ludovic Courtès 614fffe427
build-system/gnu: Add the "static" output of libc in cross environments.
Fixes a regression whereby the host libc.a would be missing when
cross-compiling.

This is a followup to commit 6dff905e51.

* guix/build-system/gnu.scm (standard-cross-packages): Add the
"cross-libc:static".
2017-12-20 14:56:47 +01:00
Efraim Flashner 5857a0658a
guix: cmake-build-system: Install libraries to /lib.
* guix/build/cmake-build-system.scm (configure): Add flag to always
install libraries in /lib.
2017-12-19 19:52:00 +02:00
Ludovic Courtès 618f0582b4
upstream: Reject bogus archive type guesses.
This would crash 'guix refresh -u' with source URLs ending in
"…/v1.2.3".

* guix/upstream.scm (package-update): Be stricter when determining
ARCHIVE-TYPE.
2017-12-19 18:16:47 +01:00
Marius Bakke 32cd878be0
Merge branch 'master' into core-updates 2017-12-19 01:42:40 +01:00
Ludovic Courtès 3caab236c4
guix gc: '--verify=foo' is reported as an error.
Fixes <https://bugs.gnu.org/29761>.
Reported by Martin Castillo <castilma@uni-bremen.de>.

* guix/scripts/gc.scm (argument->verify-options): New procedure.
(%options) ["verify"]: Adjust to use it.
* tests/guix-gc.sh: Add test.
2017-12-18 23:17:30 +01:00
Ludovic Courtès ab25eb7caa
gexp: 'computed-file' has a new #:guile parameter.
* guix/gexp.scm (<computed-file>)[guile]: New field.
(computed-file): Add #:guile.
(computed-file-compiler): Honor 'guile'.
2017-12-18 17:52:58 +01:00
Ludovic Courtès 399993f804
ui: Non-zero exit for compound '&message' and '&error-location' conditions.
* guix/ui.scm (call-with-error-handling): When both 'message?' and
'error-location?' are true, add call to 'exit'.
2017-12-18 17:52:58 +01:00
Ludovic Courtès 16613d230b
man-db: Autoload (gdbm).
Fixes 'guix pull'.
Reported by ofosos on #guix.

* guix/man-db.scm: Use 'module-autoload!' instead of 'module-use!'.
so that (gdbm) is not loaded until we need it.
2017-12-17 21:38:03 +01:00
Ludovic Courtès 58d9e71bf1
gnu-maintenance: 'latest-ftp-release' ignores "unstable" directories.
* guix/gnu-maintenance.scm (latest-ftp-release): Filter out "unstable"
directories.
2017-12-17 16:52:27 +01:00
Ludovic Courtès b8396f96bf
profiles: Use (guix man-db) to create the manual database.
Fixes <https://bugs.gnu.org/29654>.
Reported by Ruud van Asseldonk <dev+guix@veniogames.com>.

This also speeds up database creation compared to "man-db
--create" (less than half the time, on a warm cache, for 19k pages.)

* guix/man-db.scm: New file.
* Makefile.am (MODULES_NOT_COMPILED): Add it.
* guix/profiles.scm (manual-database): Rewrite to use (guix man-db).
2017-12-17 16:19:00 +01:00
Ricardo Wurmus dafc3dafea
guix: offload: Add "status" sub-command.
* guix/scripts/offload.scm (check-machine-status): New procedure.
(guix-offload): Call it when the argument is "status".
* doc/guix.texi (Daemon Offload Setup): Document it.
2017-12-16 21:51:33 +01:00
Mathieu Othacehe 5a72ddf176
scripts: system: Add --expression option.
* guix/scripts/system.scm (show-help): Add expression option.
(%options): Ditto.
(guix-system): Allow commands taking a file as an argument to use an
expression instead.
(process-action): Read operating-system from expression or file.
* doc/guix.texi (Invoking guix system): Introduce the expression option.
2017-12-15 12:15:15 +01:00
Ludovic Courtès 3e0a42973b
progress: Rename 'erase-in-line' to 'erase-current-line'.
Suggested by Danny Milosavljevic <dannym@scratchpost.org>.

* guix/progress.scm (erase-in-line): Rename to...
(erase-current-line): ... this.  Adjust callers.
2017-12-15 11:53:21 +01:00
Mathieu Othacehe e224820386
bootloader: Factorize write-file-on-device.
* gnu/bootloader/extlinux.scm (install-extlinux): Factorize bootloader
writing in a new procedure write-file-on-device defined in (gnu build
bootloader).
* gnu/build/bootloader.scm: New file.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add new file.
* gnu/system/vm.scm (qemu-img): Adapt to import and use (gnu build bootloader)
module during derivation building.
* gnu/scripts/system.scm (bootloader-installer-derivation): Ditto.
2017-12-15 11:52:38 +01:00
Ricardo Wurmus 1bc147d609
guix: ant-build-system: Do not compress jars.
Fixes <https://bugs.gnu.org/29700>.

* guix/build/ant-build-system.scm (strip-jar-timestamps): Do not compress jar
when repacking.
2017-12-15 00:00:34 +01:00
Ludovic Courtès 34797d8afc
hydra: Invalidate derivation caches after each architecture evaluation.
This reduces max RSS from 1.3G to 1.0G.

* guix/derivations.scm (invalidate-derivation-caches!): New procedure.
* build-aux/hydra/gnu-system.scm (hydra-jobs): Use it.  Add 'format'
call.
2017-12-13 23:11:53 +01:00
Ludovic Courtès d1f01e4845
memoization: Add 'invalidate-memoization!.
* guix/memoization.scm (%make-hash-table*): When not profiling, add the
new table to %MEMOIZATION-TABLES.
(invalidate-memoization!): New procedure.
2017-12-13 23:11:53 +01:00
Ludovic Courtès 90354e34e3
derivations: Don't memoize 'derivation-hash'.
This has little or no run-time impact and slightly reduces the memory
footprint.

* guix/derivations.scm (derivation-hash): Replace 'mlambda' with
'lambda'.
2017-12-13 23:11:53 +01:00
Ludovic Courtès eb1150c22c
derivations: Split 'derivation-hash' in two procedures.
* guix/derivations.scm (derivation/masked-inputs): New procedure.
(derivation-hash): Use it instead of the inline code.
2017-12-13 23:11:53 +01:00
Ludovic Courtès 22358bdb7c
Revert "derivations: 'derivation-hash' assumes inputs are coalesced."
This reverts commit 1d008d9f8c.
Reported by Rutger Helling <rhelling@mykolab.com>.
Fixes <https://bugs.gnu.org/29689>.
2017-12-13 15:13:38 +01:00
Ludovic Courtès 1d008d9f8c
derivations: 'derivation-hash' assumes inputs are coalesced.
* guix/derivations.scm (derivation-hash): Remove
redundant 'coalesce-duplicate-inputs' call.
2017-12-12 18:11:22 +01:00
Ludovic Courtès 3d19b7fbc2
derivations: Use 'define-immutable-record-type' as appropriate.
This is a followup to dc673fa113.

* guix/derivations.scm (<derivation-output>, <derivation-input>): Use
'define-immutable-record-type'.
2017-12-12 18:11:22 +01:00
Ludovic Courtès 6c80641d54
memoization: Profiling support keeps track of lookups and hits.
* guix/memoization.scm (<cache>): New record type.
(define-lookup-procedure, define-update-procedure): New macros.
(cache-ref, cacheq-ref, cache-set!, cacheq-set!): New procedures.
(cached/mv, cachedq/mv, cached, cachedq): Use them instead of 'hash-ref'
and 'hash-set!'.
(%make-hash-table*): When 'profiled?' returns true, return a <cache>
object.
(define-cache-procedure): Adjust to show cache lookups and hits.
2017-12-12 18:11:22 +01:00
Ludovic Courtès 252c408377
memoization: Add profiling support.
* guix/memoization.scm (%memoization-tables): New variable.
(%make-hash-table*, show-memoization-tables): New procedures.
(make-hash-table*): New macro.
Add top-level call to 'register-profiling-hook!'.
(memoize): Adjust to pass the resulting procedure to
'make-hash-table*'.
(%mlambda): Likewise.
2017-12-12 18:11:22 +01:00
Ludovic Courtès 03870da819
Add (guix profiling).
* guix/profiling.scm: New file.
* Makefile.am (MODULES): Add it.
* guix/store.scm (record-operation): Use 'profiled?' and
'register-profiling-hook!'.
2017-12-12 18:11:22 +01:00
nee 47dc9a0dae
guix: utils: Add version-major.
* guix/utils.scm (version-major): New procedure.
2017-12-11 19:12:23 +00:00
Eric Bavier 7f04197fef
utils: Fix cond-expand for Guile 2.0.
* guix/build/download.scm (tls-wrap): Use 'guile-2.2' feature instead.
2017-12-10 15:58:55 -06:00
Ludovic Courtès 3b80b81358
ui: Display hints to resolve profile collisions.
Fixes <https://bugs.gnu.org/29255>.
Reported by Ben Sturmfels <ben@sturm.com.au>.

* guix/ui.scm (display-collision-resolution-hint): New procedure.
(call-with-error-handling): Call it upon '&profile-collistion-error'.
2017-12-10 23:44:58 +01:00
Ludovic Courtès 8bc1935c7c
build-system/asdf: Use 'mlambda'.
* guix/build-system/asdf.scm (package-with-build-system): Use 'mlambda'
instead of 'memoize'.
2017-12-10 23:44:58 +01:00
Efraim Flashner f4007b2547
lint: 'check-vulnerabilities' also checks package properties.
* guix/scripts/lint.scm (check-vulnerabilities): Also check for CVEs
listed as mitigated in the package properties.
* tests/lint.scm ("cve: known safe from vulnerability"): New test.
2017-12-10 21:59:07 +02:00
Rutger Helling 00cf98eb60
licenses: Add wxWindows 3.1 license.
* guix/licenses.scm (wxwindows3.1+): New variable.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2017-12-08 15:03:46 +01:00
Ludovic Courtès 7920e187c1
scripts: All commands enable build hooks by default.
* guix/scripts/archive.scm (%default-options): Add 'build-hook?'.
* guix/scripts/copy.scm (%default-options): Likewise.
* guix/scripts/environment.scm (%default-options): Likewise.
* guix/scripts/pack.scm (%default-options): Likewise.
* guix/scripts/package.scm (%default-options): Likewise.
* guix/scripts/pull.scm (%default-options): Likewise.
2017-12-07 23:12:37 +01:00
Marius Bakke 9e111db453
Merge branch 'master' into core-updates 2017-12-07 18:26:11 +01:00
Ludovic Courtès 5a2f019c7d
Merge branch 'version-0.14.0' 2017-12-07 17:16:05 +01:00
Ludovic Courtès 609d126e86
Revert "packages: 'package-grafts' trims native inputs."
This reverts commit 91c9b5d016
following the concerns raised by Mark, Ben, and Tobias:
<https://lists.gnu.org/archive/html/guix-devel/2017-12/msg00081.html>.
2017-12-06 09:07:28 +01:00
Ludovic Courtès 45c32bd7e5
syscalls: Define 'input-flags' for 'tcgetattr' and friends.
* guix/build/syscalls.scm (input-flags): New macro.
2017-12-06 08:51:08 +01:00
Marius Bakke 77181815ae
Merge branch 'master' into core-updates 2017-12-05 23:41:30 +01:00
Ludovic Courtès 91c9b5d016
packages: 'package-grafts' trims native inputs.
'package-grafts' returns a list of potentially applicable grafts, which
'cumulative-grafts' then narrows by looking at store item references and
determining the subset of the grafts that's actually applicable.

Until now, 'package-grafts' would traverse native inputs and would thus
return a large superset of the applicable grafts, since native inputs
are not in the reference graph by definition.  This patch fixes that by
having 'package-grafts' ignore entirely native inputs from the
dependency graph.

* guix/packages.scm (fold-bag-dependencies)[bag-direct-inputs*]: Add
special case for libc.
* guix/packages.scm (bag-grafts)[native-grafts, target-grafts]: Remove.
[grafts]: New procedure.
Use it.
* tests/packages.scm ("package-grafts, grafts of native inputs
ignored"): New test.
2017-12-05 16:32:40 +01:00
Ludovic Courtès ff0e0041f3
packages: 'fold-bag-dependencies' honors nativeness in recursive calls.
Previously recursive calls to 'loop' would always consider all the bag
inputs rather than those corresponding to NATIVE?.

* guix/packages.scm (fold-bag-dependencies)[bag-direct-inputs*]: New
procedure.  Use it both in the 'match' expression and in its body.
2017-12-05 15:13:38 +01:00
Mathieu Othacehe 4307397b5e
bootloader: extlinux: Stop using dd binary.
* gnu/bootloader/extlinux.scm (dd): Remove it,
(install-extlinux): replace dd call by Guile I/O procedures.
* gnu/system/vm.scm (qemu-image): Add (ice-9 binary-ports) to used-modules
list to provide "get-bytevector-n" and "put-bytevector".
* guix/scripts/system.scm (bootloader-installer-derivation): Ditto.
2017-12-04 18:26:59 +01:00
Ludovic Courtès 3fb6464ba4
ui: Tweak conflicting profile entry error message.
* guix/ui.scm (call-with-error-handling): Use 'manifest-entry-output*'
when reporting conflicting profile entries.
2017-12-03 23:18:53 +01:00
Ludovic Courtès cbb76780ef
profiles: Really disable deprecation warnings for 'profile-derivation'.
This is a followup to 2815fca142.

* guix/profiles.scm (profile-derivation)[builder]: Remove
'debug-disable' call, which was ineffective.
Pass #:env-vars to 'gexp->derivation'.
2017-12-03 23:18:53 +01:00
Ludovic Courtès d9721c2096
scripts: Default to Guile 2.2 as the guile-for-build.
* guix/scripts/environment.scm (guix-environment): '%guile-for-build'
now defaults to GUILE-2.2 instead of GUILE-2.0.
* guix/scripts/package.scm (guix-package): Likewise.
* guix/scripts/pull.scm (guix-pull): Likewise.
2017-12-03 23:18:53 +01:00
Ludovic Courtès 2815fca142
profile: Use _IO* but disable deprecation warning.
This fixes a regression introduced in
2f60084f77, whereby the profile derivation
would fail to run on Guile 2.0 (as is the case with "guix package
--bootstrap").

Reported by Christopher Baines.

* guix/profiles.scm (profile-derivation)[builder]: Use _IO* but add
'debug-disable' call.
2017-12-03 21:50:46 +01:00
Ludovic Courtès 2f60084f77
profiles: Avoid _IO* in profile builder.
* guix/profiles.scm (profile-derivation)[builder]: Avoid the deprecated
_IO* constants.
2017-12-03 19:12:16 +01:00
Ludovic Courtès cdc938daf9
profiles: Do not import the host's srfi-{19,26}.scm files.
Previously the "manual-database" derivation would always import the
host's srfi-{19,26}.scm files in the build side.  In practice this means
that different users could get different manual-database.drv depending
on the Guile version they're using in the host.

For example, the (gnu tests install) tests would fail if the host was
running Guile 2.2.3 because the guest is running 2.2.2, and thus has
different srfi-{19,26}.scm files.  The manual-database.drv would need to
be built from source, which would fail because prerequisites were
missing.

Reported by Mathieu Othacehe <m.othacehe@gmail.com>
at <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=29409#96>.

* guix/profiles.scm (manual-database): Do not pass #:modules to
'gexp->derivation'.  Wrap 'build' gexp in 'with-imported-modules' form.
2017-12-03 19:12:16 +01:00
Marius Bakke c6bc8e22e9
gnu: glibc: Don't use full version string in locale path.
This is a follow-up to commit ee3ebf1a35.
Fixes <https://bugs.gnu.org/29537>.

* gnu/packages/base.scm (glibc/linux)[version]: Change to 2.26.91-gaaa2eb83b8.
[source](uri): Adjust accordingly.
[arguments]: Use VERSION-MAJOR+MINOR for locales path.
(glibc-locales, glibc-utf8-locales): Likewise.
* guix/packages.scm (patch-and-repack): Likewise.
* guix/profiles.scm (ca-certificate-bundle, profile-derivation): Likewise.
2017-12-03 16:23:43 +01:00
Ludovic Courtès e2721a05e7
Do not set '%fresh-auto-compile'.
* guix/scripts/offload.scm (build-machines): Comment out
'(set! %fresh-auto-compile #t)' since with Guile 2.2.3 it could lead to
an actual rebuild of everything that gets loaded from there on.  See
<https://bugs.gnu.org/29226>.
* guix/ui.scm (load*): Likewise.
2017-12-01 18:47:34 +01:00
Ludovic Courtès cea25b08bf
records: Use 'make-struct/no-tail'.
* guix/records.scm (make-syntactic-constructor): Use
'make-struct/no-tail' as 'make-struct' is deprecated as of 2.2.3.
2017-12-01 18:47:34 +01:00
Ludovic Courtès e261e27676
guix system: 'init' displays a progress bar while copying.
Until now it would print the name of each store item being copied, which
was verbose and unhelpful.

* guix/scripts/system.scm (copy-closure): Use 'progress-reporter/bar'
and 'call-with-progress-reporter'.
(guix-system): Parameterize 'current-terminal-columns'.
2017-12-01 16:00:14 +01:00
Ludovic Courtès e4ecd51e23
guix system: Simplify closure copy.
* guix/scripts/system.scm (copy-item): Add 'references' argument and
remove 'references*' call.  Turn into a non-monadic procedure.
(copy-closure): Remove initial call to 'references*'.  Only pass ITEM to
'topologically-sorted*' since that's equivalent.  Compute the list of
references corresponding to TO-COPY and pass it to 'copy-item'.
2017-12-01 16:00:14 +01:00
Ludovic Courtès 1fafa2f587
weather: Use (guix progress) for progress report.
* guix/progress.scm (start-progress-reporter!, stop-progress-reporter!)
(progress-reporter-report!): New procedures.
* guix/scripts/weather.scm (call-with-progress-reporter): New procedure.
(package-outputs)[update-progress!]: Remove.
Use 'call-with-progress-reporter' instead.
(guix-weather): Parameterize 'current-terminal-columns'.
2017-12-01 16:00:14 +01:00