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

[7.0.0] Fix JVM repository rules with Bzlmod #20088

Merged
merged 1 commit into from
Nov 7, 2023
Merged

Conversation

Wyverald
Copy link
Member

@Wyverald Wyverald commented Nov 7, 2023

  • Lets the http_jar and jvm_{maven_}import_external rules load from @rules_java as resolved within @bazel_tools rather than the calling module extension's repository.
  • Uses the user-provided apparent repository name in jvm_maven_import_external to generate a target name for the jar that makes the shorthand @my_import form work with Bzlmod.
  • Ensure that Bazel loads the http_jar rule with the full repo mapping for bazel_tools so that it sees rules_java, while still loading http_archive with a trivial repo mapping to prevent a cycle during module repo creation. This requires introducing a new key type for BzlLoadFunction.

Closes #19997.

PiperOrigin-RevId: 579002601
Change-Id: I94c85e9759d0913384b10b9bbd0d0cb960cdd89a

* Lets the `http_jar` and `jvm_{maven_}import_external` rules load from `@rules_java` as resolved within `@bazel_tools` rather than the calling module extension's repository.
* Uses the user-provided apparent repository name in `jvm_maven_import_external` to generate a target name for the jar that makes the shorthand `@my_import` form work with Bzlmod.
* Ensure that Bazel loads the `http_jar` rule with the full repo mapping for `bazel_tools` so that it sees `rules_java`, while still loading `http_archive` with a trivial repo mapping to prevent a cycle during module repo creation. This requires introducing a new key type for `BzlLoadFunction`.

Closes #19997.

PiperOrigin-RevId: 579002601
Change-Id: I94c85e9759d0913384b10b9bbd0d0cb960cdd89a
@Wyverald Wyverald requested a review from a team as a code owner November 7, 2023 21:37
@github-actions github-actions bot added awaiting-review PR is awaiting review from an assigned reviewer team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. labels Nov 7, 2023
@keertk keertk self-requested a review November 7, 2023 21:40
@keertk keertk enabled auto-merge (squash) November 7, 2023 21:41
@keertk keertk merged commit 5843aad into release-7.0.0 Nov 7, 2023
34 checks passed
@github-actions github-actions bot removed the awaiting-review PR is awaiting review from an assigned reviewer label Nov 7, 2023
@Wyverald Wyverald deleted the wyv-cp-f4be0b2 branch November 7, 2023 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants