[PATCH] gnu: r-minimal: Avoid referencing /gnu/store/[^-]+-glibc-[^-]+-static.

  • Done
  • quality assurance status badge
Details
3 participants
  • Ludovic Courtès
  • Christopher Baines
  • zimoun
Owner
unassigned
Submitted by
Christopher Baines
Severity
normal
C
C
Christopher Baines wrote on 6 Nov 2022 10:05
(address . guix-patches@gnu.org)
20221106090558.24507-1-mail@cbaines.net
As this causes the following error when computing a cross-compilation
derivation for r-minimal and related packages.

I think this is coming from the string appearing in the sources section of the
derivation, but not being a valid store path.

* gnu/packages/statistics.scm (r-minimal)[arguments]: Split string involving
/gnu/store.
---
gnu/packages/statistics.scm | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

Toggle diff (19 lines)
diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm
index 2d4dbe4a31..43988ad00e 100644
--- a/gnu/packages/statistics.scm
+++ b/gnu/packages/statistics.scm
@@ -470,7 +470,11 @@ (define-public r-minimal
"util-macros"
"graphite2"))
"|"
- "/gnu/store/[^-]+-glibc-[^-]+-static"
+ ;; Be careful when including store paths in the
+ ;; build script, since they might be treated as
+ ;; references
+ "/gnu/store"
+ "/[^-]+-glibc-[^-]+-static"
")/lib")) ""))))))))))))
(define-public rmath-standalone
--
2.37.3
Z
Z
zimoun wrote on 7 Nov 2022 10:27
(name . Ricardo Wurmus)(address . rekado@elephly.net)
87a6539ks9.fsf@gmail.com
Hi,

On dim., 06 nov. 2022 at 10:05, Christopher Baines <mail@cbaines.net> wrote:

Toggle quote (3 lines)
> * gnu/packages/statistics.scm (r-minimal)[arguments]: Split string involving
> /gnu/store.

It would imply rebuild many packages, no? master, staging or
core-updates?

Toggle quote (20 lines)
> ---
> gnu/packages/statistics.scm | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm
> index 2d4dbe4a31..43988ad00e 100644
> --- a/gnu/packages/statistics.scm
> +++ b/gnu/packages/statistics.scm
> @@ -470,7 +470,11 @@ (define-public r-minimal
> "util-macros"
> "graphite2"))
> "|"
> - "/gnu/store/[^-]+-glibc-[^-]+-static"
> + ;; Be careful when including store paths in the
> + ;; build script, since they might be treated as
> + ;; references
> + "/gnu/store"
> + "/[^-]+-glibc-[^-]+-static"
> ")/lib")) ""))))))))))))

LGTM.


Cheers,
simon
C
C
Christopher Baines wrote on 7 Nov 2022 10:32
(address . 59073@debbugs.gnu.org)
87bkpjf6s3.fsf@cbaines.net
zimoun <zimon.toutoune@gmail.com> writes:

Toggle quote (10 lines)
> Hi,
>
> On dim., 06 nov. 2022 at 10:05, Christopher Baines <mail@cbaines.net> wrote:
>
>> * gnu/packages/statistics.scm (r-minimal)[arguments]: Split string involving
>> /gnu/store.
>
> It would imply rebuild many packages, no? master, staging or
> core-updates?

It does, my plan was/is to ask Ricardo if he could maybe include it when
pushing the next big batch of r related changes?

Chris
-----BEGIN PGP SIGNATURE-----

iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAmNo0OxfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh
aW5lcy5uZXQACgkQXiijOwuE9Xdy+RAAmg4VekyybLrxeUkEhLXQlgyJbbyPeyNW
wd/lIBqMyv6GuTLUc9EadiXYiTMFnLEr1mHo5NpNFC5BopLuNH1RcX2b1bDx853Y
rG9D7RZ2Y/G69HLUVW75bcqUGmALe0uiV9GVqKTURTt30G+OW6txexyE6UaWji6j
UzMVz04bDA1H3kVjP1rpBH8znGD8TURuPFSdKdHMjbItoOD9zYdkL5mrE0VCEDGs
3XPrBODws/gvLMs8Cwq/YfoHJjmb7sLhUlJ2A5ikOit5kK80koISM2ejglHfqsls
rPb57YOlogQTy5gOAmKWXQPHYMwt8BCLxm6akl13qk/ZTw9i96mOomnc17NrMFRF
kZjSctDJpgsNKnQOe3fkYEGNLO8iSomqPB6PLPzPp5JJ2mjSXtaJw3uVaBIjIfnJ
z2ffg+TzAxy1EdZXYRf+1fE+M+N5M9kxXvk7LPwQ5PqgKonntNd/A3Tcc5dtED81
NcanZE+Ut/diBZW+X7KvYGeRy3UTvAjmiuWCuEpOZ4KGJuKrI34CQ/LhdVwOjU77
LaWAJGGSaG/WONgiE1FRAQCxjSK3Cc1Bm29ryCIXwKLs2ytP26kGpPbCfpxTvGZZ
aMFsdkYm/QfX8/LzujBOpS5E4Rh31S26+WxThNHmNt5T82+wvQfrUFFKQp80asrT
dCDvmtathKI=
=uBvg
-----END PGP SIGNATURE-----

L
L
Ludovic Courtès wrote on 7 Nov 2022 22:36
Re: bug#59073: [PATCH] gnu: r-minimal: Avoid referencing /gnu/store/[^-]+-glibc-[^-]+-static.
(name . Christopher Baines)(address . mail@cbaines.net)(address . 59073@debbugs.gnu.org)
87mt92sazd.fsf@gnu.org
Christopher Baines <mail@cbaines.net> skribis:

Toggle quote (3 lines)
> As this causes the following error when computing a cross-compilation
> derivation for r-minimal and related packages.

Which error? :-)

Ludo’.
Z
Z
zimoun wrote on 7 Nov 2022 15:10
Re: [bug#59073] [PATCH] gnu: r-minimal: Avoid referencing /gnu/store/[^-]+-glibc-[^-]+-static.
(address . 59073@debbugs.gnu.org)
871qqeam8q.fsf@gmail.com
Hi Chris,

On lun., 07 nov. 2022 at 10:32, Christopher Baines <mail@cbaines.net> wrote:

Toggle quote (3 lines)
> It does, my plan was/is to ask Ricardo if he could maybe include it when
> pushing the next big batch of r related changes?

I am preparing a Bioconductor upgrade, so it could be part of it.
Ricardo, WDYT?


Cheers,
simon
C
C
Christopher Baines wrote on 8 Nov 2022 08:13
Re: bug#59073: [PATCH] gnu: r-minimal: Avoid referencing /gnu/store/[^-]+-glibc-[^-]+-static.
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 59073@debbugs.gnu.org)
875yfpor0s.fsf@cbaines.net
Ludovic Courtès <ludo@gnu.org> writes:

Toggle quote (7 lines)
> Christopher Baines <mail@cbaines.net> skribis:
>
>> As this causes the following error when computing a cross-compilation
>> derivation for r-minimal and related packages.
>
> Which error? :-)

Good spot, I've updated the patch/commit message.

But it's this:

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

I'm not sure why this seems to only affect cross derivations. It's not
the only problem that's happened for cross derivations though, so it
might be good to expand the linting to cover them (maybe even for just
one common target like aarch64-linux-gnu).

Thanks,

Chris
-----BEGIN PGP SIGNATURE-----

iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAmNqAjNfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh
aW5lcy5uZXQACgkQXiijOwuE9XcTgQ//TtCIJybX9cC9Hm0JuslW/yOZ8WSXgvt5
YGvI7OFn+UhP15u1qxZWW5rk5/GuoWxS4StUOoeFlKKS9QrWs8eT0ObwQWrgb/ay
JSyJw3C33hjWJwGQmequG6u+gtqpDrkGmf3AJjCr3O6dy4UUvZj2n21FxEYvKOYM
MIhME5vb1NkOL6IWrVH0PmcDUuOZrQjvztGRcrOYuut15dgRJLR847HsPQVq37Is
ti4h6veidQcnp2I0BaCliOk/L5nlhb2YncXt4zlxqL4ASb3Sgg14YoAaT8psOHaW
wxCDo6DWju5Sys/Au6S4RuqSFTxyhq/zp8xlGYxILhax8jPR2h/kQAzphggDyrXb
2cKGm2kM9OsNypOg8o7v8DAr4JqtckMJhts/f4ICeNDT5/NJnlH76DtONwfy/iTH
PHGvXicr0Kp0pARa9JUEDT1NZtSTV/VJgM2d9Ozs6LrjFD7+zZNJ1kfjP3B6GlrB
isWGcfg+lblXRCWOS9nakm1/Jr6uOISPAZYcAbuB3MLam/t5jov3cwjtkD9rRQaw
AO0O3HnPh6KXcbl7pCNSbkyHtg493vrYq7lr3QmDgcKL5HEd5+ylPBFhxJp5LgAM
KOELQsoRUGgXvo31pg3I/ebrZJ2r6e8f2bpv6weSG5rjCwj9Gk2BFbtNItpTWY9q
JGaPft9x660=
=L3tj
-----END PGP SIGNATURE-----

