Commit Graph

5196 Commits

Author SHA1 Message Date
Ludovic Courtès a7696b9733
git-download: Don't verify X.509 certificate of SWH.
Fixes <https://bugs.gnu.org/42286>.

Regression introduced with the switch to Guile 3.0 in commit
b6bee63bed.

* guix/git-download.scm (git-fetch): Parameterize %VERIFY-SWH-CERTIFICATE.
2020-07-10 00:11:00 +02:00
Ludovic Courtès 722ad41c44
swh: Allow callers to disable X.509 certificate verification.
* guix/swh.scm (%verify-swh-certificate?): New parameter.
(http-get*, http-post*): New procedures.
(request-rate-limit-reached?): Use 'http-post*' instead of 'http-post'.
(update-rate-limit-reset-time!): Likewise.
(request-cooking): Likewise.
(call): Method defaults to 'http-get*' instead of 'http-get'.  Pass
 #:verify-certificate? to METHOD.
(vault-fetch): Likewise.
2020-07-10 00:11:00 +02:00
Ludovic Courtès d283bb960f
maint: Remove traces of "berlin.guixsd.org".
The guixsd.org domain is no longer advertised since before in 1.0.0
release in May 2019.

* etc/substitutes/berlin.guixsd.org.pub: Rename to...
* etc/substitutes/berlin.guix.gnu.org.pub: ... this.
* etc/substitutes/ci.guix.gnu.org.pub,
etc/substitutes/ci.guix.info.pub: Adjust accordingly.
* gnu/services/base.scm (%default-authorized-guix-keys): Likewise.
* guix/build/download-nar.scm (urls-for-item): Likewise.
* guix/self.scm (miscellaneous-files): Likewise.
* Makefile.am (dist_pkgdata_DATA): Likewise.
2020-07-10 00:11:00 +02:00
Arun Isaac 81a11883dc
weather: Print 0.0% correctly.
* guix/scripts/weather.scm (report-server-coverage): Report 0% coverage as
0.0%, not as .0%.
2020-07-05 16:13:37 +05:30
Arun Isaac a2daee843d
import: pypi: Handle 'null instead of #nil.
* guix/import/pypi.scm (non-empty-string-or-false): guile-json now returns
'null instead of #nil for null JSON values. Handle it.
2020-07-05 16:11:21 +05:30
Arun Isaac 9e85f652cb
discovery: Fix typo.
* guix/discovery.scm (fold-module-public-variables*): In the docstring,
replace (PROC MODULE SYMBOL VARIABLE) with (PROC MODULE SYMBOL VARIABLE
RESULT).
2020-07-05 16:07:59 +05:30
Tobias Geerinckx-Rice 5733ba7dd8
download: Replace misconfigured Apache mirror.
E.g. <http://apache.belnet.be/jakarta/oro/jakarta-oro-2.0.8.tar.gz>
redirects to a bogus 200 HTML page.

* guix/download.scm (%mirrors): Replace apache.belnet.be with
ftp.nluug.nl.
2020-07-05 08:23:35 +02:00
Arun Isaac 15c29a8a34
combinators: Fix typo.
* guix/combinators.scm (fold2): Replace "a two lists" with "two lists".
2020-07-05 03:15:08 +05:30
Ludovic Courtès f54cbc0e1b
import: Do not assume that 'package-source' returns an origin.
* guix/gnu-maintenance.scm (gnu-package?): Check whether
'package-source' returns an origin.
* guix/import/github.scm (updated-github-url): Likewise.
* guix/import/launchpad.scm (updated-launchpad-url): Likewise.
2020-07-03 23:53:31 +02:00
Ludovic Courtès 00290e7365
upstream: Define 'url-predicate' and use it.
* guix/upstream.scm (url-predicate): New procedure.
(url-prefix-predicate): Define in terms of 'url-predicate'.
* guix/import/cpan.scm (cpan-package?): Use 'url-predicate'.
* guix/import/cran.scm (cran-package?)
(bioconductor-package?)
(bioconductor-data-package?)
(bioconductor-experiment-package?): Likewise.
* guix/import/crate.scm (crate-package?): Likewise.
* guix/import/elpa.scm (package-from-gnu.org?): Likewise.
* guix/import/hackage.scm (hackage-package?): Likewise.
* guix/import/pypi.scm (pypi-package?): Likewise.
* guix/import/gem.scm (gem-package?): Use 'url-prefix-predicate'.
2020-07-03 23:53:31 +02:00
Ludovic Courtès 37c3e0bbaf
lint: Do not assume that a package's source is an origin.
* guix/lint.scm (check-source-file-name): Ensure ORIGIN is an origin.
(check-patch-file-names)[patches]: Likewise.
(check-source): Likewise.
2020-07-03 23:53:31 +02:00
Jan (janneke) Nieuwenhuizen 28febfafbb
guix system: "describe" displays multiboot info.
* guix/scripts/system.scm (display-system-generation): Display
multiboot-modules commands if set.
2020-07-03 09:28:16 +02:00
Ludovic Courtès 31522dfa19
Revert "ui: Use package-description-string."
This reverts commit bd03e99f66.

Reported by Ekaitz Zarraga <ekaitz@elenq.tech> at
<https://lists.gnu.org/archive/html/guix-devel/2020-06/msg00338.html>.

That commit broke would prevent "description: " from being taken into
account by the 'texi->plain-text' paragraph filling code.
2020-07-02 23:54:02 +02:00
Ludovic Courtès d774c7b121
channels: Dependencies listed in '.guix-channel' can have an introduction.
Suggested by Ricardo Wurmus and Simon Tournier.

* guix/channels.scm (sexp->channel-introduction): New procedure.
(read-channel-metadata): Use it.
(profile-channels)[sexp->channel-introduction]: Remove.
* tests/channels.scm ("latest-channel-instances, authenticate dependency"):
New test.
* doc/guix.texi (Channels)[Declaring Channel Dependencies]: Augment example.
2020-07-01 23:34:51 +02:00
Ludovic Courtès eb5cf39e66
services: provenance: Save channel introductions.
* gnu/services.scm (channel->code): Include CHANNEL's introduction, if
any, unless CHANNEL is the singleton %DEFAULT-CHANNELS.
(channel->sexp): Add comment.
* guix/scripts/system.scm (sexp->channel): Change pattern to allow for
extensibility.
2020-07-01 23:34:51 +02:00
Ludovic Courtès 6d39f0cb77
guix describe: Display channel introductions and add 'channels-sans-intro'.
* guix/scripts/describe.scm (%available-formats): Add "channels-sans-intro".
(channel->sexp): Add #:include-introduction?.  Emit CHANNEL's intro if
INCLUDE-INTRODUCTION? is true and CHANNEL has an introduction.
(channel->json): Include CHANNEL's introduction, if any.
(channel->recutils): Likewise.
(display-profile-info): Add 'channels-sans-intro' case.
* doc/guix.texi (Invoking guix describe): Add introduction in example.
Add 'channels-sans-intro' case.
2020-07-01 23:34:51 +02:00
Ludovic Courtès 471550c28c
channels: Save and interpret 'introduction' field in provenance data.
With this change, profiles created by 'guix pull' & co. include channel
introductions as part of the channel metadata of each manifest entry.

* guix/channels.scm (channel-instances->manifest)[instance->entry]: Add
'introduction' field when CHANNEL has an introduction.
(profile-channels)[sexp->channel-introduction]: New procedure.
Use it to initialize the 'introduction' field.
2020-07-01 23:34:51 +02:00
Ludovic Courtès 22a9699257
channels: Remove 'signature' from <channel-introduction>.
In the end signing the commit/key pair does not buy us much.  Someone
publishing a valid but different commit/key pair would effectively be
publishing a different channel, which could be a fork (made by a former
authorized developer) or simply a mirror.  In the latter case, there's
nothing to be gained by publishing a different commit/key pair.

* guix/channels.scm (<channel-introduction>)[signature]: Remove.
(make-channel-introduction): Adjust accordingly.
2020-07-01 23:34:51 +02:00
Ludovic Courtès 8b7d982e6a
channels: Make channel introductions public.
* guix/channels.scm (<channel-introduction>): Rename constructor to
'%make-channel-introduction'.
(make-channel-introduction): New procedure.
* tests/channels.scm ("authenticate-channel, wrong first commit signer")
("authenticate-channel, .guix-authorizations"): Use
'make-channel-introduction' without '@@' and without third argument.
* doc/guix.texi (Channels)[Channel Authentication, Specifying Channel
Authorizations]: New subsections.
2020-07-01 23:34:51 +02:00
Ludovic Courtès 6577682a6c
channels: Add 'openpgp-fingerprint->bytevector'.
* guix/channels.scm (openpgp-fingerprint->bytevector): New procedure.
(openpgp-fingerprint): New macro.
(%guix-channel-introduction): Use it.
2020-07-01 23:34:50 +02:00
Guillaume Le Vaillant cdf34eed33
guix: build: Fix asdf-build-system/ecl.
* guix/build/lisp-utils.scm (make-asd-file): Fix value of 'component?'
  parameter when using ECL.
2020-07-01 16:14:21 +02:00
Ludovic Courtès d2fde340ad
lint: Adjust 'swh-error exception handler.
* guix/lint.scm (check-archival): Change first clause to match only
'swh-error keys.
2020-06-30 00:18:28 +02:00
Ludovic Courtès cc6dd2981c
swh: Adjust for Guile-JSON 4.0 null handling.
* guix/swh.scm (string*): Add clause for 'null.
2020-06-30 00:18:28 +02:00
Ludovic Courtès 4f060bf2fe
pack: Dereference symlinks when looking for executables.
Fixes <https://bugs.gnu.org/42127>.
Reported by Andrius Štikonas <andrius@stikonas.eu>.

* guix/scripts/pack.scm (wrapped-package)[build]: Add trailing slash to
the arguments to 'find-files'.
2020-06-30 00:18:28 +02:00
zimoun b032d14ebd
build-system/r: bioconductor-uri: Fix archive URL.
* guix/build-system/r.scm (bioconductor-uri): Fix archive URL.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2020-06-30 00:18:27 +02:00
Marius Bakke fdbba544d8
Add more missing (ice-9 format) imports.
* gnu/machine/ssh.scm: Import (ice-9 format).
* guix/scripts/graph.scm: Likewise.
* guix/scripts/system/search.scm: Likewise.
* guix/remote.scm: Likewise.
2020-06-28 23:32:52 +02:00
Ludovic Courtès ead5c46147
channels: Error out when the 'guix' channel lacks an introduction.
* guix/channels.scm (latest-channel-instance): Raise an error instead of
warning when 'guix is unauthenticated.
* tests/channels.scm ("latest-channel-instances, missing introduction for 'guix'"):
New test.
2020-06-28 23:26:53 +02:00
Ludovic Courtès 1acc5e11be
processes: Write to $PAGER.
* guix/ui.scm (with-paginated-output-port): Export.
* guix/scripts/processes.scm (guix-processes): Use it instead of writing
directly to (current-output-port).
2020-06-28 23:26:53 +02:00
Ludovic Courtès 0505eda9c7
packages: Recognize SHA3 and BLAKE2s for 'content-hash'.
* guix/packages.scm (build-content-hash): Add 'sha3-256', 'sha3-512',
and 'blake2s-256'.
* tests/packages.scm ("package-source-derivation, origin, sha3-512"):
New test.
2020-06-27 23:42:20 +02:00
Ludovic Courtès 641631c1a2
store: Use '=' instead of 'eqv?'.
Fixes <https://bugs.gnu.org/42047>.
Reported by Jan Nieuwenhuizen <janneke@gnu.org>.

* guix/store.scm (open-connection): Use '=' instead of 'eqv?'.
This works around <https://bugs.gnu.org/42060> while also being more
accurate since the arguments are known to be integers.
2020-06-26 16:19:53 +02:00
Ludovic Courtès 6b2e91b1fc
challenge: Fix option indentation in '--help' output.
* guix/scripts/challenge.scm (show-help): Indent '--verbose' and
'--diff' correctly (high tech!).
2020-06-26 16:19:53 +02:00
Ludovic Courtès 25b267afed
Add more (ice-9 format) imports.
* guix/scripts/describe.scm: Add missing (ice-9 format).
* guix/scripts/system.scm: Likewise.
2020-06-26 16:19:53 +02:00
Ludovic Courtès 3b7145d821
deduplication: Leave the store permissions unchanged.
Suggested by Caleb Ristvedt <caleb.ristvedt@cune.org>.

* guix/store/deduplication.scm (call-with-writable-file): Call THUNK
directly when FILE is (%store-directory).
2020-06-25 12:29:23 +02:00
Ludovic Courtès 6b654a3332
deduplication: Fix default value of #:store in 'deduplicate'.
* guix/store/deduplication.scm (deduplicate): Change #:store default
value to (%store-directory).
2020-06-25 12:29:23 +02:00
Ludovic Courtès d52e16d3b6
deduplication: Use 'dynamic-wind' when changing permissions of the parent.
Suggested by Caleb Ristvedt <caleb.ristvedt@cune.org>.

* guix/store/deduplication.scm (call-with-writable-file): New procedure.
(with-writable-file): New macro.
(replace-with-link): Use it.
2020-06-25 12:29:22 +02:00
Ludovic Courtès 6f233040d3
openpgp: Use Libgcrypt's crc24 implementation.
This gives an 18% speedup on the wall-clock time of:

  guile -c '(use-modules (git) (guix git-authenticate)) (load-keyring-from-reference (repository-open ".") "keyring")'

* guix/openpgp.scm (crc24): Rewrite by calling out to 'bytevector-hash'.
2020-06-23 23:39:42 +02:00
Ludovic Courtès 2f6901c9df
self: Parallelize translation of the manual.
The guix-translated-texinfo.drv execution time goes from 1mn42s with 1
core to 1mn8s with 4 cores.

* guix/self.scm (translate-texi-manuals)[build]: Use 'n-par-for-each'
instead of 'for-each' for translation.
2020-06-23 00:03:08 +02:00
Ludovic Courtès 301527be8b
self: Move statements after definitions in translation derivation.
* guix/self.scm (translate-texi-manuals)[build]: Move statements after
definitions.
2020-06-23 00:03:08 +02:00
Ludovic Courtès 5837b3e41f
po: Micro-optimize 'read-po-file'.
* guix/build/po.scm (parse-tree->assoc): Use dot instead of ellipsis in
'match' clause to avoid repeated calls to 'list?'.
2020-06-23 00:03:08 +02:00
Ludovic Courtès 52b4524f4e
po: Avoid regexps when interpreting '\n' sequences.
This reduces the execution time of:

  (call-with-input-file "po/doc/guix-manual.de.po" read-po-file)

from 4.7s to 4.0s.

* guix/build/po.scm (interpret-newline-escape): New procedure.
(parse-tree->assoc): Use it instead of 'regexp-substitute/global'.
2020-06-23 00:03:08 +02:00
Ludovic Courtès a524a31de4
self: Speed up Texinfo cross-reference translation.
Building guix-translated-texinfo.drv goes from 11mn to 1mn50s, most of
which is taken by po4a.

* guix/self.scm (translate-texi-manuals)[build](make-ref-regex): Remove.
(canonicalize-whitespace): New procedure.
(xref-regexp): New variable.
(translate-cross-references): Rewrite to iterate over the
cross-references rather than iterating over the msgids.  Update caller.
2020-06-23 00:03:08 +02:00
Ludovic Courtès fe5de925aa
deduplicate: Avoid traversing directories twice.
Until now, we'd call (nar-sha256 file) unconditionally.  Thus, if FILE
was a directory, we would traverse it for no reason, and then call
'deduplicate' on FILE, which would again traverse it.

This change also removes redundant (mkdir-p store) calls from the loop,
and avoids 'lstat' calls by using 'scandir*'.

