Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions lib/tests/transitions/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,18 @@ diff_test(
],
)

genrule(
name = "dynamic_path",
outs = ["dynamic_path.txt"],
cmd = "echo $(RULEDIR) > $@",
)

platform_transition_filegroup(
name = "transitioned_dynamic_path",
srcs = ["dynamic_path.txt"],
target_platform = ":armv7_linux",
)

go_binary(
name = "test_transition_binary",
embed = [":transitions_lib"],
Expand Down
1 change: 1 addition & 0 deletions lib/transitions.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ platform_transition_filegroup = rule(
),
"srcs": attr.label_list(
allow_empty = False,
allow_files = True,
cfg = _transition_platform,
Comment on lines 39 to 42
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Handle File inputs before enabling allow_files

With allow_files = True, ctx.attr.srcs may contain File objects for file labels (including generated outputs). _platform_transition_filegroup_impl later indexes each src as src[DefaultInfo], which only works for targets, so using a file label will now fail at analysis time with a type/provider error. This means the new support for generated files is still broken unless the implementation switches to ctx.files.srcs (and handles runfiles separately) or branches on File vs target.

Useful? React with 👍 / 👎.

doc = "The input to be transitioned to the target platform.",
),
Expand Down