summaryrefslogtreecommitdiff
path: root/guix/channels.scm
AgeCommit message (Collapse)Author
2024-05-13guix: channels: Handle single case with authenticating message.Rostislav Svoboda
* guix/channels.scm (authenticate-channel): Handle single case with authenticating message. Change-Id: I7759607f37405e6d3bd4b7f5958fd11d908db204 Reviewed-by: Dale Mellor <guix-devel-0brg6a@rdmp.org> Signed-off-by: Christopher Baines <mail@cbaines.net>
2024-04-15channels: Autoload (git …) modules.Ludovic Courtès
Autoloading Guile-Git is important in cases where (guix channels) is used for little more than the <channel> definition. This is the case, for example, of ‘guix describe’ or ‘guix shell’. This reduces from 177 to 121 the number of .go files loaded when running: ./pre-inst-env strace -e openat -o /tmp/log.strace \ guix describe -p /var/guix/profiles/per-user/$USER/current-guix grep 'openat.*\.go.* = [0-9]' < /tmp/log.strace |wc -l Likewise, it reduces the max RSS (as measured by ‘time -f %M guix describe -p …’) from 54 to 37 MiB. * guix/channels.scm: Autoload (git …) modules. Change-Id: Ia58a99c865bf0f6fe461a1e71390d075e760f8d6
2024-04-15git: Add ‘tag->commit’ and use it in (guix channels).Ludovic Courtès
* guix/git.scm (tag->commit): New procedure, taken from… (resolve-reference): … here. Use it in the ‘tag’ case. * guix/channels.scm (resolve-channel-news-entry-tag): Use ‘tag->commit’ instead of custom code. Change-Id: I46ea387345dc1b695ce0702991a52d0cde29e2f0
2024-04-15channels: Move ‘commit-short-id’ to (guix git).Ludovic Courtès
* guix/channels.scm (commit-short-id): Move to… * guix/git.scm (commit-short-id): … here. Change-Id: If4b34b1d82b1aa5068d157f26e57e8aecc967061
2024-04-15git: Add ‘repository-info’ and use it in (guix channels).Ludovic Courtès
* guix/git.scm (repository-info): New procedure. * guix/channels.scm (repository->guix-channel): Use it instead of local code. Change-Id: I74c758c73a22e16031571ca4271cc9cab0492f6e
2024-04-15channels: Use SRFI-71 instead of SRFI-11.Ludovic Courtès
* guix/channels.scm (latest-channel-instance): Use SRFI-71. Change-Id: I73531c98b3034e228006ed91518cc7bfedc784fd
2024-03-30channels: Autoload several modules.Ludovic Courtès
* guix/channels.scm: Autoload several Git-related modules. Change-Id: I23e46eabdbfa9db340e26006419b4b87bb446853
2024-01-31channels: ‘latest-channel-instances’ traverses user-provided channels first.Ludovic Courtès
Previously, ‘latest-channel-instances’ would perform a depth-first traversal of channels. Since dependencies specified in ‘.guix-channel’ are usually less specific that those provided by the user, this would lead to the use of instances corresponding to those less specific specs, which in turn might declare dependencies that do not exist for the more specific instances. This commit changes ‘latest-channel-instances’ to perform a breadth-first traversal, thereby giving user-supplied channels higher precedence over dependencies found via ‘.guix-channel’. Fixes <https://issues.guix.gnu.org/68822>. * guix/channels.scm (latest-channel-instances)[ignore?]: Remove. [instance-name, same-named?, more-specific?]: New procedures. Rewrite as a breadth-first traversal using a regular loop. * tests/channels.scm ("latest-channel-instances reads dependencies from most-specific instance"): New test. Change-Id: Iba518145cfd209f04293a56246dbfee3b714650b
2023-10-28profiles: Hooks honor the #:system parameter of ‘profile-derivation’.Ludovic Courtès
Fixes <https://issues.guix.gnu.org/65225>. * guix/profiles.scm (info-dir-file, package-cache-file) (info-dir-file, ghc-package-cache-file, ca-certificate-bundle) (emacs-subdirs, gdk-pixbuf-loaders-cache-file, glib-schemas) (gtk-icon-themes, gtk-im-modules, linux-module-database) (xdg-desktop-database, xdg-mime-database, fonts-dir-file) (manual-database, manual-database/optional): Add optional #:system parameter and pass it to ‘gexp->derivation’. (profile-derivation): Pass HOOK a second parameter, SYSTEM. * gnu/bootloader.scm (efi-bootloader-profile)[efi-bootloader-profile-hook]: Add optional #:system parameter and pass it to ‘gexp->derivation’. * guix/channels.scm (package-cache-file): Likewise. * tests/profiles.scm ("profile-derivation, #:system, and hooks"): New test. Reported-by: Tobias Geerinckx-Rice <me@tobias.gr>
2023-06-04channels: Raise an error if dependency's introduction is malformedJosselin Poiret
* guix/channels.scm (sexp->channel-introduction): Do it.
2023-03-13guix: Strip #:use-module lists.Ludovic Courtès
This was obtained by setting up this environment: guix shell -D guix --with-input=guile@3.0.9=guile-next \ --with-commit=guile-next=e2ed33ef0445c867fe56c247054aa67e834861f2 -- make -j5 then adding 'unused-module' to (@@ (guix build compiler) %warnings), building, and checking all the "unused module" warnings and removing those that were definitely unused.
2023-02-11status: Print a hint when a 'package-cache' hook fails to build.Ludovic Courtès
* guix/channels.scm (package-cache-file): Add 'channels' to the #:properties list. * guix/status.scm (print-build-event): Upon failure, display a hint when the derivation is a 'package-cache' hook.
2023-01-23channels: 'channel->code' emits 'channel' field only when necessary.Ludovic Courtès
* guix/channels.scm (channel->code): Emit 'commit' field only when it is true.
2022-10-17channels: Interpret the 'commit' field of channel as a tag or commit.Ludovic Courtès
Previously the 'commit' field would always be interpreted as a commit ID. This change adds flexibility, allowing for things like: guix time-machine --commit=v1.2.0 -- describe * guix/channels.scm (channel-reference): Use 'tag-or-commit' rather than 'commit'. * guix/inferior.scm (channel-full-commit): Likewise. * doc/guix.texi (Invoking guix pull): Document it. (Invoking guix time-machine): Likewise.
2022-10-04channels: Warn about missing introductions.Ludovic Courtès
* guix/channels.scm (latest-channel-instance): Warn when CHANNEL has no introduction and CHECKOUT contains '.guix-authorizations'.
2022-08-09channels: Consider news files as UTF-8-encoded by default.Ludovic Courtès
Partly fixes <https://issues.guix.gnu.org/57039>. Reported by Pierre-Henry Fröhring <contact@phfrohring.com>. Previously, news file would be read using the current locale encoding. This could lead to a test failure in 'tests/channels.scm' (in a test that expects some Unicode-capable encoding) in case tests were run in a non-Unicode locale. * guix/channels.scm (channel-news-for-commit): Make port for NEWS-FILE UTF-8 by default.
2022-08-09channels: Add 'repository->guix-channel'.Ludovic Courtès
* guix/channels.scm (repository->guix-channel): New procedure. * guix/scripts/describe.scm (display-checkout-info): Use it instead of the (git) interface, and adjust accordingly.
2022-07-08channels: Emit version 3 profiles.Ludovic Courtès
Fixes <https://issues.guix.gnu.org/56441>. Reported by zimoun <zimon.toutoune@gmail.com>. Fixes a bug introduced in 4ff12d1de7cd617b791996ee7ca1240660b4c20e with version 4 of the manifest format. A new 'guix time-machine' would create a v4 manifest; when targeting an old revision (v3), 'generate-package-cache' would fail to read that manifest and abort. Furthermore, an old Guix living in a new profile with a v4 manifest would be unable to describe itself via (guix describe). * guix/channels.scm (package-cache-file): Add 'format-version' field to PROFILE. (channel-instances->derivation): Pass #:format-version to 'profile-derivation'.
2022-06-16channels: Print backtrace when generating package cache fails.Josselin Poiret
* guix/channels.scm (package-cache-file): Add a throw handler around the generate-package-cache call, and print backtrace in it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-12-25channels: Add 'branch' to 'channel->code' output.Brice Waegeneire
* guix/channels.scm (channel->code): Add 'branch' to output.
2021-09-18channels: 'channel-news-entry-commit' correctly resolves annotated tags.Ludovic Courtès
Previously, 'channel-news-entry-commit' would return the tag ID rather than the commit ID when the news entry was referred to via an annotated tag. Reported by Xinglu Chen <public@yoctocell.xyz>. * guix/channels.scm (resolve-channel-news-entry-tag): Check whether the reference points to annotated tag; resolve it if it does. * tests/channels.scm ("channel-news, annotated tag"): New test.
2021-05-12channels: Add a #:system argument to channel-instances->manifest.Christopher Baines
This allows computing a manifest for a specific system. Previously this was possible, but only through changing %current-system, which caused the derivation to be computed using that system as well (so computing a derivation for aarch64-linux on x86_64-linux would require running aarch64-linux code). This new argument adds the possibility of computing derivations for non-native systems, without having to run non-native code. I'm looking at this as it will enable the Guix Data Service to compute channel instance derivations without relying on QEMU emulation for non-native systems (it should be faster as well). * guix/channels.scm (build-from-source): Add #:system argument and pass to build. (build-channel-instance): Add system argument and pass to build-from-source. (channel-instance-derivations): Add #:system argument and pass to build-channel-instance, also rename system to current-system-value. (channel-instances->manifest): Add #:system argument and pass to channel-instance-derivations.
2021-04-12channels: Build user channels with '-O1'.Ludovic Courtès
This should noticeably speed up compilation for channels with many files. * guix/channels.scm (standard-module-derivation)[build]: Define 'optimizations-for-level' and '-O1'. Pass #:optimization-options to 'compile-files'.
2021-03-10channels: Add the channel branch in sexp->channel.Mathieu Othacehe
* guix/channels.scm (sexp->channel): Add the channel branch.
2021-03-10channels: Export channel-instance->sexp.Mathieu Othacehe
* guix/channels.scm (channel-instance->sexp): Export it.
2021-02-04channels: Consider the current channel commit as authentic.Ludovic Courtès
Fixes <https://bugs.gnu.org/45895>. When the ~/.cache/guix/authentication is empty, this change allows authentication to start at the current commit, as shown by 'guix describe', instead of starting from the introductory commit, which would take more and more time (there's currently 18K commits per year). * guix/git-authenticate.scm (authenticate-repository): Add #:authentic-commits. [authenticated-commits]: Append it. * guix/channels.scm (authenticate-channel)[authentic-commits]: New variable. Pass it to 'authenticate-repository'.
2021-02-04channels: Record 'guix' channel metadata in (guix config).Ludovic Courtès
Partially fixes <https://bugs.gnu.org/45896>. * guix/config.scm.in (%channel-metadata): New variable. * guix/describe.scm (channel-metadata): Use it. (current-channels): New procedure. (current-profile-entries): Clarify docstring. * guix/self.scm (compiled-guix): Add #:channel-metadata and pass it to 'make-config.scm'. (make-config.scm): Add #:channel-metadata and define '%channel-metadata' in the generated file. (guix-derivation): Add #:channel-metadata and pass it to 'compiled-guix'. * guix/channels.scm (build-from-source): Replace 'name', 'source', and 'commit' parameters with 'instance'. Pass #:channel-metadata to BUILD. (build-channel-instance): Adjust accordingly. * build-aux/build-self.scm (build-program): Add #:channel-metadata and pass it to 'guix-derivation'. (build): Add #:channel-metadata and pass it to 'build-program'. * guix/scripts/describe.scm (display-profile-info): Add optional 'channels' parameter. Pass it to 'display-profile-content'. (display-profile-content): Add optional 'channels' parameter and honor it. Iterate on CHANNELS rather than on the manifest entries of PROFILE. (guix-describe): When PROFILE is #f, call 'current-channels' and pass it to 'display-profile-info', unless it returns the empty list.
2021-02-01guix package: Add '--export-channels'.Ludovic Courtès
* guix/channels.scm (sexp->channel): Export. * guix/describe.scm: Use (guix channels). (manifest-entry-provenance): New procedure. * guix/scripts/package.scm (channel=?, export-channels): New procedures. (show-help, %options): Add '--export-channels'. (process-query): Honor it. * build-aux/build-self.scm (build-program)[select?]: Exclude (guix channels) to account for the (guix describe) change above. * doc/guix.texi (Invoking guix package): Document it.
2021-02-01channels: Add 'channel->code'.Ludovic Courtès
* guix/channels.scm (channel->code): New procedure, taken from... * guix/scripts/describe.scm (channel->sexp): ... here. Adjust callers accordingly.
2021-02-01guix describe: Use 'manifest-entry-channel'.Ludovic Courtès
* guix/channels.scm (manifest-entry-channel): Export. * guix/scripts/describe.scm (display-profile-content): Use it.
2021-02-01channels: Add the channel name to channel sexps.Ludovic Courtès
* guix/channels.scm (channel-instance->sexp): Add 'name'. (sexp->channel): Extract the name from SEXP, using the optional argument as a fallback.
2021-02-01channels: Factorize 'manifest-entry-channel' and channel serialization.Ludovic Courtès
* guix/channels.scm (sexp->channel, manifest-entry-channel): New procedures. (profile-channels): Replace lambda by 'manifest-entry-channel'. (channel-instance->sexp): New procedure. (channel-instances->manifest)[instance->entry]: Use 'channel-instance->sexp' instead of inline code.
2021-01-31ci: Add missing imports.Ludovic Courtès
This is a followup to 041a9466ea23d6ae811491bcf529bf9487317b48. * guix/ci.scm: Add missing imports. * guix/channels.scm: Remove (guix ci) import.
2021-01-31guix: channels: Introduce "channel-with-substitutes-available".Mathieu Othacehe
* guix/channels.scm (find-latest-commit-with-substitutes, channel-with-substitutes-available): New procedures. * guix/scripts/pull.scm (guix-pull): Move "channel-list" call inside the %current-system parameter scope. * doc/guix.texi (Channels with substitutes): New section.
2020-11-28channels: Expose the default channel in %default-channel.Zhu Zihao
* guix/channels(%default-guix-channel): New variable taken from the inner of %default-channels. (%default-channels): Refactored. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2020-10-12channels: Address test failure.Ludovic Courtès
Fixes <https://bugs.gnu.org/43940>. Reported by Maxim Cournoyer <maxim.cournoyer@gmail.com>. The "channel-instances->manifest" test would fail since 1d4ab335b22a93e01c2eb1eb3e93fc6534157040: 'quiet-guile' would be passed #f as GUILE, and thus 'package-version' would fail with wrong-type-arg. * guix/channels.scm (whole-package-for-legacy): Pass #:guile to 'whole-package'. * tests/channels.scm ("channel-instances->manifest"): Remove 'test-expect-fail'.
2020-07-25Use 'formatted-message' instead of '&message' where appropriate.Ludovic Courtès
* gnu.scm (%try-use-modules): Use 'formatted-message' instead of '&message'. * gnu/machine/digital-ocean.scm (maybe-raise-unsupported-configuration-error): Likewise. * gnu/machine/ssh.scm (machine-check-file-system-availability): Likewise. (machine-check-building-for-appropriate-system): Likewise. (deploy-managed-host): Likewise. (maybe-raise-unsupported-configuration-error): Likewise. * gnu/packages.scm (search-patch): Likewise. * gnu/services.scm (%service-with-default-value): Likewise. (files->etc-directory): Likewise. (fold-services): Likewise. * gnu/system.scm (locale-name->definition*): Likewise. * gnu/system/mapped-devices.scm (check-device-initrd-modules): Likewise. (check-luks-device): Likewise. * guix/channels.scm (latest-channel-instance): Likewise. * guix/cve.scm (json->cve-items): Likewise. * guix/git-authenticate.scm (commit-signing-key): Likewise. (commit-authorized-keys): Likewise. (authenticate-commit): Likewise. (verify-introductory-commit): Likewise. * guix/remote.scm (remote-pipe-for-gexp): Likewise. * guix/scripts/graph.scm (assert-package): Likewise. * guix/scripts/offload.scm (private-key-from-file*): Likewise. * guix/ssh.scm (authenticate-server*): Likewise. (open-ssh-session): Likewise. (remote-inferior): Likewise. * guix/ui.scm (matching-generations): Likewise. * guix/upstream.scm (package-update): Likewise. * tests/channels.scm ("latest-channel-instances, missing introduction for 'guix'"): Catch 'formatted-message?'. ("authenticate-channel, wrong first commit signer"): Likewise. * tests/lint.scm ("patches: not found"): Adjust message string. * tests/packages.scm ("patch not found yields a run-time error"): Catch 'formatted-message?'. * guix/lint.scm (check-patch-file-names): Handle 'formatted-message?'. (check-derivation): Ditto.
2020-07-25utils: Move '&fix-hint' to (guix diagnostics).Ludovic Courtès
* guix/utils.scm (&fix-hint): Move to... * guix/diagnostics.scm (&fix-hint): ... here. * gnu.scm: Adjust imports accordingly. * gnu/system/mapped-devices.scm: Likewise. * guix/channels.scm: Likewise. * guix/profiles.scm: Likewise. * guix/scripts/system/reconfigure.scm: Likewise. * guix/ssh.scm: Likewise.
2020-07-11git-authenticate: Factorize 'authenticate-repository'.Ludovic Courtès
* guix/git-authenticate.scm (repository-cache-key) (verify-introductory-commit, authenticate-repository): New procedures. * guix/channels.scm (verify-introductory-commit): Remove. (authenticate-channel): Rewrite in terms of 'authenticate-repository'.
2020-07-01channels: Dependencies listed in '.guix-channel' can have an introduction.Ludovic Courtès
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-01channels: Save and interpret 'introduction' field in provenance data.Ludovic Courtès
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-01channels: Remove 'signature' from <channel-introduction>.Ludovic Courtès
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-01channels: Make channel introductions public.Ludovic Courtès
* 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-01channels: Add 'openpgp-fingerprint->bytevector'.Ludovic Courtès
* guix/channels.scm (openpgp-fingerprint->bytevector): New procedure. (openpgp-fingerprint): New macro. (%guix-channel-introduction): Use it.
2020-06-28channels: Error out when the 'guix' channel lacks an introduction.Ludovic Courtès
* 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-21channels: 'authenticate-channel' doesn't check relation with intro commit.Ludovic Courtès
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-17channels: Warn when pulling from a mirror.Ludovic Courtès
* 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-16pull: Add '--disable-authentication'.Ludovic Courtès
* 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-16channels: Automatically add introduction for the official 'guix' channel.Ludovic Courtès
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-16channels: Make 'validate-pull' call right after clone/pull.Ludovic Courtès
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.