aboutsummaryrefslogtreecommitdiff
path: root/guix/channels.scm
Commit message (Collapse)AuthorAge
* guix: channels: Handle single case with authenticating message.Rostislav Svoboda4 days
| | | | | | | | | * 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>
* channels: Autoload (git …) modules.Ludovic Courtès2024-04-15
| | | | | | | | | | | | | | | | | | | | 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
* git: Add ‘tag->commit’ and use it in (guix channels).Ludovic Courtès2024-04-15
| | | | | | | | | * 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
* channels: Move ‘commit-short-id’ to (guix git).Ludovic Courtès2024-04-15
| | | | | | | * guix/channels.scm (commit-short-id): Move to… * guix/git.scm (commit-short-id): … here. Change-Id: If4b34b1d82b1aa5068d157f26e57e8aecc967061
* git: Add ‘repository-info’ and use it in (guix channels).Ludovic Courtès2024-04-15
| | | | | | | | * guix/git.scm (repository-info): New procedure. * guix/channels.scm (repository->guix-channel): Use it instead of local code. Change-Id: I74c758c73a22e16031571ca4271cc9cab0492f6e
* channels: Use SRFI-71 instead of SRFI-11.Ludovic Courtès2024-04-15
| | | | | | * guix/channels.scm (latest-channel-instance): Use SRFI-71. Change-Id: I73531c98b3034e228006ed91518cc7bfedc784fd
* channels: Autoload several modules.Ludovic Courtès2024-03-30
| | | | | | * guix/channels.scm: Autoload several Git-related modules. Change-Id: I23e46eabdbfa9db340e26006419b4b87bb446853
* channels: ‘latest-channel-instances’ traverses user-provided channels first.Ludovic Courtès2024-01-31
| | | | | | | | | | | | | | | | | | | | | | | 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
* profiles: Hooks honor the #:system parameter of ‘profile-derivation’.Ludovic Courtès2023-10-28
| | | | | | | | | | | | | | | | | | | | 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>
* channels: Raise an error if dependency's introduction is malformedJosselin Poiret2023-06-04
| | | | * guix/channels.scm (sexp->channel-introduction): Do it.
* guix: Strip #:use-module lists.Ludovic Courtès2023-03-13
| | | | | | | | | | | | 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.
* status: Print a hint when a 'package-cache' hook fails to build.Ludovic Courtès2023-02-11
| | | | | | | * 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.
* channels: 'channel->code' emits 'channel' field only when necessary.Ludovic Courtès2023-01-23
| | | | | * guix/channels.scm (channel->code): Emit 'commit' field only when it is true.
* channels: Interpret the 'commit' field of channel as a tag or commit.Ludovic Courtès2022-10-17
| | | | | | | | | | | | 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.
* channels: Warn about missing introductions.Ludovic Courtès2022-10-04
| | | | | * guix/channels.scm (latest-channel-instance): Warn when CHANNEL has no introduction and CHECKOUT contains '.guix-authorizations'.
* channels: Consider news files as UTF-8-encoded by default.Ludovic Courtès2022-08-09
| | | | | | | | | | | | | 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.
* channels: Add 'repository->guix-channel'.Ludovic Courtès2022-08-09
| | | | | | * 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.
* channels: Emit version 3 profiles.Ludovic Courtès2022-07-08
| | | | | | | | | | | | | | | | | 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'.
* channels: Print backtrace when generating package cache fails.Josselin Poiret2022-06-16
| | | | | | | * 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>
* channels: Add 'branch' to 'channel->code' output.Brice Waegeneire2021-12-25
| | | | * guix/channels.scm (channel->code): Add 'branch' to output.
* channels: 'channel-news-entry-commit' correctly resolves annotated tags.Ludovic Courtès2021-09-18
| | | | | | | | | | | | 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.
* channels: Add a #:system argument to channel-instances->manifest.Christopher Baines2021-05-12
| | | | | | | | | | | | | | | | | | | | | | 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.
* channels: Build user channels with '-O1'.Ludovic Courtès2021-04-12
| | | | | | | | 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'.
* channels: Add the channel branch in sexp->channel.Mathieu Othacehe2021-03-10
| | | | * guix/channels.scm (sexp->channel): Add the channel branch.
* channels: Export channel-instance->sexp.Mathieu Othacehe2021-03-10
| | | | * guix/channels.scm (channel-instance->sexp): Export it.
* channels: Consider the current channel commit as authentic.Ludovic Courtès2021-02-04
| | | | | | | | | | | | | | 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'.
* channels: Record 'guix' channel metadata in (guix config).Ludovic Courtès2021-02-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* guix package: Add '--export-channels'.Ludovic Courtès2021-02-01
| | | | | | | | | | | | | * 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.
* channels: Add 'channel->code'.Ludovic Courtès2021-02-01
| | | | | | * guix/channels.scm (channel->code): New procedure, taken from... * guix/scripts/describe.scm (channel->sexp): ... here. Adjust callers accordingly.
* guix describe: Use 'manifest-entry-channel'.Ludovic Courtès2021-02-01
| | | | | * guix/channels.scm (manifest-entry-channel): Export. * guix/scripts/describe.scm (display-profile-content): Use it.
* channels: Add the channel name to channel sexps.Ludovic Courtès2021-02-01
| | | | | | * guix/channels.scm (channel-instance->sexp): Add 'name'. (sexp->channel): Extract the name from SEXP, using the optional argument as a fallback.
* channels: Factorize 'manifest-entry-channel' and channel serialization.Ludovic Courtès2021-02-01
| | | | | | | | | * 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.
* ci: Add missing imports.Ludovic Courtès2021-01-31
| | | | | | | This is a followup to 041a9466ea23d6ae811491bcf529bf9487317b48. * guix/ci.scm: Add missing imports. * guix/channels.scm: Remove (guix ci) import.
* guix: channels: Introduce "channel-with-substitutes-available".Mathieu Othacehe2021-01-31
| | | | | | | | * 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.
* channels: Expose the default channel in %default-channel.Zhu Zihao2020-11-28
| | | | | | | | | * 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>
* channels: Address test failure.Ludovic Courtès2020-10-12
| | | | | | | | | | | | | 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'.
* Use 'formatted-message' instead of '&message' where appropriate.Ludovic Courtès2020-07-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* utils: Move '&fix-hint' to (guix diagnostics).Ludovic Courtès2020-07-25
| | | | | | | | | | | * 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.
* git-authenticate: Factorize 'authenticate-repository'.Ludovic Courtès2020-07-11
| | | | | | | * 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'.
* channels: Dependencies listed in '.guix-channel' can have an introduction.Ludovic Courtès2020-07-01
| | | | | | | | | | | 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.
* channels: Save and interpret 'introduction' field in provenance data.Ludovic Courtès2020-07-01
| | | | | | | | | | 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.
* channels: Remove 'signature' from <channel-introduction>.Ludovic Courtès2020-07-01
| | | | | | | | | | | 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.
* channels: Make channel introductions public.Ludovic Courtès2020-07-01
| | | | | | | | | | | * 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.
* channels: Add 'openpgp-fingerprint->bytevector'.Ludovic Courtès2020-07-01
| | | | | | * guix/channels.scm (openpgp-fingerprint->bytevector): New procedure. (openpgp-fingerprint): New macro. (%guix-channel-introduction): Use it.
* channels: Error out when the 'guix' channel lacks an introduction.Ludovic Courtès2020-06-28
| | | | | | | * 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.
* channels: 'authenticate-channel' doesn't check relation with intro commit.Ludovic Courtès2020-06-21
| | | | | | | | | | | | | | 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).
* channels: Warn when pulling from a mirror.Ludovic Courtès2020-06-17
| | | | | | | | | * 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.
* pull: Add '--disable-authentication'.Ludovic Courtès2020-06-16
| | | | | | | | | | * 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.
* channels: Automatically add introduction for the official 'guix' channel.Ludovic Courtès2020-06-16
| | | | | | | | | | 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.
* channels: Make 'validate-pull' call right after clone/pull.Ludovic Courtès2020-06-16
| | | | | | | | | | | | | | 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.