Commit Graph

2707 Commits (1c7a78f157062c796f6779da645be6212d6cd592)

Author SHA1 Message Date
Ludovic Courtès d2a5e6982d
file-systems: Add 'file-system-mapping->bind-mount'.
* gnu/system/file-systems.scm (file-system-mapping->bind-mount): New
procedure.
* gnu/system/linux-container.scm (mapping->file-system): Remove.
(containerized-operating-system)[mapping->fs]: Use
'file-system-mapping->bind-mount' instead of 'mapping->file-system'.
* guix/scripts/environment.scm (launch-environment/container): Likewise.
2017-02-03 00:23:28 +01:00
Leo Famulari e8c83d04e1
Merge branch 'master' into core-updates 2017-02-02 10:52:24 -05:00
Ricardo Wurmus de643f0c15
build: r-build-system: Use deterministic built date.
Fixes <http://bugs.gnu.org/25598>.

* guix/build/r-build-system.scm (install): Pass "--built-timestamp" option to
make build deterministic.
2017-02-02 15:20:50 +01:00
Ludovic Courtès 93897a4538
download: Add GNOME mirror.
* guix/download.scm (%mirrors): Add "https://download.gnome.org".
2017-02-01 23:53:35 +01:00
Tobias Geerinckx-Rice 814b099a20
download: Add ‘url-fetch/zipbomb’.
From this suggestion by Ludovic Courtès:
<http://lists.gnu.org/archive/html/guix-devel/2016-09/msg01983.html>

* guix/download.scm (url-fetch/zipbomb): New procedure.
2017-02-01 15:53:33 +01:00
Tobias Geerinckx-Rice 58f91e4d03
download: url-fetch/tarball: Make ‘name’ truly optional.
* guix/download.scm (url-fetch/tarbomb): Fall back to ‘file-name’ if
‘name’ is #f, like the regular ‘url-fetch’ does.
* gnu/packages/bioinformatics.scm (muscle)[source]: Remove ‘file-name’.
* gnu/packages/engineering.scm (fastcap)[source]: Likewise.
* gnu/packages/scheme.scm (scmutils)[source]: Likewise.
2017-02-01 15:53:32 +01:00
Ludovic Courtès f1a892c96f
lint: Use the "@" syntax for versioned packages in warnings.
* guix/scripts/lint.scm (emit-warning): Use the "@" syntax.
2017-01-31 23:51:09 +01:00
Christopher Baines c003546b0c
environment: Fix setting writable? on networking related files
* guix/scripts/environment.scm (launch-environment/container): Include the
  file name in the call to string=? when deciding if the file should be
  writable.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-01-30 10:52:45 +01:00
Ludovic Courtès 0d268c5d70
store: Add 'add-data-to-store'.
* guix/serialization.scm (write-bytevector): New procedure.
(write-string): Rewrite in terms of 'write-bytevector'.
* guix/store.scm (write-arg): Add 'bytevector' case.
(add-data-to-store): New procedure, from former 'add-text-to-store'.
(add-text-to-store): Rewrite in terms of 'add-data-to-store'.
* tests/store.scm ("add-data-to-store"): New test.
2017-01-30 10:52:45 +01:00
Ludovic Courtès 86a6ff4bb0
build-system/python: 'package-with-explicit-python' uses 'eq?' memoization.
* guix/build-system/python.scm (package-with-explicit-python): Use
'mlambdaq' instead of 'mlambda'.  This does not change the <package>
graph and has no visible impact on performance.
2017-01-28 18:55:20 +01:00
Ludovic Courtès 3d520b5428
gnu-maintenance: 'gnu-package?' uses 'eq?' memoization.
* guix/gnu-maintenance.scm (gnu-package?): Use 'mlambdaq' instead of
'mlambda'.
2017-01-28 18:55:20 +01:00
Ludovic Courtès c9134e82fe
packages: Remove 'define-memoized/v' and use 'mlambdaq' instead.
* guix/packages.scm (define-memoized/v): Remove.
(package-transitive-supported-systems): Use 'mlambdaq' instead of
'define-memoized/v'.
(package-input-rewriting)[replace]: Likewise.
2017-01-28 18:55:20 +01:00
Ludovic Courtès 55b2d92145
Use 'mlambda' instead of 'memoize'.
* gnu/packages.scm (find-newest-available-packages): Use 'mlambda'
instead of (memoize (lambda ...) ...).
* gnu/packages/bootstrap.scm (package-with-bootstrap-guile): Likewise.
* guix/build-system/gnu.scm (package-with-explicit-inputs)[rewritten-input]:
Likewise.
* guix/build-system/python.scm (package-with-explicit-python)[transform]:
Likewise.
* guix/derivations.scm (derivation->string): Likewise.
* guix/gnu-maintenance.scm (gnu-package?): Likewise.
* guix/modules.scm (module-file-dependencies): Likewise.
* guix/scripts/graph.scm (standard-package-set): Likewise.
* guix/scripts/lint.scm (official-gnu-packages*): Likewise.
* guix/store.scm (store-regexp*): Likewise.
* guix/utils.scm (location): Likewise.
2017-01-28 18:55:20 +01:00
Ludovic Courtès f9704f179a
Add (guix memoization).
* guix/combinators.scm (memoize): Remove.
* guix/memoization.scm: New file.
* Makefile.am (MODULES): Add it.
* gnu/packages.scm, gnu/packages/bootstrap.scm,
guix/build-system/gnu.scm, guix/build-system/python.scm,
guix/derivations.scm, guix/gnu-maintenance.scm,
guix/import/cran.scm, guix/import/elpa.scm,
guix/modules.scm, guix/scripts/build.scm,
guix/scripts/graph.scm, guix/scripts/lint.scm,
guix/store.scm, guix/utils.scm: Adjust imports accordingly.
2017-01-28 18:55:20 +01:00
Ludovic Courtès 3b0fcc672d
packages: Add 'package-upstream-name' and use it.
* guix/packages.scm (package-upstream-name): New procedure.
* guix/gnu-maintenance.scm (gnu-package?, ftp-server/directory)
(latest-release*, latest-gnome-release)
(latest-kde-release): Use it instead of the inline expression.
2017-01-28 00:38:20 +01:00
Ludovic Courtès 21f4a7c116
import: github: Better tolerate unexpected file extensions.
* guix/import/github.scm (find-extension): Add ".tbz".
(updated-github-url): When 'find-extension' returns #f, use "" for EXT.
2017-01-28 00:38:20 +01:00
Ludovic Courtès 6715e1ff2e
gnu-maintenance: 'gnu-package?' ignores invalid URLs.
* guix/gnu-maintenance.scm (gnu-package?)[gnu-home-page?]: Add '>>'
threading macro and use it.
2017-01-28 00:38:20 +01:00
Ludovic Courtès 2e2cf9a3bd
gnu-maintenance: GNU updater handles gnu.org-hosted Emacs packages.
* guix/gnu-maintenance.scm (pure-gnu-package?): If an "emacs-" package
matches 'gnu-hosted?', return true.
(gnu-hosted?): New procedure.
2017-01-28 00:38:20 +01:00
Ludovic Courtès b03218d532
gnu-maintenance: Honor 'upstream-name' property in GNU updater.
* guix/gnu-maintenance.scm (gnu-package?): Honor the 'usptream-name'
property of PACKAGE.
(ftp-server/directory): Likewise.
2017-01-28 00:38:19 +01:00
Marius Bakke 5a64a79131
utils: Add helper method to make files writable.
* gnu/build/activation.scm (make-file-writable): Move this to ...
* guix/build/utils.scm (make-file-writable): ... here. Export it.
* guix/build/gnu-build-system.scm (strip): Use it.
2017-01-26 22:19:16 +01:00
Ludovic Courtès 1d636d6319
build-system/gnu: Add 'reset-gzip-timestamps' phase.
* guix/build/gnu-build-system.scm (reset-gzip-timestamps): New
procedure.
(%standard-phases): Add it.
2017-01-26 22:05:49 +01:00
Ludovic Courtès 95e7be9728
utils: Add 'gzip-file?' and 'reset-gzip-timestamp'.
* guix/build/utils.scm (%gzip-magic-bytes): New variable.
(gzip-file?, reset-gzip-timestamp): New procedures.
2017-01-26 21:58:37 +01:00
Ricardo Wurmus 0db2ff65e7
bournish: Extend 'rm' command.
* guix/build/bournish.scm (rm-command): New procedure.
(%commands): Use it.
* tests/bournish.scm: Add tests for "rm" and "rm -r".
2017-01-26 13:49:56 +01:00
Carlo Zancanaro 2f977d92d3
import: pypi: Don't add setuptools to propagated-inputs.
* guix/import/pypi.scm (compute-inputs): Don't add setuptools to the imported
  package's propagated-inputs.
2017-01-26 13:44:31 +01:00
Ludovic Courtès 0363474a0b
build-system/gnu: 'strip' phase now skips symlinks.
This avoids a situation where the "debug" output would contain separate
(and different) .debug files for "libfoo.so" and "libfoo.so.0.0", even
though "libfoo.so" is actually a symlink to "libfoo.so.0.0".

* guix/build/gnu-build-system.scm (strip): Remove 'file-exists?' call in
'for-each' lambda.  Pass a predicate to 'find-files' to restrict the
result to regular files.
2017-01-26 11:29:38 +01:00
Mathieu Othacehe db6afe387a
copy: Use userauth-public-key/auto! for ssh authentification.
* guix/scripts/copy.scm (open-ssh-session): Replace userauth-agent! by
  userauth-public-key/auto!. This way, if ssh-agent is not run,
  default ssh key (~/.ssh/id_rsa) will be used as a fallback.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-01-26 11:26:24 +01:00
Leo Famulari d123f2f991
Merge branch 'master' into core-updates 2017-01-25 12:42:39 -05:00
Christopher Baines 0ca575f3bb
container: Pass through TERM when calling exec.
* guix/scripts/container/exec.scm (guix-container-exec): Capture the value of
  the TERM environment variable, and pass it through to the container.  This
  means some applications now work where they did not before (e.g. htop), and
  others have more functionality, providing that the terminal was capable of
  enabling that functionality in the first place.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2017-01-25 14:27:31 +01:00
Ludovic Courtès 482fda2729
grafts: Do not pull derivation outputs not depended on.
Fixes <http://bugs.gnu.org/24886>.

Previously, the grafting derivation of, say, brdf-explorer would pull in
qt:doc even though brdf-explorer depends only on qt:out, not qt:doc.

* guix/grafts.scm (with-cache): Use 'vhash-assoc' and 'vhash-cons'
instead of 'vhash-assq' and 'vhash-consq'.
(cumulative-grafts): Pass #:outputs to 'graft-derivation/shallow'.  Use
OUTPUTS instead of (derivation-output-names drv).
(graft-derivation): Add #:outputs parameter; pass it to
'cumulative-grafts'.
* tests/grafts.scm (make-derivation-input): New variable.
("graft-derivation, replaced derivation has multiple outputs"): Make
sure P2:zzz is not part of the outputs of P3D.
("graft-derivation with #:outputs")
("graft-derivation, unused outputs not depended on"): New tests.
2017-01-25 11:04:25 +01:00
Ludovic Courtès fd7d1235f1
grafts: Shallow grafting can be performed on a subset of the outputs.
* guix/grafts.scm (graft-derivation/shallow): Add #:outputs parameter.
[outputs]: Rename to...
[output-pairs]: ... this.  Adjust 'build-expression->derivation' call
accordingly.
2017-01-24 23:09:06 +01:00
Ludovic Courtès 3483f004a9
syscalls: Export 'read-utmpx'.
* guix/build/syscalls.scm (read-utmpx-from-port): New procedure.
* tests/syscalls.scm ("read-utmpx, EOF")
("read-utmpx"): New tests.
2017-01-24 00:46:37 +01:00
Ludovic Courtès 58ea4d407c
Merge branch 'master' into core-updates 2017-01-23 22:33:10 +01:00
Ludovic Courtès fcd75bdbfa
search-paths: Allow specs with #f as their separator.
This adds support for single-entry search paths.
Fixes <http://bugs.gnu.org/25422>.
Reported by Leo Famulari <leo@famulari.name>.

* guix/search-paths.scm (<search-path-specification>)[separator]:
Document as string or #f.
(evaluate-search-paths): Add case for SEPARATOR as #f.
(environment-variable-definition): Handle SEPARATOR being #f.
* guix/build/utils.scm (list->search-path-as-string): Add case for
SEPARATOR as #f.
(search-path-as-string->list): Likewise.
* guix/build/profiles.scm (abstract-profile): Likewise.
* tests/search-paths.scm: New file.
* Makefile.am (SCM_TESTS): Add it.
* tests/packages.scm ("--search-paths with single-item search path"):
New test.
* gnu/packages/version-control.scm (git)[native-search-paths](separator):
New field.
2017-01-23 22:23:41 +01:00
Ludovic Courtès c5746f2399
guix package: Honor the order of profiles when -p appears multiple times.
* guix/scripts/package.scm (process-query): Reverse the order of
PROFILES.
* tests/guix-package-net.sh: Test it with '--search-paths'.
2017-01-23 22:21:23 +01:00
Ludovic Courtès ac080e296e
lint: Display PACKAGE@VERSION.
* guix/scripts/lint.scm (run-checkers): Remove 'name' variable.  Display
PACKAGE@VERSION instead of PACKAGE-VERSION.
2017-01-21 16:43:26 +01:00
Ludovic Courtès 150309726f
syscalls: Add utmpx procedures and data structure.
* guix/build/syscalls.scm (<utmpx-entry>): New record type.
(%utmpx): New C struct.
(login-type): New bits.
(setutxent, endutxent, getutxent, utmpx-entries): New procedures.
2017-01-19 23:21:25 +01:00
Ludovic Courtès 57f068bec5
syscalls: Extract 'bytes->string'.
* guix/build/syscalls.scm (bytes->string): New procedure.
(bytevector->string-list): Use it.
2017-01-19 23:20:57 +01:00
Mathieu OTHACEHE d18b79fed8
import: github: Catch HTTP 403 error during fetch.
* guix/import/github.scm (json-fetch*): Catch 403 HTTP error that may be
  raised if a github token has not been set.

Signed-off-by: Mathieu OTHACEHE <m.othacehe@gmail.com>
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-01-19 17:17:16 +01:00
Ludovic Courtès 840f38ba37
guix environment, build: Allow absolute file names with '--root'.
Reported by Chris Webber.

* guix/scripts/build.scm (register-root): If ROOT is absolute, keep it
as is.
* guix/scripts/environment.scm (register-gc-root): Likewise.
* tests/guix-environment.sh (expected): Add test.
2017-01-19 00:11:15 +01:00
Ludovic Courtès 0aeed5e310
grafts: Preserve the cache across recursive calls.
Before this commit, we'd lose the cache across recursive calls to
'cumulative-grafts', which isn't great performance-wise.

This bug was already present before
d38bc9a9f6.

* guix/grafts.scm (with-cache): In the miss case, call 'current-state'
after EXP has been evaluated.
2017-01-16 22:13:21 +01:00
Ludovic Courtès 90ad5c8836
grafts: Actually cache grafts during the derivation DAG traversal.
This fixes a regression introduced in
d38bc9a9f6 whereby the cache was
effectively disabled.

Reported by Thomas Danckaert <thomas.danckaert@gmail.com>.

* guix/grafts.scm (with-cache): In the cache miss case, wrap body in
'mbegin'.
2017-01-16 22:13:21 +01:00
Christopher Baines 849a1b8133
profiles: Export 'ca-certificate-bundle'.
* guix/profiles.scm: Export ca-certificate-bundle, such that it can be used in
other G-expressions.  This is useful where these G-expressions run programs
that require a ca-certificate-bundle, e.g. git.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-01-16 11:03:42 +01:00
Ludovic Courtès 6da5bb7b1b
guix build: Add '--repair'.
* guix/scripts/build.scm (show-help, %options): Add '--repair'.
* doc/guix.texi (Invoking guix gc): Mention 'guix build --repair'.
(Additional Build Options): Document it.
2017-01-15 22:47:25 +01:00
Ludovic Courtès d9da3a757d
guix build: Do not force 'build-cores', 'max-build-jobs', and 'max-silent-time'.
This lets the daemon use its own default settings unless otherwise
specified.

* guix/scripts/build.scm (set-build-options-from-command-line): Do not
provide default values for #:build-cores and #:max-build-jobs.
(%default-options): Remove 'max-silent-time'.
2017-01-15 15:43:22 +01:00
Ludovic Courtès deac976d3d
daemon: Client settings no longer override daemon settings.
Fixes <http://bugs.gnu.org/20217>.

* nix/libstore/worker-protocol.hh (PROTOCOL_VERSION): Bump to 0x161.
* nix/nix-daemon/nix-daemon.cc (performOp): "build-max-jobs",
"build-max-silent-time", and "build-cores" are no longer read upfront;
instead, read them from the key/value list at the end.
* nix/nix-daemon/guix-daemon.cc (main): Explicitly set
'settings.maxBuildJobs'.
* guix/store.scm (%protocol-version): Bump to #x161.
(set-build-options): #:max-build-jobs, #:max-silent-time, and
 #:build-cores now default to #f.  Adjust handshake to new protocol.
* tests/store.scm ("build-cores"): New test.
* tests/guix-daemon.sh: Add test for default "build-cores" value.
2017-01-15 15:43:22 +01:00
Ludovic Courtès 153b62957c
challenge: Add '--verbose'.
* guix/scripts/challenge.scm (summarize-report): Add #:verbose?
parameter.
[report-hashes]: New procedure.  Use it.
Honor VERBOSE? in the 'match case.
(show-help, %options): Add '--verbose'.
(guix-challenge): Honor it.
2017-01-14 00:57:51 +01:00
Ludovic Courtès 4d8e95097e
challenge: Return comparison reports instead of just discrepancies.
This makes it easier to distinguish between matches, mismatches, and the
various cases of inconclusive reports.

* guix/scripts/challenge.scm (<discrepancy>): Rename to...
(<comparison-report>): ... this.  Add 'result' field.
(comparison-report): New macro.
(comparison-report-predicate, comparison-report-mismatch?)
(comparison-report-match?)
(comparison-report-inconclusive?): New procedures.
(discrepancies): Rename to...
(compare-contents): ... this.  Change to return a list of
<comparison-report>.  Remove calls to 'warning'.
(summarize-discrepancy): Rename to...
(summarize-report): ... this.  Adjust to <comparison-report>.
(guix-challenge): Likewise.
* tests/challenge.scm ("no discrepancies")
("one discrepancy"): Adjust to new API.
("inconclusive: no substitutes")
("inconclusive: no local build"): New tests.
2017-01-14 00:57:51 +01:00
ng0 d8c8e423ed
licenses: Add wtfpl2.
* guix/licenses.scm (wtfpl2): New variable.

