Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gradle 8.7 fatal bug on debian multiple atchirecture #28936

Closed
dpsimspon opened this issue Apr 23, 2024 · 2 comments
Closed

gradle 8.7 fatal bug on debian multiple atchirecture #28936

dpsimspon opened this issue Apr 23, 2024 · 2 comments
Labels
a:bug closed:unreproducible Unable to reproduce with given information

Comments

@dpsimspon
Copy link

dpsimspon commented Apr 23, 2024

Current Behavior

gradle 8.7 detects that the /usr/bin/jvm/openjdk- directory does not contain a java command and decides this is fatal error and that it can not continue. gradle resists strenuous efforts, some of which require root access, to fix this problem

Expected Behavior

gradle should notice there is no java and silently bypass that directory., which contains a src.zip flie which multiple architectures can share on Debian systems. java, javac, etc can be found in a java--openjdk- directory, for example java 1.7 tools can be found in usr/lib/jvm/java-17-openjdk-amd64 on my x86 64 systems.

A fallback method which is easy to reach and prioritises "works" over smart features would be a really useful feature. I appreciate it might not be a priority and require invasive changes in lots of places.

Suggested partial fix, which at least covers ./gradlew javaToolchains for me modulo some cosmetic issues:

---gradle-8.7-dist/src/jvm-services/org/gradle/jvm/toolchain/internal/FileBasedInstallationFactory.java      1980-02-01 00:00:00.000000000 +0000
+++ gradle-8.7/src/jvm-services/org/gradle/jvm/toolchain/internal/FileBasedInstallationFactory.java     2024-04-23 16:48:25.349948591 +0100
@@ -30,10 +30,14 @@
         if (javaCandidates == null) {
             return Collections.emptySet();
         }
+       /* On Debian, and maybe some other systems, just a directory
+        * is insufficient so check for java instead. */
+       final String java = "bin" + File.seperator + "java";
         return Stream.of(javaCandidates)
-            .filter(File::isDirectory)
+            .filter(d -> new File(d, java).isFile())
             .map(d -> new InstallationLocation(d, supplierName))
             .collect(toSet());
     }
 
 }

Context (optional)

I encountered this trying to build something using a current version of java, which would ideally be java 23, which uses gradle features which the debian version does not support. This only cost me a whole week of discovering gradle not only gets it wrong bit also insists on getting it wrong.

Steps to Reproduce

Try to do a grade build on a current debian multiple architecture system. The debian version has a fix for this issue but can;t be used to build gradle 8.7.

Gradle version

8.7

Build scan URL (optional)

No response

Your Environment (optional)

No response

@ov7a
Copy link
Member

ov7a commented Apr 25, 2024

We appreciate the effort, but we must ask for more information so that we can triage it.

We do not see an immediate root cause, and we need a minimal reproducible example for the triage. If we have a reproducer, we may be able also to suggest workarounds or ways to avoid the problem.

The ideal way to provide a reproducer is to leverage our reproducer template. You can also use Gradle Project Replicator to reproduce the structure of your project.

This issue will be closed after 7 days unless you provide more information.


This issue should be already addressed by

Probably you hit some corner case. Ideally, you can setup GitHub Action in our reproducer template to capture all the details. If it's very hard, then please provide at least a full log with stacktrace of your build failure.

@ov7a ov7a added the pending:reproducer Indicates that the issue requires a reproducer or will be closed after 7 days label Apr 25, 2024
Copy link

github-actions bot commented May 2, 2024

While we asked for a reproducer, none was provided. If you provide a valid reproducer, we will consider this issue again. In the meantime, closing as unreproducible.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 2, 2024
@github-actions github-actions bot added closed:unreproducible Unable to reproduce with given information and removed to-triage pending:reproducer Indicates that the issue requires a reproducer or will be closed after 7 days labels May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:bug closed:unreproducible Unable to reproduce with given information
Projects
None yet
Development

No branches or pull requests

2 participants