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

[6.2.0] Add version to JavaRuntimeInfo #17913

Merged
merged 4 commits into from
Apr 3, 2023
Merged

Commits on Apr 3, 2023

  1. Add version to JavaRuntimeInfo.

    1. As suggested in #6354 (comment), add a JDK version attribute to the java_runtime rule. This will allow changing behavior based on the Java runtime's version.
    
    2. As an application of the above, pass -Djava.security.manager=allow to Java tests on JDK 17+. This makes the Bazel Java test runner to work on JDK 19. Fixes #14502.
    
    3. To make the above generally useful, the remote_java_repository and local_java_repository must set the new version attribute in the java_runtime rules that they create. This means the old static jdk.BUILD file no longer suffices. Move the contents of jdk.BUILD into a Starlark file, so the version can be interpolated in by JDK repository rules and macros. (This isn't the nicest, but local_java_repository is not a repository rule, so the template cannot be in a non-Starlark file.)
    
    Closes #17775.
    
    PiperOrigin-RevId: 518860040
    Change-Id: I8223b6407dd09528a4e5a6bf12354e5fc68278c6
    
    (cherry picked from commit 7556e11)
    benjaminp authored and hvadehra committed Apr 3, 2023
    Configuration menu
    Copy the full SHA
    8c28017 View commit details
    Browse the repository at this point in the history
  2. Use string.replace() instead of string.format() to avoid issues with …

    …select{} in the template string
    hvadehra committed Apr 3, 2023
    Configuration menu
    Copy the full SHA
    a456b8d View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    85397fd View commit details
    Browse the repository at this point in the history
  4. Fix starlark_repository_test

    Change the grep pattern to exactly match what the test is looking for. The old pattern would match BUILD file content from the jdk_build_file.bzl template
    hvadehra committed Apr 3, 2023
    Configuration menu
    Copy the full SHA
    f51dbf8 View commit details
    Browse the repository at this point in the history