Page MenuHomeFreeBSD

java/openjdk24: Build with temporary bootjdk
AcceptedPublic

Authored by haraldei_anduin.net on Wed, May 14, 12:13 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, May 30, 5:31 PM
Unknown Object (File)
Fri, May 30, 2:04 PM
Unknown Object (File)
Fri, May 30, 2:04 PM
Unknown Object (File)
Fri, May 30, 2:04 PM
Unknown Object (File)
Fri, May 30, 2:04 PM
Unknown Object (File)
Fri, May 30, 2:04 PM
Unknown Object (File)
Thu, May 29, 4:33 PM
Unknown Object (File)
Sat, May 24, 7:24 AM
Subscribers

Details

Reviewers
emaste
jrm
glewis
pkubaj
bofh
Group Reviewers
PowerPC
Summary

This patch will download and extract a bootstrap jdk to the ${WRKSRC} if
a suitable jdk is not already installed on the system. This is a change
from before, where we would instead add the previous OpenJDK version as
a dependency.

This would cause the previous jdk to also be built and installed, which
in turn could mean that it's previous version would have to be built and
installed, etc.

Chaning this behaviour to only rely on the bootstrap jdk when builting
the port will save both on build time and install size.

Sponsored by: The FreeBSD Foundation

Test Plan
  • Build the java/openjdk24 port on a system without any java installed, and verify that it does not install any other java versions than openjdk24.
    • on x86_64
    • on aarch64
    • on PPC64 (I need help to test this.)
  • Build the java/openjdk24 port on a system with openjdk23 already installed, and verify that it does not download the bootjdk.
    • on x86_64
    • on aarch64
    • on PPC64 (I need help to test this.)

Diff Detail

Repository
R11 FreeBSD ports repository
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 64194
Build 61078: arc lint + arc unit

Event Timeline

haraldei_anduin.net created this revision.

Note, I do not have a OpenJDK23 bootstrap jdk for PPC64 yet, and will need help to get that built.

I am not a hard blocker here.

I requested an openjdk account on freefall to host the distfiles. Adding PowerPC here to see if they are willing to help.

bofh added inline comments.
java/openjdk24/Makefile
174

Unless you have defined EXTRACT_ONLY, all the DISTFILES are supposed to be extracted. Can you recheck this once more? And in the improbable case that this is not extracted, this should go under post-extract target instead of pre-configure.

java/openjdk24/Makefile
174

You're right! It's extracted twice, once directly under work, and once within the work/openjdk source directory.

That means I don't need this explicit extract target at all. Which it way nicer :) Thanks!

In D50349#1148782, @jrm wrote:

I requested an openjdk account on freefall to host the distfiles. Adding PowerPC here to see if they are willing to help.

I was also pointed to a recipe for getting poudriere to use qemu for building for other hardware. I'll try that as well.

  • java/openjdk24: Don't extract bootjdk twice

I feel that we could follow other java/bootstrap-openjdk* route, that seems more clear and cleaner (IMHO). We don't have newer bootstrap-openjdk than version 17 and maybe it's time for adding a bootstrap-openjdk23?

java/openjdk24/Makefile
110

Where is this variable being used?

115

Where is this variable being used?

I feel that we could follow other java/bootstrap-openjdk* route, that seems more clear and cleaner (IMHO). We don't have newer bootstrap-openjdk than version 17 and maybe it's time for adding a bootstrap-openjdk23?

That's the alternative, but that will at minimum install two jdk versions when you want to install one. Unless a suitable jdk is installed already, of course.

Personally I find the proposed change more elegant and cleaner, but if the old way is preferred by the community, I'm fine with discarding the proposal. In any case. The reason I started looking into this in the first place is that I need someplace to fetch the bootstrap jdk's from for CI jobs.

java/openjdk24/Makefile
110

Good catch! It's not anymore. I'll clean it up.

  • java/openjdk24: Remove unused var from Makefile

I do not see any pkg-descr file. Please add one.

java/openjdk24/Makefile
6

The distfiles have been added to the openjdk account, so it's time to update the location to openjdk instead of bofh.

I do not see any pkg-descr file. Please add one.

It's there:
https://cgit.freebsd.org/ports/tree/java/openjdk24/pkg-descr

java/openjdk24/Makefile
6

I am planning to, as soon as we have the files there.

java/openjdk24/Makefile
6

I copied them over about an hour ago, so they should be available now. Please let me know if that's not the case.

  • java/openjdk24: Update distfiles location
haraldei_anduin.net marked an inline comment as done.
This revision is now accepted and ready to land.Thu, May 15, 7:11 PM

I feel that we could follow other java/bootstrap-openjdk* route, that seems more clear and cleaner (IMHO). We don't have newer bootstrap-openjdk than version 17 and maybe it's time for adding a bootstrap-openjdk23?

That's the alternative, but that will at minimum install two jdk versions when you want to install one. Unless a suitable jdk is installed already, of course.

Personally I find the proposed change more elegant and cleaner, but if the old way is preferred by the community, I'm fine with discarding the proposal. In any case. The reason I started looking into this in the first place is that I need someplace to fetch the bootstrap jdk's from for CI jobs.

Yeah, it's superfluous to install multiple JDKs unless you really need to use multiple versions, and the bootstrap- one isn't supposed to be used in other place so it's better not to leave on the system. (OTOH, it's only BUILD_DEPENDS so it won't be the case when installing via pkg)

Sorry that I wasn't being clear, the one I really like is what we're doing with rust: we have lang/rust and lang/rust-bootstrap, the -bootstrap one is really for building the bootstrap toolchain, from source, instead of downloading a binary file. Once lang/rust-bootstrap is built by the official pkg builder, the result is uploaded somewhere and will be used for bootstraping lang/rust, as the part of distfiles, instead of a dependency port/package. I like this mechanism a lot because it has better transparency of the bootstrap toolchain's build environment, which is maintained by the project officially, and makes it standardized and reproducible.

It could be harder for openjdk as I'm not sure if it's possible (and not very hard) to build openjdk via what's already in base, a.k.a llvm/clang. More precisely, we only need to build a subset which is sufficient to bootstrap the full openjdk.

Anyway, I'm not against this update, just wanted to express my thoughts of the best way, for the record. If that makes sense, we can move toward that in the future.

BTW, one minor question, why do we choose 23.0.1+11? Is 23.0.2+7-1 from`java/openjdk23` newer? I guess it doesn't affect as both of them should be able to bootstrap openjdk24.

Yeah, it's superfluous to install multiple JDKs unless you really need to use multiple versions, and the bootstrap- one isn't supposed to be used in other place so it's better not to leave on the system. (OTOH, it's only BUILD_DEPENDS so it won't be the case when installing via pkg)

Yeah, it's only an issue when installing from ports. Installing from pkg will not be affected by this change.

Sorry that I wasn't being clear, the one I really like is what we're doing with rust: we have `lang/rust` and `lang/rust-bootstrap`, the -bootstrap one is really for building the bootstrap toolchain, from source, instead of downloading a binary file.

I see. And I agree that would be a good and transparent way of handing the bootstrapping.

Unfortunately that's not possible with Java, as a functional JDK is required to build the JDK itself. Even the existing bootstrap-openjdk ports only download a prebuilt binary openjdk that's then installed onto the system.

On the other hand, if a suitable JDK is already installed on the system, this will be used as the bootstraping JDK. This is no change from the previous behaviour. The only difference this patch introduces is that the bootrstrapping JDK, if it's needed, is not installed onto the system.

Iow, the transparency is acheived via the port for the previous JDK port. That's what will be the bootstrapping jdk.

BTW, one minor question, why do we choose `23.0.1+11`? Is `23.0.2+7-1` from`java/openjdk23` newer?

Yes, 23.0.2 is newer. In short, it does not matter. I chose the original update release just to have a base point. For OpenJDK 24 I've chosen the original GA release, and expect that will be the pattern going forward.

On the other hand, if a suitable JDK is already installed on the system, this will be used as the bootstraping JDK. This is no change from the previous behaviour. The only difference this patch introduces is that the bootrstrapping JDK, if it's needed, is not installed onto the system.

In general I prefer that build system behaviour is explicitly deterministic (rather than based on the presence of some optional component) but that's independent of your change here. This change looks fine to me.