Signed-off-by: Leo Famulari <leo@famulari.name>
2017-01-13 14:13:01 -05:00
Ludovic Courtès 608a50b66c
http-client: Provide 'User-Agent' header by default.
* guix/http-client.scm (http-fetch): Add #:headers parameter and honor
it.  Rename 'auth-header' to 'headers'.
* guix/import/github.scm (json-fetch*): Add comment about required
User-Agent.
2017-01-13 18:24:19 +01:00
Ludovic Courtès 4cd5ec801b
import: github: Fix regression on the /releases retrieval.
Fixes a regression introduced in
62bd24db39, which introduced a call to
'hash-table->alist'.

* guix/import/github.scm (json-fetch*): New procedure.
(latest-released-version): Use it.
2017-01-13 18:24:19 +01:00
Ludovic Courtès 6d30b1b2ca
ui: Wrap 'canonicalize-path' for better error reporting.
Reported by Christopher Baines.

* guix/ui.scm (canonicalize-path): New procedure.
2017-01-13 18:24:19 +01:00
Ludovic Courtès e7ff05438f
ui: Factorize error-reporting wrapper code.
* guix/ui.scm (augmented-system-error-handler): New procedure.
(error-reporting-wrapper): New macro.
(symlink, copy-file): Define using 'error-reporting-wrapper'.
2017-01-13 18:24:19 +01:00
Leo Famulari cc0725914e
Merge branch 'master' into python-tests 2017-01-13 10:21:17 -05:00
Ludovic Courtès 4cdff6ae37
challenge: Use a warning when substitutes are lacking.
* guix/scripts/challenge.scm (discrepancies): Use 'warning' instead of
'leave'.
2017-01-12 23:28:45 +01:00
Ludovic Courtès 26ab00a0a9
perform-download: Add backward-compatible case.
This is meant to ease transition for people running an older guix-daemon
invoking a recent 'guix perform-download' with only one argument.

This is a followup to 9b5364a3af.

* guix/scripts/perform-download.scm (perform-download): Make 'output'
optional.  Bind 'output*' from DRV's "out" and honor it.
(guix-perform-download): Add clause with one argument.
2017-01-11 23:01:54 +01:00
Mathieu Lirzin dc673fa113
derivations: Make <derivation> record datatype immutable.
* guix/derivations.scm (<derivation>): Make it immutable.
(derivation): Use generic 'set-field' instead of ad-hoc functional setter.
2017-01-11 18:55:31 +01:00
Mathieu Lirzin 5c6a30c511
git download: Remove redundant argument in 'gexp->derivation' call.
* guix/git-download.scm (git-fetch): Call 'gexp->derivation' with only one
'#:local-build?' keyword argument.
2017-01-11 18:55:26 +01:00
Ludovic Courtès 9b5364a3af
daemon: Allow check builds of 'builtin:download' derivations.
Fixes <http://bugs.gnu.org/25089>.
Reported by Leo Famulari <leo@famulari.name>.

* nix/libstore/build.cc (DerivationGoal::runChild): In the 'isBuiltin'
case, check whether DRV's output is in 'redirectedOutputs', and pass an
'output' argument to the built-in builder.
(DerivationGoal::addHashRewrite): Add 'printMsg' call.
* nix/libstore/builtins.hh (derivationBuilder): Add 'output' parameter.
* nix/libstore/builtins.cc (builtinDownload): Likewise.
Add OUTPUT to ARGV.
* guix/scripts/perform-download.scm (perform-download): Add 'output'
parameter.
(guix-perform-download): Adjust 'match' clauses accordingly.
* tests/derivations.scm ("'download' built-in builder, check mode"): New
test.
2017-01-11 17:06:31 +01:00
Ludovic Courtès aa042770da
guix package: Fix version and output for 'guix package -i /gnu/store/…'.
* guix/utils.scm (package-name->name+version): Add optional 'delimiter'
parameter.
* guix/scripts/package.scm (store-item->manifest-entry): Pass #\- as the
delimiter for 'package-name->name+version'.  Use "out" instead of #f for
the 'output' field.
* tests/guix-package.sh: Add test.
2017-01-11 11:58:21 +01:00
Ludovic Courtès 1545a012cb
guix archive: Allow compilation in the absence of Guile-JSON.
Fixes <http://bugs.gnu.org/25409>.
Reported by Ben Woodcroft <b.woodcroft@uq.edu.au>.

* guix/scripts/archive.scm: Use 'module-autoload!' instead of #:use-module
to (guix docker).
2017-01-10 15:56:49 +01:00
Ludovic Courtès dd1141eba2
http-client: Improve error reporting.
* guix/http-client.scm (http-fetch): Change message in &message
condition to include URI, CODE, and the reason phrase.
2017-01-10 15:34:11 +01:00
Ludovic Courtès 01445711db
guix archive: '-f docker' supports package names as arguments.
This allows users to type:

  guix archive -f docker emacs

as was already the case for the 'nar' format.

Reported by David Thompson.

* guix/scripts/archive.scm (%default-options): Add 'format'.
(export-from-store): Dispatch based on the 'format' key in OPTS.
(guix-archive): Call 'export-from-store' in all cases when the 'export'
key is in OPTS.
2017-01-07 22:55:40 +01:00
Leo Famulari 74288230ea
Merge branch 'master' into core-updates 2017-01-06 17:14:41 -05:00
Ricardo Wurmus 03476a23ff
guix: Add Docker image export.
* guix/docker.scm: New file.
* Makefile.am (MODULES): Register it.
* guix/scripts/archive.scm (show-help, %options, guix-archive): Add
support for "--format".
* doc/guix.texi (Invoking guix archive): Document it.
2017-01-06 16:44:00 +01:00
Ludovic Courtès 76c31074c8
derivations: Share a cache between 'derivation' and 'read-derivation'.
This leads a 13% speedup on 'guix build libreoffice -d' and 18% on
'guix build gnome -d'.

* guix/derivations.scm (%derivation-cache): New variable.
(read-derivation): Use it instead of the private 'cache' variable.
(derivation): Populate %DERIVATION-CACHE before returning.
2017-01-05 23:45:39 +01:00
Ludovic Courtès 6d943e553d
derivations: Micro-optimize 'write-derivation'.
* guix/derivations.scm (write-derivation)[write-input]: Use 'display'
instead of 'write' for PATH.
Use 'simple-format' instead of 'format', and '~a' instead of '~s' for
SYSTEM and BUILDER.
2017-01-05 23:45:38 +01:00
Ludovic Courtès b96a0640a3
graph: Add '%reverse-package-node-type'.
* guix/scripts/graph.scm (%reverse-package-node-type): New variable.
(%node-types): Add it.
* tests/graph.scm ("reverse package DAG"): New test.
* doc/guix.texi (Invoking guix refresh): Add cross-reference to
"Invoking guix graph".
(Invoking guix graph): Document 'reverse-package'.
2017-01-04 16:18:53 +01:00
Ludovic Courtès d38bc9a9f6
grafts: Move caching to a new 'with-cache' macro.
* guix/grafts.scm (with-cache): New macro.
(cumulative-grafts)[return/cache]: Remove.
Use 'with-cache' instead.
2017-01-04 16:18:52 +01:00
Julien Lepiller e6876cb9dc
gnu: Add ocaml-build-system.
* guix/build/ocaml-build-system.scm: New file.
* guix/build-system/ocaml.scm: New file.
* Makefile.am (MODULES): Add them.
* gnu/packages/ocaml.scm (ocaml)[native-search-paths]: Adjuste OCAMLPATH.

Signed-off-by: David Craven <david@craven.ch>
2017-01-04 16:03:39 +01:00
David Craven ee17a9e06e
git-download: Add some helpers.
* guix/git-download.scm (git-version, git-file-name): New variables.
2017-01-04 11:44:07 +01:00
David Craven 3b7ccbe94c
build-system: cargo: Use correct cargo.
* gnu/packages/rust.scm (cargo-bootstrap): Make private.
* guix/build-system/cargo.scm (default-cargo): Use cargo.
2017-01-04 11:29:15 +01:00
Manolis Ragkousis 484437bd43
guix: build: make-bootstrap: Copy libpthread_nonshared.a to the new system.
* guix/build/make-bootstrap.scm (%libc-object-files-rx): Update regexp.
2017-01-03 16:00:43 +02:00
Ludovic Courtès d925cdc35f
ui: Keep the word "Copyright" untranslated.
Suggested by John Darrington <john@darrington.wattle.id.au>.