C
C
Christopher Baines wrote on 8 Nov 2022 08:13
[PATCH v2] gnu: r-minimal: Avoid referencing /gnu/store/[^-]+-glibc-[^-]+-static.
(address . 59073@debbugs.gnu.org)
20221108071318.21580-1-mail@cbaines.net
As this causes the following error when computing a cross-compilation
derivation for r-minimal and related packages:

guix build: error: path ‘/gnu/store/[^-]+-glibc-[^-]+-static’ is not valid

I think this is coming from the string appearing in the builder and thus the
sources section of the derivation, but not being a valid store path.

* gnu/packages/statistics.scm (r-minimal)[arguments]: Split string involving
/gnu/store.
---
gnu/packages/statistics.scm | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

Toggle diff (19 lines)
diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm
index 2d4dbe4a31..43988ad00e 100644
--- a/gnu/packages/statistics.scm
+++ b/gnu/packages/statistics.scm
@@ -470,7 +470,11 @@ (define-public r-minimal
"util-macros"
"graphite2"))
"|"
- "/gnu/store/[^-]+-glibc-[^-]+-static"
+ ;; Be careful when including store paths in the
+ ;; build script, since they might be treated as
+ ;; references
+ "/gnu/store"
+ "/[^-]+-glibc-[^-]+-static"
")/lib")) ""))))))))))))
(define-public rmath-standalone
--
2.37.3
L
L
Ludovic Courtès wrote on 8 Nov 2022 14:09
Re: bug#59073: [PATCH] gnu: r-minimal: Avoid referencing /gnu/store/[^-]+-glibc-[^-]+-static.
(name . Christopher Baines)(address . mail@cbaines.net)(address . 59073@debbugs.gnu.org)
87fsetpp7g.fsf@gnu.org
Hi,

Christopher Baines <mail@cbaines.net> skribis:

Toggle quote (3 lines)
> → 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:

Toggle snippet (26 lines)
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@cbaines.net>.
* guix/build-system/gnu.scm (gnu-cross-build): When PHASES is a pair,
pass it through 'sexp->gexp'.

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’.
L
L
Ludovic Courtès wrote on 8 Nov 2022 14:10
control message for bug #59073
(address . control@debbugs.gnu.org)
87edudpp6p.fsf@gnu.org
close 59073
quit
Z
Z
zimoun wrote on 8 Nov 2022 22:32
Re: [bug#59073] [PATCH] gnu: r-minimal: Avoid referencing /gnu/store/[^-]+-glibc-[^-]+-static.
(address . 59073@debbugs.gnu.org)
86k045t9md.fsf@gmail.com
Hi,

On Tue, 08 Nov 2022 at 14:09, Ludovic Courtès <ludo@gnu.org> wrote:

Toggle quote (4 lines)
> Interesting bug!
>
> I pushed a fix and explanation:

Oh! :-)

Toggle quote (5 lines)
> That said, this code is bogus:
>
> 1. We should refrain from using non-literal strings as patterns in
> ‘substitute*’.

What does it mean “non-literal string” here?


Cheers,
simon
L
L
Ludovic Courtès wrote on 10 Nov 2022 15:07
(name . zimoun)(address . zimon.toutoune@gmail.com)
87bkpej428.fsf@gnu.org
Hi,

zimoun <zimon.toutoune@gmail.com> skribis:

Toggle quote (7 lines)
>> That said, this code is bogus:
>>
>> 1. We should refrain from using non-literal strings as patterns in
>> ‘substitute*’.
>
> What does it mean “non-literal string” here?

A string that is not a literal (or constant, if you prefer).

This is OK:

(substitute* f
((".*") …))

This is not:

(substitute* f
(((string-append "." (star))) …))

Ludo’.
Z
Z
zimoun wrote on 10 Nov 2022 15:40
(name . Ludovic Courtès)(address . ludo@gnu.org)
87sfiq98kp.fsf@gmail.com
Hi,

On jeu., 10 nov. 2022 at 15:07, Ludovic Courtès <ludo@gnu.org> wrote:

Toggle quote (12 lines)
> A string that is not a literal (or constant, if you prefer).
>
> This is OK:
>
> (substitute* f
> ((".*") …))
>
> This is not:
>
> (substitute* f
> (((string-append "." (star))) …))

Thanks for explaining.

Cheers,
simon
?