Hi Philipp,

"Phillip Davis" <[email protected]> skribis:

> Our projects are built against an older commit of guix. But I had
> trouble building the system containers against that older commit. So,
> every package that the system containers know about is in '/packages/*'
> relative to the monorepo root. But those packages use a kind of
> disgusting hack to load their `guix.scm` from '/submodule/guix.scm',
> `inferior-eval` that package, then expose that to the 'superior' guix as
> a regular package. The point is -- these packages depend on the content
> of submodules being present in a certain directory relative to their
> source. This is also for ease of development.

Interesting setup.

> Now, I want to publish the monorepo's '/packages' directory as a
> channel for the purposes of a substitute server. As far as I can tell,
> there is no way to make a channel load submodules. Is there a way to get
> the same effect, is there any interest in a PR making such a thing
> possible, or should I be thinking about some completely different third
> thing?

I think this would be a one-line change:

diff --git a/guix/channels.scm b/guix/channels.scm
index ac9303c5fa0..26f8a04b146 100644
--- a/guix/channels.scm
+++ b/guix/channels.scm
@@ -429,6 +429,7 @@ (define* (latest-channel-instance store channel
   (let ((channel (ensure-default-introduction channel))
         (checkout commit relation
                   (update-cached-checkout (channel-url channel)
+                                          #:recursive? #t
                                           #:ref (channel-reference channel)
                                           #:starting-commit starting-commit
                                           #:verify-certificate? verify-certificate?)))
However, this would have rather tricky implications: using
‘time-machine’ from an older Guix would fail to fetch submodules, and
using ‘time-machine’ would get them.  This is a problem because it would
silently break a pretty fundamental reproducibility property.

I’m not sure how to add this functionality without having this
undesirable side effect.

As a first step, we could detect the presence of ‘.gitmodules’ and emit
a warning… but that wouldn’t solve the problem.

Thoughts?

Ludo’.

Reply via email to