Commit Graph

4331 Commits

Author SHA1 Message Date
Ludovic Courtès 9323ab550f
tests: 'with-http-server' accepts multiple responses.
* guix/tests/http.scm (call-with-http-server): Replace 'code' and 'data'
parameters with 'responses+data'.  Compute RESPONSES as a function of
that.  Remove #:headers parameter.
[http-write]: Quit only when RESPONSES is empty.
[server-body]: Get the response and data from RESPONSES, and set it to
point to the rest.
(with-http-server): Adjust accordingly.
* tests/derivations.scm ("'download' built-in builder")
("'download' built-in builder, invalid hash")
("'download' built-in builder, not found")
("'download' built-in builder, check mode"): Adjust to new
'with-http-server' interface.
* tests/lint.scm ("home-page: 200")
("home-page: 200 but short length")
("home-page: 404", "home-page: 301, invalid"):
("home-page: 301 -> 200", "home-page: 301 -> 404")
("source: 200", "source: 200 but short length")
("source: 404", "source: 404 and 200")
("source: 301 -> 200", "source: 301 -> 404"):
("github-url", github-url): Likewise.
* tests/swh.scm (with-json-result)
("lookup-origin, not found"): Likewise.
2019-09-02 15:25:01 +02:00
Ricardo Wurmus 8786fec485
import: cran: Only use the git import with what looks like a URL.
* guix/import/cran.scm (fetch-description): Abort if the argument does not
look like a URL.
2019-09-02 14:46:04 +02:00
Ricardo Wurmus c7358ac4fc
import: cran: Retry failed git imports on Bioconductor.
* guix/import/cran.scm (cran->guix-package): Retry failed git imports on
Bioconductor.
2019-09-02 14:45:17 +02:00
Efraim Flashner 2f43e5db1c
build/cargo-build-system: Use invoke.
* guix/build/cargo-build-system.scm (crate-src?, build, check,
install): Use 'invoke'.
2019-09-02 11:07:53 +03:00
Ludovic Courtès 900e0fbcc4
lint: Gracefully handle errors from 'connect' & co.
* guix/lint.scm (call-with-networking-fail-safe): Add case for
'system-error' as typically raised by 'connect' & co.
2019-08-31 21:04:09 +02:00
Ludovic Courtès c3e59de9b1
guix system: Reinstalling the bootloader preserves extra menu entries.
Fixes <https://bugs.gnu.org/36876>.
Reported by Jesse Gibbons <jgibbons2357@gmail.com>.

Previously 'guix system delete-generations' or 'switch-generation' would
lose the extra bootloader menu entries specified in the current system's
configuration.  This fixes that.

