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 only builds with Java 22, which is EOL #877

Closed
pluiedev opened this issue Nov 7, 2024 · 4 comments
Closed

Gradle only builds with Java 22, which is EOL #877

pluiedev opened this issue Nov 7, 2024 · 4 comments
Labels

Comments

@pluiedev
Copy link

pluiedev commented Nov 7, 2024

As this comment in #865 pointed out, currently the build script arbitrarily sets the languageVersion to only Java 22 and not Java 23, preventing it from building on Java 23. This is especially problematic when working with package libraries like Nixpkgs, which has already removed Java 22 as it has reached its EOL date in September 2024.

Please remove the version specifier, or maybe setting a minimum version requirement rather than an exact one.

@pluiedev pluiedev changed the title Gradle only accepts Java 22 which is EOL Gradle only builds with Java 22, which is EOL Nov 7, 2024
@Col-E
Copy link
Owner

Col-E commented Nov 7, 2024

which has already removed Java 22 as it has reached its EOL date in September 2024

Would it be reasonable to assume that when Java 23 hits EOL that Nixpkgs will also remove it?

currently the build script arbitrarily sets the languageVersion to only Java 22

We use 22 (A non LTS release) because:

  • The FFM API has been moved to a stable API from its incubator state
  • JavaFX has plans on bumping its minimum version to 22 to also take advantage of FFM

We use toolchain support to ensure anyone building should get the same exact output. It also sets all the respective compiler versioning arguments.

Sorta related, I noticed a while ago that Gradle had stopped auto-downloading JDK's for toolchain usage a couple versions ago. I meant to address that so building would be less of an involved process for users who don't already have a 22 JDK installed, but never got around to it. We can do that by utilizing the foojay toolchain plugin.

@Col-E Col-E added the 4.X label Nov 7, 2024
@pluiedev
Copy link
Author

pluiedev commented Nov 7, 2024

Would it be reasonable to assume that when Java 23 hits EOL that Nixpkgs will also remove it?

Yes. As far as I can tell Nixpkgs only supports Java 8, 11, 17, 21 and 23 in the source tree — everything else is flagged as broken and unsupported since maintaining EOL versions turned out to be too much of a burden (see NixOS/nixpkgs#313216, NixOS/nixpkgs#310466, NixOS/nixpkgs#313210)

Also, downloading a JDK would also not be ideal for Nixpkgs since build environments are sandboxed and programs do not have internet access. The only reason that Gradle still somehow works is because we use a man-in-the-middle cache which has all dependencies prefetched and locked at specific versions and hashes, and in the build process we hijack any network requests to return dependencies from the cache. Yes, it's janky, but it achieves the same effect of reproducibility.

@xroberx
Copy link

xroberx commented Nov 8, 2024

We use 22 (A non LTS release) because:

* The [FFM API](https://openjdk.org/jeps/454) has been moved to a stable API from its incubator state

So the FFM API is also stable in Java 23, no?

@Col-E
Copy link
Owner

Col-E commented Nov 24, 2024

I'm going to keep 22 as the build target for now, but I have addressed the issues seen when updating it to 23.

If you're consuming the repo and doing builds in a 23 environment, find/replace the version to what you want and it should build now.

@Col-E Col-E closed this as completed Nov 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants