-
Notifications
You must be signed in to change notification settings - Fork 281
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
Build with JDK 21 #1556
Build with JDK 21 #1556
Conversation
test/BUILD
Outdated
#scala_library( | ||
# name = "JunitRuntimePlatform", | ||
# srcs = [ | ||
# "src/main/scala/scalarules/test/junit/runtime_platform/JunitRuntimePlatformTest.java", | ||
# ], | ||
# deps = ["@io_bazel_rules_scala_junit_junit"], | ||
#) | ||
# | ||
#scala_junit_test( | ||
# name = "JunitRuntimePlatform_test_runner", | ||
# size = "small", | ||
# runtime_jdk = "@bazel_tools//tools/jdk:remote_jdk11", | ||
# suffixes = ["Test"], | ||
# tests_from = [":JunitRuntimePlatform"], | ||
# runtime_deps = [":JunitRuntimePlatform"], | ||
#) |
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.
@simuons are these accidentally commented out, or is there a reason? If there's a reason, please leave a comment in the code.
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.
@liucijus thanks for noting. I forgot about 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.
@liucijus fixed test for jdk > 11. Please take a look.
Add -Djava.security.manager=allow jvm flag to: - tools executed via ctx.actions.run if host jdk is >= 17 - generated test executables if target jdk is >= 17
Make sure compilation toolchain matches runtime target version This test was failing with --java_language_version=21 Because it got compiled with newer jdk than was run.
a9aaa79
to
3233a86
Compare
Codebase doesn't build with jdk 21 with default settings.
Issue is that workers and test runners use SecurityManager which fails at runtime.
Fix is to conditionally add -Djava.security.manager=allow jvm flag to:
This change involves some kind of guessing with which jdk version worker will be run.
JDK is linked into worker/executable runfiles and it matches host jdk (hence added _java_host_runtime attribute to all relevant rules)
Added separate build for jdk 21