unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#59073] [PATCH] gnu: r-minimal: Avoid referencing /gnu/store/[^-]+-glibc-[^-]+-static.
@ 2022-11-06  9:05 Christopher Baines
  2022-11-07  9:27 ` zimoun
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Christopher Baines @ 2022-11-06  9:05 UTC (permalink / raw)
  To: 59073

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(-)

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





^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [bug#59073] [PATCH] gnu: r-minimal: Avoid referencing /gnu/store/[^-]+-glibc-[^-]+-static.
  2022-11-06  9:05 [bug#59073] [PATCH] gnu: r-minimal: Avoid referencing /gnu/store/[^-]+-glibc-[^-]+-static Christopher Baines
@ 2022-11-07  9:27 ` zimoun
  2022-11-07  9:32   ` Christopher Baines
  2022-11-07 21:36 ` Ludovic Courtès
  2022-11-08  7:13 ` [bug#59073] [PATCH v2] " Christopher Baines
  2 siblings, 1 reply; 11+ messages in thread
From: zimoun @ 2022-11-07  9:27 UTC (permalink / raw)
  To: Christopher Baines, 59073; +Cc: Ricardo Wurmus

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?

> ---
>  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





^ permalink raw reply	[flat|nested] 11+ messages in thread

* [bug#59073] [PATCH] gnu: r-minimal: Avoid referencing /gnu/store/[^-]+-glibc-[^-]+-static.
  2022-11-07  9:27 ` zimoun
@ 2022-11-07  9:32   ` Christopher Baines
  2022-11-07 14:10     ` zimoun
  0 siblings, 1 reply; 11+ messages in thread
From: Christopher Baines @ 2022-11-07  9:32 UTC (permalink / raw)
  To: zimoun, Ricardo Wurmus; +Cc: 59073

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


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

> 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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 987 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [bug#59073] [PATCH] gnu: r-minimal: Avoid referencing /gnu/store/[^-]+-glibc-[^-]+-static.
  2022-11-07  9:32   ` Christopher Baines
@ 2022-11-07 14:10     ` zimoun
  0 siblings, 0 replies; 11+ messages in thread
From: zimoun @ 2022-11-07 14:10 UTC (permalink / raw)
  To: Christopher Baines, Ricardo Wurmus; +Cc: 59073

Hi Chris,

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

> 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




^ permalink raw reply	[flat|nested] 11+ messages in thread

* [bug#59073] [PATCH] gnu: r-minimal: Avoid referencing /gnu/store/[^-]+-glibc-[^-]+-static.
  2022-11-06  9:05 [bug#59073] [PATCH] gnu: r-minimal: Avoid referencing /gnu/store/[^-]+-glibc-[^-]+-static Christopher Baines
  2022-11-07  9:27 ` zimoun
@ 2022-11-07 21:36 ` Ludovic Courtès
  2022-11-08  7:13   ` Christopher Baines
  2022-11-08  7:13 ` [bug#59073] [PATCH v2] " Christopher Baines
  2 siblings, 1 reply; 11+ messages in thread
From: Ludovic Courtès @ 2022-11-07 21:36 UTC (permalink / raw)
  To: Christopher Baines; +Cc: 59073

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?  :-)

Ludo’.




^ permalink raw reply	[flat|nested] 11+ messages in thread

* [bug#59073] [PATCH v2] gnu: r-minimal: Avoid referencing /gnu/store/[^-]+-glibc-[^-]+-static.
  2022-11-06  9:05 [bug#59073] [PATCH] gnu: r-minimal: Avoid referencing /gnu/store/[^-]+-glibc-[^-]+-static Christopher Baines
  2022-11-07  9:27 ` zimoun
  2022-11-07 21:36 ` Ludovic Courtès
@ 2022-11-08  7:13 ` Christopher Baines
  2 siblings, 0 replies; 11+ messages in thread
From: Christopher Baines @ 2022-11-08  7:13 UTC (permalink / raw)
  To: 59073

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(-)

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





^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [bug#59073] [PATCH] gnu: r-minimal: Avoid referencing /gnu/store/[^-]+-glibc-[^-]+-static.
  2022-11-07 21:36 ` Ludovic Courtès
@ 2022-11-08  7:13   ` Christopher Baines
  2022-11-08 13:09     ` Ludovic Courtès
  0 siblings, 1 reply; 11+ messages in thread
From: Christopher Baines @ 2022-11-08  7:13 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 59073

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


Ludovic Courtès <ludo@gnu.org> writes:

> 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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 987 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [bug#59073] [PATCH] gnu: r-minimal: Avoid referencing /gnu/store/[^-]+-glibc-[^-]+-static.
  2022-11-08  7:13   ` Christopher Baines
@ 2022-11-08 13:09     ` Ludovic Courtès
  2022-11-08 21:32       ` zimoun
  0 siblings, 1 reply; 11+ messages in thread
From: Ludovic Courtès @ 2022-11-08 13:09 UTC (permalink / raw)
  To: Christopher Baines; +Cc: 59073

Hi,

Christopher Baines <mail@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@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’.




^ permalink raw reply	[flat|nested] 11+ messages in thread

* [bug#59073] [PATCH] gnu: r-minimal: Avoid referencing /gnu/store/[^-]+-glibc-[^-]+-static.
  2022-11-08 13:09     ` Ludovic Courtès
@ 2022-11-08 21:32       ` zimoun
  2022-11-10 14:07         ` Ludovic Courtès
  0 siblings, 1 reply; 11+ messages in thread
From: zimoun @ 2022-11-08 21:32 UTC (permalink / raw)
  To: Ludovic Courtès, Christopher Baines; +Cc: 59073

Hi,

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

> Interesting bug!
>
> I pushed a fix and explanation:

Oh! :-)

> 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




^ permalink raw reply	[flat|nested] 11+ messages in thread

* [bug#59073] [PATCH] gnu: r-minimal: Avoid referencing /gnu/store/[^-]+-glibc-[^-]+-static.
  2022-11-08 21:32       ` zimoun
@ 2022-11-10 14:07         ` Ludovic Courtès
  2022-11-10 14:40           ` zimoun
  0 siblings, 1 reply; 11+ messages in thread
From: Ludovic Courtès @ 2022-11-10 14:07 UTC (permalink / raw)
  To: zimoun; +Cc: Christopher Baines, 59073

Hi,

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

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




^ permalink raw reply	[flat|nested] 11+ messages in thread

* [bug#59073] [PATCH] gnu: r-minimal: Avoid referencing /gnu/store/[^-]+-glibc-[^-]+-static.
  2022-11-10 14:07         ` Ludovic Courtès
@ 2022-11-10 14:40           ` zimoun
  0 siblings, 0 replies; 11+ messages in thread
From: zimoun @ 2022-11-10 14:40 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Christopher Baines, 59073

Hi,

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

> 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




^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-11-11  9:56 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-06  9:05 [bug#59073] [PATCH] gnu: r-minimal: Avoid referencing /gnu/store/[^-]+-glibc-[^-]+-static Christopher Baines
2022-11-07  9:27 ` zimoun
2022-11-07  9:32   ` Christopher Baines
2022-11-07 14:10     ` zimoun
2022-11-07 21:36 ` Ludovic Courtès
2022-11-08  7:13   ` Christopher Baines
2022-11-08 13:09     ` Ludovic Courtès
2022-11-08 21:32       ` zimoun
2022-11-10 14:07         ` Ludovic Courtès
2022-11-10 14:40           ` zimoun
2022-11-08  7:13 ` [bug#59073] [PATCH v2] " Christopher Baines

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).