summaryrefslogtreecommitdiff
path: root/guix/channels.scm
Commit message (Collapse)AuthorAge
* 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.
* channels: 'latest-channel-instance' authenticates Git checkouts.Ludovic Courtès2020-06-16
| | | | | | | | | | | | | | | | | | | | | | 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.
* pull: Protect against downgrade attacks.Ludovic Courtès2020-05-25
| | | | | | | | | | | * guix/scripts/pull.scm (%default-options): Add 'validate-pull'. (%options, show-help): Add '--allow-downgrades'. (warn-about-backward-updates): New procedure. (guix-pull): Pass #:current-channels and #:validate-pull to 'latest-channel-instances'. * guix/channels.scm (ensure-forward-channel-update): Add hint for when (channel-commit channel) is true. * doc/guix.texi (Invoking guix pull): Document '--allow-downgrades'.
* channels: 'latest-channel-instances' guards against non-forward updates.Ludovic Courtès2020-05-25
| | | | | | | | | | | | | | | * guix/channels.scm (latest-channel-instance): Add #:starting-commit and pass it to 'update-cached-checkout'. Return the commit relation as a second value. (ensure-forward-channel-update): New procedure. (latest-channel-instances): Add #:current-channels and #:validate-pull. [current-commit]: New procedure. Pass #:starting-commit to 'latest-channel-instance'. When the returned relation is true, call VALIDATE-PULL. (latest-channel-derivation): Add #:current-channels and #:validate-pull. Pass them to 'latest-channel-instances*'. * tests/channels.scm ("latest-channel-instances #:validate-pull"): New test.
* git: 'update-cached-checkout' returns the commit relation.Ludovic Courtès2020-05-25
| | | | | | | | | | | * guix/git.scm (update-cached-checkout): Add #:starting-commit parameter. Call 'commit-relation' when #:starting-commit is true. Always return the relation or #f as the third value. (latest-repository-commit): Adjust accordingly. * guix/import/opam.scm (get-opam-repository): Likewise. * tests/channels.scm ("latest-channel-instances includes channel dependencies") ("latest-channel-instances excludes duplicate channel dependencies"): Update mock of 'update-cached-checkout' accordingly.
* channels: 'latest-channel-instances' doesn't leak internal state.Ludovic Courtès2020-05-25
| | | | | * guix/channels.scm (latest-channel-instances): Remove 'previous-channels' argument. Introduce 'loop' and use it.
* channels: 'build-from-source' restores '%guile-for-build'.Ludovic Courtès2020-05-15
| | | | | | | | | | | | | | | | | Not restoring it would cause problems when running: guix time-machine --commit=6298c3ffd9654d3231a6f25390b056483e8f407c or similar because the target Guix would be built with 2.2, and then we'd erroneously go on and attempt build the profile with 2.2. This would fail because profile dependencies such as "guile-gdbm-ffi" now target 3.0. * guix/channels.scm (call-with-guile): New procedure. (with-guile): New macro. (build-from-source): Use it instead of calling 'set-guile-for-build' just once. This ensures that '%guile-for-build' is restored afterwards.
* channels: Move quirks and patches to (guix quirks).Ludovic Courtès2020-05-15
| | | | | | | | | * guix/channels.scm (apply-patches): Don't access <patch> record directly; use 'applicable-patch?' and 'apply-patch' instead. (<patch>, syscalls-reexports-local-variables?) (guile-2.2.4, %quirks, %bug-41028-patch, %patches): Move to... * guix/quirks.scm: ... here. New file. (apply-patch, applicable-patch?): New procedures.
* channels: Add patch for <https://bugs.gnu.org/41028>.Ludovic Courtès2020-05-07
| | | | | | | | | | | | | Without this patch, we couldn't jump from here to commits before 05e783871c2c69b402e088863d46f5be7915ac74 because the 'compute-guix-derivation' script would crash with an unbound-variable error for 'call-with-new-thread'. Fixes <https://bugs.gnu.org/41028>. Reported by Christopher Baines <mail@cbaines.net>. * guix/channels.scm (%bug-41028-patch): New variable. (%patches): Add it.
* channels: Add mechanism to patch checkouts of the 'guix channel.Ludovic Courtès2020-05-07
| | | | | | | | | | | | | | | * guix/channels.scm (<patch>): New record type. (apply-patches): New procedure. (latest-channel-instance)[dot-git?]: New procedure. Use 'update-cached-checkout' and 'add-to-store' instead of 'latest-repository-commit'. Call 'apply-patches' when CHANNEL is the 'guix channel. (%patches): New variable. * guix/git.scm (url+commit->name): Make public. * tests/channels.scm ("latest-channel-instances includes channel dependencies") ("latest-channel-instances excludes duplicate channel dependencies"): Mock 'update-cached-checkout' instead of 'latest-repository-commit'. Wrap body in 'with-store' and pass the store to 'latest-channel-instances'.
* channels: Add 'latest-channel-instance'.Ludovic Courtès2020-05-07
| | | | | * guix/channels.scm (latest-channel-instance): New procedure. (latest-channel-instances): Use it.
* channels: Use a declarative profile.Ludovic Courtès2020-04-26
| | | | | * guix/channels.scm (package-cache-file): Use 'profile' instead of 'profile-derivation'.
* channels: Call 'build-self.scm' procedure with a trivial build handler.Ludovic Courtès2020-04-06
| | | | | | | | | | Previously, "TESTS=installed-os guix build -m etc/system-tests.scm" would repeat the "Computing Guix derivation" phase ~5 times due to the fact that there were several call paths, within a build-accumulator, leading to (package-derivation store guix). * guix/channels.scm (with-trivial-build-handler): New procedure. (build-from-source): Wrap 'build' call in 'with-trivial-build-handler'.
* channels: Provide a hint when the 'guix' channel is lacking.Ludovic Courtès2020-01-09
| | | | | | | | Fixes <https://bugs.gnu.org/39043>. Reported by Jesse Gibbons <jgibbons2357@gmail.com>. * guix/channels.scm (channel-instance-derivations): Raise '&fix-hint' condition in addition to the '&message' condition.