GNU bug report logs

#68797 Channel dependencies should be propagated

PackageSource(s)Maintainer(s)
guix PTS Buildd Popcon
Reply or subscribe to this bug. View this bug as an mbox, status mbox, or maintainer mbox

Report forwarded to bug-guix@gnu.org:
bug#68797; Package guix. (Mon, 29 Jan 2024 15:02:02 GMT) (full text, mbox, link).


Acknowledgement sent to Ludovic Courtès <ludovic.courtes@inria.fr>:
New bug report received and forwarded. Copy sent to bug-guix@gnu.org. (Mon, 29 Jan 2024 15:02:02 GMT) (full text, mbox, link).


Message #5 received at submit@debbugs.gnu.org (full text, mbox, reply):

From: Ludovic Courtès <ludovic.courtes@inria.fr>
To: bug-guix@gnu.org
Subject: Channel dependencies should be propagated
Date: Mon, 29 Jan 2024 16:01:14 +0100
Hello!

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:

--8<---------------cut here---------------start------------->8---
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))
--8<---------------cut here---------------end--------------->8---

Here’s the script:

--8<---------------cut here---------------start------------->8---
#!/bin/sh

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))
EOF
cat > b/.guix-channel <<EOF
(channel
  (version 0)
  (dependencies
   (channel (name my-channel-a) (url "$PWD/a"))))
EOF
(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))
EOF
cat > c/.guix-channel <<EOF
(channel
  (version 0)
  (dependencies
   (channel (name my-channel-b) (url "$PWD/b"))))
EOF
(cd c; git init; git add .; git commit -m init)

cat > "channels.scm" <<EOF
(list (channel
        (name 'guix)
        (url "https://git.savannah.gnu.org/git/guix.git")
        (commit
          "65dc2d40cb113382fb98796f1d04099f28cab355")
        (introduction
          (make-channel-introduction
            "9edb3f66fd807b096b48283debdcddccfea34bad"
            (openpgp-fingerprint
              "BBB0 2DDF 2CEA F6A8 0D1D  E643 A2A0 6DF2 A33A 54FA"))))
      (channel
        (name 'my-channel-c)
        (url "$PWD/c")))
EOF

exec guix time-machine -C channels.scm -- describe
--8<---------------cut here---------------end--------------->8---

Ludo’.




Severity set to 'important' from 'normal' Request was from Ludovic Courtès <ludo@gnu.org> to control@debbugs.gnu.org. (Tue, 30 Jan 2024 17:18:01 GMT) (full text, mbox, link).


Information forwarded to bug-guix@gnu.org:
bug#68797; Package guix. (Fri, 28 Jun 2024 06:38:02 GMT) (full text, mbox, link).


Message #10 received at 68797@debbugs.gnu.org (full text, mbox, reply):

From: Richard Sent <richard@freakingpenguin.com>
To: 68797@debbugs.gnu.org
Subject: Relevant code
Date: Fri, 28 Jun 2024 00:29:53 -0400
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.




Send a report that this bug log contains spam.


debbugs.gnu.org maintainers <help-debbugs@gnu.org>. Last modified: Sun Sep 8 03:29:24 2024; Machine Name: wallace-server

GNU bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.