[PATCH 0/1] antlr4 package does not refer to java executable by full path

  • Open
  • quality assurance status badge
Details
2 participants
  • Maxim Cournoyer
  • Rutherther
Owner
unassigned
Submitted by
Rutherther
Severity
normal
Merged with
R
R
Rutherther wrote on 17 Nov 2024 20:15
(address . guix-patches@gnu.org)(name . Rutherther)(address . rutherther@ditigal.xyz)
cover.1731870758.git.rutherther@ditigal.xyz
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
R
R
Rutherther wrote on 17 Nov 2024 20:17
[PATCH 1/1] gnu: antlr4: Pass full path to java in bin executable
(address . 74405@debbugs.gnu.org)(name . Rutherther)(address . rutherther@ditigal.xyz)
27ea0b2b5326c827fd03399b4009c1bb62d81600.1731870758.git.rutherther@ditigal.xyz
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(-)

Toggle diff (23 lines)
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
R
R
Rutherther wrote on 17 Nov 2024 20:26
Merge two issues
(address . control@debbugs.gnu.org)
87r079d5m0.fsf@ditigal.xyz
merge 74405 74406

I've accidentally sent an issue twice, trying to merge them, not sure if
I am doing it right and if I have permissions to do it, sorry if this is
just spamming. ... How does debbugs know for what project this is, where
do I specify "guix"?
R
R
Rutherther wrote on 4 Dec 2024 20:12
[PATCH 0/1] qt-build-system: Wrap with build variables to allow %outputs in arguments
(address . 74405@debbugs.gnu.org)(name . Rutherther)(address . rutherther@ditigal.xyz)
cover.1733339135.git.rutherther@ditigal.xyz
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
R
R
Rutherther wrote on 4 Dec 2024 20:14
(address . 74405@debbugs.gnu.org)
87ser31cre.fsf@ditigal.xyz
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. :(
M
M
Maxim Cournoyer wrote on 2 Jan 14:45 +0100
Re: [bug#74405] [PATCH 0/1] qt-build-system: Wrap with build variables to allow %outputs in arguments
(name . Rutherther)(address . rutherther@ditigal.xyz)(address . 74405@debbugs.gnu.org)
877c7d72i5.fsf@gmail.com
Hey,

Rutherther <rutherther@ditigal.xyz> writes:

Toggle quote (5 lines)
> 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
M
M
Maxim Cournoyer wrote on 2 Jan 14:48 +0100
(name . Rutherther)(address . rutherther@ditigal.xyz)
871pxl72di.fsf@gmail.com
Hi Rutherther,

Rutherther <rutherther@ditigal.xyz> writes:

Toggle quote (15 lines)
> 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.

Toggle snippet (3 lines)
#:configure-flags #~(list (string-append "DESTDIR=" #$output))

--
Thanks,
Maxim
M
M
Maxim Cournoyer wrote on 2 Jan 14:51 +0100
Re: [bug#74406] [PATCH 1/1] gnu: antlr4: Pass full path to java in bin executable
(name . Rutherther)(address . rutherther@ditigal.xyz)
87wmfd5nof.fsf@gmail.com
Hi Rutherther,

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

Rutherther <rutherther@ditigal.xyz> writes:

Toggle quote (33 lines)
> 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
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 74405@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 74405
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch