summaryrefslogtreecommitdiff
path: root/guix/channels.scm
AgeCommit message (Collapse)Author
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.
2020-06-16channels: 'latest-channel-instance' authenticates Git checkouts.Ludovic Courtès
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.
2020-05-25pull: Protect against downgrade attacks.Ludovic Courtès
* 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'.
2020-05-25channels: 'latest-channel-instances' guards against non-forward updates.Ludovic Courtès
* 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.
2020-05-25git: 'update-cached-checkout' returns the commit relation.Ludovic Courtès
* 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.
2020-05-25channels: 'latest-channel-instances' doesn't leak internal state.Ludovic Courtès
* guix/channels.scm (latest-channel-instances): Remove 'previous-channels' argument. Introduce 'loop' and use it.
2020-05-15channels: 'build-from-source' restores '%guile-for-build'.Ludovic Courtès
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.
2020-05-15channels: Move quirks and patches to (guix quirks).Ludovic Courtès
* 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.
2020-05-07channels: Add patch for <https://bugs.gnu.org/41028>.Ludovic Courtès
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.
2020-05-07channels: Add mechanism to patch checkouts of the 'guix channel.Ludovic Courtès
* 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'.
2020-05-07channels: Add 'latest-channel-instance'.Ludovic Courtès
* guix/channels.scm (latest-channel-instance): New procedure. (latest-channel-instances): Use it.
2020-04-26channels: Use a declarative profile.Ludovic Courtès
* guix/channels.scm (package-cache-file): Use 'profile' instead of 'profile-derivation'.
2020-04-06channels: Call 'build-self.scm' procedure with a trivial build handler.Ludovic Courtès
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'.
2020-01-09channels: Provide a hint when the 'guix' channel is lacking.Ludovic Courtès
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.
2019-10-27channels: Refer to 'guile-json-3'.Ludovic Courtès
Fixes a regression introduced in 84af1e74029fd4c43636f7d8d3e6f82ddab9ce82. * guix/channels.scm (whole-package-for-legacy): Refer to GUILE-JSON-3, not GUILE-JSON.
2019-10-02channels: Add quirk to build recent 'master' with Guile 2.2.4.Ludovic Courtès
Fixes <https://bugs.gnu.org/37506>. Reported by Marius Bakke <mbakke@fastmail.com>. * guix/channels.scm (syscalls-reexports-local-variables?) (guile-2.2.4, guile-for-source): New procedures. (%quirks): New variable. (build-from-source): Add calls to 'guile-for-source' and 'set-guile-for-build'.
2019-09-23channels: Allow news entries to refer to a tag.Ludovic Courtès
Suggested by Ricardo Wurmus <rekado@elephly.net>. * guix/channels.scm (<channel-news-entry>)[tag]: New field. (sexp->channel-news-entry): Accept either 'commit' or 'tag' in 'entry' forms. (resolve-channel-news-entry-tag): New procedure. (channel-news-for-commit): Move 'with-repository' form one level higher. Call 'resolve-channel-news-entry-tag' on all the news entries. * guix/tests/git.scm (populate-git-repository): Add clause for 'tag'. * tests/channels.scm ("channel-news, one entry"): Create a tag and add an entry with a tag. Check that the tag is resolved and also visible in the <channel-news-entry> record. * doc/guix.texi (Channels): Mention tags in news entries.
2019-09-23channels: Add support for a news file.Ludovic Courtès
* guix/channels.scm (<channel-metadata>)[news-file]: New field. (read-channel-metadata): Set the 'news-file' field. (read-channel-metadata-from-source): Likewise. (<channel-news>, <channel-news-entry>): New record types. (sexp->channel-news-entry, read-channel-news) (channel-news-for-commit): New procedures. * guix/tests/git.scm (populate-git-repository): For 'add', allow CONTENTS to be a procedure. * tests/channels.scm ("channel-news, no news") ("channel-news, one entry"): New tests. * doc/guix.texi (Channels): Document it.
2019-08-16channels: Add 'profile-channels'.Ludovic Courtès
* guix/channels.scm (profile-channels): New procedure. * guix/scripts/describe.scm (display-profile-info)[channels]: Define in terms of 'profile-channels'.
2019-07-19channels: Always provide a <channel-metadata> record.Ludovic Courtès
This simplifies the code since one no longer needs to think about whether '.guix-channel' was present. * guix/channels.scm (read-channel-metadata): Always pass a string as the first argument to 'channel-metadata'. (read-channel-metadata-from-source): Always return a <channel-metadata> record. (channel-instance-dependencies): Remove now unneeded 'match'. (standard-module-derivation): Assume DIRECTORY is never #f and contains a leading slash. * tests/channels.scm (channel-metadata-directory) (channel-metadata-dependencies): New procedures. ("channel-instance-metadata returns #f if .guix-channel does not exist"): Remove. ("channel-instance-metadata returns default if .guix-channel does not exist"): New test. (make-instance): Use 'write' instead of 'display' when creating '.guix-channel'. (instance--no-deps): Remove dependencies. (instance--sub-directory): New variable. ("channel-instance-metadata and default dependencies") ("channel-instance-metadata and directory"): New tests. ("latest-channel-instances excludes duplicate channel dependencies"): Expect 'channel-commit' to return a string and adjust accordingly.
2019-07-19channels: Remove unneeded 'version' field of <channel-metadata>.Ludovic Courtès
The idea is that 'read-channel-metadata' will take care of converting possibly older versions to the current data type. Thus, storing the version number is unnecessary. * guix/channels.scm (<channel-metadata>)[version]: Remove. (read-channel-metadata, channel-instance-dependencies): Adjust accordingly.
2019-07-19channels: Strictly check the version of '.guix-channel'.Ludovic Courtès
Until now the 'version' field in '.guix-channel' could be omitted, or it could be any value. * guix/channels.scm (read-channel-metadata): Rename to... (channel-instance-metadata): ... this. (channel-instance-dependencies): Adjust accordingly. (read-channel-metadata): New procedure. Use 'match' to require a 'version' field. Provide proper error handling when the channel sexp is malformed or when given an unsupported version number. (read-channel-metadata-from-source): Use 'catch' and 'system-error-errno' instead of 'file-exists?'. * tests/channels.scm (instance--unsupported-version): New variable. (read-channel-metadata): Rename to... (channel-instance-metadata): ... this. Rename tests accordingly. ("channel-instance-metadata rejects unsupported version"): New test.
2019-07-15channels: Avoid use of 'derivation-input-path'.Ludovic Courtès
* guix/channels.scm (old-style-guix?): Use 'derivation-name' rather than 'derivation-input-path'.
2019-07-14channels: Add optional directory to channel metadata.Jan Nieuwenhuizen
* guix/channels.scm (<channel-metadata>): Add directory slot. Update users. (read-channel-metadata-from-source): New function. (standard-module-derivation): Use it. * doc/guix.texi (Package Modules in a Subdirectory): New subsection.
2019-07-08channels: Key cached channel derivations by system.Ludovic Courtès
Previously, the channel instance to derivation mapping would be independent of the system. Thus, building the same channel instance for several different systems would always return the derivation that was first computed. This is a followup to c3ab921eed2a471022e9863a94ea521508782e53. * guix/channels.scm (channel-instance-derivations)[instance->derivation]: Pass the current system as a third argument to 'mcached'.
2019-07-06channels: Simplify 'channel-instances->manifest'.Ludovic Courtès
* guix/channels.scm (channel-instances->manifest)[instance->entry]: Change to take two arguments instead of a tuple. Turn into a non-monadic procedure. Call it via 'map' instead of 'mapm'.
2019-06-03deprecation: Use the 'warning' procedure for diagnostics.Ludovic Courtès
Until now, (guix deprecation) had its own warning mechanism, which was inconsistent (it did not use colors, etc.) * guix/deprecation.scm (deprecation-warning-port): Remove (source-properties->location-string): Remove. (warn-about-deprecation): Use 'warning' instead of 'format'. (define-deprecated, define-deprecated/alias): Adjust docstring. * guix/channels.scm (build-from-source): Refer to 'guix-warning-port' instead of 'deprecation-warning-port'.
2019-04-17pull: '--url', '--commit', and '--branch' apply to the 'guix' channel.Ludovic Courtès
Suggested by pkill9 <pkill9@runbox.com>. * guix/scripts/pull.scm (channel-list): Apply REF and URL to the 'guix' channel. * doc/guix.texi (Invoking guix pull): Adjust accordingly.
2019-03-08channels: Do not fail when the inferior lacks 'guix repl'.Ludovic Courtès
Fixes <https://bugs.gnu.org/34637>. Reported by Martin Flack <martin.flack@gmail.com>. Previously we'd fail to build the package cache for old versions of Guix that lack 'guix repl'. Now we simply ignore the issue and keep going without a cache. * guix/inferior.scm (gexp->derivation-in-inferior): Add #:silent-failure? and honor it. [drop-extra-keyword]: New procedure. Use it. * guix/channels.scm (package-cache-file): Pass #:silent-failure? #t.
2019-01-29channels: Do not offload package cache derivation.Ludovic Courtès
* guix/channels.scm (package-cache-file): Pass #:local-build? to 'gexp->derivation-in-inferior'.
2019-01-28channels: Turn off deprecation warnings when loading 'build-self.scm'.Ludovic Courtès
* guix/channels.scm (build-from-source): Parameterize DEPRECATION-WARNING-PORT when loading SCRIPT.
2019-01-20channels: Use 'fold2'.Ludovic Courtès
* guix/channels.scm (latest-channel-instances): Use 'fold2' instead of 'fold'.
2019-01-20channels: Gracefully report the lack of a 'guix' channel.Ludovic Courtès
* guix/channels.scm (channel-instance-derivations): Raise an '&message' condition when CORE-INSTANCE is #f.
2019-01-20channels: Build channel modules in an inferior.Ludovic Courtès
This ensures that channel modules are compiled with the right Guile, that they get to see the right modules, and so on. IOW, it avoids bugs such as those addressed by commits 3c0e16391ed9a3e3e4611b940fb393c5f2ecea63 and cb341c121919877ae6267a6460c0c17536d06eff. * guix/channels.scm (standard-module-derivation): Add 'core' parameter. Rewrite in terms of 'gexp->derivation-in-inferior'. (build-from-source): Add #:core parameter and pass it to 'standard-module-derivation'. (build-channel-instance): Add 'core' parameter and pass it on. (channel-instance-derivations)[dependencies]: Remove. Adjust 'build-channel-instance' call.
2019-01-20channels: Don't pull from the same channel more than once.Ludovic Courtès
Previous 'channel-instance->manifest' would call 'latest-channel-derivation', which could trigger another round of 'latest-repository-commit' for no good reason. * guix/channels.scm (resolve-dependencies): New procedure. (channel-instance-derivations)[edges]: New variable. [instance->derivation]: New procedure. * tests/channels.scm (make-instance): Use 'checkout->channel-instance' instead of 'channel-instance'. ("channel-instances->manifest"): New test.
2019-01-15channels: Compute a package cache and use it.Ludovic Courtès
* gnu/packages.scm (cache-is-authoritative?, load-package-cache) (cache-lookup, generate-package-cache): New procedures. (%package-cache-file): New variable. (find-packages-by-name): Rename to... (find-packages-by-name/direct): ... this. (find-packages-by-name): Rewrite to use the package cache when 'cache-is-authoritative?' returns true. * tests/packages.scm ("find-packages-by-name + version, with cache") ("find-packages-by-name with cache"): New tests. * guix/channels.scm (package-cache-file): New procedure. (%channel-profile-hooks): New variable. (channel-instances->derivation): Use it in #:hooks. * guix/scripts/package.scm (build-and-use-profile): Add #:hooks and honor it. * guix/scripts/pull.scm (build-and-install): Pass #:hooks to UPDATE-PROFILE.