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

Failed to make the JDK #3792

Open
manojniit opened this issue May 6, 2024 · 13 comments
Open

Failed to make the JDK #3792

manojniit opened this issue May 6, 2024 · 13 comments
Labels
arm Issues that affect or relate to the ARM OS testing Issues that enhance or fix our test suites Waiting on OP Issues that are awaiting a response from the original author of the ticket

Comments

@manojniit
Copy link

What are you trying to do?
I'm trying to build the java temurin-jdk. but i got the below exception. Where i need to change the compiler settings?

Observed behaviour:

An exception has occurred in the compiler (19.0.2). Please file a bug against the Java compiler via the Java bug reporting page (http://bugreport.java.com) after checking the Bug Database (http://bugs.java.com) for duplicates. Include your program, the following diagnostic, and the parameters passed to the Java compiler in your report. Thank you.
java.io.UncheckedIOException: java.nio.file.FileSystemException: .: Value too large for defined data type
at java.base/java.nio.file.Files$2.hasNext(Files.java:3802)
at java.base/java.util.Iterator.forEachRemaining(Iterator.java:132)
at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1921)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:575)
at java.base/java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260)
at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:616)
at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:622)
at java.base/java.util.stream.ReferencePipeline.toList(ReferencePipeline.java:627)
at jdk.compiler/com.sun.tools.javac.file.JavacFileManager$DirectoryContainer.list(JavacFileManager.java:491)
at jdk.compiler/com.sun.tools.javac.file.JavacFileManager.list(JavacFileManager.java:778)
at jdk.compiler/com.sun.tools.javac.code.ClassFinder.list(ClassFinder.java:750)
at jdk.compiler/com.sun.tools.javac.code.ClassFinder.scanUserPaths(ClassFinder.java:687)
at jdk.compiler/com.sun.tools.javac.code.ClassFinder.fillIn(ClassFinder.java:568)
at jdk.compiler/com.sun.tools.javac.code.ClassFinder.complete(ClassFinder.java:312)
at jdk.compiler/com.sun.tools.javac.code.Symtab.lambda$addRootPackageFor$8(Symtab.java:827)
at jdk.compiler/com.sun.tools.javac.code.Symbol.complete(Symbol.java:682)
at jdk.compiler/com.sun.tools.javac.comp.Enter.visitTopLevel(Enter.java:356)
at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:549)
at jdk.compiler/com.sun.tools.javac.comp.Enter.classEnter(Enter.java:286)
at jdk.compiler/com.sun.tools.javac.comp.Enter.classEnter(Enter.java:301)
at jdk.compiler/com.sun.tools.javac.comp.Enter.complete(Enter.java:604)
at jdk.compiler/com.sun.tools.javac.comp.Enter.main(Enter.java:588)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:1042)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:917)
at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:317)
at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:176)
at jdk.compiler/com.sun.tools.javac.Main.compile(Main.java:64)
at jdk.compiler/com.sun.tools.javac.Main.main(Main.java:50)
Caused by: java.nio.file.FileSystemException: .: Value too large for defined data type
at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:100)
at java.base/sun.nio.fs.UnixException.asIOException(UnixException.java:115)
at java.base/sun.nio.fs.UnixDirectoryStream$UnixDirectoryIterator.readNextEntry(UnixDirectoryStream.java:168)
at java.base/sun.nio.fs.UnixDirectoryStream$UnixDirectoryIterator.hasNext(UnixDirectoryStream.java:198)
at java.base/java.nio.file.Files$2.hasNext(Files.java:3800)
... 29 more
printing javac parameters to: /app/workspace/build/src/make/hotspot/javac.20240506_195918.args
gmake[3]: *** [gensrc/GensrcJvmti.gmk:36: /app/workspace/build/src/build/linux-arm-server-release/hotspot/variant-server/tools/jvmti/_the.BUILD_JVMTI_TOOLS_batch] Error 4
gmake[2]: *** [make/Main.gmk:245: hotspot-server-gensrc] Error 2
gmake[2]: *** Waiting for unfinished jobs....
Compiling up to 245 files for BUILD_jdk.javadoc.interim
Compiling up to 17 files for BUILD_JAVAC_SERVER
error: cannot read directory /app/workspace/build/src/build/linux-arm-server-release/buildtools/interim_langtools_modules
1 error
gmake[3]: *** [CompileInterimLangtools.gmk:124: /app/workspace/build/src/build/linux-arm-server-release/buildtools/interim_langtools_modules/java.compiler.interim/_the.BUILD_java.compiler.interim_batch] Error 1
gmake[3]: *** Waiting for unfinished jobs....
gmake[2]: *** [make/Main.gmk:78: interim-langtools] Error 2

ERROR: Build failed for targets 'images legacy-jre-image test-image static-libs-image' in configuration 'linux-arm-server-release' (exit code 2)

=== Output from failing command(s) repeated here ===

  • For target buildtools_interim_langtools_modules_java.compiler.interim__the.BUILD_java.compiler.interim_batch:
    error: cannot read directory /app/workspace/build/src/build/linux-arm-server-release/buildtools/interim_langtools_modules
    1 error

  • For target hotspot_variant-server_tools_jvmti__the.BUILD_JVMTI_TOOLS_batch:
    An exception has occurred in the compiler (19.0.2). Please file a bug against the Java compiler via the Java bug reporting page (http://bugreport.java.com) after checking the Bug Database (http://bugs.java.com) for duplicates. Include your program, the following diagnostic, and the parameters passed to the Java compiler in your report. Thank you.
    java.io.UncheckedIOException: java.nio.file.FileSystemException: .: Value too large for defined data type
    at java.base/java.nio.file.Files$2.hasNext(Files.java:3802)
    at java.base/java.util.Iterator.forEachRemaining(Iterator.java:132)
    at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1921)
    at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
    at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
    at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:575)
    at java.base/java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260)
    at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:616)
    at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:622)
    at java.base/java.util.stream.ReferencePipeline.toList(ReferencePipeline.java:627)
    at jdk.compiler/com.sun.tools.javac.file.JavacFileManager$DirectoryContainer.list(JavacFileManager.java:491)
    at jdk.compiler/com.sun.tools.javac.file.JavacFileManager.list(JavacFileManager.java:778)
    at jdk.compiler/com.sun.tools.javac.code.ClassFinder.list(ClassFinder.java:750)
    ... (rest of output omitted)

  • All command lines available in /app/workspace/build/src/build/linux-arm-server-release/make-support/failure-logs.
    === End of repeated output ===

No indication of failed target found.
HELP: Try searching the build log for '] Error'.
HELP: Run 'make doctor' to diagnose build problems.

make[1]: *** [/app/workspace/build/src/make/Init.gmk:320: main] Error 2
make: *** [/app/workspace/build/src/make/Init.gmk:186: images] Error 2
OpenJDK make failed, archiving make failed logs
Copying build.log to TemurinLogsArchive
Copying make-support/failure-logs to TemurinLogsArchive
Archiving and compressing with gzip
gzip: warning: GZIP environment variable is deprecated; use an alias or script

real 0m0.052s
user 0m0.070s
sys 0m0.015s
Your archive was created as /app/workspace/build/src/build/linux-arm-server-release/OpenJDK.tar.gz
Moving the artifact to location /app/workspace/target//OpenJDK-makefailurelogs.tar.gz
archive done.
Failed to make the JDK, exiting****

Any other comments:

Can anyone help me with this?

@github-actions github-actions bot added arm Issues that affect or relate to the ARM OS testing Issues that enhance or fix our test suites labels May 6, 2024
@karianna
Copy link
Contributor

karianna commented May 7, 2024

It's looks like you're trying to build Java 19 which is no longer under support. Have you tried building an LTS version (17 or 21)?

@karianna karianna added the Waiting on OP Issues that are awaiting a response from the original author of the ticket label May 7, 2024
@karianna
Copy link
Contributor

karianna commented May 7, 2024

Is this for Arm32?

@manojniit
Copy link
Author

manojniit commented May 7, 2024

Yes, it was originally intended for arm32 architecture, but Temurin builds no longer support arm32. Therefore, I've switched to building for arm64 architecture. Now, I'm unsure about the specific compiler settings that need to be adjusted to successfully build OpenJDK using Temurin.

@karianna
Copy link
Contributor

karianna commented May 7, 2024

Can you post what command you used with makejdk-any-platform.sh?

@judovana
Copy link
Contributor

judovana commented May 7, 2024

Ugh. Can you spare us some time, and pinpoint a bit more directly what you re trying to do?

Usually calling to makejdk_any_platform.sh do not need tha tmuch logic. I had brieafly looked over Dockerfile, build.sh and docker-img.sh and noticed few things:

in docker file is arm64v8 in build sh is -platform linux/arm/v8 \ maybe it does not meter,but for sure it is not arm32. The call to makejdk-any-platform is not visible and COPY assets/jvm/jdk19 really do not sound right. Please update to 21 or downgrade to 17.

Why there is copy of temurin-repo? Are there osme changes? I'm not brave enough to launch this:)

@manojniit
Copy link
Author

This is what I'm trying to do

In order to keep using the latest Java versions and features, I have to create the JDK and JRE ourselves. I want to make this task as automated as possible.

I've managed to make JDK and JRE Debian packages work for Java 21 on a Raspberry Pi. But this process takes a lot of time and isn't good for doing over and over again.

So, I've software and scripts on the Docker Server temurin" directory. I'm trying to build "arm32" JDKs on the server using Docker and QEMU. But until now, I haven't been successful in building the images.

@karianna
Copy link
Contributor

karianna commented May 8, 2024

@manojniit I cannot tell from your build scripts how and where you are following instructions similar to:

https://github.com/adoptium/temurin-build?tab=readme-ov-file#how-do-i-build-openjdk-in-a-docker-image

@sxa
Copy link
Member

sxa commented May 8, 2024

@manojniit I cannot tell from your build scripts how and where you are following instructions similar to:
https://github.com/adoptium/temurin-build?tab=readme-ov-file#how-do-i-build-openjdk-in-a-docker-image

I don't believe --docker supports the QEMU environment that the OP is trying to use here, although it would probably work natively on an arm32 machine.

So, I've software and scripts on the Docker Server temurin" directory. I'm trying to build "arm32" JDKs on the server using Docker and QEMU. But until now, I haven't been successful in building the images.

Hi @manojniit, it should work ok ... You can use our pre-built docker images for running the build to make things simpler:

docker run --platform linux/arm/v7 -it adoptoptopenjdk/ubuntu1604_build_image

We create that build image from this Dockerfile and publish it at Dockerhub so you don't need to build it yourself but I'm giving you the link in case you want to build it yourself.

It sounds like your goal is to build a version of JDK21 for Arm32 which Temurin does not currently provide. To do this you will also need an Arm32 JDK20 or 21 to use as the boot JDK. You can get an "Early access" Temurin 20 build from us which will be suitable as a boot JDK - it just hasn't gone through all of our testing process. You could start with JDK19, use that as a boot JDK to build a JDK20, then use your built 20 to build 21 but it's simpler to use our 20-ea build.

The only other thing you'll need to define within that image is the compiler, since the default gcc 5.4 in Ubuntu 16.04 is not suitable for building JDK21. The following steps should allow you to build a JDK21 within the container with GCC11.2 - the same version we use for JDK21 on most other architectures:

git clone https://github.com/adoptium/temurin-build
cd temurin-build
curl -L https://api.adoptium.net/v3/binary/latest/20/ea/linux/arm/jdk/hotspot/normal/adoptium | tar xpfz -
export CC=/usr/local/gcc11/bin/gcc-11.2 
export CXX=/usr/local/gcc11/bin/g++-11.2 
./makejdk-any-platform.sh -J $PWD/jdk-20.0.2+9 jdk21u

Once that completes you should have a usable JDK as a tarball in target/OpenJDK-jdk.tar.gz. Note that this will build from the latest available JDK21 code (21.0.4+2-beta+2 at the time of writing). If you want to build a specific tagged version (The latest upstream GA level for other platforms was 21.0.3+9) you can specify it with -t like this:

./makejdk-any-platform.sh -J $PWD/jdk-20.0.2+9 -t jdk-21.0.3+9 --target-file-name OpenJDK21U-jdk_arm32_hotspot_21.0.3+9.tar.gz jdk21u

I've added the --target-file-name parameter to this example which is optional but might be useful to set the filename during the build instead of leaving it as just OpenJDK-jdk.tar.gz.

Hope that helps.

@sxa
Copy link
Member

sxa commented May 10, 2024

Actually I'm bit confused with the settings, Can you help me to update the settings in my dockerfile and shell script file inorder to build the jdk...

I'm still unclear on what you're trying to achieve. From your earlier message you said:

So, I've software and scripts on the Docker Server temurin" directory. I'm trying to build "arm32" JDKs on the server using Docker and QEMU. But until now, I haven't been successful in building the images.

Your commands above are pulling from FROM arm64v8/ubuntu:22.04 which is not going to build for arm32. The information in my earlier comment should allow you to build a JDK21 on arm32. Also your scripts seem to be trying to build JDK20 which is out of support so I would not recommend buildng and using that version - is there a reason for JDK20 instead of 21?

We cannot provide any assistance if the problem you're seeing with your scripts is related to the crash on JDK19 (which is also out of support) as per your original message.

@sxa
Copy link
Member

sxa commented May 10, 2024

That makes sense, but your scripts do not seem consistent with that - they are trying to use JDK19 to build JDK20 on aarch64, not JDK21 on arm32.

Are you able to configure your script to use the commands and docker images I gave earlier, which seem to be the ones that will allow you to easily meet your goals of creating a JDK21 on arm32 the same way we do.

@sxa
Copy link
Member

sxa commented May 10, 2024

On another note, I'd be very interested in knowing what you plan to use Arm32 JDK21 for - if you're able to willing to a add a comment into adoptium/adoptium-support#962 (comment) to say why you would find that useful that would be helpful so we can collect all such reasons in one place :-)

@sxa
Copy link
Member

sxa commented May 14, 2024

I'm about to go on vacation until June so I won't be able to provide any more advice, but I'm not sure what to suggest. if you are able to run the JDK to get this message out of the build summary in the arm32 container:
openjdk version "20.0.2-beta" 2023-07-18 OpenJDK Runtime Environment Temurin-20.0.2+9-202309010331 (build 20.0.2-beta+9-202309010331)
then there should be no problem with executing it later during the build, so this:
Failed to create server process: Cannot run program "/temurin-build/jdk-20.0.2+9/bin/java": error=0, Failed to exec spawn helper: pid: 38146, exit value: 1
seems strange, since it was able to run java to get the version string during the configure stage.

@manojniit
Copy link
Author

Hi, I didn't get the solution for the above problems. I tried your way as well, but it is also not working. I have been trying for 1 month. If you have any solution, I would appreciate your help. While researching the problem, I found out that the issue is with QEMU. I have provided the reference link below (https://gitlab.com/qemu-project/qemu/-/issues/263). I tried your way but got the spawn error. I gave all the permissions (https://stackoverflow.com/questions/61301818/java-failed-to-exec-spawn-helper-error-since-moving-to-java-14-on-linux), but I still didn't find any solution. If you have any solutions, please feel free to share them with me. I am trying to implement OpenJDK for Raspberry Pi for ARM 32.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arm Issues that affect or relate to the ARM OS testing Issues that enhance or fix our test suites Waiting on OP Issues that are awaiting a response from the original author of the ticket
Projects
Status: Todo
Development

No branches or pull requests

4 participants