GNU bug report logs - #74405
[PATCH 0/1] antlr4 package does not refer to java executable by full path

Previous Next

Package: guix-patches;

Reported by: Rutherther <rutherther <at> ditigal.xyz>

Date: Sun, 17 Nov 2024 19:16:02 UTC

Severity: normal

Tags: patch

Merged with 74406

To reply to this bug, email your comments to 74405 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to julien <at> lepiller.eu, guix-patches <at> gnu.org:
bug#74405; Package guix-patches. (Sun, 17 Nov 2024 19:16:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Rutherther <rutherther <at> ditigal.xyz>:
New bug report received and forwarded. Copy sent to julien <at> lepiller.eu, guix-patches <at> gnu.org. (Sun, 17 Nov 2024 19:16:02 GMT) Full text and rfc822 format available.

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

From: Rutherther <rutherther <at> ditigal.xyz>
To: guix-patches <at> gnu.org
Cc: Rutherther <rutherther <at> ditigal.xyz>
Subject: [PATCH 0/1] antlr4 package does not refer to java executable by full
 path
Date: Sun, 17 Nov 2024 20:15:12 +0100
Hello,

this seems to me like a bug - the package antlr4 refers
to "java" in bin/antlr4 that is produced. I think it should
refer to #$icedtea/bin/java. It seems to me quite probable
this was a mistake, since there was java written multiple
times in phases, where it's available in PATH automatically.

Rutherther (1):
  gnu: antlr4: Pass full path to java in bin executable

 gnu/packages/java.scm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)


base-commit: d108a7aac2c51f21c55cb8ea8801629a97f5242a
--
2.46.0




Information forwarded to julien <at> lepiller.eu, guix-patches <at> gnu.org:
bug#74405; Package guix-patches. (Sun, 17 Nov 2024 19:18:02 GMT) Full text and rfc822 format available.

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

From: Rutherther <rutherther <at> ditigal.xyz>
To: 74405 <at> debbugs.gnu.org
Cc: Rutherther <rutherther <at> ditigal.xyz>
Subject: [PATCH 1/1] gnu: antlr4: Pass full path to java in bin executable
Date: Sun, 17 Nov 2024 20:17:01 +0100
The executable outputted by antlr4 package does not
refer to full path of java, but to standalone "java".
That means the package expects java to be in PATH.
Since it's an application, requiring java to run,
it should rather refer to full path of java executable
it was built with/for.

* gnu/packages/java.scm: (antrl4)[arguments]: Change "java" in bin/antlr4 for full path

Change-Id: I311b9ec54a90fc7251eb8fcb62b232e843853e64
---
 gnu/packages/java.scm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index df57385ea7..8607b62bea 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -8866,13 +8866,14 @@ (define-public antlr4
          (add-after 'install 'bin-install
            (lambda* (#:key inputs outputs #:allow-other-keys)
              (let ((jar (string-append (assoc-ref outputs "out") "/share/java"))
-                   (bin (string-append (assoc-ref outputs "out") "/bin")))
+                   (bin (string-append (assoc-ref outputs "out") "/bin"))
+                   (java (search-input-file inputs "bin/java")))
                (mkdir-p bin)
                (with-output-to-file (string-append bin "/antlr4")
                  (lambda _
                    (display
                      (string-append "#!" (which "sh") "\n"
-                                    "java -cp " jar "/antlr4.jar:"
+                                    java " -cp " jar "/antlr4.jar:"
                                     (string-join
                                       (apply
                                         append
-- 
2.46.0




Merged 74405 74406. Request was from Rutherther <rutherther <at> ditigal.xyz> to control <at> debbugs.gnu.org. (Sun, 17 Nov 2024 19:27:01 GMT) Full text and rfc822 format available.

Information forwarded to rutherther <at> ditigal.xyz, maxim.cournoyer <at> gmail.com, iyzsong <at> envs.net, guix-patches <at> gnu.org:
bug#74405; Package guix-patches. (Wed, 04 Dec 2024 19:13:02 GMT) Full text and rfc822 format available.

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

From: Rutherther <rutherther <at> ditigal.xyz>
To: 74405 <at> debbugs.gnu.org
Cc: Rutherther <rutherther <at> ditigal.xyz>
Subject: [PATCH 0/1] qt-build-system: Wrap with build variables to allow
 %outputs in arguments
Date: Wed,  4 Dec 2024 20:12:17 +0100
It is impossible to refer to %outputs in arguments like #:configure-flags
(ie. `(assoc-ref %outputs "out")` leads to unbound-variable %outputs).
I think the issue is in qt using different system than build systems such
as cmake or gnu. Since I am unsure about the reason for qt not having
the same structure, I am submitting this to guix devel for discussion,
as well as opening a patch in case this is fine to be merged. If not,
could someone please explain what the reason behind not adding
inputs and outputs is, and what is the alternative?

Regards,
Rutherther

Rutherther (1):
  guix: qt: add inputs and outputs build variables in qt-build

 guix/build-system/qt.scm | 54 +++++++++++++++++++++-------------------
 1 file changed, 28 insertions(+), 26 deletions(-)


base-commit: 006679d1e6ca7acea0629b4f019c8cf89cde08be
--
2.46.0




Information forwarded to guix-patches <at> gnu.org:
bug#74405; Package guix-patches. (Wed, 04 Dec 2024 19:15:02 GMT) Full text and rfc822 format available.

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

From: Rutherther <rutherther <at> ditigal.xyz>
To: 74405 <at> debbugs.gnu.org
Subject: Re: [PATCH 0/1] qt-build-system: Wrap with build variables to allow
 %outputs in arguments
Date: Wed, 04 Dec 2024 20:14:45 +0100
So sorry, I meant to make a new issue, but instead,
I accidentally sent it to this one thanks to mumi
being so easy to use, and not noticing I didn't switch
to a new issue. :(




Information forwarded to guix-patches <at> gnu.org:
bug#74405; Package guix-patches. (Thu, 02 Jan 2025 13:47:02 GMT) Full text and rfc822 format available.

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

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Rutherther <rutherther <at> ditigal.xyz>
Cc: 74405 <at> debbugs.gnu.org
Subject: Re: [bug#74405] [PATCH 0/1] qt-build-system: Wrap with build
 variables to allow %outputs in arguments
Date: Thu, 02 Jan 2025 22:45:54 +0900
Hey,

Rutherther <rutherther <at> ditigal.xyz> writes:

> So sorry, I meant to make a new issue, but instead,
> I accidentally sent it to this one thanks to mumi
> being so easy to use, and not noticing I didn't switch
> to a new issue. :(

No big deal :-).  It's happened to me as well.

-- 
Thanks,
Maxim




Information forwarded to guix-patches <at> gnu.org:
bug#74405; Package guix-patches. (Thu, 02 Jan 2025 13:49:02 GMT) Full text and rfc822 format available.

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

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Rutherther <rutherther <at> ditigal.xyz>
Cc: 74405 <at> debbugs.gnu.org,
 宋文武 <iyzsong <at> envs.net>
Subject: Re: [bug#74405] [PATCH 0/1] qt-build-system: Wrap with build
 variables to allow %outputs in arguments
Date: Thu, 02 Jan 2025 22:48:41 +0900
Hi Rutherther,

Rutherther <rutherther <at> ditigal.xyz> writes:

> It is impossible to refer to %outputs in arguments like #:configure-flags
> (ie. `(assoc-ref %outputs "out")` leads to unbound-variable %outputs).
> I think the issue is in qt using different system than build systems such
> as cmake or gnu. Since I am unsure about the reason for qt not having
> the same structure, I am submitting this to guix devel for discussion,
> as well as opening a patch in case this is fine to be merged. If not,
> could someone please explain what the reason behind not adding
> inputs and outputs is, and what is the alternative?
>
> Regards,
> Rutherther
>
> Rutherther (1):
>   guix: qt: add inputs and outputs build variables in qt-build

I haven't seen that patch in the series here, but just for the record I
think support for %outputs is omitted by purpose to nudge new package
definitions to migrate to use G-Expressions, e.g.

--8<---------------cut here---------------start------------->8---
#:configure-flags #~(list (string-append "DESTDIR=" #$output))
--8<---------------cut here---------------end--------------->8---

-- 
Thanks,
Maxim




Information forwarded to guix-patches <at> gnu.org:
bug#74405; Package guix-patches. (Thu, 02 Jan 2025 13:52:02 GMT) Full text and rfc822 format available.

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

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Rutherther <rutherther <at> ditigal.xyz>
Cc: Julien Lepiller <julien <at> lepiller.eu>, 74405 <at> debbugs.gnu.org,
 74406 <at> debbugs.gnu.org
Subject: Re: [bug#74406] [PATCH 1/1] gnu: antlr4: Pass full path to java in
 bin executable
Date: Thu, 02 Jan 2025 22:51:28 +0900
Hi Rutherther,

Apologies for the delay, this had been tagged as SPAM by big G.

Rutherther <rutherther <at> ditigal.xyz> writes:

> The executable outputted by antlr4 package does not
> refer to full path of java, but to standalone "java".
> That means the package expects java to be in PATH.
> Since it's an application, requiring java to run,
> it should rather refer to full path of java executable
> it was built with/for.
>
> * gnu/packages/java.scm: (antrl4)[arguments]: Change "java" in bin/antlr4 for full path
>
> Change-Id: I311b9ec54a90fc7251eb8fcb62b232e843853e64
> ---
>  gnu/packages/java.scm | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
> index df57385ea7..8607b62bea 100644
> --- a/gnu/packages/java.scm
> +++ b/gnu/packages/java.scm
> @@ -8866,13 +8866,14 @@ (define-public antlr4
>           (add-after 'install 'bin-install
>             (lambda* (#:key inputs outputs #:allow-other-keys)
>               (let ((jar (string-append (assoc-ref outputs "out") "/share/java"))
> -                   (bin (string-append (assoc-ref outputs "out") "/bin")))
> +                   (bin (string-append (assoc-ref outputs "out") "/bin"))
> +                   (java (search-input-file inputs "bin/java")))
>                 (mkdir-p bin)
>                 (with-output-to-file (string-append bin "/antlr4")
>                   (lambda _
>                     (display
>                       (string-append "#!" (which "sh") "\n"
> -                                    "java -cp " jar "/antlr4.jar:"
> +                                    java " -cp " jar "/antlr4.jar:"

Hm.  I'm not sure what is the state of the art here for our Java
packages; it makes sense that it should work out of the box, but perhaps
there's a reason to want to have it run with any Java available on PATH?

I'll defer to Julien, which I believe has done more work with Java in
Guix.

-- 
Thanks,
Maxim




This bug report was last modified 169 days ago.

Previous Next


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