GNU bug report logs -
#44835
gnu/ci.go: Embeds build path, breaking reproducible builds
Previous Next
Full log
Message #11 received at 44835 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On 2020-11-26, Ludovic Courtès wrote:
> 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:
>
> 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)
>
> … 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.
This does resolve the reproducibility issues after some "quick" testing;
no idea if it breaks anything, though I didn't see any new test suite
failures (though my builds are patched to skip many tests)...
live well,
vagrant
[signature.asc (application/pgp-signature, inline)]
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.