Commit Graph

2522 Commits (db6afe387ae74943a0c66c7488be49bd509b51c4)

Author SHA1 Message Date
David Craven dc77498c1c
build-system: cargo: Make Cargo.toml writeable.
* guix/build/cargo-build-system.scm (configure): Make sure Cargo.toml
  is writeable before attempting modification.

Problem reported by Danny Milosavljevic <dannym@scratchpost.org>.
2017-01-01 18:11:57 +01:00
Ludovic Courtès f11c444d44
Add 'guix copy'.
* guix/scripts/copy.scm: New file.
* guix/scripts/archive.scm (options->derivations+files): Export.
* doc/guix.texi (Invoking guix copy): New node.
* Makefile.am (MODULES) [HAVE_GUILE_SSH]: Add guix/scripts/copy.scm.
* po/guix/POTFILES.in: Likewise.
2016-12-31 18:35:29 +01:00
Ludovic Courtès 13164a2102
ssh: 'retrieve-files' detects remote export failures.
* guix/ssh.scm (retrieve-files): Call 'lookahead-u8' and raise a
'&message' condition when it returns EOF.
2016-12-31 18:35:29 +01:00
Ludovic Courtès 23973e4fbf
ssh: 'send-files' returns the list of items sent.
* guix/ssh.scm (send-files): Return MISSING.
2016-12-31 18:35:29 +01:00
Ludovic Courtès e9629e8221
ssh: Allow transfers of complete closures.
* guix/ssh.scm (store-export-channel, send-files)
(file-retrieval-port, retrieve-files): Add #:recursive? parameter and
honor it.
2016-12-31 18:35:29 +01:00
Ludovic Courtès c0b2d08bf4
git-download: Use a single download script for all derivations.
That way, we have only one /gnu/store/…-git-download instead of one
/gnu/store/…-PACKAGE-checkout-builder for each package.

This is a followup to ced200328c.