* guix/store/deduplication.scm (deduplicate): Add named loop.  Move
'mkdir-p' outside the loop.  Use 'scandir*' instead of 'scandir'.  Do
not call 'nar-sha256' when FILE has type 'directory.
2020-06-22 15:42:55 +02:00
Ludovic Courtès a0d419e639
compile: Build gnu/{packages,tests}/* with '-O1'.
* guix/build/compile.scm (optimization-options): Use '-O1' for the
simple case.
2020-06-22 15:42:55 +02:00
Ludovic Courtès e4a4287c5f
channels: 'authenticate-channel' doesn't check relation with intro commit.
Fixes <https://bugs.gnu.org/41908>.
Reported by Jan Nieuwenhuizen <janneke@gnu.org>.

The relation check imposed an extra restriction that was unnecessary:
it's enough to authenticate the set difference between the closure of
START-COMMIT and that of END-COMMIT.  Any attempt to jump to an
unrelated commit would lead to the authentication failure of one commit
on the way.

* guix/channels.scm (authenticate-channel): Remove extra
'commit-relation' check when (null? commits).
2020-06-21 17:36:40 +02:00
Ludovic Courtès 41939c374a
git-authenticate: Ignore authenticated commit cache when it's not #o600.
* guix/git-authenticate.scm (previously-authenticated-commits): Stat
PORT; return the empty list if it's no #o600 and change it to #o600.
2020-06-21 17:36:39 +02:00
Ludovic Courtès 50e7e6a065
build-system/gnu: Cross builds properly handle #:allowed-references & co.
Fixes <https://bugs.gnu.org/41775>.

* guix/build-system/gnu.scm (gnu-cross-build)[canonicalize-reference]:
Pass TARGET and SYSTEM to 'package-cross-derivation'.
2020-06-20 23:35:58 +02:00
Ludovic Courtès 90f496be9a
tests: Actually run 'tests/guix-environment-container.sh'.
This test was skipped since the switch to Guile 3 because
'assert-container-features' would be inlined and thus accessing it with
@@ would fail with an unbound-variable error.

* guix/scripts/environment.scm (assert-container-features): Export.
* tests/guix-environment-container.sh: Use single '@'.
2020-06-20 13:18:11 +02:00
Pierre Neidhardt 5a08660ecb
build-system/asdf: Add support for component-less systems.
* guix/build/lisp-utils.scm (make-asd-file): Ensure lib directory exists and
check if prebuilt bundle system was generated.
(generate-system-definition): Add :class and :components only if prebuilt
system was generated.
2020-06-18 17:14:08 +02:00
Ludovic Courtès 05f79da93f
profiles: 'linux-module-database' hooks gracefully handles module-less kernels.
Fixes <https://bugs.gnu.org/41924>.

* guix/profiles.scm (linux-module-database)[build]: Arrange so
'directory-entries' always returns a list.  Add 'match' clause for the
empty list.

Co-authored-by: Ivan Kozlov <kanichos@yandex.ru>
2020-06-18 14:48:17 +02:00
Ludovic Courtès fea072d727
profiles: Reindent 'linux-module-database'.
* guix/profiles.scm (linux-module-database): Reindent.
2020-06-18 14:48:17 +02:00
Ludovic Courtès 3b72618f6e
nar: Use (guix i18n).
* guix/nar.scm: Use (guix i18n) instead of (guix ui).
2020-06-18 14:48:17 +02:00
Ludovic Courtès d7fb553801
nar: Avoid opening the database an additional time.
* guix/nar.scm (finalize-store-file): Call 'register-items' and pass it
DB.  This avoids opening the database a second time and hopefully
reduces contention on 'db.sqlite-shm'.
2020-06-18 14:48:17 +02:00
Ludovic Courtès 97a46055ca
database: 'register-items' takes an open database.
* guix/store/database.scm (store-database-directory)
(store-database-file): New procedures.
(call-with-database): Add call to 'mkdir-p'.
(register-items): Add 'db' parameter and remove #:state-directory and #:schema.
(register-path): Use 'store-database-file' and 'with-database', and
parameterize SQL-SCHEMA.
* gnu/build/image.scm (register-closure): Likewise.
* gnu/build/vm.scm (register-closure): Likewise.
* guix/scripts/pack.scm (store-database)[build]: Likewise.
2020-06-18 14:48:17 +02:00
Ludovic Courtès f9a0fc9dbb
build-system/gnu: Fix 'install' phase of 'gnu-dist'.
* guix/build/gnu-dist.scm (install-dist): Fix 2nd argument to
'for-each'.
2020-06-18 14:48:17 +02:00
Ludovic Courtès 290c316621
repl: Fix typo that would lead ~/.guile to be used when running scripts.
This is a followup to c924e54139.

* guix/scripts/repl.scm (guix-repl)[opts]: Set 'ignore-dot-guile?', with
question mark.
2020-06-18 14:48:17 +02:00
Ludovic Courtès 4ae762af76
channels: Warn when pulling from a mirror.
* guix/channels.scm (<channel-metadata>)[url]: New field.
(read-channel-metadata): Initialize it.
(read-channel-metadata-from-source): Likewise.
(channel-instance-primary-url): New procedure.
(latest-channel-instances): Compare CHANNEL's URL against it.
* doc/guix.texi (Channels)[Primary URL]: New subsection.
2020-06-17 19:32:43 +02:00
Ludovic Courtès ba8c09f289
build-system/gnu: Rename "make dist" phase to 'build-dist'.
* guix/build/gnu-dist.scm (%dist-phases): Add BUILD under the name
'build-dist'.
2020-06-17 19:32:43 +02:00
Ludovic Courtès 7488d70c55
build-system/gnu: Simplify 'dist-package'.
* guix/build-system/gnu.scm (dist-package): Use default keyword
arguments in 'substitute-keyword-arguments'.
2020-06-17 19:32:43 +02:00
Ludovic Courtès dabbddbbaa
build-system/gnu: Remove redundant 'unpack' phase from 'gnu-dist'.
This has become redundant with the standard 'unpack' phase since
17919a5801.

* guix/build/gnu-dist.scm (copy-source): Remove.
(%dist-phases): Remove 'unpack' phase.
2020-06-17 19:32:43 +02:00
Ludovic Courtès 03686f26cc
build-system/gnu: Remove Hydra-specific code from 'gnu-dist'.
* guix/build/gnu-dist.scm (install-dist): Remove code for
'hydra-build-products'.
2020-06-17 19:32:43 +02:00
Ludovic Courtès 2ee1cce324
build-system/gnu: Remove 'autoreconf' phase from 'gnu-dist'.
This has been superseded by the 'bootstrap' phase added in
189be331ac.

* guix/build/gnu-dist.scm (autoreconf): Remove.
(%dist-phases): Remove it.
2020-06-17 19:32:43 +02:00
Ludovic Courtès 8cca3f939a
build-system/gnu: Adjust 'dist-package' to current 'autoconf-wrapper' API.
This is a followup to 464f544739.

* guix/build-system/gnu.scm (dist-package): Do not call 'autoconf-wrapper'.
2020-06-17 19:32:43 +02:00
Ludovic Courtès 94642ab06b
profiles: Add comment at the top of 'manifest' file.
* guix/build/profiles.scm (build-profile): Add comment at the top of
MANIFEST-FILE.
2020-06-17 12:06:33 +02:00
Ludovic Courtès 838ac881ec
time-machine: Add '--disable-authentication'.
* guix/inferior.scm (cached-channel-instance): Add #:authenticate? and
pass it to 'latest-channel-instances'.
* guix/scripts/time-machine.scm (show-help, %options): Add
'--disable-authentication'.
(%default-options): Add 'authenticate-channels?'.
(guix-time-machine): Honor it.
2020-06-16 16:10:47 +02:00
Ludovic Courtès a9eeeaa6ae
pull: Add '--disable-authentication'.
* guix/channels.scm (latest-channel-instance): Add #:authenticate? and
honor it.
(latest-channel-instances): Likewise.
* guix/scripts/pull.scm (%default-options): Add 'authenticate-channels?'.
(show-help, %options): Add '--disable-authentication'.
(guix-pull): Pass #:authenticate? to 'latest-channel-instances'.
* doc/guix.texi (Invoking guix pull): Document it.
2020-06-16 16:10:47 +02:00
Ludovic Courtès c3f6f564e9
channels: Automatically add introduction for the official 'guix' channel.
This is useful when people run "guix time-machine -C channels.scm",
where 'channels.scm' misses channel introductions.

* guix/channels.scm (%default-channel-url): New variable.
(%default-channels): Use it.
(ensure-default-introduction): New procedure.
(latest-channel-instance): Call it.
2020-06-16 16:10:47 +02:00
Ludovic Courtès 5bafc70d1e
channels: Make 'validate-pull' call right after clone/pull.
This should come before patching, authentication, etc.

* guix/channels.scm (latest-channel-instance): Add #:validate-pull
parameter and honor it.  Return a single value: the instance.
(ensure-forward-channel-update): Change 'instance' parameter to 'commit'
and adjust accordingly.
(latest-channel-instances): Adjust to 'latest-channel-instance' changes.
* guix/scripts/pull.scm (warn-about-backward-updates): Change 'instance'
parameter to 'commit' and adjust accordingly.
* tests/channels.scm ("latest-channel-instances #:validate-pull"):
Likewise.
2020-06-16 16:10:47 +02:00
Ludovic Courtès 43badf261f
channels: 'latest-channel-instance' authenticates Git checkouts.
Fixes <https://bugs.gnu.org/22883>.

* guix/channels.scm (<channel>)[introduction]: New field.
(<channel-introduction>): New record type.
(%guix-channel-introduction): New variable.
(%default-channels): Use it.
(<channel-metadata>)[keyring-reference]: New field.
(%default-keyring-reference): New variable.
(read-channel-metadata, read-channel-metadata-from-source): Initialize
the 'keyring-reference' field.
(commit-short-id, verify-introductory-commit)
(authenticate-channel): New procedures.
(latest-channel-instance): Call 'authenticate-channel' when CHANNEL has
an introduction.
* tests/channels.scm (gpg+git-available?, commit-id-string): New
procedures.
("authenticate-channel, wrong first commit signer"):
("authenticate-channel, .guix-authorizations"): New tests.
* doc/guix.texi (Invoking guix pull): Mention authentication.
2020-06-16 16:10:47 +02:00
Ludovic Courtès 1e2b9bf2d4
tests: Move OpenPGP helpers to (guix tests gnupg).
* tests/git-authenticate.scm (key-id): Remove.
(%ed25519-public-key-file, %ed25519-secret-key-file)
(%ed25519bis-public-key-file, %ed25519bis-secret-key-file)
(read-openpgp-packet, key-fingerprint): Move to...
* guix/tests/gnupg.scm: ... here.
2020-06-16 16:10:46 +02:00
Ludovic Courtès 41946b79f1
git-authenticate: 'authenticate-commits' takes a #:keyring parameter.
* guix/git-authenticate.scm (authenticate-commits): Add #:keyring
parameter.
2020-06-16 16:10:46 +02:00
Ludovic Courtès a450b4343b
git-authenticate: Cache takes a key parameter.
* guix/git-authenticate.scm (authenticated-commit-cache-file)
(cache-authenticated-commit, previously-authenticated-commits): Add
'key' parameter and honor it.
* build-aux/git-authenticate.scm (git-authenticate): Pass
"channels/guix" as the key.
2020-06-16 16:10:46 +02:00
Efraim Flashner 3646a44a14
build-system: cmake: Add substitutable keyword.
* guix/build-system/cmake.scm (cmake-build, cmake-cross-build): Add
substitutable keyword.
2020-06-16 16:40:27 +03:00
Tobias Geerinckx-Rice 38ee8f7dba
pack: Add zstd compressor.
* guix/scripts/pack.scm (%compressors): Add zstd.
* doc/guix.texi (Invoking guix pack): Document it.
2020-06-16 13:35:33 +02:00
Arun Isaac bd03e99f66
ui: Use package-description-string.
* guix/ui.scm (package->recutils): Use package-description-string instead of
package-description and P_.
2020-06-15 23:31:56 +05:30
Arun Isaac a1da0904a6
ui: Do not translate package synopsis a second time.
* guix/ui.scm (package->recutils): package-synopsis-string already returns a
translated string. Do not attempt to translate it again.
2020-06-15 23:31:56 +05:30
Arun Isaac e70a884706
ui: Cut off search early if any regexp does not match.
* guix/ui.scm (relevance): When one of the regexps does not match, cut off
early and return 0. Do not try to match the remaining regexps.
2020-06-15 23:31:56 +05:30
Mathieu Othacehe 53e6195607
ci: Add build-products id field and export accessors.
* guix/ci.scm (build-product?, build-product-id,
build-product-type, build-product-file-size,
build-product-path): Export them,
[id]: new field.
2020-06-15 15:34:19 +02:00
Mathieu Othacehe 9e989d9e36
ci: Add status option to "latest-builds".
* guix/ci.scm (latest-builds): Add "status" option.
2020-06-15 15:33:42 +02:00
Tobias Geerinckx-Rice c9ea4eecf4
download: Remove usa-mirror.go-parts.com mirror.
It incorrectly redirects 404s (at least) to the commercial home page.

* guix/download.scm (%mirrors): Remove usa-mirror.go-parts.com URLs.
2020-06-15 14:26:44 +02:00
Mathieu Othacehe bb76f50b9b
ci: Fix buildproducts reading.
This is a follow-up of 4e05bbb093.

* guix/ci.scm (<build>)[products]: Test for vector type, as products can be
"null".
2020-06-15 09:53:02 +02:00
Mathieu Othacehe ef6f9f16fe
ci: Add job option to "latest-builds".
* guix/ci.scm (latest-builds): Add "job" option.
2020-06-15 09:15:08 +02:00
Mathieu Othacehe 4e05bbb093
ci: Add build products support.
* guix/ci.scm (<build-product>): New json mapping,
(<build)[products]: new field.
2020-06-15 09:15:08 +02:00
Konrad Hinsen c924e54139
guix repl: Add script execution.
* guix/scripts/repl.scm: Add filename options for script execution.
* doc/guix.texi (Invoking guix repl): Document it.
* tests/guix-repl.sh: Test it.
* Makefile.am: (SH_TESTS): Add it.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2020-06-14 23:02:36 +02:00
Mathieu Othacehe 80f92866e3
scripts: system: Fix "init" command.
This is a follow-up of 7ca533c723. The
introduced "target" variable is shadowing the target argument.

* guix/scripts/system.scm (perform-action): Rename "target" variable to
"target*".
2020-06-14 17:42:36 +02:00
Ludovic Courtès 993023a28e
lint: Add 'check-for-collisions' checker.
Suggested by Edouard Klein <edk@beaver-labs.com>.

* guix/profiles.scm (check-for-collisions): Export.
* guix/lint.scm (check-profile-collisions): New procedure.
(%local-checkers): Add 'profile-collisions' checker.
* tests/lint.scm ("profile-collisions: no warnings")
("profile-collisions: propagated inputs collide")
("profile-collisions: propagated inputs collide, store items"): New tests.
* doc/guix.texi (Invoking guix lint): Document it.
2020-06-14 15:34:42 +02:00
Ludovic Courtès 9acac9f9c6
profiles: Fix pathological performance of 'manifest-transitive-entries'.
For packages with lots of propagated inputs,
'manifest-transitive-entries', as called from 'check-for-collisions',
would exhibit pathological behavior.  For example, "guix install cl-ana"
wouldn't complete in 1mn; now, it's down to 20s.

The issue was that manifest entries would never be 'equal?' due to the
delayed field in <manifest-entry>.

* guix/profiles.scm (manifest-transitive-entries): Use a vhash instead
of a set.  Use 'manifest-entry=?' instead of 'equal?' when checking for
equality.
2020-06-14 15:34:41 +02:00
Ludovic Courtès e66f243e92
ui: Set 'LESS' environment variable unconditionally.
Fixes <https://bugs.gnu.org/41811>.
Reported by Lars-Dominik Braun <lars@6xq.net>.

* guix/ui.scm (call-with-paginated-output-port): Remove (getenv "LESS")
call.
2020-06-14 15:34:38 +02:00
Marius Bakke 8ab70bae52
Merge branch 'staging' 2020-06-13 22:52:25 +02:00
Jan (janneke) Nieuwenhuizen 7ca533c723
image: Make 'find-image' non-monadic.
* gnu/system/image.scm (find-image): Make non-monadic.  Add 'target'
parameter.
* gnu/tests/install.scm (run-install): Update caller,
passing (%current-target-system).
* guix/scripts/system.scm (perform-action): Likewise.
2020-06-13 15:03:55 +02:00
Ricardo Wurmus 8e518d4802
guix: Update to Bioconductor 3.11.
* guix/build-system/r.scm (bioconductor-uri): Use new URL.
* guix/import/cran.scm (%bioconductor-version): Update to 3.11.
2020-06-13 01:19:38 +02:00
Christopher Baines db6290af7c
lint: check-patch-file-names: Use origin-actual-file-name.
This avoids crashes for the patch-file-names checker where a <origin> is used
for a patch, but without a value for the file-name field. This is currently
the case with the bash package.

* guix/lint.scm (check-patch-file-names): Change origin-file-name to
origin-actual-file-name.
2020-06-12 22:26:47 +01:00
Ludovic Courtès 52c529ff20
git-authenticate: Disallow SHA1 (and MD5) signatures.
* guix/git-authenticate.scm (commit-signing-key): Add
 #:disallowed-hash-algorithms and honor it.
(authenticate-commit)[recent-commit?]: New variable.
Pass #:disallowed-hash-algorithms to 'commit-signing-key'.
* tests/git-authenticate.scm ("signed commits, SHA1 signature"): New test.
2020-06-12 18:56:11 +02:00
Efraim Flashner 205a0ecd5b
download: Add more apache mirrors.
* guix/download.scm (%mirrors): Add more apache mirrors.
2020-06-12 18:28:51 +03:00
Chris Marusich 21887021b9
guix: lint: Support origins in check-patch-file-names.
* guix/lint.scm (check-patch-file-names)[starts-with-package-name?]: New
procedure, extracted from the existing logic.  Using it, add a clause to
the match-lambda to handle origin records.
2020-06-11 22:30:14 -07:00
Marius Bakke 9b043df740
Merge branch 'master' into staging 2020-06-11 23:30:32 +02:00
Ludovic Courtès 03a70e4c19
packages: 'package-grafts' returns grafts for all the relevant outputs.
Fixes <https://bugs.gnu.org/41796>.
Reported by Jakub Kądziołka <kuba@kadziolka.net>.

* guix/packages.scm (input-graft): Add 'output' parameter and honor it.
Add OUTPUT to the cache key.
(input-cross-graft): Likewise.
(fold-bag-dependencies): Operate on inputs instead of nodes.  Turn
VISITED into a vhash instead of a set.  Pass PROC HEAD and OUTPUT
instead of just HEAD.
(bag-grafts): Adjust accordingly.
* tests/packages.scm ("package-grafts, dependency on several outputs"):
New test.
2020-06-11 19:05:05 +02:00
Caleb Ristvedt 8971f626f2
database: separate transaction-handling and retry-handling.
Previously call-with-transaction would both retry when SQLITE_BUSY errors were
thrown and do what its name suggested (start and rollback/commit a
transaction).  This changes it to do only what its name implies, which
simplifies its implementation.  Retrying is provided by the new
call-with-SQLITE_BUSY-retrying procedure.

* guix/store/database.scm (call-with-transaction): no longer restarts, new
  #:restartable? argument controls whether "begin" or "begin immediate" is
  used.
  (call-with-SQLITE_BUSY-retrying, call-with-retrying-transaction,
  call-with-retrying-savepoint): new procedures.
  (register-items): use call-with-retrying-transaction to preserve old
  behavior.

* .dir-locals.el (call-with-retrying-transaction,
  call-with-retrying-savepoint): add indentation information.
2020-06-10 21:54:35 -05:00
Caleb Ristvedt 37545de4a3
database: ensure update-or-insert is run within a transaction
update-or-insert can break if an insert occurs between when it decides whether
to update or insert and when it actually performs that operation.  Putting the
check and the update/insert operation in the same transaction ensures that the
update/insert will only succeed if no other write has occurred in the middle.

* guix/store/database.scm (call-with-savepoint): new procedure.
  (update-or-insert): use call-with-savepoint to ensure the read and the
  insert/update occur within the same transaction.
2020-06-10 21:54:35 -05:00
Caleb Ristvedt 5d6e225528
database: rewrite query procedures in terms of with-statement.
Most of our queries would fail to finalize their statements properly if sqlite
returned an error during their execution.  This resolves that, and also makes
them somewhat more concise as a side-effect.

This also makes some small changes to improve certain queries where behavior
was strange or overly verbose.

* guix/store/database.scm (call-with-statement): new procedure.
  (with-statement): new macro.
  (last-insert-row-id, path-id, update-or-insert, add-references): rewrite to
  use with-statement.
  (update-or-insert): factor last-insert-row-id out of the end of both
  branches.
  (add-references): remove pointless last-insert-row-id call.

* .dir-locals.el (with-statement): add indenting information.
2020-06-10 21:54:35 -05:00
Caleb Ristvedt 3cd92a855e
database: work around guile-sqlite3 bug preventing statement reset
guile-sqlite3 provides statement caching, making it unnecessary for sqlite to
keep re-preparing statements that are frequently used.  Unfortunately it
doesn't quite emulate the semantics of sqlite_finalize properly, because it
doesn't cause a commit if the statement being finalized is the last "active"
statement (see https://notabug.org/guile-sqlite3/guile-sqlite3/issues/12).  We
work around this by wrapping sqlite-finalize with our own version that ensures
sqlite-reset is called, which does The Right Thing™.

* guix/store/database.scm (sqlite-finalize): new procedure that shadows the
  sqlite-finalize from (sqlite3).
2020-06-10 21:54:32 -05:00