Skip to content

Commit

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

Closes bazelbuild#20810.

PiperOrigin-RevId: 597048244
Change-Id: I225424cc32e572b26c6d6e76e2c09c4d2e6a4ba6

Closes bazelbuild#20825
  • Loading branch information
fmeum committed Jan 10, 2024
1 parent cac8d12 commit 950d310
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 27 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.

32 changes: 20 additions & 12 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 @@ -198,8 +198,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 @@ -232,7 +230,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 @@ -282,11 +282,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 @@ -309,7 +304,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 950d310

Please sign in to comment.