-
Notifications
You must be signed in to change notification settings - Fork 6k
8346719: Add relaunchers to the static JDK image for missing executables #24380
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
base: master
Are you sure you want to change the base?
Conversation
… are not included in static JDK" This reverts commit 5392674.
👋 Welcome back ihse! A progress list of the required criteria for merging this PR into |
❗ This change is not yet ready to be integrated. |
A bit of discussion/rationale for this PR:
|
Right now, the static-jdk image is a bit strange in that it's a modular run-time image but with all native code compiled into bin/java. In time we hope that jlink will be able to create a static image where everything is in the single executable, so no bin directory (or any directory) for launchers. I don't object to doing something to help testing the intermediate step, just not sure that main line is the right place for this. As regards the shim when I wonder if it should use CreateProcessW but maybe it doesn't matter for the test environments where they will run. |
The way I see it is that we need to be able to produce a generic static JDK image, to be able to test it and keep it from bit-rotting. In actual practice, though, a static JDK is of limited (or rather no) use by itself, and the static build will only serve to produce component that are consumed by downstream setups, where these static libraries are incorporated more tightly into a product. So while we continue to hammer out how to improve this, I think it is important to be able to test static builds in mainline, or they will break. I think we are going to have to keep these relaunchers around for as long as we want to test the static build, even if no downstream consumer really cares. If that is going to be kept in the "static-jdk" image, or in another deliverable, I can't say. Possibly the entire "static-jdk" will go away when we are done with proper jlink/jmod integration, or maybe not. For now, I think this works fine. |
I must admit that I am not very well versed in Windows programming. What is the difference? I thought it was just about the encoding of the function argument. If we change to use CreateProcessW, does not all argument processing have to be changed as well, to be able to propagate command line options? |
@AlanBateman Related to the topic, I just submitted openjdk/leyden@56a9e59 with experimental change for jlinking hermetic image using a pre-linked static launcher executable (when @slowhog's openjdk/leyden#46 is in place, I'll experiment with collecting the static libs from .jmod and performing native linking). The experimental change currently still writes out a complete jdk image but only the |
Agree with @magicus on the importance of being able to test static builds in mainline. It would be good to include teir1 testing for the static builds on linux-x64 in GHA. Currently, we do static build on linux-x64 in GHA without running any tests. |
@magicus This pull request has been inactive for more than 8 weeks and will be automatically closed if another 8 weeks passes without any activity. To avoid this, simply issue a |
/keepalive |
@magicus The pull request is being re-evaluated and the inactivity timeout has been reset. |
@magicus this pull request can not be integrated into git checkout static-relaunchers
git fetch https://git.openjdk.org/jdk.git master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push |
In the static JDK image, a single humongous java executable is generated, and no other launcher, such as javac. This makes it impossible to run our jtreg tests, which assume these are present.
The solution is fortunately simply: we just need to add a bunch of trivial launchers, which are thin wrappers that execute the main java binary, with the proper arguments. This will result in the same behavior as the normal dynamic launchers, only that we will need to take the detour of launching another process instead of calling directly into the JLI library.
Progress
Error
Warnings
Issue
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/24380/head:pull/24380
$ git checkout pull/24380
Update a local copy of the PR:
$ git checkout pull/24380
$ git pull https://git.openjdk.org/jdk.git pull/24380/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 24380
View PR using the GUI difftool:
$ git pr show -t 24380
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/24380.diff
Using Webrev
Link to Webrev Comment