Skip to content

Conversation

@meteorcloudy
Copy link
Member

@meteorcloudy meteorcloudy commented Jun 1, 2023

Rolling forward 975866a (which was rollbacked at d51c75f) with fixes.

  • Introduces a rules_java_builtin repo in WORKSPACE prefix to avoid conflict with user defined rules_java.
    • @bazel_tools//tools/jdk/*.bzl loads from rules_java_builtin through repo-mappings.
    • @local_jdk was overridden in jdk.WORKSPACE to add repo_mapping for rules_java.
    • jdk.WORKSPACE explicitly loads from rules_java_builtin for JDK definitions and java toolchain definitions.
  • Allow using __SKIP_WORKSPACE_PREFIX__ and __SKIP_WORKSPACE_SUFFIX__ in WORKSPACE comment.
  • Re-export more symbols from @bazel_tools to be backward-compatible.

Fixes #18551

Related:

@meteorcloudy meteorcloudy requested review from a team as code owners June 1, 2023 18:12
@meteorcloudy meteorcloudy requested review from aiuto and removed request for a team June 1, 2023 18:12
@github-actions github-actions bot added awaiting-review PR is awaiting review from an assigned reviewer team-Configurability platforms, toolchains, cquery, select(), config transitions team-Remote-Exec Issues and PRs for the Execution (Remote) team team-Rules-Java Issues for Java rules labels Jun 1, 2023
@meteorcloudy meteorcloudy marked this pull request as draft June 1, 2023 18:16
@meteorcloudy meteorcloudy force-pushed the respect_rules_java_second_try branch from 4f7629b to f55459f Compare June 1, 2023 18:35
@meteorcloudy meteorcloudy changed the title Respect rules java second try Respect rules_java as the source of truth for java toolchains (second try) Jun 2, 2023
@meteorcloudy meteorcloudy force-pushed the respect_rules_java_second_try branch 2 times, most recently from 2c1f5b7 to 857fe5d Compare June 2, 2023 13:52
@meteorcloudy meteorcloudy force-pushed the respect_rules_java_second_try branch 3 times, most recently from 4f97edd to 0894e0a Compare June 5, 2023 10:53
copybara-service bot pushed a commit to bazelbuild/rules_java that referenced this pull request Jun 5, 2023
Accepting additional args for local_java_repository

This is required so that we can add repo_mapping attribute for `local_jdk` so that we can redirect rules_java to rules_java_builtin in bazelbuild/bazel#18558 to resolve the breakages for downstream projects.

END_PUBLIC

PiperOrigin-RevId: 537840788
Change-Id: I10df4474df4864101ee702705340626ebda07f4f
This is only for making it easier to setup integration tests.
… prefix

Enable shared repo for testing for rules_java_builtin

Mock rules_java_builtin

Also clear workspace prefix

Fix bugs

Fix android tests

Fix more tests

More test fixes

Fix blackbox tests

More fixes

Mock more files for rules_java
@meteorcloudy meteorcloudy force-pushed the respect_rules_java_second_try branch from 0894e0a to 91114cb Compare June 5, 2023 13:22
@copybara-service copybara-service bot closed this in 3029a7d Jun 7, 2023
amishra-u pushed a commit to amishra-u/bazel that referenced this pull request Jun 7, 2023
… try)

Rolling forward bazelbuild@975866a (which was rollbacked at bazelbuild@d51c75f) with fixes.

- Introduce a `rules_java_builtin` repo in WORKSPACE prefix to avoid conflict with user defined rules_java.
    - `@bazel_tools//tools/jdk/*.bzl` loads from `rules_java_builtin` through repo-mappings.
    - `@local_jdk` was overridden in `jdk.WORKSPACE` to add repo_mapping for `rules_java`.
    - `jdk.WORKSPACE` explicitly loads from `rules_java_builtin` for JDK definitions and java toolchain definitions.
- Allow using `__SKIP_WORKSPACE_PREFIX__` and `__SKIP_WORKSPACE_SUFFIX__` in WORKSPACE comment.
- Fixed many tests by adjusting the WORKSPACE file content.
- Re-export more symbols from `@bazel_tools` to be backward-compatible.

Fixes bazelbuild#18551

Related:
- bazelbuild#18373
- bazelbuild/rules_java#110
- bazelbuild#18423

Closes bazelbuild#18558.

PiperOrigin-RevId: 538483417
Change-Id: I5223eec2c4b10131fc8c5b342237385ff2f56413
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-review PR is awaiting review from an assigned reviewer team-Configurability platforms, toolchains, cquery, select(), config transitions team-Remote-Exec Issues and PRs for the Execution (Remote) team team-Rules-Java Issues for Java rules

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bazel downstream projects are broken due to out-dated rules_java version with Bazel@HEAD

1 participant