Fixes <https://bugs.gnu.org/33323>.
Reported by swedebugia <swedebugia@riseup.net>.
* guix/scripts/package.scm (process-query): Call 'leave' when
'find-packages-by-name' returns the empty list.
* tests/guix-package.sh: Test it.
* guix/ci.scm (<checkout>, <evaluation>): New record types.
(latest-builds): Add #:evaluation and #:system and honor it. Define
'option'.
(json->checkout, json->evaluation, latest-evaluations)
(evaluations-for-commit): New procedures.
Partially fixes <https://bugs.gnu.org/28159>.
The FTP server at ftp.free.fr had become unable to produce directory
listings, effectively making the updater dysfunctional. Furthermore FTP
is considered obsolescent so HTTP + HTML looks more future-proof.
* guix/gnu-maintenance.scm (html->sxml, html-links)
(latest-html-release): New procedures.
(latest-kernel.org-release): Rewrite in terms of 'latest-html-release'.
Fixes a regression introduced in
5f7dd092ca where, upon completion, 'guix
pull' would fail (instead of printing the new/upgraded packages) with
ugly errors like:
successfully built /gnu/store/…-profile.drv
1 package in profile
Backtrace:
[…]
In guix/store.scm:
1605:24 1 (run-with-store _ _ #:guile-for-build _ #:system _ # _)
In unknown file:
0 (_ #<build-daemon 256.97 2476b40>)
ERROR: Wrong type to apply: #t
Reported by thorwil on #guix.
* guix/scripts/pull.scm (build-and-install): Add missing 'return' when
DRY-RUN? is wrong.
Fixes a bug whereby directories in the output of 'guix pack -f tarball'
would not be read-only.
* guix/build/store-copy.scm (reset-permissions): New procedure.
(populate-store): Pass #:keep-mtime? #t to 'copy-recursively'. Call
'reset-permissions'.
* tests/pack.scm ("self-contained-tarball"): In CHECK, define
'canonical?' and use it to check that every file has an mtime of 1 and
is read-only.
* tests/guix-pack.sh: Invoke "chmod -Rf +w" before "rm -rf" in trap.
* guix/scripts/pack.scm (squashfs-image)[database]: New variable.
[build]: Add (gnu build install) to the closure. Call
'install-database-and-gc-roots' when DATABASE is true, and invoke
mksquashfs once more.
* tests/pack.scm ("squashfs-image + localstatedir"): New test.
* guix/docker.scm (build-docker-image): Add #:database parameter.
Create /var/guix/db, /var/guix/profiles, etc. when DATABASE is true.
* guix/scripts/pack.scm (docker-image): Export. Remove #:deduplicate?
parameter. Define 'database' and pass it to 'docker-image'.
* tests/pack.scm (test-assertm): Recompile the derivation of
%BOOTSTRAP-GUILE.
("docker-image + localstatedir"): New test.
This is another way to address <https://bugs.gnu.org/32184>, which was
previously addressed in commit 19c924af4f.
* gnu/build/install.scm (register-closure): Move to...
* gnu/build/vm.scm (register-closure): ... here. New procedure.
* guix/scripts/pack.scm (self-contained-tarball)[build]: Remove
now unneeded 'with-extensions' form and custom (guix config) module.
* tests/guix-pack.sh: Revert the strategy from
commit 19c924af4f.
* tests/pack.scm ("self-contained-tarball"): Likewise.
* guix/scripts/pack.scm (store-database): New procedure.
(self-contained-tarball): Use it when LOCALSTATEDIR? is true.
Remove 'schema' and add 'database'.
[build]: Pass DATABASE to 'populate-single-profile-directory'.
(squashfs-image): Remove #:deduplicate? parameter.
[build]: Remove (gnu build install) and (guix config) from the imported
modules. Remove 'with-extensions'.
* gnu/build/install.scm (populate-single-profile-directory): Remove
#:deduplicate?, #:register?, and #:schema; add #:database. Remove call
to 'register-closure' and simply copy DATABASE instead.
* guix/self.scm (miscellaneous-files): New procedure.
(whole-package): Remove #:substitute-keys, add #:miscellany.
[build]: Remove code for SUBSTITUTE-KEYS and add code to copy MISCELLANY
to OUTPUT.
(compiled-guix): Adjust call to 'whole-package'.
* guix/self.scm (whole-package): Add #:substitute-keys and honor it.
(compiled-guix): Pass #:substitute-keys to 'whole-package' when
PULL-VERSION is one.
Otherwise the user might believe that git-fetch stalled, observing the lack of
output following a 'fatal' git error message (see:
https://debbugs.gnu.org/33100).
* guix/build/git.scm (git-fetch): Print message when falling back to a full
fetch.
* guix/import/hackage.scm (hackage-module->sexp): Do not repeat inputs again
in native-inputs. native-inputs should only contain packages that are not
already listed in inputs.
Fixes <https://bugs.gnu.org/32966>.
Reported by Clément Lassieur <clement@lassieur.org>.
* guix/gexp.scm (gexp-attribute): Add 'equal?' optional parameter; pass
it to 'delete-duplicates'.
(gexp-modules)[module=?]: New procedure.
Pass it to 'gexp-attribute'.
* tests/gexp.scm ("gexp-modules deletes duplicates"): New test.
* guix/scripts.scm (%disk-space-warning): New variable.
(warn-about-disk-space): New procedure.
* guix/scripts/package.scm (build-and-use-profile): Use it.
* guix/scripts/system.scm (process-action): Likewise.
Fixes <https://bugs.gnu.org/32184>.
* guix/tests.scm (call-with-external-store): New procedure.
(with-external-store): New macro.
* tests/pack.scm (%store): Remove.
(test-assertm): Add 'store' parameter.
("self-contained-tarball"): Wrap in 'with-external-store'.
* tests/guix-pack.sh: Connect to the external store, if possible, by
setting NIX_STORE_DIR and GUIX_DAEMON_SOCKET. Remove most uses of
'--bootstrap'.
Fixes a regression introduced in
48b444304e whereby "guix pack -C none
hello" would fail with:
ERROR: In procedure string-join:
In procedure string-join: Wrong type argument in position 1: #f
builder for `/gnu/store/…-tarball-pack.tar.drv' failed with exit code 1
* guix/scripts/pack.scm (self-contained-tarball): Adjust for when
'compressor-command' returns #f.
* guix/status.scm (build-event-output-port)[guile@2.0]: Do not call 'setvbuf'
on custom binary port.
* tests/status.scm (current-build-output-port, UTF-8 + garbage)[guile@2.0]:
Use "?" in place of REPLACEMENT CHARACTER.
This allows for more accurate status tracking and parsing of extended
build traces.
* guix/status.scm (multiplexed-output-supported?): New procedure.
(print-build-event): Don't print \r when PRINT-LOG? is true.
Adjust 'build-log' handling for when 'multiplexed-output-supported?'
returns true.
(bytevector-index, split-lines): New procedures.
(build-event-output-port)[%build-output-pid, %build-output]
[%build-output-left]: New variables.
[process-line]: Handle "@ build-output" traces.
[process-build-output]: New procedure.
[write!]: Add case for when %BUILD-OUTPUT-PID is true. Use
'bytevector-index' rather than 'string-index'.
(compute-status): Add #:derivation-path->output-path. Use it.
* tests/status.scm ("compute-status, multiplexed build output"):
New test.
("build-output-port, UTF-8")
("current-build-output-port, UTF-8 + garbage"): Adjust to new
'build-log' output.
* guix/scripts/build.scm (set-build-options-from-command-line):
Pass #:multiplexed-build-output?.
(%default-options): Add 'multiplexed-build-output?'.
* guix/scripts/environment.scm (%default-options): Likewise.
* guix/scripts/pack.scm (%default-options): Likewise.
* guix/scripts/package.scm (%default-options): Likewise.
* guix/scripts/pull.scm (%default-options): Likewise.
* guix/scripts/system.scm (%default-options): Likewise.
This allows clients to tell whether output comes from the daemon or, if
it comes from a builder, from which builder it comes. The latter is
particularly useful when MAX-BUILD-JOBS > 1.
* nix/libstore/build.cc (DerivationGoal::tryBuildHook)
(DerivationGoal::startBuilder): Print the child's PID in "@ build-started"
traces.
(DerivationGoal::handleChildOutput): Define 'prefix', pass it to
'writeToStderr'.
* nix/libstore/globals.cc (Settings:Settings): Initialize
'multiplexedBuildOutput'.
(Settings::update): Likewise.
* nix/libstore/globals.hh (Settings)[multiplexedBuildOutput]: New field.
Update 'printBuildTrace' documentation.
* nix/libstore/worker-protocol.hh (PROTOCOL_VERSION): Bump to 0.163.
* nix/nix-daemon/nix-daemon.cc (performOp) <wopSetOptions>: Special-case
"multiplexed-build-output" and remove "use-ssh-substituter".
* guix/store.scm (set-build-options): Add #:multiplexed-build-output?
and honor it.
(%protocol-version): Bump to #x163.
* tests/store.scm ("multiplexed-build-output"): New test.
fixlet
Fixes a regression introduced in
795d430d90 whereby 'guix describe' would
no longer display the generation number of ~/.config/guix/current.
* guix/scripts/describe.scm (guix-describe): Call 'canonicalize-profile'.
This is a followup to 8155a20907.
* guix/scripts/pull.scm (migrate-generations): Compute the right target
for /var/guix/profiles/per-user/USER/current-guix. Previously we'd
return "current-N-link" instead of "current-guix-N-link'.
Reported by Formbi on #guix.
* guix/scripts/pull.scm (migrate-generations): Use 'symlink' and
'delete-file' instead of 'rename-file'. The latter could lead to EXDEV
when $HOME and /var were different partitions.
Previously the migration code would fail to create that file, so
~/.config/guix/current would be dangling.
* guix/scripts/pull.scm (migrate-generations): Create
/var/guix/profiles/per-user/USER/current-guix.
This is more consistent with what 'guix package' does, more pleasant for
users (we no longer clobber ~/.config/guix), and more
cluster-friendly (since /var/guix/profiles is usually an NFS share
already.)
* guix/scripts/pull.scm (%current-profile, %user-profile-directory): New
variables.
(migrate-generations, ensure-default-profile): New procedures.
(guix-pull): Use %CURRENT-PROFILE by default. Call
'ensure-default-profile'.
* doc/guix.texi (Invoking guix pull): Adjust 'guix package -p
~/.config/guix/current' example.
* guix/scripts.scm (warn-about-old-distro): Check %PROFILE-DIRECTORY
"/current-guix".
Fixes <https://bugs.gnu.org/32929>.
Reported by Michael Bowcutt <mwb71@case.edu>.
* guix/self.scm (guix-derivation)[guile]: Use "2.2" when PULL-VERSION >= 1.
Likewise for the #:guile-version argument.
* guix/status.scm (maybe-utf8->string): New procedure.
(build-event-output-port): Use it in lieu of 'utf8->string'.
* tests/status.scm ("build-output-port, UTF-8")
("current-build-output-port, UTF-8 + garbage"): New tests.
Fixes a regression introduced in
1d0be47ab6 whereby the total size for
directories (coming from substitutes) would be 4KiB. This led the
progress bar to go back to the start, typically.
* guix/progress.scm (progress-reporter/trace): Add 'total'. In 'start',
initialize it. Adjust 'report' to update it. Adjust 'stop' to prefer
SIZE as the actual size and then TOTAL. Do not use the size of FILE as
the total since that could be 4KiB when FILE is a directory.
Fixes <https://bugs.gnu.org/32895>.
Reported by Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>.
* guix/progress.scm (progress-reporter/trace): In 'stop', make sure SIZE
is an integer. Previously we'd generate a "@ download-progress" trace
with #f for the 'transferred' number when downloading files whose size
is not known in advance.
* guix/build/lisp-utils.scm (normalize-dependency): Modify match
clauses to match the upper-case symbols that lisp produces.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Add a #:cabal-revision argument for specifying which Cabal file revision
from Hackage should be used.
* guix/build-system/haskell.scm (source-url->revision-url): New function.
(lower): Accept a cabal-revision keyword argument, convert it to an
origin record, and add it to the resulting bag's host-inputs.
(haskell-build): Pass the cabal-revision input to the builder as an
argument.
* guix/build/haskell-build-system.scm (patch-cabal-file): New phase.
(%standard-phases): Add it.
* guix/store.scm (derivation-log-file): New procedure.o
(log-file): Use it.
* guix/status.scm (print-build-event): Use 'derivation-log-file' instead
of 'log-file'. Check wheter the return value is #f.
* guix/scripts/perform-download.scm (perform-download): Add
#:print-build-trace? and pass it to 'url-fetch'.
(guix-perform-download): Define 'print-build-trace?' and pass it to
'perform-download'.
* guix/build/download.scm (ftp-fetch): Add #:print-build-trace? and
honor it.
(url-fetch): Likewise.
* nix/libstore/builtins.cc (builtinDownload): Set _NIX_OPTIONS
environment variable.
This uses the 'replacement' service slot introduced in the Shepherd
version 0.5.0.
* gnu/services/shepherd.scm (shepherd-service-upgrade): Return a list of
services that need to be restarted to complete their upgrade.
* guix/scripts/system.scm (call-with-service-upgrade-info): Rename an internal
variable to reflect the change to shepherd-service-upgrade.
(upgrade-shepherd-services): Call 'load-services/safe' instead of
'load-services'. Print a message about services that need to be
manually restarted.
* gnu/services/herd.scm (load-services/safe): New procedure.
* doc/guix.texi (Invoking guix system): Document the new behaviour.
Co-authored-by: Ludovic Courtès <ludo@gnu.org>
This makes it do the right thing w.r.t. git worktrees.
* guix/git-download.scm (git-file-list): Use REPOSITORY-WORKING-DIRECTORY to
locate checkout. Rename from "top" to "workdir".
Fixes <https://bugs.gnu.org/32600>.
Reported by Leo Famulari.
* guix/store/database.scm (register-items): Check whether TO-REGISTER is
in DB by calling 'path-id', and skip the reset-timestamps,
registration, and deduplication phases when it is.
* guix/store/database.scm (register-items): Add #:log-port. Use
'progress-reporter/bar' to show a progress report.
(register-path): Pass #:log-port to 'register-items'.
* guix/profiles.scm (packages->manifest)[inferiors-loaded?]: New
variable.
[inferior->entry]: New procedure.
Accept inferior packages when INFERIORS-LOADED? is true.
* tests/guix-package.sh: Add test using a manifest with an inferior.
* tests/inferior.scm ("packages->manifest"): New test.
* guix/inferior.scm (inferior-package->manifest-entry): New procedure.
* tests/inferior.scm (manifest-entry->list): New procedure.
("inferior-package->manifest-entry"): New test.
* guix/inferior.scm (<inferior>)[packages, table]: New fields.
(open-inferior): Initialize these new fields.
(inferior-packages): Rename to...
(%inferior-packages): ... this.
(inferior-packages): New procedure; force the promise.
(%inferior-package-table, lookup-inferior-packages): New procedures.
* tests/inferior.scm ("lookup-inferior-packages")
("lookup-inferior-packages and eq?-ness"): New tests.
* guix/inferior.scm (read-inferior-response)
(send-inferior-request): New procedures.
(inferior-eval): Rewrite in terms of these.
(proxy, inferior-package-derivation, inferior-package->derivation)
(package-compiler): New procedures.
* tests/inferior.scm ("inferior-package-derivation"): New test.
The asdf documentation specifies that asdf:load-asd should be preferred to
calling load on a system definition file.
* guix/build/lisp-utils.scm (compile-system): Replace load with asdf:load-asd.
(system-dependencies): Likewise.
(test-system): Likewise.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Add support for dependencies of the form (:version <name> <version>),
(:feature <feature> <dependency-specification>) and (:require <module-name>),
as defined by
<https://common-lisp.net/project/asdf/asdf.html#The-defsystem-grammar>.
* guix/build/lisp-utils.scm (normalize-dependency): New variable.
(make-asd-file)[dependencies]: Use it to generate dependencies with normalized
names.
[dependency-name]: New variable.
[registry]: Use it to flatten the normalized dependencies.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Previously, on machines where /etc/ssl/certs did exist, we'd have this:
$ unset SSL_CERT_DIR
$ unset SSL_CERT_FILE
$ guix pull
Updating channel 'guix' from Git repository at 'https://git.savannah.gnu.org/git/guix.git'...
guix pull: error: Git error: the SSL certificate is invalid
This is because we'd let OpenSSL look for certificates in its default
location, which is an empty directory in its own prefix.
* guix/scripts/pull.scm (honor-x509-certificates): New procedure.
(guix-pull): Use it instead of calling 'honor-lets-encrypt-certificates!'.
Previously a command like:
$(readlink -f ~/.config/guix/current)/bin/guix describe
would succeed without printing anything.
* guix/scripts/describe.scm (display-profile-info): Don't call
'generation-file-name' when NUMBER is zero.
* guix/scripts/pull.scm (display-profile-content): Likewise.
This could result in deadlock in unusual situations, whereby we'd start
waiting for a reply while the query hasn't been flushed to the socket.
* guix/store.scm (buffering-output-port)[flush]: Add call to
'force-output'.
(add-to-store): Add call to 'write-buffered-output'.
* guix/gnupg.scm (%gpgv-command, current-keyring): New variables
(gnupg-verify): Add optional 'keyring' parameter. Use 'gpgv' instead of
'gpg' and pass it '--keyring'.
(gnupg-receive-keys): Add optional 'keyring' parameter and honor it.
(gnupg-verify*): Add #:keyring and honor it.
* guix/scripts/refresh.scm (%options, show-help): Add '--keyring'.
(guix-refresh): Parameterize CURRENT-KEYRING.
* doc/guix.texi (Invoking guix refresh): Document '--keyring' and the
keybox format.
Fixes a regression introduced in
aed0a59405 whereby external channels would
fail to build due to the lack of a (git) module.
Reported by Alex ter Weele on #guix.
* guix/channels.scm (channel-instance-derivations)[guile-gcrypt]:
Remove.
[dependencies]: New variable.
Use it in the 2nd argument to 'build-channel-instance'.
Fixes a regression introduced in
aed0a59405 whereby 'git-predicate' would
throw to 'git-error instead of returning #f as the docstring says.
* guix/git-download.scm (git-predicate): Return #f upon 'git-error'.
Fixes <https://bugs.gnu.org/27925>.
* guix/git-download.scm (files->directory-tree)
(directory-in-tree?): Remove.
(git-file-list): New procedures.
(git-predicate): Use it instead of opening a pipe to 'git'. Remove
directory tree hack and rely exclusively on inode/device numbers.
Reported-by: Ludovic Courtès <ludo@gnu.org>.
* guix/scripts/build.scm (guix-build),
guix/scripts/package.scm (guix-package): Duplicate port before handing it to
build-output-port.
Reported by Pjotr Prins <pjotr.public12@thebird.nl>.
* guix/ui.scm (build-output-port): Add pattern for hash mismatch error; be
more careful with error messages in verbose mode.
Fixes <https://bugs.gnu.org/32686>.
Reported by Oleg Pykhalov <go.wigust@gmail.com>.
* guix/build/profiles.scm (ensure-writable-directory): Add #:symlink.
[absolute?]: New procedure.
[unsymlink]: Use it to determine how to resolve readlink's result.
(build-profile): Pass SYMLINK to 'ensure-writable-directory'.
* tests/profiles.scm ("profile-derivation when etc/ is a relative symlink"):
New test.