From e53ce9ea0c36c4affb04a07c189bc5318fff5435 Mon Sep 17 00:00:00 2001 From: David Zbarsky Date: Mon, 23 Dec 2024 16:26:19 -0500 Subject: [PATCH] fix: Compatibility with symbolic macros --- py/defs.bzl | 2 +- py/private/py_image_layer.bzl | 4 ++-- py/tests/py_image_layer/asserts.bzl | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/py/defs.bzl b/py/defs.bzl index fa250767..c21382be 100644 --- a/py/defs.bzl +++ b/py/defs.bzl @@ -61,7 +61,7 @@ resolutions = _resolutions def _py_binary_or_test(name, rule, srcs, main, deps = [], resolutions = {}, **kwargs): # Compatibility with rules_python, see docs in py_executable.bzl - main_target = "_{}.find_main".format(name) + main_target = "{}.find_main".format(name) determine_main( name = main_target, target_name = name, diff --git a/py/private/py_image_layer.bzl b/py/private/py_image_layer.bzl index a98d7581..39f56949 100644 --- a/py/private/py_image_layer.bzl +++ b/py/private/py_image_layer.bzl @@ -80,7 +80,7 @@ awk < $< 'BEGIN { """ % (mtree_begin_blocks, root, ifs, name) native.genrule( - name = "_{}_manifests".format(name), + name = "{}_manifests".format(name), srcs = [name + ".manifest"], outs = [ "{}.{}.manifest.spec".format(name, group_name) @@ -146,7 +146,7 @@ def py_image_layer(name, binary, root = "/", layer_groups = {}, compress = "gzip # Finally create layers using the tar rule srcs = [] for group_name in group_names: - tar_target = "_{}_{}".format(name, group_name) + tar_target = "{}_{}".format(name, group_name) tar( name = tar_target, srcs = [binary], diff --git a/py/tests/py_image_layer/asserts.bzl b/py/tests/py_image_layer/asserts.bzl index 5bccef2b..5755225a 100644 --- a/py/tests/py_image_layer/asserts.bzl +++ b/py/tests/py_image_layer/asserts.bzl @@ -2,7 +2,7 @@ load("@aspect_bazel_lib//lib:write_source_files.bzl", "write_source_file") # buildifier: disable=function-docstring def assert_tar_listing(name, actual, expected): - actual_listing = "_{}_listing".format(name) + actual_listing = "{}_listing".format(name) native.genrule( name = actual_listing, srcs = actual, @@ -18,4 +18,4 @@ def assert_tar_listing(name, actual, expected): out_file = expected, testonly = True, tags = ["skip-on-bazel6"], - ) \ No newline at end of file + )