unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: Vagrant Cascadian <vagrant@reproducible-builds.org>
Cc: Mathieu Othacehe <othacehe@gnu.org>, 44835@debbugs.gnu.org
Subject: bug#44835: gnu/ci.go: Embeds build path, breaking reproducible builds
Date: Thu, 26 Nov 2020 22:39:08 +0100	[thread overview]
Message-ID: <87blfj23yb.fsf@gnu.org> (raw)
In-Reply-To: <87r1ojgzdh.fsf@yucca> (Vagrant Cascadian's message of "Mon, 23 Nov 2020 20:19:54 -0800")

[-- Attachment #1: Type: text/plain, Size: 886 bytes --]

Hi!

Vagrant Cascadian <vagrant@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:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 520 bytes --]

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)

[-- Attachment #3: Type: text/plain, Size: 266 bytes --]


… 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’.

       reply	other threads:[~2020-11-26 21:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87r1ojgzdh.fsf@yucca>
2020-11-26 21:39 ` Ludovic Courtès [this message]
2020-12-01  9:41   ` bug#44835: gnu/ci.go: Embeds build path, breaking reproducible builds Mathieu Othacehe
2020-12-03 13:23     ` Ludovic Courtès
2024-03-07 21:46       ` Vagrant Cascadian

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87blfj23yb.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=44835@debbugs.gnu.org \
    --cc=othacehe@gnu.org \
    --cc=vagrant@reproducible-builds.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).