GNU bug report logs - #59073
[PATCH] gnu: r-minimal: Avoid referencing /gnu/store/[^-]+-glibc-[^-]+-static.

Previous Next

Package: guix-patches;

Reported by: Christopher Baines <mail <at> cbaines.net>

Date: Sun, 6 Nov 2022 09:07:01 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #26 received at 59073 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Christopher Baines <mail <at> cbaines.net>
Cc: 59073 <at> debbugs.gnu.org
Subject: Re: bug#59073: [PATCH] gnu: r-minimal: Avoid referencing
 /gnu/store/[^-]+-glibc-[^-]+-static.
Date: Tue, 08 Nov 2022 14:09:55 +0100
Hi,

Christopher Baines <mail <at> cbaines.net> skribis:

>   → guix build --target=aarch64-linux-gnu r-minimal
>   guix build: error: path ‘/gnu/store/[^-]+-glibc-[^-]+-static’ is not valid

Interesting bug!

I pushed a fix and explanation:

--8<---------------cut here---------------start------------->8---
commit 3bd4b92f55f40119349e39902a9b800de98040d2

    build-system/gnu: Turn #:phases into a gexp when cross-compiling.
    
    Previously, we'd get this error:
    
      $ guix build --target=aarch64-linux-gnu r-minimal -d --no-grafts
      guix build: error: path ‘/gnu/store/[^-]+-glibc-[^-]+-static’ is not valid
    
    This is because the sexp would be passed as an input of the surrounding
    gexp in 'gnu-cross-build', and thus
    "/gnu/store/[^-]+-glibc-[^-]+-static" would be interpreted as a source
    file name, as in this example:
    
      scheme@(guix gexp)> #~(foo #$(list 'whatever "/gnu/store/[^-]+-glibc-[^-]+-static"))
      $11 = #<gexp (foo #<gexp-input (whatever "/gnu/store/[^-]+-glibc-[^-]+-static"):out>) 7f098badec30>
      scheme@(guix gexp)> (gexp-inputs $11)
      $12 = (#<gexp-input "/gnu/store/[^-]+-glibc-[^-]+-static":out>)
    
    Fixes <https://issues.guix.gnu.org/59073>.
    Reported by Christopher Baines <mail <at> cbaines.net>.
    
    * guix/build-system/gnu.scm (gnu-cross-build): When PHASES is a pair,
    pass it through 'sexp->gexp'.
--8<---------------cut here---------------end--------------->8---

That said, this code is bogus:

  1. We should refrain from using non-literal strings as patterns in
     ‘substitute*’.

  2. We should call ‘%store-directory’ from (guix build utils) instead
     of hardcoding “/gnu/store”.

Both of these should be fixed at some point.

Thanks,
Ludo’.




This bug report was last modified 2 years and 250 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.