Skip to content

Commit

Permalink
Avoid emitting canonical labels into repo rules
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.
  • Loading branch information
fmeum committed Jan 9, 2024
1 parent e7a0086 commit 1bbb52e
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 30 deletions.
6 changes: 3 additions & 3 deletions MODULE.bazel.lock

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

47 changes: 29 additions & 18 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 @@ -192,8 +192,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 @@ -226,7 +224,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 1bbb52e

Please sign in to comment.