Commit Graph

7184 Commits

Author SHA1 Message Date
Ludovic Courtès 885d524f79
substitute: Gracefully retry after failed partial downloads.
Fixes <https://issues.guix.gnu.org/63443>.
Reported by Attila Lendvai <attila@lendvai.name>.

* guix/scripts/substitute.scm (catch-system-error): New macro.
(download-nar): Add call to 'delete-file-recursively'.
* tests/substitute.scm ("substitute, previous partial download around"):
New test.
2023-06-08 22:54:58 +02:00
Ludovic Courtès 3f5e141829
substitute: Delete cached narinfos more than two-month old.
This allows 'guix substitute' to shrink the cache a bit more, which
saves space and improves performance of cache-cleanup phases since fewer
entries need to be traversed.

* guix/scripts/substitute.scm (cached-narinfo-expiration-time): Define
'max-ttl' and use it as an upper bound.
2023-06-08 22:27:20 +02:00
Ludovic Courtès 92ee0fd5eb
import: Gracefully handle EPIPE.
Previously, "guix import pypi f3 | head -3" would print a backtrace.

* guix/scripts/import.scm (guix-import): Wrap
'pretty-print-with-comments' call in 'leave-on-EPIPE'.
2023-06-08 22:06:00 +02:00
Ludovic Courtès dc0c5d56ee
records: Use SRFI-11 instead of SRFI-71, for Guile 2.0 compatibility.
This fixes a failure of 'tests/packages.scm' introduced in
b88e38d4b51b9aa0e857baeb614c000e491ad309: some of the tests import (guix
records) on the build side, which uses '%bootstrap-guile' (Guile 2.0)
where SRFI-71 is unavailable.