* guix/ui.scm (show-version-and-exit): Make "Copyright (C) 2017"
untranslatable, except "(C)" itself, like Gnulib's version-etc does.
2017-01-02 23:14:36 +01:00
Ludovic Courtès eeb05e87d3
guix hash: '-x' excludes '.git' even when it is a regular file.
* guix/scripts/hash.scm (guix-hash)[vcs-file?]: Add case for '.git'
regular files.
2017-01-02 15:23:21 +01:00
Ludovic Courtès 74d862e8a2
ui: It's 2017 now!
* guix/ui.scm (show-version-and-exit): Change year to 2017.
2017-01-01 23:38:52 +01:00
Ludovic Courtès a6e0ae4046
syscalls: 'terminal-columns' swallows ENOSYS.
* guix/build/syscalls.scm (terminal-columns): Catch ENOSYS.
2017-01-01 23:38:07 +01:00
Ludovic Courtès fef494d27d
gnu-maintenance: Update ViewVC URLs.
* guix/gnu-maintenance.scm (%gnumaint-base-url): Change "/gnumaint" to
"/womb/gnumaint".
(%package-list-url, %package-description-url): Adjust accordingly.
2017-01-01 23:30:30 +01:00
Ludovic Courtès 5e2e4a51f9
gexp: Support 'ungexp' forms in improper lists.
* guix/gexp.scm (gexp)[collect-escapes, substitute-references]: Replace
the (exp0 exp ...) patterns with (exp0 . exp) to match improper lists.
Adjust clause bodies accordingly.
* tests/gexp.scm ("one input package, dotted list"): New test.
2017-01-01 23:30:30 +01:00
Ludovic Courtès 4a6e889feb
gexp: Properly report substitution errors.
* guix/gexp.scm (gexp)[substitute-ungexp]: Wrap body in 'with-syntax'
and pass EXP as the last argument to 'syntax-error'.
[substitute-ungexp-splicing]: Pass EXP as the last argument to
'syntax-error'.
2017-01-01 23:30:30 +01:00
David Craven f1d136957d
build-system: cargo: Handle Cargo.lock file not present.
* guix/build-system/cargo.scm (cargo-build): Add src output.
  (private-keywords): Add #:outputs.
* guix/build/cargo-build-system.scm (configure): Use /share/rust-source
  when replacing inputs.
  (build, check): Don't do anything when there isn't a Cargo.lock file
  present.
  (install): Install sources to src output. When a Cargo.lock file is
  present use cargo install to install binaries to out.
* guix/import/crate.scm (make-crate-sexp): Importer uses the src output
  for crate inputs by default.
* guix/import/utils.scm (package-names->package-inputs, maybe-inputs,
  maybe-native-inputs): Take an optional output argument.
* tests/crate.scm (crate->guix-package test): Update.

Problem reported by Francisco Gómez García <espectalll@kydara.com>.
2017-01-01 18:20:52 +01:00
David Craven f53a5514e0
import: crate: Provide a default home-page value.
* guix/import/crate.scm (make-crate-sexp): Provide a default home-page
  value.
* tests/crate.scm (test-crate): Add repository field.

Problem reported by ng0 <ng0@libertad.pw>.
2017-01-01 18:12:06 +01:00
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
Marius Bakke e46a043ecd
build-system/python: Make sure 'check' returns failures.
* guix/build/python-build-system.scm (check): Wrap 'call-setuppy' in 'if' so
that it actually fails when the tests fail. Print informational message when
skipped.
2016-12-13 21:04:31 +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
Marius Bakke be12f4e275
build-system/perl: Don't create non-deterministic 'perllocal.pod' files.
* guix/build/perl-build-system.scm (configure): Add "NO_PERLLOCAL=1"
to Makefile.PL arguments.
2016-11-28 23:11:39 +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
Leo Famulari a282cdae10
Merge branch 'master' into core-updates 2016-11-26 16:21:47 -05:00
Marius Bakke c254ac3200
build-system/gnu: Make libraries writable before stripping.
* guix/build/gnu-build-system.scm (strip)[strip-dir]: Change mode of
files before running strip-command.
2016-11-26 09:07:07 +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
Hartmut Goebel e442246a2f
lint: more packages to probably be a native input.
* guix/scripts/lint.scm (check-inputs-should-be-native package): Add python
  packages which are typically used for testing or for building the
  documentation.
2016-11-15 17:37:50 +01:00
Hartmut Goebel 891a843d51
guix: Add lint-checker for packages which should be no inputs at all.
Also refactor some common code into a new function.

Examples for these pacakges are python(2)-setuptools and python(2)-pip, which
are installed together with python itself.

* guix/scripts/lint.scm (warn-if-package-has-input): New procedure.
  (check-inputs-should-be-native package): Use it; rename and clean-up
  variables. (check-inputs-should-not-be-an-input-at-all): New procedure.
  (%checkers) Add it.
