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
openjdk: enable bootstrapping on ARM #65247
Conversation
Some other notes:
OpenJDK 8 does not directly support ARM, but there is an upstream branch (which is used by AdoptOpenJDK for their builds) which supports |
Are you aware of the community builder? https://github.com/nix-community/aarch64-build-box |
Yes, I thought about trying the community builder, but I was getting kind of tired of working on this PR and I didn't really like the idea of cluttering nixpkgs with a bunch of patches for a feature that likely gets little use. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM after some superficial review. I don't know anything about jdk bootstrapping, so I can't greenlight this on my own in good conscience. But this looks like a great improvement, thank you for this!
Some nitpicks included.
pkgs/development/compilers/adoptopenjdk-bin/generate-sources.py
Outdated
Show resolved
Hide resolved
rm $out/lib/libfreetype.so | ||
|
||
# for backward compatibility | ||
ln -s $out $out/jre |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we not need this backwards compatibility any more?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't figure out what the backwards compatibility concern was here, since openjdk11
does not have this symlink. Also, users are unlikely to use adoptopenjdk
directly anymore, so I felt that backwards compatibility was less important.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe @taku0 who added the line initially has an opinion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oracle JDK and other JDKs had jre
folder and some packages depend on it. I forgot which packages depend on it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If openjdk11
doesn't have it, and no one's complaining, then I don't think adoptopenjdk
needs it either.
CC @taku0 who init'ed adoptopenjdk and may be able to provide a more useful review. Also @bennofs, @tomfitzhenry, @wkennington, @NeQuissimus, @thoughtpolice as a semi-random sample of people intereseted in (adopt-)openjdk according to git shortlog. Hopefully we'll be able to keep this from bitrotting too badly :) |
Running a simple AWT application results in
May or may not related to adoptium/temurin-build#693. Reverting |
29ebbd6
to
67bdce6
Compare
I fixed the fontconfig issue. There are a few other libraries that could use a similar fix (e.g. gtk3), but they shouldn't cause any crashes, just missing features such as native look and feel. Now that we have normal OpenJDK builds for all platforms that AdoptOpenJDK supports, very few users will need to use AdoptOpenJDK, so these features will probably not be missed. I have tested with the example @taku0 posted, as well with some JavaFX examples I found here: https://github.com/callicoder/javafx-examples |
@GrahamcOfBorg eval |
@lopsided98 would you mind rebasing this on current master? I don't know why ofBorg complains about a chromium trace, I can only assume it was an issue with the version of master this PR was branched off of. |
67bdce6
to
99a09e6
Compare
I rebased it, but it didn't fix anything. I think ofborg merges the PR into master before testing, so it shouldn't matter what commit it is based on. |
Okay looks like this line is causing the trace:
Which complains because the current oldest chromium version in nixpkgs is 76, so there is no point in keeping that old patch. What I don't understand is why the trace only appears on this PR. It should pop up every time you eval chromium on a non-clang machine (e.g. x86 linux). What would make more sense is the patch below that, which is aarch64 specific. Aarch64 chromium probably wasn't eval'd by ofBorg before because the jdk was unfree and the aarch64 specific patch is also for an outdated version. But that is not the one the trace complains about. @lopsided98 maybe just remove both outdated patches? |
I would argue that other chromium changes don't need to be included in this PR, removing the patches was only necessary to appease ofBorg. Any other cleanup can be done in followup PRs. Any objections to merging this as-is? @taku0 I'd especially appreciate a final comment from you, since you did a lot of the prior work and had some comments that are (I think) resolved. |
I am a nixpkgs chromium maintainer and that chromium change is fine with me. |
I just noticed this targets master. It should probably target staging instead, both for the relatively high rebuild count and the additional testing. |
AdoptOpenJDK seems to be fine. |
This allows OpenJDK 11 to build for armv6l, armv7l and aarch64, and OpenJDK 8 to build for aarch64.
One of these patches was causing a warning message, which broke ofborg evaluation.
@volth for what it's worth, I built jvmci8 on x86 locally. Not sure if I tested it on aarch64. I suspect ofBorg will time out. |
9c5bc92
to
8b0a684
Compare
I haven't really addressed the |
@matthewbauer @volth objections to merge? |
graalvm builds on x86 (while eating a TON of ram, wow). Thanks again @lopsided98 for taking on this PR. |
This broke the tarball job on |
Apparently for some reason |
On a related note, it would probably make sense to use AdoptOpenJDK instead of Zulu on macOS, but I don't have any macOS machines so I can't do it myself. |
See #67839 |
@grahamc shouldn't ofBorg have caught this? Its essentially an eval failure on mac, isn't it? |
Any idea why this MR introduced this channel-blocking breakage? #68307 |
I think this PR broke all gradle-based packages, specifically commit de5e65a (found by bisecting). I am getting this error:
For some reason gradle seems to use the jre instead of the jdk regardless of the |
preFixup = '' | ||
prefix=$jre stripDirs "$STRIP" "$stripDebugList" "''${stripDebugFlags:--S}" | ||
patchELF $jre | ||
propagatedBuildInputs+=" $jre" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The JRE inputs need to be propagated to jdk as well to ensure that the setJavaClassPath
hook is used.
This breaks for instance scalafmt and scalafix:
related to ZHF #68361
Motivation for this change
I started out with the goal of adding support for 32-bit ARM to
adoptopenjdk-bin
, but then quickly realized that this binary package could be used to bootstrap the OpenJDK build on these platforms. This led to me also making a lot of changes to clean up the OpenJDK packages.Things done
This PR makes
openjdk8
andopenjdk11
useadoptopenjdk-bin
for bootstrapping. AdoptOpenJDK is a well-known organization that provides prebuilt OpenJDK binaries for many architectures. Their build scripts are open source and their infrastructure is publicly visible, which I believe makes Nix's OpenJDK bootstrapping process more transparent and trustworthy than the status quo, which uses a bootstrapping tarball of undocumented origin. From a technical standpoint, AdoptOpenJDK binaries make it easier to bootstrap OpenJDK on more platforms.While I was working on this, I tried to clean up parts of the packages that I believe are no longer necessary or could be done better, but in doing so I there is the possibility that I broke something. Are there any particularly problematic packages I should test?
Testing
x86_64-linux
i686-linux
aarch64-linux
armv6l-linux
armv7l-linux
openjdk8
openjdk8_headless
openjdk11
openjdk11_headless
bazel
jmeter
jetbrains.idea-community
2javaPackages
✔️ = builds and runs
❌ = fails to build
🚫 = not supported
blank = not tested
1
openjfx11
(and thereforeopenjdk11
) fails to build oni686-linux
for non-obvious reasons, even without this PR, and I did not try to fix it.2Overridden to use OpenJDK 11 built from source
I do not have the ability to test on macOS, but I did not really touch anything Darwin related.
sandbox
innix.conf
on non-NixOS)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
) (I didn't test every single binary)nix path-info -S
before and after)