Propagate tags through opentitan_rom_binary
Bazel observes tags only for leaf targets when run with
--build_tag_filters so we need to explicitly propagate tags when emitting
rules. This allows specifying "all" with a subset of the targets based
on filters.
Bypass-Presubmit-Reason: previously tested
Change-Id: I048f025194888c53664d8a92edcf88699ca2f59d
diff --git a/rules/matcha.bzl b/rules/matcha.bzl
index bf4886a..49fac79 100644
--- a/rules/matcha.bzl
+++ b/rules/matcha.bzl
@@ -148,6 +148,7 @@
per_device_deps = device_deps("secure_core"),
platform = OPENTITAN_PLATFORM,
testonly = False,
+ tags = [],
**kwargs):
"""A helper macro for generating OpenTitan binary artifacts for ROM.
@@ -160,6 +161,7 @@
per_device_deps: List of devices and device deps to build the target for.
platform: The target platform for the artifacts.
testonly: The target is built for test only.
+ tags: List of tags to apply to each target.
**kwargs: Arguments to forward to `opentitan_binary`.
Emits rules:
For each device in per_device_deps entry:
@@ -190,6 +192,7 @@
deps = deps + dev_deps,
extract_sw_logs_db = device == "sim_dv",
testonly = testonly,
+ tags = tags,
**kwargs
))
@@ -206,6 +209,7 @@
bin = bin_name,
platform = platform,
testonly = testonly,
+ tags = tags,
word_size = 32,
)
@@ -217,6 +221,7 @@
srcs = [elf_name],
platform = platform,
testonly = testonly,
+ tags = tags,
)
# Create a filegroup with just the current device's targets.
@@ -224,6 +229,7 @@
name = devname,
srcs = dev_targets,
testonly = testonly,
+ tags = tags,
)
all_targets.extend(dev_targets)
@@ -232,6 +238,7 @@
name = name,
srcs = all_targets,
testonly = testonly,
+ tags = tags,
)
def flash_binary(