Skip to content

Commit c35d666

Browse files
authored
fix: compatibility with symbolic macros (#488)
### Changes are visible to end-users: yes - Searched for relevant documentation and updated as needed: yes - Breaking change (forces users to change their own code or config): no - Suggested release notes appear below: yes See https://bazel.build/extending/macros#naming, these naming conventions are violated by this legacy macro (and thus by a symbolic macro wrapping this legacy macro) ### Test plan - Covered by existing test cases
1 parent 0b3c298 commit c35d666

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

py/defs.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ resolutions = _resolutions
6161

6262
def _py_binary_or_test(name, rule, srcs, main, deps = [], resolutions = {}, **kwargs):
6363
# Compatibility with rules_python, see docs in py_executable.bzl
64-
main_target = "_{}.find_main".format(name)
64+
main_target = "{}.find_main".format(name)
6565
determine_main(
6666
name = main_target,
6767
target_name = name,

py/private/py_image_layer.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ awk < $< 'BEGIN {
8080
""" % (mtree_begin_blocks, root, ifs, name)
8181

8282
native.genrule(
83-
name = "_{}_manifests".format(name),
83+
name = "{}_manifests".format(name),
8484
srcs = [name + ".manifest"],
8585
outs = [
8686
"{}.{}.manifest.spec".format(name, group_name)
@@ -146,7 +146,7 @@ def py_image_layer(name, binary, root = "/", layer_groups = {}, compress = "gzip
146146
# Finally create layers using the tar rule
147147
srcs = []
148148
for group_name in group_names:
149-
tar_target = "_{}_{}".format(name, group_name)
149+
tar_target = "{}_{}".format(name, group_name)
150150
tar(
151151
name = tar_target,
152152
srcs = [binary],

py/tests/py_image_layer/asserts.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ load("@aspect_bazel_lib//lib:write_source_files.bzl", "write_source_file")
22

33
# buildifier: disable=function-docstring
44
def assert_tar_listing(name, actual, expected):
5-
actual_listing = "_{}_listing".format(name)
5+
actual_listing = "{}_listing".format(name)
66
native.genrule(
77
name = actual_listing,
88
srcs = actual,
@@ -18,4 +18,4 @@ def assert_tar_listing(name, actual, expected):
1818
out_file = expected,
1919
testonly = True,
2020
tags = ["skip-on-bazel6"],
21-
)
21+
)

0 commit comments

Comments
 (0)