* doc/guix.texi (Python Modules): Document it.
* tests/lint.scm: ("inputs: python-setuptools should not be an input at all
  (input)", "inputs: python-setuptools should not be an input at all
  (native-input)" "inputs: python-setuptools should not be an input at all
  (propagated-input)"): Add tests.
2016-11-15 17:37:49 +01:00
Hartmut Goebel c1019287a4
guix: python-build-system: Add background about Python installation methods. 2016-11-15 17:37:47 +01:00
Hartmut Goebel b002f964bb
guix: python-build-system: Delete .egg-info file created in phase check.
* guix/build/python-build-system.scm (check): Delete .egg-info dirs
  which did not exist prior to calling setup.py but afterwards.
2016-11-15 17:37:46 +01:00
Hartmut Goebel a2ff4f0240
guix: python-build-system: Add helpers for getting and setting PYTHONPATH.
* guix/build/python-build-system.scm (add-installed-pythonpath,
  site-packages): New exported procedures.
2016-11-15 17:37:45 +01:00
Hartmut Goebel 5f7565d190
guix: python-build-system: Add option "#:use-setuptools?" (default true).
* guix/build-system/python.scm (python-build): New keyword argument
  "#:use-setuptools?", defaulting to #t.
* guix/build/python-build-system.scm (call-setup-py): New positional
  parameter "use-setuptools?". If false, do not use the shim-wrapper
  for addin setuptools. (build, check): accept keyword-
  parameter, and pass to call-setuppy. (install): same; if
  "use-setuptools?" is false, do not use options "--root" and
  "--single-version-externally-managed" for setup.py.
* doc/guix.texi (Build Systems): Document it.
2016-11-15 17:37:44 +01:00
Marius Bakke 46bcdcc287
guix: python-build-system: Import setuptools before calling `setup.py'.
This is needed for packages using "distutils" instead of "setuptools" since
the former does not understand the "--single-version-externally-managed"
flag. Also export __file__ since it will be unset when setup.py is called from
python "exec".

* guix/build/python-build-system.scm (call-setuppy): extend "python setup.py"
  call to import setuptools, export __file__, and call setup.py from
  setuptools python environment.

Co-Authored-By: Hartmut Goebel <h.goebel@crazy-compilers.com>
2016-11-15 17:37:43 +01:00
Hartmut Goebel 7db40bce58
guix: build all Python packages with --single-version-externally-managed.
This requires setuptools to be installed together with python, which is
the case for Python 3 anyway and which we do for our build of Python 2
(see last commit).

* guix/build/python-build-system.scm (install): Add
  "--single-version-externally-managed" and "--root=/" to params to be
  passed to call-setuppy. Remove thus needless manipulation of
  PYTHONPATH. Remove now unused argument "inputs".
2016-11-15 17:37:41 +01:00
Hartmut Goebel 043a51c0c2
guix: python-build-system: Fix an outdated comment. 2016-11-15 17:37:39 +01:00
Alex Sassmannshausen c91b368e96
import/cpan: Maybe coerce version to string.
* guix/import/cpan.scm (cpan-module->sexp) <version>: Test if version in
  meta is string or number.  If it is number, coerce to string.
2016-11-14 00:06:09 +01:00
Ludovic Courtès 2cab1dd58b
Merge branch 'core-updates' 2016-11-13 00:34:16 +01:00
Ludovic Courtès 166ba5b102
substitute: Disable HTTPS certificate verification.
Fixes a regression introduced in
9e4e431e04 as a consequence of
bc3c41ce36.
Reported by Marius Bakke <mbakke@fastmail.com>.

* guix/scripts/substitute.scm (fetch): Pass #:verify-certificate? #f to
'open-connection-for-uri' and 'http-fetch'.
(download-cache-info): Likewise.
(http-multiple-get): Add #:verify-certificate? and honor it.
(fetch-narinfos): Pass #:verify-certificate? #f.
2016-11-12 13:04:45 +01:00
Ludovic Courtès 17cff9c662
http-client: Add #:verify-certificate? to 'http-fetch'.
* guix/http-client.scm (http-fetch): Add #:verify-certificate? parameter
and pass it to 'open-connection-for-uri'.
2016-11-12 13:04:45 +01:00
Ludovic Courtès 5970e8e248
container: Pass a list of <file-system> objects as things to mount.
* gnu/build/linux-container.scm (mount-file-systems): 'mounts' is now a
list of <file-system> objects instead of a list of lists ("specs").
Add call to 'file-system->spec' as the argument to 'mount-file-system'.
(run-container, call-with-container): Adjust docstring accordingly.
* gnu/system/file-systems.scm (spec->file-system): New procedure.
* gnu/system/linux-container.scm (container-script)[script]: Call
'spec->file-system' inside gexp.
* guix/scripts/environment.scm (launch-environment/container): Remove
call to 'file-system->spec'.
* tests/containers.scm ("call-with-container, mnt namespace")
("call-with-container, mnt namespace, wrong bind mount"): Pass a list of
<file-system> objects.
2016-11-10 18:01:44 +01:00
Ludovic Courtès c169d91e5a
lint: 'cve' checker catches 'tls-certificate-error'.
Reported by Frederick Muriithi <fredmanglis@gmail.com>.

* guix/scripts/lint.scm (tls-certificate-error-string): New procedure.
(validate-uri): Use it.
(current-vulnerabilities*): Catch 'tls-certificate-error' and print a
warning.
2016-11-09 21:24:44 +01:00