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

Add --{no,}autodetect_server_javabase. #12542

Conversation

AustinSchuh
Copy link
Contributor

We want bazel to fail to start instead of falling back to a host
JRE/JDK. We are using a hermetic JDK and the embedded JRE, so there
should be no need to use anything from the host. We've debugged enough
cases so far where the host installed JDK was buggy and causing random
crashes on specific machines.

Fixes: #12451

We want bazel to fail to start instead of falling back to a host
JRE/JDK.  We are using a hermetic JDK and the embedded JRE, so there
should be no need to use anything from the host.  We've debugged enough
cases so far where the host installed JDK was buggy and causing random
crashes on specific machines.

Fixes: bazelbuild#12451
@google-cla google-cla bot added the cla: yes label Nov 24, 2020
@comius comius self-assigned this Nov 24, 2020
@comius comius requested review from comius and removed request for jin, aiuto, gregestren and floriographygoth November 24, 2020 07:24
@AustinSchuh
Copy link
Contributor Author

It should be pretty easy to make the test pass, but can you confirm the approach looks sane?

@comius
Copy link
Contributor

comius commented Dec 3, 2020

It should be pretty easy to make the test pass, but can you confirm the approach looks sane?

Yes, it's ok.

Mind also adding a test for it? This will ensure that somebody else won't break the feature later. There are integration tests in //src/test/shell/integration. statup_options or java_integration_test should get you started, but there is no integration test on //src:bazel_nojdk, so you'll need to set it up.

@jin jin added the team-Rules-Java Issues for Java rules label Dec 4, 2020
@AustinSchuh
Copy link
Contributor Author

AustinSchuh commented Dec 6, 2020

Sure, done. That was surprisingly easy. Tested both normal and nojdk bazel with --autodetect_server_javabase and --noautodetect_server_javabase.

FATAL: The install_base directory '/var/lib/buildkite-agent/bazeltest/install_base' contains a different Bazel version (found aa41a738151267f7716fdef640010dd7 but this binary is 8dc389309eace6214919196718842380).  Remove it or specify a different --install_base.
@comius
Copy link
Contributor

comius commented Dec 11, 2020

Nice implementation, thanks for your effort! Sorry for the delay.

frc971-automation pushed a commit to frc971/971-Robot-Code that referenced this pull request Dec 13, 2020
This is the upstream rc6 branch with two cherry-picks:

Fix a couple of bugs with Incompatible Target Skipping
bazelbuild/bazel#12560

Add --{no,}autodetect_server_javabase
bazelbuild/bazel#12542

This patch also uses the new --noautodetect_server_javabase flag.

Change-Id: I7a397e4a9f17b942d0f81c7affb829d2de385a30
@bazel-io bazel-io closed this in 07400c0 Dec 14, 2020
@AustinSchuh AustinSchuh deleted the austin/autodetect_server_javabase branch December 19, 2020 04:32
meisterT pushed a commit that referenced this pull request Jan 12, 2021
We want bazel to fail to start instead of falling back to a host
JRE/JDK.  We are using a hermetic JDK and the embedded JRE, so there
should be no need to use anything from the host.  We've debugged enough
cases so far where the host installed JDK was buggy and causing random
crashes on specific machines.

Fixes: #12451

Closes #12542.

PiperOrigin-RevId: 347411720
ulfjack pushed a commit to EngFlow/bazel that referenced this pull request Mar 5, 2021
We want bazel to fail to start instead of falling back to a host
JRE/JDK.  We are using a hermetic JDK and the embedded JRE, so there
should be no need to use anything from the host.  We've debugged enough
cases so far where the host installed JDK was buggy and causing random
crashes on specific machines.

Fixes: bazelbuild#12451

Closes bazelbuild#12542.

PiperOrigin-RevId: 347411720
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes team-Rules-Java Issues for Java rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No way exists to ignore a host JDK
3 participants