GNU bug report logs -
#44835
gnu/ci.go: Embeds build path, breaking reproducible builds
Previous Next
Full log
Message #8 received at 44835 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Hi!
Vagrant Cascadian <vagrant <at> reproducible-builds.org> skribis:
> My *wild* guess is it maybe has something to do with the use of
> canonicalize-path:
>
> (define (find-current-checkout arguments)
> "Find the first checkout of ARGUMENTS that provided the current file.
> Return #f if no such checkout is found."
> (let ((current-root
> (canonicalize-path
> (string-append (dirname (current-filename)) "/.."))))
> (find (lambda (argument)
> (and=> (assq-ref argument 'file-name)
> (lambda (name)
> (string=? name current-root)))) arguments)))
‘canonicalize-path’ is called at run time, so that’s fine. However,
‘current-filename’ is a macro that captures the source file name at
build time, so it’s the likely culprit here.
I was going to go with something like:
[Message part 2 (text/x-patch, inline)]
diff --git a/gnu/ci.scm b/gnu/ci.scm
index 5548d9560e..0bacfbe025 100644
--- a/gnu/ci.scm
+++ b/gnu/ci.scm
@@ -488,7 +488,8 @@ valid."
Return #f if no such checkout is found."
(let ((current-root
(canonicalize-path
- (string-append (dirname (current-filename)) "/.."))))
+ (string-append (dirname (search-path %load-path "gnu/ci.scm"))
+ "/.."))))
(find (lambda (argument)
(and=> (assq-ref argument 'file-name)
(lambda (name)
[Message part 3 (text/plain, inline)]
… but I don’t think we can assume that the checkout is in the
‘%load-path’ when this code is executed. WDYT, Mathieu?
Looking at f71b0a0012d46bd30ead1a14ed58fd59647415e2, which introduced
this, there might be other options too.
Thanks,
Ludo’.
This bug report was last modified 1 year and 73 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.