* guix/git-download.scm (git-fetch)[build]: Get the URL, commit, and
recursive parameter using 'getenv'.  Pass #:script-name and #:env-vars
arguments to 'gexp->derivation'.
2016-12-31 18:35:29 +01:00
Ludovic Courtès 987a29ba43
Add (guix ssh) module.
* guix/scripts/offload.scm (connect-to-remote-daemon)
(store-import-channel, store-export-channel, send-files)
(retrieve-files): Move to (guix ssh).
(nonce): Add optional 'name' parameter and use it.
(retrieve-files*): New procedure.
(transfer-and-offload): Use it instead of 'retrieve-files', and add
first parameter to 'send-files'.
(assert-node-can-import): Likewise.
(assert-node-can-export): Use 'retrieve-files' instead of
'store-export-channel'.
* guix/ssh.scm: New file.
* configure.ac: Use 'GUIX_CHECK_GUILE_SSH' and define 'HAVE_GUILE_SSH'
Automake conditional.
* Makefile.am (MODULES) [HAVE_GUILE_SSH]: Add guix/ssh.scm.
2016-12-31 01:44:04 +01:00
Carlo Zancanaro 681a555b83
import: elpa: Import dependencies as propagated-inputs
* guix/import/elpa.scm (elpa-package->sexp): Import dependencies as
propagated-inputs.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2016-12-29 18:22:49 +01:00
Carlo Zancanaro 36225d4fef
import: elpa: Fix call-with-downloaded-file
* guix/import/elpa.scm (call-with-downloaded-file): Make function behaviour
match documentation string.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2016-12-29 18:22:49 +01:00
Ludovic Courtès 7c247809ef
guix build: '--with-source' overrides the 'replacement' of a package.
* guix/scripts/build.scm (package-with-source): Set 'replacement' to #f.
* tests/scripts-build.scm ("options->transformation, with-source,
replacement"): New test.
2016-12-21 23:48:14 +01:00
Ludovic Courtès 62bd24db39
import: github: Use 'json-fetch'.
* guix/import/github.scm (json-fetch*): Remove.
(latest-released-version): Adjust accordingly.
2016-12-20 19:14:41 +01:00
Ludovic Courtès f943c317fb
environment: Add '--root' option.
* guix/scripts/environment.scm (show-help, %options): Add --root.
(register-gc-root): New procedure.
(guix-environment): Call 'register-gc-root' when OPTS has a 'gc-root'
option.
* doc/guix.texi (Invoking guix environment): Document it.
* tests/guix-environment.sh: Add tests.
2016-12-20 19:14:41 +01:00
Marius Bakke 4cb7786eff
import: pypi: Match new 'pypi-uri' domain in updater.
* guix/import/pypi.scm (pypi-package?): Match pypi.io domain.
2016-12-20 12:57:26 +01:00
Ludovic Courtès d343a60f93
gexp: Slightly simplify 'gexp-inputs'.
* guix/gexp.scm (gexp-inputs)[add-reference-inputs]: Remove unneeded
'if' in the non-native nested gexp case.
2016-12-19 17:51:00 +01:00
Ludovic Courtès 5b14a7902c
gexp: Native inputs of nested gexps are properly accounted for.
Previously, 'gexp-native-inputs' would not return the native inputs of
nested gexps.  For example, this:

  (gexp-native-inputs #~(foo #$#~(bar #+coreutils)))

would return '().

* guix/gexp.scm (gexp-inputs)[add-reference-inputs]: In the
non-recursive cases, check whether N? and NATIVE? are the same, and act
accordingly.
[native-input?]: Remove.
Fold over all of (gexp-references exp).
* tests/gexp.scm ("ungexp + ungexp-native, nested, special mixture"):
New test.
* tests/gexp.scm ("input list splicing + ungexp-native-splicing"): Pass
 #:native? #t to 'gexp-input'.
2016-12-19 17:51:00 +01:00
Ricardo Wurmus fdbc84b056
import cran: Handle HTTP errors.
Fixes <http://bugs.gnu.org/23479>.

* guix/import/cran.scm (fetch-description): Return #f in case of HTTP
errors.
2016-12-17 19:13:42 +01:00
Ricardo Wurmus d68ba5f483
guix import: Print list of expressions.
* guix/scripts/import.scm (guix-import): Print list of expressions.
2016-12-17 19:13:41 +01:00
Ricardo Wurmus 64ce53eb5e
import cran: Add "recursive" option.
* guix/scripts/import/cran.scm: (%options): Add "recursive" option.
(guix-import-cran): Handle "recursive" option.
* doc/guix.texi (Invoking guix import): Document it.
2016-12-17 19:13:41 +01:00
Ricardo Wurmus 94e907b962
import cran: Add recursive importer.
* guix/import/cran.scm (recursive-import): New variable.
(cran->guix-package): Memoize the procedure.
2016-12-17 19:12:55 +01:00
Ricardo Wurmus b26abe4f14
import cran: Ignore default R packages.
* guix/import/cran.scm (default-r-packages): New variable.
(description->package): Drop default R packages from list of inputs.
2016-12-17 15:56:48 +01:00
Ricardo Wurmus ad68f7fa58
import cran: description->package: Also return package dependencies.
* guix/import/cran.scm (description->package): Return package
  dependencies in addition to generated package expression.
2016-12-17 15:56:48 +01:00
Ricardo Wurmus bfa0c752bc
import cran: Move guix-name to top-level.
* guix/import/cran.scm (guix-name): Move to top-level.
2016-12-17 15:56:48 +01:00
Ricardo Wurmus 2e5f32ce1b
import cran: Remove more invalid characters from package names.
* guix/import/cran.scm (guix-name): Replace period and underscore with
  dash; always prepend package names with "r-".
2016-12-17 15:56:47 +01:00
Ricardo Wurmus 576eda6d02
import cran: Handle BSD licenses with LICENSE file.
* guix/import/cran.scm (string->license): Add cases for BSD licenses
with LICENSE file.
2016-12-17 15:56:47 +01:00
Ricardo Wurmus 741d68c20d
import cran: Translate MIT to the Expat license.
* guix/import/cran.scm (string->license): Translate "MIT" license to
Expat license.
2016-12-17 15:56:47 +01:00
Ricardo Wurmus 13f54d081b
import cran: Do not use "or later" licenses by default.
* guix/import/cran.scm (string->license): Use exact license versions.
2016-12-17 15:56:39 +01:00
Ludovic Courtès a6562c7e20
profiles: Remove dependency on 'glibc-utf8-locales' for tests.
Commit 1af0860e8b added a mandatory
dependency on 'glibc-utf8-locales', which entails long rebuilds for
tests.

* guix/profiles.scm (profile-derivation): Add #:locales? parameter.
Add 'set-utf8-locale' variable.  Use it when LOCALES? is true.
(link-to-empty-profile): Pass #:locales? #f.
* guix/scripts/environment.scm (inputs->profile-derivation): Pass
  #:locales?.
* guix/scripts/package.scm (build-and-use-profile): Likewise.
* tests/packages.scm ("--search-paths with pattern"): Pass #:locales? #f.
* tests/profiles.scm ("profile-derivation")
("profile-derivation, inputs", "profile-manifest, search-paths")
("etc/profile", "etc/profile when etc/ already exists"):
("etc/profile when etc/ is a symlink"): Likewise.
2016-12-17 14:46:42 +01:00
Ludovic Courtès 1af0860e8b
profiles: Build profiles in a UTF-8 locale.
Fixes <http://bugs.gnu.org/25213>.
Reported by Christopher Baines <mail@cbaines.net>.

* guix/profiles.scm (profile-derivation)[glibc-utf8-locales]: New
variable.
[builder]: Use it to set 'LOCPATH'.
2016-12-16 18:01:08 +01:00
Ludovic Courtès 580deec5b4
download: Protect against dangling symlinks in $SSL_CERT_DIR.
Reported by Christopher Baines <mail@cbaines.net>
in <https://bugs.gnu.org/25213>.

* guix/build/download.scm (make-credendials-with-ca-trust-files): Check
whether FILE exists before calling
'set-certificate-credentials-x509-trust-file!'.
2016-12-16 18:00:01 +01:00
Ludovic Courtès 99ec0cb397
refresh: Make dependency on (guix import crates) weak.
Reported by Tobias Geerinckx-Rice <me@tobias.gr>.

* guix/scripts/refresh.scm: Do not explicitly import (guix import crates).
2016-12-16 17:38:39 +01:00
David Craven 6976c68158
upstream: Determine archive type correctly.
* guix/upstream.scm (package-update): Take the basename of the uri
  before trying to determine the extension.
2016-12-15 05:57:03 +01:00
Ricardo Wurmus 4d93f312f0
graph: Add d3js backend.
* d3.v3.js, graph.js: New files.
* Makefile.am (EXTRA_DIST): List them.
* guix/graph.scm (%d3js-backend): New variable.
(emit-d3js-prologue, emit-d3js-epilogue, emit-d3js-node,
emit-d3js-edge): New procedures.
(%graph-backends): Add %d3js-backend.
2016-12-14 21:58:32 +01:00
Ricardo Wurmus 642339dc3f
graph: Add "list-backend" and "backend" options.
* guix/graph.scm (%graph-backends): New variable.
* guix/scripts/graph.scm (lookup-backend, list-backends): New
procedures.
(%options): Add options for "backend" and "list-backends".
(show-help): Add help texts for "backend" and "list-backend" options.
(%default-options): Add "backend" default.
(guix-graph): Pass backend argument to "export-graph".
* doc/guix.texi (Invoking guix graph): Document the new options.
2016-12-14 21:57:37 +01:00
Ricardo Wurmus 51377437a1
graph: Backend must have name and description.
* guix/graph.scm (<graph-backend>): Add fields "name" and "description".
(%graphviz-backend): Provide values for name and description.
(export-graph): Ignore name and description when matching backends.
(graph-backend-name, graph-backend-description): New procedures.
* tests/graph.scm (make-recording-backend): Initialize name and
description fields of test graph-backend.
2016-12-14 21:43:06 +01:00
David Craven 8ac5298786
import: Add updater for rust crates.
* guix/import/crate.scm (crate-package?, latest-release,
  %crate-updater): New variables.
* guix/scripts/refresh.scm (%updaters): Add crate updater.
* doc/guix.texi: Add crate updater to table.
2016-12-14 16:30:42 +01:00
David Craven 3e0c036584
import: Add importer for rust crates.
* guix/import/crate.scm: New file.
* guix/scripts/import/crate.scm: New file.
* guix/scripts/import.scm (importers): Add crate importer.
* tests/crate.scm: New file.
* doc/guix.texi: Add crate importer to table.
* Makefile.am (MODULES, SCM_TESTS): Add files.
2016-12-14 16:30:42 +01:00
David Craven bb3f36ed4c
import: utils: Add some utilities.
* guix/import/utils.scm (maybe-inputs, maybe-native-inputs,
  package->definition): New variables.
2016-12-14 16:30:42 +01:00
David Craven 4b3cb7f4bc
build-system: Add cargo build system.
* guix/build-system/cargo.scm: New file.
* guix/build/cargo-build-system.scm: New file.
* Makefile.am (MODULES): Add files.
2016-12-14 16:30:42 +01:00
Ludovic Courtès af72a21a69
upstream: Use first url when it lacks an extension.
* guix/upstream.scm (package-update): Use a url from the list when it
  lacks an extension.
2016-12-14 14:20:50 +01:00
Eric Bavier ff55fe5599
import: cpan: Add updater.
* guix/import/cpan.scm (module->dist-name): Fetch the field of interest.
(cpan-fetch): Accept release name rather than module name.
(fix-source-url): Rename to ...
(cpan-source-url): ... this.  Take metadata as parameter.
(package->upstream-name, cpan-version, cpan-package?, latest-release):
New procedures.
(cpan-module->sexp): Use cpan-version and cpan-source-url.
(%cpan-updater): New variable.
* guix/scripts/refresh.scm (%updaters): Add %CPAN-UPDATER.
2016-12-12 22:22:33 -06:00
Eric Bavier d391ad57d6
import: cpan: Move core-module? to top-level.
* guix/import/cpan.scm (cpan-module->sexp): Move local core-module?
procedure to ...
(core-module?): ... here.
2016-12-12 22:22:33 -06:00
Eric Bavier 63773200d7
import: json: Silence json-fetch output.
* guix/import/json.scm (json-fetch): Use http-fetch instead of url-fetch
to avoid writing to stdout and a temporary file for each invocation.
* guix/import/gem.scm (rubygems-fetch): Do not redirect json-fetch
output to /dev/null.
* guix/import/pypi.scm (pypi-fetch): Likewise.
2016-12-12 22:22:02 -06:00
Mark H Weaver d94691e0c2
Merge branch 'master' into staging 2016-12-10 23:03:57 -05:00
Ludovic Courtès 27991c97e6
offload: Allow testing machines that match a regexp.
* guix/scripts/offload.scm (check-machine-availability): Add 'pred'
parameter and honor it.
(guix-offload): for the "test" sub-command, accept an extra 'regexp'
parameter.  Pass a second argument to 'check-machine-availability'.
2016-12-09 23:12:06 +01:00
Ludovic Courtès 2b513387cd
offload: Test each machine only once.
* guix/scripts/offload.scm (check-machine-availability)[build-machine=?]:
New procedure.
Add call to 'delete-duplicates'.
2016-12-09 23:02:02 +01:00
Ludovic Courtès bd8345777f
offload: Do not read ~/.ssh/known_hosts.
* guix/scripts/offload.scm (open-ssh-session): Pass #:knownhosts to
'make-session'.
2016-12-09 23:02:01 +01:00
Ludovic Courtès f80b4d2ce0
Merge remote-tracking branch 'origin/master' into staging 2016-12-09 18:11:14 +01:00
Ludovic Courtès 13d5e8dae5
store: 'open-connection' no longer raises '&nar-error' for protocol errors.
* guix/store.scm (open-connection): Guard body against 'nar-error?' and
re-raise as '&nix-connection-error'.
* tests/store.scm ("connection handshake error"): New test.
2016-12-08 23:12:11 +01:00
Manolis Ragkousis f13f60cb26
gnu: make-bootstrap: Produce the correct %glibc-bootstrap-tarball for Hurd systems.
* gnu/packages/make-bootstrap.scm (%glibc-bootstrap-tarball): Make it a procedure.
  (%glibc-stripped): Make it a procedure and move the kernel specific part from
  here to ...
* guix/build/make-bootstrap.scm (make-stripped-libc): ... here. New file.
* Makefile.am (MODULES): Add it.
2016-12-07 12:59:02 +02:00
Jan Nieuwenhuizen cba36e6482
gnu: cross-base: Add i686-w64-mingw32 target.
* guix/utils.scm (mingw-target?): New function.
* gnu/packages/cross-base.scm (cross-gcc-snippet): New procedure
(cross-gcc): Use it.
(cross-gcc-arguments, cross-gcc-patches, cross-gcc): Support MinGW.
(native-libc, cross-newlib?): New functions.
(cross-libc): Use cross-newlib? to support MinGW.
(%gcc-include-paths, %gcc-cross-include-paths): New variables.
2016-12-07 10:23:16 +01:00
Ludovic Courtès 8d125cfc2e
offload: Increase the connection timeout.
* guix/scripts/offload.scm (open-ssh-session): Set #:timeout to 10.
2016-12-06 01:00:11 +01:00
Ludovic Courtès 0237d79717
offload: Send the build log to the right file descriptor.
This fixes a regression introduced in
21531add32 whereby the build log would no
longer be sent to FD 4, thereby leading the daemon to not see the build
log.

* guix/scripts/offload.scm (transfer-and-offload): Parameterize
CURRENT-BUILD-OUTPUT-PORT.
2016-12-06 00:50:08 +01:00
Ludovic Courtès e11c42f297
offload: Fix plural of some messages.
* guix/scripts/offload.scm (send-files): Use 'N_' for possibly plural
message.  Write "store item" instead of "store file".
(retrieve-files): Likewise.
2016-12-05 23:26:38 +01:00
Ludovic Courtès 1d48cf948c
offload: Make the compression methods configurable.
* guix/scripts/offload.scm (<build-machine>)[compression]
[compression-level]: New fields.
(open-ssh-session): Honor them.
* doc/guix.texi (Daemon Offload Setup): Document them.
2016-12-05 23:19:38 +01:00
Chris Marusich 067a2e2de9
guix system: If the new system generation already exists, overwrite it.
Fixes <http://bugs.gnu.org/25100>.

Before that, 'guix system reconfigure' would fail if the next generation
already existed.

* guix/scripts/system.scm (switch-to-system): Use 'switch-symlink'
instead of 'symlink'.
* doc/guix.texi (Using the Configuration System, Invoking guix system):
Document the behavior.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2016-12-05 23:19:37 +01:00
Tobias Geerinckx-Rice d8501b844b
refresh: Indicate that PACKAGE... is optional.
* guix/scripts/refresh.scm (show-help): Add brackets around PACKAGE.
2016-12-05 20:50:12 +01:00
Ludovic Courtès aebaee95cc
offload: Add "test" sub-command.
* guix/scripts/offload.scm (assert-node-repl, assert-node-has-guix)
(nonce, assert-node-can-import, assert-node-can-export)
(check-machine-availability): New procedures.
(%random-state): New variable.
(guix-offload): Add case for "test".
* doc/guix.texi (Daemon Offload Setup): Document it.  Remove obsolete
bit about remote invocation of 'guix build'.
2016-12-05 18:18:10 +01:00
Ludovic Courtès 42d07286f4
publish: Factorize 'content-length' addition.
* guix/scripts/publish.scm (with-content-length): New procedure.
(http-write) <application/octet-stream>: Use it.
2016-12-04 22:32:26 +01:00
Marius Bakke a351fc8369
Merge branch 'master' into staging 2016-12-04 17:41:36 +01:00
Ludovic Courtès 463fb7d0c8
offload: Do not abort when a machine is unreachable.
* guix/scripts/offload.scm (machine-load): Wrap 'open-ssh-session' call
in 'false-if-exception'; return +inf.0 if it returns #f.
2016-12-01 23:35:11 +01:00
Ludovic Courtès 74afca5dcf
offload: Gracefully report connection failures.
* guix/scripts/offload.scm (open-ssh-session): Check the return value of
'connect!'.  Call 'leave' when it's not 'ok.
2016-12-01 23:35:10 +01:00
Ludovic Courtès 6374633b92
store: Increase buffering for the '%stderr-write' upcall.
* guix/store.scm (process-stderr) <%stderr-write>: Pass #:buffer-size to
'dump-port'.
2016-12-01 23:35:10 +01:00
Ludovic Courtès 0b72475301
offload: Warn about the lack of zlib support.
* guix/scripts/offload.scm (guix-offload): Print a warning when
'zlib-support?' returns false.
2016-12-01 23:35:10 +01:00
Ludovic Courtès f3cf860635
offload: Remove redundant call to 'topologically-sorted' in 'send-file'.
* guix/scripts/offload.scm (send-files): Remove call to
'topologically-sorted'.
2016-12-01 23:35:10 +01:00
Marius Bakke 8a7cbc882a
Merge branch 'master' into staging 2016-11-30 18:24:32 +01:00
Ludovic Courtès 3676f89255
refresh: '--list-updaters' shows updater coverage.
* guix/scripts/refresh.scm (list-updaters-and-exit): Compute the
coverage ratio of each updater and print it.  Print the coverage ratio
for all the updaters.
* doc/guix.texi (Invoking guix refresh): Document it.
2016-11-30 17:35:21 +01:00
Ludovic Courtès 2fd370e816
gnu-maintenance: Add kernel.org updater.
* guix/gnu-maintenance.scm (latest-kernel.org-release): New procedure.
(%kernel.org-updater): New variable.
* guix/scripts/refresh.scm (%updaters): Add it.
2016-11-30 17:35:21 +01:00
Ludovic Courtès 8d5d06282e
upstream: Properly verify signatures of uncompressed tarballs.
* guix/upstream.scm (uncompressed-tarball): New procedure.
(download-tarball): Use it when the basename of SIGNATURE-URL doesn't
contain the basename of URL.
2016-11-30 17:35:21 +01:00
Ludovic Courtès 4e6230ec00
refresh: Honor the selected updaters when '-u' isn't given.
Fixes a regression introduced in
e9c72306fd.

* guix/scripts/refresh.scm (check-for-package-update): Add 'updaters'
parameter and honor it.
(guix-refresh): Pass UPDATERS to 'check-for-package-update'.
2016-11-30 17:35:21 +01:00
Ludovic Courtès 7632f7bc21
gnu-maintenance: Factorize URL prefix predicates.
* guix/gnu-maintenance.scm (url-prefix-predicate): New procedure.
(gnome-package?): Rewrite in terms of 'url-prefix-predicate'.
(kde-package?, xorg-package?): Remove.
(%kde-updater, %xorg-updater): Use 'url-prefix-predicate'.
2016-11-30 17:35:20 +01:00
Hartmut Goebel 3bf4280659
Merge branch 'master' into python-build-system 2016-11-29 18:47:16 +01:00
Ludovic Courtès 3e95d88d51
gnu-maintenance: 'latest-kde-release' honors 'upstream-name' properties.
* guix/gnu-maintenance.scm (latest-kde-release): Honor the
'upstream-name' property of PACKAGE.
2016-11-29 16:12:31 +01:00
Ludovic Courtès e9c72306fd
refresh: Warn about packages that lack an updater.
* guix/upstream.scm (package-update-path): Rename to...
(package-latest-release): ... this.  Remove 'version>?' check.
(package-latest-release*): New procedure.
(package-update): Use it.
* guix/scripts/refresh.scm (lookup-updater): Rename to...
(lookup-updater-by-name): ... this.
(warn-no-updater): New procedure.
(update-package): Add #:warn? parameter and honor it.
(check-for-package-update): New procedure.
(guix-refresh)[warn?]: New variable.
Replace inline code when UPDATE? is false with a call to
'check-for-package-update'.
Pass WARN? to 'check-for-package-update' and 'update-package'.
* doc/guix.texi (Invoking guix refresh): Document it.  Fix a couple of
typos.
2016-11-29 16:12:31 +01:00
Ludovic Courtès c062b1eb6c
pull: Set '%nix-instantiate' to a sensible value.
Reported by ng0 <ng0@libertad.pw>.
Fixes <http://bugs.gnu.org/25053>.

* guix/build/pull.scm (build-guix): Replace "@NIX_INSTANTIATE@" in
guix/config.scm with "nix-instantiate".
2016-11-28 22:58:18 +01:00
Ludovic Courtès 1cd1d8a7ea
offload: Call 'machine-load' only once per machine.
This fixes a longstanding issue where 'choose-build-machine' would make
on average O(N log(N)) calls to 'machine-load', plus an extra call for
the selected machine, instead of N calls.

* guix/scripts/offload.scm (machine-load): Add comment.
(machine-power-factor, machine-less-loaded-or-faster?): Remove.
(choose-build-machine)[machines+slots]: Rename to...
[machines+slots+loads]: ... this.
[undecorate]: Adjust accordingly.
[machine-less-loaded-or-faster?]: New procedure.
Remove extra 'machine-load' call in body.
2016-11-26 23:21:37 +01:00
Ludovic Courtès bc1ad4e334
offload: Drop 'remote-pipe'.
* guix/scripts/offload.scm (remote-pipe): Remove.
(machine-load): Use 'open-remote-pipe*' instead of 'remote-pipe'.
2016-11-25 23:44:21 +01:00
Ludovic Courtès cf283dd92e
offload: Rewrite to make direct RPCs to the remote daemon.
* guix/scripts/offload.scm (<build-machine>)[daemon-socket]: New field.
(connect-to-remote-daemon): New procedure.
(%gc-root-file, register-gc-root, remove-gc-roots, offload): Remove.
(transfer-and-offload): Rewrite using 'connect-to-remote-daemon' and
RPCs over SSH.
(store-import-channel, store-export-channel): New procedures.
(send-files, retrieve-files): Rewrite using these.
2016-11-25 23:44:20 +01:00
Ludovic Courtès e8a5db80d5
offload: Remove 'with-nar-error-handling' macro.
* guix/scripts/offload.scm (with-nar-error-handling): Remove.
(guix-offload): Use 'with-error-handling' instead.
2016-11-25 23:44:20 +01:00
Ludovic Courtès 6230d6f04f
store: 'open-connection' can taken an open port.
* guix/store.scm (open-unix-domain-socket): New procedure.
(open-connection): Add #:port parameter and honor it.
2016-11-25 23:44:20 +01:00
Ludovic Courtès 9e76eed37f
offload: Reuse SSH session during 'transfer-and-offload'.
* guix/scripts/offload.scm (remote-pipe): Replace 'machine' parameter
with 'session'.  Remove 'open-ssh-session' call.
(register-gc-root): Replace 'machine' with 'session'.  Use '
session-get' instead of 'build-machine-name'.
(remove-gc-roots, offload, send-files, retrieve-files): Likewise.
(transfer-and-offload): Add 'open-ssh-session' call.  Handle 'offload'
errors here.
(machine-load): Add call to 'open-ssh-session'.
2016-11-25 23:44:20 +01:00
Ludovic Courtès 21531add32
offload: Use Guile-SSH instead of GNU lsh.
* guix/scripts/offload.scm (<build-machine>)[ssh-options]: Remove.
[host-key, host-key-type]: New fields.
(%lsh-command, %lshg-command, user-lsh-private-key): Remove.
(user-openssh-private-key, private-key-from-file*): New procedures.
(host-key->type+key, open-ssh-session): New procedures.
(remote-pipe): Remove 'mode' parameter.  Rewrite in terms of
'open-ssh-session' etc.  Update users.
(send-files)[missing-files]: Rewrite using the bidirectional channel
port.
Remove call to 'call-with-compressed-output-port'.
(retrieve-files): Remove call to 'call-with-decompressed-port'.
(machine-load): Remove exit status logic.
* doc/guix.texi (Requirements): Mention Guile-SSH.
(Daemon Offload Setup): Document 'host-key' and 'private-key'.  Show the
default value on each @item line.
* m4/guix.m4 (GUIX_CHECK_GUILE_SSH): New macro.
* config-daemon.ac: Use 'GUIX_CHECK_GUILE_SSH'.  Set
'HAVE_DAEMON_OFFLOAD_HOOK' as a function of that.
2016-11-25 23:44:20 +01:00
Leo Famulari de32aa74b4
Merge branch 'master' into python-build-system 2016-11-25 11:20:21 -05:00
Leo Famulari 2ac7d54616
Merge branch 'master' into staging 2016-11-23 22:24:52 -05:00
Ludovic Courtès 9e38e3cf52
syscalls: Add 'add-network-route/gateway' and 'delete-network-route'.
* guix/build/syscalls.scm (SIOCADDRT, SIOCDELRT): New variables.
(%rtentry): New C struct.
(RTF_UP, RTF_GATEWAY, %sockaddr-any): New variables.
(add-network-route/gateway, delete-network-route): New procedures.
* tests/syscalls.scm ("add-network-route/gateway")
("delete-network-route"): New tests.
2016-11-21 00:34:48 +01:00
Ludovic Courtès 8eb790f368
syscalls: Add 'c-struct-field-offset'.
* guix/build/syscalls.scm (define-c-struct-macro): New macro.
(define-c-struct): Use it.
(c-struct-field-offset): New macro.
2016-11-21 00:34:48 +01:00
Ludovic Courtès fac46e3f5e
lint: Add 'mirror-url' checker.
* guix/scripts/lint.scm (origin-uris): New procedure.
(check-source): Use it.
(check-mirror-url): New procedure.
(%checkers): Add 'mirror-url' checker.
* tests/lint.scm ("mirror-url")
("mirror-url: one suggestion"): New tests.
* doc/guix.texi (Invoking guix lint): Document it.
2016-11-19 18:44:53 +01:00
Ludovic Courtès e74f64b9e5
store: Add 'references*'.
* guix/store.scm (references*): New procedure.
* guix/profiles.scm (manifest-lookup-package)[references*]: Remove.
* guix/scripts/system.scm (references*): Remove.
* tests/gexp.scm ("gexp->file", "gexp->file + file-append")
("gexp->derivation", "gexp->derivation, cross-compilation")
("gexp->derivation, ungexp + ungexp-native")
("scheme-file", "text-file*", "mixed-text-file"): Remove 'references*'
instead of (store-lift references).
2016-11-19 18:44:53 +01:00
Ludovic Courtès 713335fa61
derivations: Add 'raw-derivation'.
* guix/derivations.scm (raw-derivation): New procedure.
* guix/download.scm (raw-derivation): Remove.
* guix/gexp.scm (raw-derivation): Remove.
2016-11-19 18:44:53 +01:00
Ludovic Courtès 4c80d4c481
download: Do not offload 'builtin:download' derivations.
* guix/download.scm (built-in-download): Pass #:local-build? #t.
2016-11-18 18:28:02 +01:00
Roel Janssen 88bdbb2a0f
guix package: Display newline after generation diffs.
* guix/ui.scm (display-profile-content-diff): Display an extra newline.
2016-11-17 23:49:29 +01:00
Ludovic Courtès e9ff8d9ff1
syscalls: 'configure-network-interface' has a #:netmask parameter.
* guix/build/syscalls.scm (configure-network-interface): Add #:netmask
keyword parameter and honor it.
2016-11-17 23:21:47 +01:00
Ludovic Courtès 67e5f3b71d
syscalls: Add bindings for SIOCGIFNETMASK and SIOCSIFNETMASK.
* guix/build/syscalls.scm (SIOCGIFNETMASK, SIOCSIFNETMASK): New
variables.
(set-network-interface-netmask, network-interface-netmask): New
procedures.
* tests/syscalls.scm ("network-interface-netmask lo")
("set-network-interface-netmask"): New tests.
2016-11-16 23:38:06 +01:00
Ludovic Courtès 9d9d0c9c98
syscalls: Use 'define-c-struct' for 'struct ifconf'.
* guix/build/syscalls.scm (ifconf-struct): Remove.
(%ifconf-struct): New C struct.
(network-interface-names): Use 'make-bytevector' and 'write-ifconf!'
instead of 'make-c-struct', and 'read-ifconf' instead of
'parse-c-struct'.
2016-11-16 23:38:05 +01:00
Ludovic Courtès f43714e620
syscalls: C struct writer correctly handles pointer fields.
* guix/build/syscalls.scm (write-type): Add case for '*.
2016-11-16 23:38:05 +01:00
Ludovic Courtès 05ceb8dcaf
download: Use the built-in 'download' builder when available.
Fixes <http://bugs.gnu.org/22774>.
Reported by Christopher W Carpenter.

* guix/download.scm (built-in-builders*, raw-derivation)
(built-in-download): New procedures.
(in-band-download): New procedure, with code formerly in 'url-fetch'.
(url-fetch): Call 'built-in-builders*' and dispatch between
'built-in-download' and 'in-band-download'.
2016-11-16 18:19:55 +01:00
Ludovic Courtès f9aefa2d5f
daemon: Add 'built-in-builders' RPC.
* nix/libstore/builtins.cc (builtinBuilderNames): New function.
* nix/libstore/builtins.hh (builtinBuilderNames): New declaration.
* nix/libstore/worker-protocol.hh (PROTOCOL_VERSION): Bump to 0x160.
(WorkerOp)[wopBuiltinBuilders]: New value.
* nix/nix-daemon/nix-daemon.cc (performOp): Handle it.
* guix/store.scm (operation-id)[built-in-builders]: New value.
* guix/store.scm (read-arg): Add 'string-list'.
(built-in-builders): New procedure.
* tests/derivations.scm ("built-in-builders"): New test.
2016-11-16 18:19:54 +01:00
Ludovic Courtès 94d92c7796
daemon: Add "builtin:download" derivation builder.
This ensures that 1) the derivation doesn't change when Guix changes;
2) the derivation closure doesn't contain Guix and its dependencies; 3)
we don't have to rely on ugly chroot hacks.

Adapted from Nix commit 0a2bee307b20411f5b0dda0c662b1f9bb9e0e131.

* nix/libstore/build.cc (DerivationGoal::runChild): Add special case for
'isBuiltin(drv)'.  Disable chroot when 'isBuiltin(drv)'.
* nix/libstore/builtins.cc, nix/libstore/builtins.hh,
nix/scripts/download.in, guix/scripts/perform-download.scm: New files.
* guix/ui.scm (show-guix-help)[internal?]: Add 'perform-download'.
* nix/local.mk (libstore_a_SOURCES): Add builtins.cc.
(libstore_headers): Add builtins.hh.
(nodist_pkglibexec_SCRIPTS): Add 'scripts/download'.
* config-daemon.ac: Emit 'scripts/download'.
* Makefile.am (MODULES): Add 'guix/scripts/perform-download.scm'.
* tests/derivations.scm ("unknown built-in builder")
("'download' built-in builder")
("'download' built-in builder, invalid hash")
("'download' built-in builder, not found")
("'download' built-in builder, not fixed-output"): New tests.

Co-authored-by: Eelco Dolstra <eelco.dolstra@logicblox.com>
2016-11-16 18:19:47 +01:00
Ludovic Courtès 17ab08bcf0
tests: Move HTTP server to (guix tests http).
* tests/lint.scm (%http-server-port, %local-url)
(%http-server-socket, http-write, %http-server-lock)
(%http-server-ready, http-open, stub-http-server)
(call-with-http-server, with-http-server): Move to (guix tests http).
Adjust tests for %HTTP-SERVER-SOCKET as a promise and %LOCAL-URL as a
parameter.
* guix/tests/http.scm: New file.
* Makefile.am (dist_noinst_DATA): Add it.
(GOBJECTS): Add .go files for all of $(dist_noinst_DATA).
(make-go): Depend on $(dist_noinst_DATA).
2016-11-16 18:00:41 +01:00
Ludovic Courtès 1bcc87bb68
guix download: Add '-o' option.
* guix/scripts/download.scm (download-to-file, download-to-store*): New
procedures.
(%default-options): Add 'download-proc'.
(show-help): Adjust description and document '-o'.
(%options): Add '-o'.
(guix-download): Remove 'store' variable.  Add 'fetch' and define 'path'
to as its result.
* tests/guix-download.sh: Add test.
2016-11-16 18:00:41 +01:00
Hartmut Goebel caa9b834e7
guxi: cmake-build-system: Enable output for failing test-cases.
* guix/build/cmake-build-system.scm (cmake-build-system): Set
  environment variable CTEST_OUTPUT_ON_FAILURE to an non-empty value.
2016-11-15 22:40:25 +01:00