Channel dependencies should be propagated

  • Open
  • quality assurance status badge
3 participants
  • Ludovic Courtès
  • Ludovic Courtès
  • Richard Sent
Submitted by
Ludovic Courtès

Debbugs page

Ludovic Courtès wrote on 29 Jan 07:01 -0800
(address .

With channels flourishing, we found a bug that’s always been there.

When channel C depends on B, which depends on A, in general you need
both A and B to be present in the build environment of C (the derivation
that compiles C when you run ‘pull’ or ‘time-machine’) because
potentially B is going to load modules from A.

However, currently only B is present in C’s environment.

To illustrate that, the script below creates three such channels.
Right now it fails like this:

Toggle snippet (11 lines)
building /gnu/store/2pnfkl9l6lsndsgk4qg7rq4wjh2iisj0-my-channel-c.drv...
|builder for `/gnu/store/2pnfkl9l6lsndsgk4qg7rq4wjh2iisj0-my-channel-c.drv' failed to produce output path `/gnu/store/lix9sz9g2x2ixr3dsyrbnxhxfcqn41l7-my-channel-c'
build of /gnu/store/2pnfkl9l6lsndsgk4qg7rq4wjh2iisj0-my-channel-c.drv failed
View build log at '/var/log/guix/drvs/2p/nfkl9l6lsndsgk4qg7rq4wjh2iisj0-my-channel-c.drv.gz'.
cannot build derivation `/gnu/store/alh2yy1258206zki24z9nzi1zwrggd4d-profile.drv': 1 dependencies couldn't be built
guix time-machine: error: build of `/gnu/store/alh2yy1258206zki24z9nzi1zwrggd4d-profile.drv' failed
$ zcat /var/log/guix/drvs/2p/nfkl9l6lsndsgk4qg7rq4wjh2iisj0-my-channel-c.drv.gz
(repl-version 0 1 1)
(exception misc-error (value #f) (value "no code for module ~S") (value ((my-channel-a))) (value #f))

Here’s the script:

Toggle snippet (53 lines)

set -ex

mkdir a
echo '(define-module (my-channel-a))' > a/my-channel-a.scm
(cd a; git init; git add .; git commit -m init)

mkdir b
cat > b/my-channel-b.scm <<EOF
(define-module (my-channel-b)
#:use-module (my-channel-a))
cat > b/.guix-channel <<EOF
(version 0)
(channel (name my-channel-a) (url "$PWD/a"))))
(cd b; git init; git add .; git commit -m init)

mkdir c
cat > c/my-channel-c.scm <<EOF
(define-module (my-channel-c)
#:use-module (my-channel-b))
cat > c/.guix-channel <<EOF
(version 0)
(channel (name my-channel-b) (url "$PWD/b"))))
(cd c; git init; git add .; git commit -m init)

cat > "channels.scm" <<EOF
(list (channel
(name 'guix)
(url "")
"BBB0 2DDF 2CEA F6A8 0D1D E643 A2A0 6DF2 A33A 54FA"))))
(name 'my-channel-c)
(url "$PWD/c")))

exec guix time-machine -C channels.scm -- describe

Ludovic Courtès wrote on 30 Jan 09:17 -0800
control message for bug #68797
(address .
severity 68797 important
Richard Sent wrote on 27 Jun 21:29 -0700
Relevant code
(address .
For whoever takes this on, I believe the relevant code is
resolve-dependencies in (guix channels). Note that resolve-dependencies
operates on <channel-instance> records, not <channel>.

I came up with something earlier that handled one level of searching in
the dependency graph, but between the awkwardness of converting between
<channel-instance> to <channel-metadata> to <channel> to
<channel-instance> and the unfamiliar VHash structure, couldn't quite
iron it out to handle arbitrary depths. Unfortunately that code is lost,
but I'll give it another try sometime if no one else gets to this first.

Take it easy,
Richard Sent
Making my computer weirder one commit at a time.
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to

To respond to this issue using the mumi CLI, first switch to it
mumi current 68797
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch