Commit Graph

5840 Commits

Author SHA1 Message Date
Ludovic Courtès
ee61777a32
profiles: Add 'load-profile'.
* guix/profiles.scm (%precious-variables): New variable.
(purify-environment, load-profile): New procedures.
* guix/scripts/environment.scm (%precious-variables)
(purify-environment, create-environment): Remove.
(launch-environment): Call 'load-profile' instead of 'create-environment'.
* tests/profiles.scm ("load-profile"): New test.
2021-06-18 14:18:07 +02:00
Ludovic Courtès
c5b1b48f09
lint: check-patch-headers: Recognize Git diffs.
* guix/lint.scm (check-patch-headers): Add "diff --git " prefix.
2021-06-18 14:18:06 +02:00
Ludovic Courtès
f371972e78
import: launchpad: Gracefully handle 404s from api.launchpad.net.
Fixes <https://bugs.gnu.org/49031>.
Reported by Emad Alblueshi <emad.albloushi@gmail.com>.

* guix/import/launchpad.scm (latest-released-version): Gracefully handle
'json-fetch' returning #f.
2021-06-18 14:18:06 +02:00
Christopher Baines
4985a42724
Start enabling substitutes from bordeaux.guix.gnu.org.
In addition to substitutes from ci.guix.gnu.org.  There are more changes that
can be made in the future, but these changes seem like a good start.

* config-daemon.ac (guix_substitute_urls): Add https://bordeaux.guix.gnu.org.
* guix/scripts/substitute.scm (%default-substitute-urls): Add
http://bordeaux.guix.gnu.org.
* guix/store.scm (%default-substitute-urls): Add bordeaux.guix.gnu.org.
* doc/guix.texi: Adjust accordingly.
* doc/contributing.texi: Adjust accordingly.
2021-06-18 11:25:41 +01:00
Maxim Cournoyer
375d5d03c9
pack: Fix the system value passed to build-docker-image.
Before this change, the system value would be passed as x86_64 when using a
i686-linux emulated system, e.g.:

  $ guix environment --system=i686-linux --ad-hoc  guile -- \
      guile -c '(display (utsname:machine (uname))) (newline)'
  x86_64

This change uses the Guile builtin %host-type variable, which doesn't have
this problem:

  $ guix environment --system=i686-linux --ad-hoc guile -- \
      guile -c '(display %host-type) (newline)'
  i686-unknown-linux-gnu

* guix/scripts/pack.scm (docker-image)[#:system] Use %host-type as a fall-back
when target is not defined.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2021-06-16 21:44:33 -04:00
Ludovic Courtès
0b535f7b8b
hg-download: Make (guix swh) output visible.
* guix/hg-download.scm (hg-fetch)[build]: Add 'setvbuf' calls.
2021-06-14 18:35:18 +02:00
Xinglu Chen
69d7333217
hg-download: Support falling back to SWH.
* guix/hg-download.scm (hg-fetch): Fall back to fetching the source from SWH
if the upstream source is missing.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-06-14 18:35:18 +02:00
Xinglu Chen
c4ff492879
swh: Support lookup of Hg tags.
* guix/swh.scm (lookup-origin-revision): Support lookup of Hg tags, not just
Git tags.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-06-14 18:35:18 +02:00
itd
1aa8cc2f0e
hg-download: Remove bogus hg-reference-recursive? export.
* guix/hg-download.scm: Do not export undefined hg-reference-recursive?.

Signed-off-by: Tobias Geerinckx-Rice <me@tobias.gr>
2021-06-14 10:02:15 +02:00
Ludovic Courtès
0294cfc25a
guix package: Do not say "nothing to do" upon rollback & co.
Previously, "guix package --switch-generations=4" or similar would print
"nothing to do".

* guix/scripts/package.scm (process-actions): Do not warn about "nothing
to do" when one of %ACTIONS is requested.
2021-06-13 23:57:45 +02:00
Paul A. Patience
483f537081
doc, gnu, guix: Fix typos.
* doc/guix.texi: Fix various typos and reword a sentence.
* gnu/packages/cpp.scm (cpplint)[description]: Fix typo.
* gnu/packages/dns.scm (ldns): Fix typo in comment.
* gnu/packages/games.scm (yamagi-quake2): Fix typo in comment.
* gnu/packages/qt.scm (python-pyqtwebengine): Fix typo in comment.
* gnu/packages/rails.scm (ruby-autoprefixer-rails): Fix typo in comment.
* gnu/packages/syndication.scm (quiterss)[description]: Fix typo.
* gnu/packages/terminals.scm (kmscon): Fix typo in comment.
* gnu/packages/xml.scm (perl-xml-sax-base)[description]: Fix typo.
  (python-elementpath)[description]: Fix typo.
* guix/build/asdf-build-system.scm (output-translation): Fix typo in docstring.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-06-13 23:57:45 +02:00
Ludovic Courtès
fb3927486a
describe: 'current-channel-entries' ignores non-channel profile entries.
Fixes <https://bugs.gnu.org/48778>.

A side effect of c47f3fc135 is that
(@ (guix describe) current-profile) provides the correct answer when the
'guix' package is installed in a profile.  Consequently, the 'guix'
package installed in /run/current-system/profile (for instance) would
end up loading all the .scm files in that directory.

* guix/describe.scm (current-channel-entries): Remove ENTRY if it lacks
the 'source' property.
2021-06-13 23:57:44 +02:00
Ludovic Courtès
8cef92d063
profiles: Move some of the work to the build side.
When running:

  guix environment --ad-hoc gnome --no-grafts --search-paths

this reduces wall-clock time by ~5%.  The number of object cache lookups
goes down from 96K to 89K.  (Note that 'gnome' is an interesting example
because it has many propagated inputs, which themselves have propagated
inputs too, which would lead to a long input list and a long manifest in
the 'profile-derivation' gexp.)

* guix/profiles.scm (profile-derivation)[inputs, search-paths]: Remove.
[extra-inputs]: New variable.
[builder]: Adjust call to 'build-profile'.
* guix/build/profiles.scm (manifest-sexp->inputs+search-paths): New
procedure.
(build-profile): Remove 'inputs' parameter; make 'manifest' the 2nd
positional parameter and add #:extra-inputs.  Call
'manifest-sexp->inputs+search-paths' to obtain 'inputs' and
'search-paths'.
2021-06-12 00:49:32 +02:00
Ludovic Courtès
baf0a42882
git: Update the mtime of the just-updated checkout.
Reported by zimoun <zimon.toutoune@gmail.com>.

Previously, the mtime of CACHE-DIRECTORY may or may not have been
updated after a pull.  Thus, 'maybe-remove-expired-cache-entries' could
potentially delete CACHE-DIRECTORY right before it's returned.

* guix/git.scm (update-cached-checkout): Call 'utime' on CACHE-DIRECTORY.
2021-06-12 00:49:32 +02:00
Xinglu Chen
93d85deae6
lint: Check for trailing whitespace in description.
* guix/lint.scm (check-description-style): Check for trailing whitespace.
* tests/lint.scm: ("description: trailing whitespace"): New test.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-06-08 23:28:04 +02:00
Xinglu Chen
04afb76958
lint: Check for trailing whitespace in synopsis.
* guix/lint.scm (check-synopsis-style): Check for trailing whitespace.
* tests/lint.scm ("synopsis: contains trailing whitespace"): New test.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-06-08 23:28:04 +02:00
Ludovic Courtès
7ccf416dd0
transformations: '--with-latest' correctly handles already-latest case.
Previously, '--with-latest' would wrongfully print:

  warning: could not determine latest upstream release of 'xyz'

when 'xyz' is already the latest version.  This fixes that.

* guix/transformations.scm (transform-package-latest): Use
'package-latest-release' instead of 'package-latest-release*'.
2021-06-08 23:28:04 +02:00
Ludovic Courtès
0c10902609
grafts: Cache the derivation/graft mapping for the whole session.
Partly fixes <https://bugs.gnu.org/41702>.
Reported by Lars-Dominik Braun <ldb@leibniz-psychology.org>.

Previously, 'graft-derivation' would start anew at every call.  When
creating a profile with lots of packages, it would potentially do the
same work multiple times.  The per-session cache addresses this.  It
increases the derivation-graft-cache hit rate from 77.9% to 80.1% on:

  GUIX_PROFILING="derivation-graft-cache" ./pre-inst-env \
    guix environment --ad-hoc libreoffice inkscape krita darktable -n

The effect is more visible on the pathological case below, where cache
hit rate goes from 75% to 87% and wall-clock time from 5.0s to 3.5s:

  GUIX_PROFILING="derivation-graft-cache" ./pre-inst-env \
    guix environment --ad-hoc r-learnr --search-paths

* guix/grafts.scm (%graft-cache): New variable.
(graft-derivation): Add calls to 'store-connection-cache' and
'set-store-connection-cache!'.
2021-06-08 09:25:50 +02:00
Ludovic Courtès
fde3c349f5
store: 'references/cached' now uses a per-session cache.
* guix/store.scm (%reference-cache): Remove.
(%reference-cache-id): New variable.
(references/cached): Rewrite in terms of it.
2021-06-08 09:25:50 +02:00
Ludovic Courtès
2725f04634
store: Remove 'references/substitutes'.
This procedure lost its only user in commit
710854304b.

* guix/store.scm (references/substitutes): Remove.
* tests/store.scm ("references/substitutes missing reference info")
("references/substitutes with substitute info"): Remove.
2021-06-08 09:25:50 +02:00
Ludovic Courtès
4a93fb0595
grafts: Use SRFI-71 instead of SRFI-11.
* guix/grafts.scm (reference-origins): Use SRFI-71 'let*'.
2021-06-08 09:25:49 +02:00
Ludovic Courtès
6bd3d4fe06
grafts: Record cache lookups for profiling.
* guix/grafts.scm (record-cache-lookup!): New procedure.
(with-cache): Use it.
2021-06-08 09:25:49 +02:00
Ludovic Courtès
0a3c723e07
store: Generalize cache lookup recording.
* guix/store.scm (cache-lookup-recorder): New procedure.
(record-cache-lookup!): Define in terms of it.
2021-06-08 09:25:49 +02:00
Ludovic Courtès
d9d7b9ec41
store: Support dynamic allocation of per-connection caches.
* guix/store.scm (<store-connection>)[object-cache]: Remove.
[caches]: New field.
(open-connection, port->connection): Adjust '%make-store-connection'
calls accordingly.
(%store-connection-caches, %object-cache-id): New variables.
(allocate-store-connection-cache, vector-set)
(store-connection-cache, set-store-connection-cache)
(set-store-connection-caches!, set-store-connection-cache!): New
procedures.
(cache-object-mapping): Add #:cache parameter.
(set-store-connection-object-cache!): Remove.
(lookup-cached-object): Use 'store-connection-cache'.
(run-with-store): Use 'store-connection-caches' and
'set-store-connection-caches!'.
2021-06-08 09:25:49 +02:00
Christopher Baines
26499816a9
etc: Add "bordeaux.guix.gnu.org.pub" public key file.
* etc/substitutes/bordeaux.guix.gnu.org.pub: New file.
* Makefile.am (dist_pkgdata_DATA): Add it.
* guix/self.scm (miscellaneous-files): Add
"share/guix/bordeaux.guix.gnu.org.pub".
2021-06-07 11:31:17 +01:00
Mathieu Othacehe
a068ed6a5f
scripts: substitute: Cache connection when looking for narinfos.
The process-substitution procedure is opening two distinct connections. The
first one when looking for narinfo by calling lookup-narinfo and the other one
when fetching nar files.

Cache the connection when looking for narinfos so that process-substitution
only opens one connection.

* guix/scripts/substitute.scm (lookup-narinfo): Cache connection by using
open-connection-for-uri/cached.
2021-06-06 18:54:29 +02:00
Maxime Devos
82b0e27de1
lint: tests-true: Check if tests are enabled when cross-compiling.
* guix/lint.scm (check-tests-true): New linter.
(%local-checkers)[tests-true]: Add it.
* tests/lint.scm ("tests-true: #:tests? must not be set to #t")
("tests-true: absent #:tests? is acceptable")
("tests-true: #:tests? #f is acceptable")
("tests-true: #:tests? #t acceptable when compiling natively"): Test it.

Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
2021-06-06 18:49:12 +02:00
Xinglu Chen
aaafd19bd1
hg-download: Add helpers for defining packages.
Hg followup to commit ee17a9e06e.

* guix/hg-download.scm (hg-version, hg-file-name): New procedures.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2021-06-05 23:39:29 +02:00
Ludovic Courtès
2ac5e07a89
profiles: 'check-for-collisions' filters out more non-collisions upfront.
When running:

  GUIX_PROFILING="gc object-cache" ./pre-inst-env \
    guix install gnome -p /tmp/sdsdfsd --no-grafts -n

this reduces the number of object cache lookup from 115K to 96K, with a
slight CPU and memory usage reduction as well.

* guix/profiles.scm (check-for-collisions)[candidates]: Exclude entries
if their 'item' fields are eq?.
2021-06-05 23:39:25 +02:00
Ricardo Wurmus
c343c3bc1f
guix: Update to Bioconductor 3.13.
* guix/build-system/r.scm (bioconductor-uri): Update version.
* guix/import/cran.scm (%bioconductor-version): Update.
2021-06-05 09:12:39 +02:00
Xinglu Chen
7e16321560
licenses: Add BSD-1-Clause license.
* licenses.scm (bsd-1): New variable.
2021-06-03 21:53:05 +02:00
Xinglu Chen
bdc298ecee
import: Add CHICKEN egg importer.
* guix/import/egg.scm: New file.
* guix/scripts/import/egg.scm: New file.
* tests/egg.scm: New file.
* Makefile.am (MODULES, SCM_TESTS): Register them.
* po/guix/POTFILES.in: Likewise.
* guix/scripts/import.scm (importers): Add egg importer.
* doc/guix.texi (Invoking guix import, Invoking guix refresh): Document it.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-06-03 13:05:18 +02:00
Ludovic Courtès
1e8ebb16c9
gnu-maintenance: 'generic-html' computes the right source URL.
Fixes a regression introduced in
84f8bae0f8, whereby the URL computed for
the new ffmpeg (for instance) would be:

  https://ffmpeg.org/ffmpeg-4.4.tar.xz

instead of:

  https://ffmpeg.org/releases/ffmpeg-4.4.tar.xz

Reported by Maxim Cournoyer.

* guix/gnu-maintenance.scm (latest-html-release)[url->release]: Adjust
computation in the case of a URI-reference with a relative path.
2021-06-03 13:04:20 +02:00
Ludovic Courtès
5bcb4f8a58
ui, lint: Simplify exception handling in Guile 3 style.
* guix/lint.scm (check-derivation)[try]: Remove "catch #t" wrapping.
* guix/ui.scm (call-with-error-handling): Remove "catch 'system-error"
and move 'system-error handling to the &exception-with-kind-and-args
clause.
2021-06-01 23:26:07 +02:00
Ludovic Courtès
82d8ab01f5
maint: Require Guile 3.0.
* configure.ac: Require Guile 3.0.
* doc/guix.texi (Requirements): Adjust accordingly.
* gnu/packages/package-management.scm (guile2.2-guix): Remove.
* guix/lint.scm (exception-with-kind-and-args?): Remove 'cond-expand'.
* guix/scripts/deploy.scm (deploy-machine*): Likewise.
* guix/store.scm (call-with-store): Likewise.
* guix/swh.scm (http-get*, http-post*): Likewise.
* guix/ui.scm (without-compiler-optimizations, guard*)
(call-with-error-handling): Likewise.
2021-06-01 23:26:07 +02:00
Mathieu Othacehe
0b8fa24bbd
publish: Add keep-alive support when sending nar.
The default Guile web server implementation supports the keep alive
mechanism. However, in our custom http-write implementation, the connection
is unconditionally close after sending nar files.

To prevent that, when supported, add the client port to the server poll set so
that further requests can be handled without closing the connection.

* guix/scripts/publish.scm (nar-response-port): Rename it into ...
(nar-compressed-port): ... this procedure. Operate directly on a given PORT.
(http-write): Add keep-alive support when sending nar files.
* guix/scripts/substitute.scm (process-substitution): Pass the download size
to the progress-report-port procedure so that it doesn't block reading from
the input port when keep-alive is supported.
2021-06-01 09:10:32 +02:00
Mathieu Othacehe
2acc114a96
publish: Preserve the request connection header.
The Guile web server is reading the response connection header to decide
whether to close the connection. However, as the request connection header is
not forwarded to the response, this mechanism cannot work.

* guix/scripts/publish.scm (add-extra-headers): New procedure.
(make-request-handler): Use it to forward the request connection header to the
response.
2021-06-01 09:10:32 +02:00
Mathieu Othacehe
4f2fa2f980
progress: Add a download-size argument to progress-report-port.
* guix/progress.scm (progress-report-port): Add a download-size argument.
2021-06-01 09:10:32 +02:00
Ludovic Courtès
84f8bae0f8
gnu-maintenance: 'generic-html' correctly handles relative release URLs.
* guix/gnu-maintenance.scm (latest-html-release)[url->release]: Fix
source URL construction in cases where URL is a possibly relative path.
2021-05-28 23:04:44 +02:00
Ludovic Courtès
d7c356edb9
gnu-maintenance: 'release-file?' accepts 'v' prefix as in "PKG-v1.2.tgz".
* guix/gnu-maintenance.scm (%tarball-rx, %package-name-rx): Accept 'v'
and 'V' prefixes.  Accept ".tgz" extension.
* tests/gnu-maintenance.scm ("release-file?"): Add test.
2021-05-28 23:04:44 +02:00
Ludovic Courtès
a44fa3742c
guix build: Emit "nothing to do" warning only when needed.
This is a followup to 681af1fb78.

* guix/scripts/build.scm (guix-build): Emit "nothing to do" warning only
when both DRV and ITEMS are null.
2021-05-28 23:04:43 +02:00
Ludovic Courtès
f8c4437f0f
guix package: Do not warn about "missing arguments" when there's nothing to do.
In some cases, running "guix upgrade" can trigger this warning, and
"missing arguments" is misleading then.

Reported by flatwhatson on #guix.

* guix/scripts/package.scm (process-actions): Change warning to "nothing
to do".
2021-05-28 23:04:43 +02:00
Xinglu Chen
3f5bc6cbb3
import: opam: Generate license for package.
* guix/import/opam.scm (opam->guix-package): Generate license for the
‘license’ field.
* tests/opam.scm (test-opam-file): Update accordingly.
("opam->guix-package"): Likewise.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-05-28 11:36:03 +02:00
Andrew Whatson
ebbfee880c
git-download: Support submodules in 'git-predicate'.
* guix/git-download.scm (git-file-list): Add prefix and recursive?
arguments.  Recurse into submodules when requested.
(git-predicate): Add recursive? argument.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-05-28 11:36:02 +02:00
Ludovic Courtès
50d5bb1f3e
git-download: 'git-predicate' now ignores deleted files.
When git-predicate is used on an active worktree, some files in the
index might not exist on the filesystem.  Instead of failing with "No
such file or directory", these should be ignored.

* guix/git-download.scm (git-predicate): Wrap 'lstat' call in
'false-if-exception'.  Return RESULT when STAT is #f.

Co-authored-by: Andrew Whatson <whatson@gmail.com>
2021-05-28 11:36:02 +02:00
Ludovic Courtès
681af1fb78
scripts: Commands warn when passed zero arguments.
This is a followup to 3f8326237d.

* guix/scripts/archive.scm (export-from-store): Warn then FILES is
empty.
* guix/scripts/build.scm (guix-build): Likewise.
* guix/scripts/copy.scm (warn-if-empty): New procedure.
(send-to-remote-host, retrieve-from-remote-host): Call it.
* guix/scripts/edit.scm (guix-edit): Warn when SPECS is empty.
* guix/scripts/environment.scm (guix-environment): Warn when MANIFEST
has zero entries.
* guix/scripts/graph.scm (guix-graph): Warn then ITEMS is empty.
* guix/scripts/package.scm (process-actions): Warn when FILES and TRANS
are both empty.
2021-05-28 11:36:02 +02:00
Ludovic Courtès
7243a8c7ec
deploy: Error out when the FILE argument is missing.
* guix/scripts/deploy.scm (guix-deploy): Error out when FILE is false.
2021-05-28 11:36:02 +02:00
Mathieu Othacehe
316d9e0817
guix: ci: Add spec support to latest-evaluations.
* guix/ci.scm (latest-evaluations): Add spec parameter support.
2021-05-26 15:29:32 +02:00
Mathieu Othacehe
a2155f41f5
guix: ci: Fix evaluation complete? field.
* guix/ci.scm (<evaluation>): Fix evaluation complete? field.
2021-05-26 15:29:32 +02:00
Xinglu Chen
cfec09a992
import: hackage: Prefix licenses with 'license:'.
* guix/import/hackage.scm (string->license): Prefix the value of the license
field with ‘license:’.
* tests/hackage.scm (match-ghc-foo, match-ghc-foo-6, match-ghc-foo-revision):
Adjust accordingly.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-05-22 23:39:27 +02:00