* guix/scripts/system.scm (reinstall-bootloader): Turn PARAMS into a
single <boot-parameters>.  Adjust ENTRIES to include extra menu entries
specified in PARAMS.
2019-08-30 01:33:45 +02:00
Ludovic Courtès 7d09f2e85f
lint: formatting: Reporters return #f or a warning.
* guix/lint.scm (report-tabulations, report-trailing-white-space)
(report-long-line, report-lone-parentheses): Return #f instead
of *unspecified* when there are no warnings.
(report-formatting-issues): Use 'filter-map' instead of 'map' + 'filter'.
2019-08-30 01:33:45 +02:00
Ricardo Wurmus ad553ec4b1
import: cran: Add support for git repositories.
* guix/import/cran.scm (vcs-file?): New procedure.
(download): Support downloading from git.
(fetch-description): Add a clause for the 'git repository type.
(files-match-pattern?): New procedure.
(tarball-files-match-pattern?): Implement in terms of FILES-MATCH-PATTERN?.
(directory-needs-fortran?, directory-needs-zlib?,
directory-needs-pkg-config?): New procedures.
(needs-fortran?, needs-zlib?, needs-pkg-config?): Rename these procedures...
(tarball-needs-fortran?, tarball-needs-zlib?, tarball-needs-pkg-config?):
...to this, and use them.
(file-hash): New procedure.
(description->package): Handle the 'git repository type.
* guix/import/utils.scm (package->definition): Handle package expression
inside of a let.
* guix/scripts/import.scm (guix-import): Handle let expressions.
* doc/guix.texi (Invoking guix import): Document it.
2019-08-29 11:38:12 +02:00
Ricardo Wurmus 54ddd85220
import: cran: guix-import-cran: Use (guix import utils).
* guix/scripts/import/cran.scm (guix-import-cran): Use PACKAGE->DEFINITION
from (guix import utils) instead of custom procedure.
2019-08-29 08:06:54 +02:00
Ludovic Courtès dae950ca50
deploy: Do not quote error messages.
* guix/scripts/deploy.scm (guix-deploy): Do not quote the message.
2019-08-28 18:52:52 +02:00
Ludovic Courtès e09c7f4ae4
remote, ssh: Show the command exit status upon failure.
* guix/remote.scm (remote-pipe-for-gexp): Show the exit status in error
message.
* guix/ssh.scm (remote-inferior): Likewise.
2019-08-28 18:52:52 +02:00
Ludovic Courtès d229215051
diagnostics: Avoid highlighting complete messages.
* guix/diagnostics.scm (%highlight-argument): Don't highlight ARG if it
contains white space.
2019-08-28 18:52:52 +02:00
Ludovic Courtès 8f67a76a54
lint: Log diagnostics with 'info', not 'warning'.
* guix/scripts/lint.scm (emit-warnings): Use 'info', not 'warning'.
This removes the unhelpful "warning:" prefix that commit
3d33c93cef introduced.
2019-08-28 18:52:51 +02:00
Ludovic Courtès 8146c48632
swh: Correctly handle visits without a snapshot.
As discussed at
<https://sympa.inria.fr/sympa/arc/swh-devel/2019-08/msg00016.html>.

* guix/swh.scm (string*): New procedure.
(<visit>)[snapshot-url]: Pass 'string*' as the conversion procedure.
[status]: Pass 'string->symbol' as the conversion procedure.
(visit-snapshot): Return #f when 'visit-snapshot-url' returns #f.
(lookup-origin-revision): Filter to visits for which
'visit-snapshot-url' is true.
2019-08-28 18:52:51 +02:00
Ludovic Courtès b8815c5ec4
swh: 'swh-download' prints debugging info.
* guix/git-download.scm (git-fetch): Print a message before calling
'swh-download'.
* guix/swh.scm (swh-download): Add #:log-port.  Write debugging messages
to LOG-PORT.
2019-08-28 18:52:51 +02:00
Efraim Flashner 3762e31b6c
build/cargo-build-system: Remove 'update-cargo-lock phase.
* guix/build/cargo-build-system.scm (update-cargo-lock): Remove
procedure.
(configure): Delete Cargo.lock file if it exists.
(%standard-phases): Remove 'update-cargo-lock.
* doc/guix.texi (Build System)[cargo-build-system]: Remove references to
the 'update-cargo-lock phase.
2019-08-28 09:41:59 +03:00
Ludovic Courtès 58d5f280a3
lint: Correct use of 'with-networking-fail-safe'.
Fixes <https://bugs.gnu.org/37160>.
Reported by Jonathan Brielmaier <jonathan.brielmaier@web.de>.

* guix/lint.scm (check-for-updates): Make sure the first argument to
'with-networking-fail-safe' is the whole error message.
2019-08-28 00:27:14 +02:00
Ludovic Courtès 7979a287f8
pack: Create /tmp in Docker images.
Fixes <https://bugs.gnu.org/37161>.

* guix/scripts/pack.scm (docker-image)[build]: Add a 'directory' entry
for "/tmp" to DIRECTIVES.
* tests/pack.scm ("docker-image + localstatedir"): Test the presence of /tmp.
* gnu/tests/docker.scm (run-docker-test)["Load docker image and run
it"]: Test the presence and permission bits of "/tmp".
2019-08-27 12:20:44 +02:00
Ludovic Courtès 2b7c89f4fc
docker: Take a list of directives instead of a list of symlinks.
* guix/docker.scm (symlink-source, topmost-component): Remove.
(directive-file): New procedure.
(build-docker-image): Remove #:symlinks and add #:extra-files.
Make a sub-directory "extra" and call 'evaluate-populate-directive' for
EXTRA-FILES in that directory.
* guix/scripts/pack.scm (docker-image)[build](symlink->directives,
directives): New procedures.
Pass #:extra-files instead of #:symlinks to 'build-docker-image'.
2019-08-27 12:20:44 +02:00
Ludovic Courtès dd6976dd75
import: github: 'github-package?' uses 'package-upstream-name'.
* guix/import/github.scm (updated-github-url): Use
'package-upstream-name' instead of 'package-name'.  This allows
'github-package?' to match more packages, given an appropriate upstream
name.
2019-08-27 12:20:44 +02:00
Mark H Weaver 32e18e9b94
Merge branch 'wip-binaries' 2019-08-26 23:28:58 -04:00
David Thompson 6cef554be8
packages: Apply target triplet in bag-transitive-host-inputs.
Fixes a bug where propagated inputs that should be cross-compiled are instead
compiled for the host system.

* guix/packages.scm (bag-transitive-host-inputs): Call transitive-inputs in
  the context of the bag's target system triplet.
2019-08-26 09:40:17 -04:00
Ludovic Courtès 90c98b5a89
swh: 'swh-download' checks return value of 'vault-fetch'.
Reported by Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
in <https://bugs.gnu.org/36931>.

* guix/swh.scm (swh-download): Check whether 'vault-fetch' return false
before calling 'dump-port'.
2019-08-23 18:41:49 +02:00
Ludovic Courtès b908fcd8c0
pack: '-R' honors the requested output.
Fixes <https://bugs.gnu.org/36925>.
Reported by Jesse Gibbons <jgibbons2357@gmail.com>.

* guix/scripts/pack.scm (wrapped-package): Add 'output*' parameter.
[build]: Define 'input' and 'target'; use them instead of #$package and
 #$output, respectively.
(wrapped-manifest-entry): New procedure.
(map-manifest-entries): Call PROC directly.
(guix-pack): Pass WRAPPED-MANIFEST-ENTRY to 'map-manifest-entries'.
2019-08-23 18:41:49 +02:00
Mark H Weaver 888e477bf8
Revert "import: utils: Add hash-ref*."
This reverts commit 8a3b11d1eb.
2019-08-22 14:24:37 -04:00
Mark H Weaver d020821c0b
Revert "import: cpan: Adapt for the change to guile-json version 3."
This reverts commit 01ce7af25a.
2019-08-22 14:24:11 -04:00
Christopher Baines 01ce7af25a
import: cpan: Adapt for the change to guile-json version 3.
In guile-json version 3, JSON objects are represented as hash tables, rather
than alists.

* guix/import/cpan.scm (string->license): Change the match expression to match
on lists, rather than vectors.
(module->dist-name, cpan-source-url, cpan-version): Change assoc-ref to
hash-ref.
(cpan-module->sexp): Change assoc-ref to hash-ref, and assoc-ref* to
hash-ref*.
* tests/cpan.scm ("source-url-http", "source-url-https"): Convert the alist to
a hash table.
2019-08-21 18:29:30 +01:00
Christopher Baines 8a3b11d1eb
import: utils: Add hash-ref*.
With the change to guile-json version 3, JSON objects are represented as hash
tables, rather than alists. The cpan importer uses assoc-ref* on a hash table,
so add an equivalent function for hash tables.

* guix/import/utils.scm (hash-ref*): New procedure.
2019-08-21 18:29:27 +01:00
Ludovic Courtès 0ea009db9d
upstream: Gracefully handle archive type changes.
Previously, if the currently used archive type (e.g., "bz2") was
unavailable for the new version, 'guix refresh -u' would crash instead
of updating to the archive with the new type.

* guix/upstream.scm (package-update/url-fetch): When URL is #f, pick the
first of URLS; likewise for SIGNATURE-URL.
2019-08-17 23:18:11 +02:00
Ludovic Courtès 4496ea74aa
refresh: Use the standard diagnostic procedures.
* guix/scripts/refresh.scm (warn-no-updater): Use 'warning' instead of
'format'.
(update-package): Use 'info' and 'warning' instead of 'format'.
2019-08-17 23:18:11 +02:00
Ludovic Courtès 8d64ef567f
import: gnome: Update for Guile-JSON 3.x.
This is a followup to 81c3dc3224.

* guix/import/gnome.scm (jsonish->upstream-source): Use 'assoc-ref'
instead of 'hash-ref'.
(latest-gnome-release): Match a vector containing an alist, not a hash
table.  Use 'fold' instead of 'hash-fold' over RELEASES.
2019-08-17 23:18:11 +02:00
Ludovic Courtès 23ab21fa9d
derivations: Fix typo in docstring.
* guix/derivations.scm (derivation-build-plan): Fix typo in the
docstring.
2019-08-17 19:26:10 +02:00
Ludovic Courtès 268896444b
derivations: Delete duplicate inputs when computing derivation hash.
Fixes <https://bugs.gnu.org/36777>.
Reported by Carl Dong <contact@carldong.me>.

* guix/derivations.scm (derivation/masked-inputs): Call
'delete-duplicates' on INPUTS.
* tests/derivations.scm ("derivation with duplicate fixed-output inputs"):
New test.
2019-08-16 23:00:26 +02:00
Ludovic Courtès a7c714d398
channels: Add 'profile-channels'.
* guix/channels.scm (profile-channels): New procedure.
* guix/scripts/describe.scm (display-profile-info)[channels]: Define in
terms of 'profile-channels'.
2019-08-16 23:00:26 +02:00
Ricardo Wurmus 5063deab08
import: cran: Support experiment and annotation packages.
* guix/import/cran.scm (%bioconductor-packages-list-url): Replace variable...
(bioconductor-packages-list-url): ...with this procedure.
(bioconductor-packages-list): Accept optional TYPE argument.
(latest-bioconductor-package-version): Same.
(fetch-description): Determine package type and use it in calls to
LATEST-BIOCONDUCTOR-PACKAGE-VERSION and BIOCONDUCTOR-URI.
(description->package): Pass package type to URI helper procedure; include
package type in annotation or experiment packages from Bioconducter.
2019-08-16 15:07:22 +02:00
Ricardo Wurmus c586f427b4
build-system/r: bioconductor-uri: Take optional package type.
* guix/build-system/r.scm (bioconductor-uri): Take optional TYPE argument to
return annotation or experiment URLs.
2019-08-16 15:07:22 +02:00
Jakob L. Kreuze 4cc5e5204b
machine: Use 'become-command'.
* gnu/machine/ssh.scm (managed-host-remote-eval): Pass an appropriate
'become-command' to 'remote-eval'.
* guix/ssh.scm (remote-authorize-signing-key): Add optional
'become-command' argument.
All callers changed.
2019-08-16 08:47:28 -04:00
Jakob L. Kreuze ddef146b89
remote: Resolve missing 'G_'.
* guix/remote.scm: Require (guix i18n).
2019-08-16 08:45:44 -04:00
Jan Nieuwenhuizen 4f3811f6bb
guix: copy-linux-headers: Extract procedure, add headers.
* guix/build/make-bootstrap.scm (copy-linux-headers): New procedure; extract
from make-stripped-libc and add headers for Mes bootstrap.
(make-stripped-libc): Use it.
2019-08-15 14:46:03 -04:00
Jakob L. Kreuze 5f32531770
remote: Use (%daemon-socket-uri) rather than hard-coded path.
* guix/remote.scm (remote-eval): Use (%daemon-socket-uri) as the default
value of 'socket-name' rather than hard-coded path.
2019-08-15 07:43:21 -04:00
Jakob L. Kreuze 3033d59ac9
machine: Automatically authorize the coordinator's signing key.
* guix/ssh.scm (remote-authorize-signing-key): New variable.
* gnu/machine/ssh.scm (deploy-managed-host): Authorize coordinator's
signing key before any invocations of 'remote-eval'.
(deploy-managed-host): Display an error if a signing key does not exist.
* doc/guix.texi (Invoking guix deploy): Remove section describing manual
signing key authorization.
(Invoking guix deploy): Add section describing the 'authorize?' field.
2019-08-15 07:43:13 -04:00
Jakob L. Kreuze 9c70c460a0
machine: Implement 'roll-back-machine'.
* gnu/machine.scm (roll-back-machine, &deploy-error, deploy-error?)
(deploy-error-should-roll-back)
(deploy-error-captured-args): New variable.
* gnu/machine/ssh.scm (roll-back-managed-host): New variable.
* guix/scripts/deploy.scm (guix-deploy): Roll-back systems when a
deployment fails.
2019-08-15 07:43:09 -04:00
Jakob L. Kreuze 5ea7537b9a
machine: Allow non-root users to deploy.
* doc/guix.texi (Invoking guix deploy): Add section describing
prerequisites for deploying as a non-root user.
* guix/remote.scm (remote-pipe-for-gexp): New optional 'become-command'
argument.
(%remote-eval): New optional 'become-command' argument.
(remote-eval): New 'become-command' keyword argument.
* guix/ssh.scm (remote-inferior): New optional 'become-command'
argument.
(inferior-remote-eval): New optional 'become-command' argument.
(remote-authorize-signing-key): New optional 'become-command' argument.
* gnu/machine/ssh.scm (machine-become-command): New variable.
(managed-host-remote-eval): Invoke 'remote-eval' with the
'#:become-command' keyword.
(deploy-managed-host): Invoke 'remote-authorize-signing-key' with the
'#:become-command' keyword.
2019-08-15 07:43:03 -04:00
Jakob L. Kreuze 03cbd94d48
remote: Remove '--system' argument.
* gnu/services.scm (activation-script): Return a <program-file> rather
than a <scheme-file>.
* gnu/deploy.scm (guix-deploy): Remove handling for '--system'.
(show-help): Remove documentation for '--system'.
(%default-options): Remove default setting for 'system'.
2019-08-14 15:38:13 -04:00
Jakob L. Kreuze 2c8e04f136
remote: Build derivations appropriate for the remote's
* gnu/machine/ssh.scm (machine-ssh-configuration): Add 'system' field.
(managed-host-remote-eval): Pass 'system' field to 'remote-eval'.
(machine-check-building-for-appropriate-system): New variable.
(check-deployment-sanity): Add call to
'machine-check-building-for-appropriate-system'.
* doc/guix.texi (Invoking guix deploy): Describe new 'system' field.
* guix/ssh.scm (remote-system): New variable.
* guix/remote.scm (remote-eval): Use result of 'remote-system' when
lowering the G-Expression.
(remote-eval): Add 'system' keyword argument.
(trampoline): Return a <program-file> rather than a <scheme-file>.
2019-08-14 15:38:09 -04:00
Marius Bakke 36f400f616
Merge branch 'master' into staging 2019-08-08 18:14:45 +02:00
Robert Vollmert e07f765558
import: hackage: Update list of ghc-included packages.
It turns out the list in the release notes is incomplete.
This updates the list from /gnu/store/<hash>-ghc-8.4.3/lib/ghc-8.4.3.

* guix/import/hackage.scm (ghc-standard-libraries): Update list.
2019-08-07 22:05:29 -04:00
Marius Bakke 8e7f97b9ff
Merge branch 'master' into staging 2019-08-08 00:35:37 +02:00
Ricardo Wurmus 9bd1333e58
Merge remote-tracking branch 'origin/master' into wip-texlive 2019-08-07 22:26:55 +02:00
Jakob L. Kreuze 55e238f2ab
deploy: Use all machine modules when loading deployment
* guix/scripts/deploy.scm (load-source-file): Enumerate and include all
submodules of (gnu machine) when loading the provided deployment
specification.
2019-08-07 16:05:58 -04:00