GNU bug report logs -
#36777
Guix Inferiors: Curious incorrect derivation output bug
Previous Next
Reported by: Carl Dong <contact <at> carldong.me>
Date: Wed, 24 Jul 2019 01:10:01 UTC
Severity: important
Done: Ludovic Courtès <ludo <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #17 received at 36777 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Ludovic Courtès <ludo <at> gnu.org> skribis:
> For future reference, the bisect output is:
>
> # first bad commit: [5cf4b26d52bcea382d98fb4becce89be9ee37b55] derivations: <derivation-input> now aggregates a <derivation>.
Does the patch below have any effect?
My understanding is that it shouldn’t have any effect (because inputs
have already been coalesced at that point), but that’s one place where
5cf4b26d52bcea382d98fb4becce89be9ee37b55 introduced a difference.
Thanks in advance,
Ludo’.
[Message part 2 (text/x-patch, inline)]
diff --git a/guix/derivations.scm b/guix/derivations.scm
index 92d50503ce..eb94fea55e 100644
--- a/guix/derivations.scm
+++ b/guix/derivations.scm
@@ -239,12 +239,17 @@ the store."
"Return a list of inputs, such that when INPUTS contains the same DRV twice,
they are coalesced, with their sub-derivations merged. This is needed because
Nix itself keeps only one of them."
+ (define (derivation-file-name* obj)
+ (if (derivation? obj)
+ (derivation-file-name obj)
+ obj))
+
(fold (lambda (input result)
(match input
- (($ <derivation-input> (= derivation-file-name path) sub-drvs)
+ (($ <derivation-input> (= derivation-file-name* path) sub-drvs)
;; XXX: quadratic
(match (find (match-lambda
- (($ <derivation-input> (= derivation-file-name p)
+ (($ <derivation-input> (= derivation-file-name* p)
s)
(string=? p path)))
result)
@@ -685,7 +690,7 @@ name of each input with that input's hash."
(make-derivation-input hash sub-drvs))))
inputs)))
(make-derivation outputs
- (sort inputs
+ (sort (coalesce-duplicate-inputs inputs)
(lambda (drv1 drv2)
(string<? (derivation-input-derivation drv1)
(derivation-input-derivation drv2))))
This bug report was last modified 5 years and 362 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.