[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: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 17 Nov 2024 20:43
[PATCH 1/1] gnu: antlr4: Pass full path to java in bin executable
(address . 74406@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
M
M
Maxim Cournoyer wrote on 2 Jan 14:51 +0100
(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 74406@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 74406
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