* guix/records.scm (match-record-inner): Use SRFI-11 instead of SRFI-71.
2023-06-06 11:54:39 +02:00
Ricardo Wurmus a025d8fee6
import/cran: Ensure current package is not among inputs.
* guix/import/cran.scm (cran-package-inputs): Remove the current package from
the result.
2023-06-05 18:55:11 +02:00
Josselin Poiret cacc0cb6ab
channels: Raise an error if dependency's introduction is malformed
* guix/channels.scm (sexp->channel-introduction): Do it.
2023-06-04 11:30:18 +02:00
Josselin Poiret 80d1228321
build-system: New agda-build-system.
* guix/build-system/agda.scm: New file.
* guix/build/agda-build-system.scm: New file.
* Makefile.am (MODULES): Register them.
* doc/guix.texi (Build Systems): Add documentation for agda-build-system.
2023-06-04 10:59:34 +02:00
Josselin Poiret 0769a9b3c5
build-system/haskell: Export default-haskell.
* guix/build-system/haskell.scm: Export default-haskell.
2023-06-04 10:59:33 +02:00
Josselin Poiret f045c7ac80
records: match-record: Do not show internal form.
* guix/records.scm (lookup-field+wrapper): Attach source properties to the
field syntax object instead.
2023-06-04 10:59:28 +02:00
(unmatched-parenthesis ew syntax 4cd5293621
records: Add MATCH-RECORD-LAMBDA.
* guix/records.scm (match-record-lambda): New syntax.
* tests/records.scm ("match-record-lambda"): New test.

Signed-off-by: Josselin Poiret <dev@jpoiret.xyz>
2023-06-04 10:59:25 +02:00
(unmatched-parenthesis d b88e38d4b5
records: match-record: Support thunked and delayed fields.
* guix/records.scm (match-record): Unwrap matched thunked and delayed fields.
* tests/records.scm ("match-record, thunked field",
"match-record, delayed field"): New tests.

Signed-off-by: Josselin Poiret <dev@jpoiret.xyz>
2023-06-04 10:34:35 +02:00
(unmatched-parenthesis 1a4aace3af
records: match-record: Raise a syntax error if TYPE is nonexistent.
* guix/records.scm (match-record): Raise a human-compherensible syntax error
  if the given record type identifier is unbound.

Co-authored-by: Josselin Poiret <dev@jpoiret.xyz>
Signed-off-by: Josselin Poiret <dev@jpoiret.xyz>
2023-06-04 10:34:33 +02:00
Ludovic Courtès 69dfdb7bd1
environment: Fix unbound-variable bug with '--symlink'.
Fixes <https://issues.guix.gnu.org/63845>.
Reported by Maxim Cournoyer <maxim.cournoyer@gmail.com>.

* guix/scripts/environment.scm (launch-environment/container): Reference
'evaluate-populate-directive' before calling 'call-with-container'.
2023-06-02 16:57:17 +02:00
Ludovic Courtès 0a8f53d61b
read-print: Add 'package/inherit' special form.
* guix/read-print.scm (%special-forms): Add 'package/inherit'.
2023-06-02 15:47:27 +02:00
Ludovic Courtès acef4cecf9
ci: Reify the timestamps of evaluations.
* guix/ci.scm (<evaluation>)[start-time, checkout-time,
completion-time]: New fields.
2023-06-02 15:47:27 +02:00
Ricardo Wurmus c2f0ce73a7
import/cran: string->license: Add another case for GPLv3+.
* guix/import/cran.scm (string->license): Translate "GPL (>=3)" to gpl3+.
2023-06-02 12:52:22 +02:00
Ricardo Wurmus cbbb619ddb
import/cran: Libraries should not use CRAN-GUIX-NAME.
* guix/import/cran.scm (source-dir->dependencies): Do not use CRAN-GUIX-NAME
when processing result of NEEDED-LIBRARIES-IN-DIRECTORY.
2023-06-02 12:49:25 +02:00
Ricardo Wurmus 67183e25ad
import/cran: Also search Makevars file for libraries.
* guix/import/cran.scm (needed-libraries-in-directory): Look at Makevars in
addition to Makevars.in for libraries.
2023-06-02 12:48:42 +02:00
Ludovic Courtès 57ceb64e34
upstream: Honor package properties for ignored and extra inputs.
* guix/upstream.scm (update-package-inputs)[filtered-inputs]
[regular-inputs, native-inputs, propagated-inputs]: New procedures.
Use them in 'update-field' calls.
* tests/guix-refresh.sh (GUIX_TEST_UPDATER_TARGETS): Add "libreoffice"
to the dependencies of "the-test-package".  Add 'updater-ignored-inputs'
property to "the-test-package".
* doc/guix.texi (Invoking guix refresh): Document it.
2023-05-31 23:25:26 +02:00
Ludovic Courtès 9e237fe0bd
import: gem: Updater provides input list.
* guix/import/gem.scm (import-release): Add 'inputs' field.
* tests/gem.scm ("package-latest-release"): New test.
2023-05-31 23:25:26 +02:00
Ludovic Courtès e6f82fcd5f
import: gem: Factorize "bundler" special case for name mapping.
* guix/import/gem.scm (ruby-package-name): Add "bundler" special case.
(gem->guix-package): Adjust accordingly.
* tests/gem.scm ("gem-recursive-import")
("gem-recursive-import with a specific version"): Remove "ruby-bundler"
from the expected packages.
2023-05-31 23:25:26 +02:00
Ludovic Courtès d46d1bee1e
import: elpa: Updater provides input list.
* guix/import/elpa.scm (elpa-dependency->upstream-input): New
procedure.
(latest-release): Add 'inputs' field.
* tests/elpa.scm ("package-latest-release"): New test.
2023-05-31 23:25:26 +02:00
Ludovic Courtès a738c1a0c7
import: cpan: Updater provides input list.
* guix/import/cpan.scm (latest-release): Add 'inputs' field.
* tests/cpan.scm ("package-latest-release"): New test.
2023-05-31 23:25:25 +02:00
Ludovic Courtès c4fe4e7eb8
import: cpan: Represent dependencies as <upstream-input> records.
* guix/import/cpan.scm (cpan-name->downstream-name)
(cran-dependency->upstream-input, cran-module-inputs): New procedures.
(cpan-module->sexp)[guix-name, convert-inputs]: Remove.
[maybe-inputs]: Adjust to deal with <upstream-input>.
Use 'cpan-name->downstream-name' instead of 'guix-name'.  Add call to
'cpan-module-inputs' and adjust calls to 'maybe-inputs'.  No longer emit
input labels.
* tests/cpan.scm ("cpan->guix-package"): Adjust test accordingly.
2023-05-31 23:25:25 +02:00
Ludovic Courtès f13e73df10
import: cpan: Remove unary 'string-append' call.
* guix/import/cpan.scm (package->upstream-name): Remove useless
'string-append'.
2023-05-31 23:25:25 +02:00
Ludovic Courtès cd262c403f
upstream: Remove <upstream-input-change> and related code.
* guix/upstream.scm (<upstream-input-change>): Remove.
(changed-inputs): Remove.
* tests/upstream.scm (test-package, test-new-package)
("changed-inputs returns no changes")
("changed-inputs returns changes to plain input list")
("changed-inputs returns changes to all plain input lists"): Remove.
2023-05-31 23:25:25 +02:00
Ludovic Courtès ec0a2fc87b
upstream: 'update-package-source' edits input fields.
Previously, 'guix refresh r-ggplot2 -u' and similar commands would print
of list of input changes that would have to be made manually.  With this
change, 'guix refresh -u' takes care of updating input fields
automatically.

* guix/upstream.scm (update-package-inputs): New procedure.
(update-package-source): Call it when 'upstream-source-inputs' returns
true.
* guix/scripts/refresh.scm (update-package): Remove iteration over the
result of 'changed-inputs'.
* guix/import/test.scm (available-updates): Add support for input
lists.
* tests/guix-refresh.sh (GUIX_TEST_UPDATER_TARGETS): Add input list for
"the-test-package".
Make sure 'guix refresh -u' updates 'inputs' accordingly.
* doc/guix.texi (Invoking guix refresh): Mention it.
2023-05-31 23:25:25 +02:00
Ludovic Courtès 9f3ea03516
diagnostics: Factorize 'absolute-location'.
* guix/scripts/style.scm (absolute-location): Move to...
* guix/diagnostics.scm (absolute-location): ... here.
* guix/upstream.scm (update-package-source): Use it.
2023-05-31 23:25:25 +02:00
Ludovic Courtès e6223017d9
upstream: Replace 'input-changes' field by 'inputs'.
Returning the expected list of inputs rather than changes relative to
the current package definition is less ambiguous and offers more
possibilities for further processing.

* guix/upstream.scm (<upstream-source>)[input-changes]: Remove.
[inputs]: New field.
(<upstream-input>): New record type.
* guix/upstream.scm (upstream-input-type-predicate)
(input-type-filter, upstream-source-regular-inputs)
(upstream-source-native-inputs, upstream-source-propagated-inputs): New
procedures.
(changed-inputs): Expect an <upstream-source> as its second argument.
Adjust accordingly.
* guix/import/pypi.scm (distribution-sha256): New procedure.
(maybe-inputs): Expect a list of <upstream-input>.
(compute-inputs): Rewrite to return a list of <upstream-input>.
(pypi-package-inputs, pypi-package->upstream-source): New procedures.
(make-pypi-sexp): Use it.
* guix/import/stackage.scm (latest-lts-release): Define 'cabal'.
Replace 'input-changes' field by 'inputs'.
* guix/scripts/refresh.scm (update-package): Use 'changed-inputs'
instead of 'upstream-source-input-changes'.
* tests/cran.scm ("description->package"): Adjust order of inputs.
* tests/pypi.scm (default-sha256, default-sha256/base32): New variables.
(foo-json): Add 'digests' entry.
("pypi->guix-package, no wheel"): Check HASH against DEFAULT-SHA256/BASE32.
("pypi->guix-package, wheels"): Likewise.
("pypi->guix-package, no usable requirement file."): Likewise.
("pypi->guix-package, package name contains \"-\" followed by digits"):
Likewise.
("package-latest-release"): New test.
* tests/upstream.scm (test-package-sexp): Remove.
("changed-inputs returns no changes"): Rewrite to use <upstream-source>.
(test-new-package-sexp): Remove.
("changed-inputs returns changes to plain input list"): Rewrite.
("changed-inputs returns changes to all plain input lists"): Likewise.
("changed-inputs returns changes to labelled input list")
("changed-inputs returns changes to all labelled input lists"): Remove.
* guix/import/cran.scm (maybe-inputs): Expect PACKAGE-INPUTS to be a
list of <upstream-input>.
(source-dir->dependencies): Return a list of <upstream-input>.
(vignette-builders): Likewise.
(uri-helper, cran-package-source-url)
(cran-package-propagated-inputs, cran-package-inputs): New procedures.
(description->package): Use them instead of local definitions.
(latest-cran-release): Replace 'input-changes' field by 'inputs'.
(latest-bioconductor-release): Likewise.
(format-inputs): Remove.
* guix/import/hackage.scm (cabal-package-inputs): New procedure.
(hackage-module->sexp): Use it.
[maybe-inputs]: Expect a list of <upstream-input>.
2023-05-31 23:25:24 +02:00
Ludovic Courtès e7910f4882
import: json: Add #:timeout to 'json-fetch'.
* guix/import/json.scm (json-fetch): Add #:timeout and pass it to
'http-fetch'.
2023-05-31 23:25:24 +02:00
Ludovic Courtès 4663cfd381
import: utils: 'call-with-networking-exception-handler' doesn't unwind.
That way backtraces show where the error actually originates from.

* guix/import/utils.scm (call-with-networking-exception-handler):
Rewrite using 'with-exception-handler'.
2023-05-31 23:25:24 +02:00
Ludovic Courtès d2f36abd02
tests: pypi: Rewrite tests using a local HTTP server.
* guix/import/pypi.scm (%pypi-base-url): New variable.
(pypi-fetch): Use it.
* tests/pypi.scm (foo-json): Compute URLs relative to '%local-url'.
(test-json-1, test-json-2, test-source-hash): Remove.
(file-dump): New procedure.
(with-pypi): New macro.
("pypi->guix-package, no wheel")
("pypi->guix-package, wheels")
("pypi->guix-package, no usable requirement file.")
("pypi->guix-package, package name contains \"-\" followed by digits"):
Rewrite using 'with-pypi'.
2023-05-31 23:25:24 +02:00
Ludovic Courtès 09526da78f
tests: http: Allow responses to specify a path.
* guix/tests/http.scm (%local-url): Add #:path parameter and honor it.
(call-with-http-server)[responses]: Add extra clause with 'path'.
[bad-request]: New variable.
[server-body]: Handle three-element clauses.
Wrap 'run-server' call in 'parameterize'.
2023-05-31 23:25:24 +02:00
Ludovic Courtès d0be53d03e
transformations: Add "--tune" to "--help-transform".
* guix/transformations.scm (show-transformation-options-help/detailed):
Add '--tune'.
2023-05-31 23:24:33 +02:00
Remco van 't Veer 782d806c3a
guix gc: Round MiBs in user feedback.
* guix/scripts/gc.scm (guix-gc): Round MiBs in user feedback.

Signed-off-by: Florian Pelz <pelzflorian@pelzflorian.de>
2023-05-31 22:45:35 +02:00
Ludovic Courtès 8af9a2aa5f
substitute: If a server's nar URL is 404, try the next one(s).
If a substitute server advertises in its narinfo, for example, both a
/zstd and a /lzip URL but the /zstd URL is unreachable, try the /lzip
URL.

Fixes <https://issues.guix.gnu.org/63634>.

* guix/narinfo.scm (narinfo-preferred-uris): New procedure.
(narinfo-best-uri): Rebase on top of it.
* guix/scripts/substitute.scm (download-nar)[try-fetch]: New procedure.
Use 'narinfo-preferred-uris' and 'try-fetch' to attempt all the URLs of
NARINFO.
* tests/substitute.scm (request-substitution): Remove 'parameterize'.
Delete DESTINATION.
("substitute, preferred nar URL is 404, other is 200"): New test.
2023-05-30 00:15:29 +02:00
Ludovic Courtès ca1ea6373a
self: Install 'guix-daemon.cil'.
* guix/self.scm (selinux-policy): New procedure.
(miscellaneous-files): Add 'daemon' parameter.  Add 'guix-daemon.cil'.
(compiled-guix): Adjust call to 'miscellaneous-files'.
2023-05-25 12:51:16 +02:00
Ludovic Courtès 9fa92acbf0
self: Build against "graphviz-minimal".
Fixes <https://issues.guix.gnu.org/63050>.
Reported by Andreas Enge <andreas@enge.fr>.

* guix/self.scm (%packages): Change "graphviz" to refer to
"graphviz-minimal".  Add "font-ghostscript".
(info-manual): Define 'font-ghostscript'.
[build]: Set XDG_DATA_DIRS.
2023-05-24 15:04:00 +02:00
Ludovic Courtès 3f59fd6d11
substitute: Rethrow with 'raise-exception', not 'throw'.
Rethrowing with 'throw' doesn't work as intended when the exception
being rethrown is a SRFI-34 exception.

Fixes <https://issues.guix.gnu.org/55820>.

* guix/scripts/substitute.scm (kind-and-args-exception?): New variable.
(call-with-cached-connection): Rewrite using 'guard' instead of 'catch'
and 'raise' instead of 'throw'.
(system-error?): Use 'kind-and-args-exception?' instead of local
definition.
2023-05-22 17:05:22 +02:00
Ludovic Courtès ba5da5125a
style: Add 'arguments' styling rule.
* guix/scripts/style.scm (unquote->ungexp, gexpify-argument-value)
(quote-argument-value, gexpify-argument-tail)
(gexpify-package-arguments): New procedures.
(%gexp-keywords): New variable.
(%options): Add "arguments" case for 'styling-procedure.
(show-stylings): Update.
* tests/style.scm ("gexpify arguments, already gexpified")
("gexpify arguments, non-gexp arguments, margin comment")
("gexpify arguments, phases and flags")
("gexpify arguments, append arguments")
("gexpify arguments, substitute-keyword-arguments")
("gexpify arguments, append substitute-keyword-arguments"): New tests.
* doc/guix.texi (package Reference): For 'arguments', add compatibility
note and link to 'guix style'.
(Invoking guix style): Document the 'arguments' styling rule.
2023-05-18 20:01:32 +02:00
Ludovic Courtès cd08d64b3a
refresh: Honor '--key-server'.
Previously, the '--key-server' option would be ignored in an invocation
like:

  ./pre-inst-env guix refresh python-scipy=1.8.1 -t pypi -u \
     --key-server=pgp.mit.edu

* guix/upstream.scm (download-tarball): Add #:key-server parameter and
pass it to 'gnupg-verify*'.
(package-update/url-fetch, package-update/git-fetch)
(package-update): Likewise.
* guix/scripts/refresh.scm (update-package): Add #:key-server and pass
it down to 'package-update'.
(guix-refresh): Pass #:key-server to 'update-package'.
2023-05-18 19:20:58 +02:00
Simon Tournier d81701a85a
scripts: import: elpa: Return consistent error code.
Fixes <https://bug.gnu.org/58308>.
Reported by Ricardo Wurmus.

* guix/scripts/import/elpa.scm (guix-import-elpa): Return consistent error
code independently of the 'recursive' option.

Signed-off-by: Josselin Poiret <dev@jpoiret.xyz>
2023-05-17 22:22:22 +02:00
Simon Tournier b89ab866bc
scripts: import: elpa: Warn when version is specified.
* guix/scripts/import/elpa.scm (guix-import-elpa): Warn when version is
specified.

Signed-off-by: Josselin Poiret <dev@jpoiret.xyz>
2023-05-17 22:22:21 +02:00
Ludovic Courtès 3186a52e11
download: Refer to the 'guile-gnutls' package and not 'gnutls'.
This reinstates c625e5b64d, which was
reverted due to a circular dependency:

  https://issues.guix.gnu.org/63331

This is a followup to 305794762c, which
removed Guile bindings from 'gnutls'.

* guix/android-repo-download.scm (android-repo-fetch): Refer to
'guile-gnutls instead of 'gnutls.
* guix/cvs-download.scm (cvs-fetch): Likewise.
* guix/git-download.scm (git-fetch): Likewise.
* guix/hg-download.scm (hg-fetch): Likewise.
2023-05-11 13:23:08 +02:00
Efraim Flashner 649ce7b433
Merge branch 'rust-team' 2023-05-09 09:56:33 +03:00
Efraim Flashner 1bb29cd49c
gnu: gcc: Update cpu tuning architectures.
* gnu/packages/gcc.scm (%gcc-7.5-armhf-micro-architectures): Add missing
micro-architecture.
(%gcc-10-armhf-micro-architectures): Adjust accordingly.
(%gcc-11-aarch64-micro-architectures): Add missing micro-architecture.
(%gcc-12-aarch64-micro-architectures, %gcc-12-armhf-micro-architectures,
%gcc-12-x86_64-micro-architectures, %gcc-13-aarch64-micro-architectures,
%gcc-13-armhf-micro-architectures, %gcc-13-x86_64-micro-architectures):
New variables.
(gcc-12)[properties]: Use new compiler-cpu-architectures.
* guix/cpu.scm (cpu->gcc-architecture): Update entries for Intel, AMD,
x86_64 fallback and aarch64.
2023-05-09 09:52:24 +03:00
Efraim Flashner f4c3f2be94
gnu: rust: Update to 1.67.
* gnu/packages/rust.scm (rust): Update to 1.67.
[arguments]: Add a phase to skip tests requiring mercurial. Extend the
custom 'patch-process-tests phase.
(rust-1.64)[arguments]: Adjust 'patch-cargo-checksums phase to patch
another file.
* guix/build/cargo-build-system.scm (package): Adjust to remove
Cargo.toml.orig file if it exists.
2023-05-07 19:28:57 +03:00
Efraim Flashner 1963daf94c
build: cargo-build-system: Don't try to package when skipping build.
* guix/build/cargo-build-system.scm (package): If the package isn't
going to be built then use the source instead.
2023-05-07 19:28:57 +03:00
Ludovic Courtès c3d7c09b9f
Revert "download: Refer to the 'guile-gnutls' package and not 'gnutls'."
This reverts commit c625e5b64d, which
introduced a circular dependency: the origin of guile-gnutls relies on
'git-download', which would now depend on guile-gnutls.
2023-05-06 19:12:16 +02:00
Ludovic Courtès c625e5b64d
download: Refer to the 'guile-gnutls' package and not 'gnutls'.
This is a followup to 305794762c, which
removed Guile bindings from 'gnutls'.

* guix/android-repo-download.scm (android-repo-fetch): Refer to
'guile-gnutls instead of 'gnutls.
* guix/cvs-download.scm (cvs-fetch): Likewise.
* guix/git-download.scm (git-fetch): Likewise.
* guix/hg-download.scm (hg-fetch): Likewise.
2023-05-06 18:19:13 +02:00