From 030f1367f055720034cb178e50fd5d4c6ff371b1 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 5 Sep 2018 10:35:43 +0200 Subject: channels: Add 'latest-channel-derivation' convenience procedure. * guix/channels.scm (latest-channel-derivations): Remove. (latest-channel-instances*, latest-channel-derivation): New procedures. --- guix/channels.scm | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'guix/channels.scm') diff --git a/guix/channels.scm b/guix/channels.scm index ec3e05eaf5..794383fe22 100644 --- a/guix/channels.scm +++ b/guix/channels.scm @@ -48,7 +48,7 @@ latest-channel-instances channel-instance-derivations - latest-channel-derivations + latest-channel-derivation channel-instances->manifest)) ;;; Commentary: @@ -216,14 +216,6 @@ INSTANCES." (list core)))) instances))) -(define latest-channel-derivations - (let ((latest-channel-instances (store-lift latest-channel-instances))) - (lambda (channels) - "Return, as a monadic value, the list of derivations for the latest -instances of CHANNELS." - (mlet %store-monad ((instances (latest-channel-instances channels))) - (channel-instance-derivations instances))))) - (define (whole-package-for-legacy name modules) "Return a full-blown Guix package for MODULES, a derivation that builds Guix modules in the old ~/.config/guix/latest style." @@ -290,3 +282,14 @@ channel instances." (entries (mapm %store-monad instance->entry (zip instances derivations)))) (return (manifest entries)))) + +(define latest-channel-instances* + (store-lift latest-channel-instances)) + +(define* (latest-channel-derivation #:optional (channels %default-channels)) + "Return as a monadic value the derivation that builds the profile for the +latest instances of CHANNELS." + (mlet* %store-monad ((instances ((store-lift latest-channel-instances) + channels)) + (manifest (channel-instances->manifest instances))) + (profile-derivation manifest))) -- cgit v1.2.3 From cb341c121919877ae6267a6460c0c17536d06eff Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 5 Sep 2018 22:42:16 +0200 Subject: channels: Fix external channel builds. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes a regression introduced in ca719424455465fca4b872c371daf2a46de88b33 whereby external channels would fail to build due to the lack of (gcrypt …) modules. * guix/channels.scm (channel-instance-derivations): Add 'guile-gcrypt'. Pass it along CORE to 'build-channel-instance'. --- guix/channels.scm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'guix/channels.scm') diff --git a/guix/channels.scm b/guix/channels.scm index 794383fe22..ebae7489f4 100644 --- a/guix/channels.scm +++ b/guix/channels.scm @@ -207,13 +207,18 @@ INSTANCES." (guix-channel? (channel-instance-channel instance))) instances)) + ;; Guile-Gcrypt is a dependency of CORE-INSTANCE. + (define guile-gcrypt + (module-ref (resolve-interface '(gnu packages gnupg)) + 'guile-gcrypt)) + (mlet %store-monad ((core (build-channel-instance core-instance))) (mapm %store-monad (lambda (instance) (if (eq? instance core-instance) (return core) (build-channel-instance instance - (list core)))) + (list core guile-gcrypt)))) instances))) (define (whole-package-for-legacy name modules) -- cgit v1.2.3 From 37a6cdbf1b3503d3e60840a176318284b1f7ca25 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 5 Sep 2018 23:31:51 +0200 Subject: git: Don't require users to specifiy "origin/" for branches. Fixes . Reported by Eric Brown . * guix/git.scm (update-cached-checkout): Remove "origin/" from default REF. Define CANONICAL-REF and use it instead of REF. (latest-repository-commit): Remove "origin/" from default REF. * guix/channels.scm (%default-channels): Remove "origin/" from 'branch'. --- guix/channels.scm | 2 +- guix/git.scm | 17 ++++++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) (limited to 'guix/channels.scm') diff --git a/guix/channels.scm b/guix/channels.scm index ebae7489f4..cf833db8b9 100644 --- a/guix/channels.scm +++ b/guix/channels.scm @@ -78,7 +78,7 @@ ;; Default list of channels. (list (channel (name 'guix) - (branch "origin/master") + (branch "master") (url "https://git.savannah.gnu.org/git/guix.git")))) (define (guix-channel? channel) diff --git a/guix/git.scm b/guix/git.scm index c577eba5ee..3d0eb93d9b 100644 --- a/guix/git.scm +++ b/guix/git.scm @@ -112,7 +112,7 @@ OID (roughly the commit hash) corresponding to REF." (define* (update-cached-checkout url #:key - (ref '(branch . "origin/master")) + (ref '(branch . "master")) (cache-directory (url-cache-directory url (%repository-cache-directory)))) @@ -122,6 +122,17 @@ to REF. REF is pair whose key is [branch | commit | tag] and value the associated data, respectively [ | | ]." + (define canonical-ref + ;; We used to require callers to specify "origin/" for each branch, which + ;; made little sense since the cache should be transparent to them. So + ;; here we append "origin/" if it's missing and otherwise keep it. + (match ref + (('branch . branch) + `(branch . ,(if (string-prefix? "origin/" branch) + branch + (string-append "origin/" branch)))) + (_ ref))) + (with-libgit2 (let* ((cache-exists? (openable-repository? cache-directory)) (repository (if cache-exists? @@ -130,7 +141,7 @@ data, respectively [ | | ]." ;; Only fetch remote if it has not been cloned just before. (when cache-exists? (remote-fetch (remote-lookup repository "origin"))) - (let ((oid (switch-to-ref repository ref))) + (let ((oid (switch-to-ref repository canonical-ref))) ;; Reclaim file descriptors and memory mappings associated with ;; REPOSITORY as soon as possible. @@ -144,7 +155,7 @@ data, respectively [ | | ]." #:key (cache-directory (%repository-cache-directory)) - (ref '(branch . "origin/master"))) + (ref '(branch . "master"))) "Return two values: the content of the git repository at URL copied into a store directory and the sha1 of the top level commit in this directory. The reference to be checkout, once the repository is fetched, is specified by REF. -- cgit v1.2.3