Skip to content

Commit

Permalink
[7.1.0] Avoid emitting canonical labels into generated repos (#20917)
Browse files Browse the repository at this point in the history
As long as #20722 isn't resolved, the canonical name for the given
apparent name can change without the repo rule being refetched.

Closes #20810.
Commit
1c45bc5

PiperOrigin-RevId: 597048244
Change-Id: I225424cc32e572b26c6d6e76e2c09c4d2e6a4ba6

---------

Co-authored-by: Fabian Meumertzheim <[email protected]>
  • Loading branch information
keertk and fmeum authored Jan 17, 2024
1 parent 86a5f6b commit 572f5ea
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 22 deletions.
12 changes: 6 additions & 6 deletions MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions src/test/tools/bzlmod/MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions tools/build_defs/repo/http.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,6 @@ def _http_file_impl(ctx):
return _update_integrity_attr(ctx, _http_file_attrs, download_info)

_HTTP_JAR_BUILD = """\
load("{rules_java_defs}", "java_import")
package(default_visibility = ["//visibility:public"])
java_import(
Expand Down Expand Up @@ -220,7 +218,6 @@ def _http_jar_impl(ctx):
ctx.file("WORKSPACE", "workspace(name = \"{name}\")".format(name = ctx.name))
ctx.file("jar/BUILD", _HTTP_JAR_BUILD.format(
file_name = downloaded_file_name,
rules_java_defs = str(Label("@rules_java//java:defs.bzl")),
))

return _update_integrity_attr(ctx, _http_jar_attrs, download_info)
Expand Down
6 changes: 0 additions & 6 deletions tools/build_defs/repo/jvm.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -288,11 +288,6 @@ def jvm_maven_import_external(
srcjar_urls = kwargs.pop("srcjar_urls", None)

rule_name = kwargs.pop("rule_name", "java_import")
rules_java_defs = str(Label("@rules_java//java:defs.bzl"))
rule_load = kwargs.pop(
"rule_load",
'load("{}", "java_import")'.format(rules_java_defs),
)

if fetch_sources:
src_coordinates = struct(
Expand All @@ -315,7 +310,6 @@ def jvm_maven_import_external(
srcjar_urls = srcjar_urls,
canonical_id = artifact,
rule_name = rule_name,
rule_load = rule_load,
tags = tags,
**kwargs
)

0 comments on commit 572f5ea

Please sign in to comment.