fix: Allow generated files in platform_transition_filegroup#1240
fix: Allow generated files in platform_transition_filegroup#1240philsc wants to merge 1 commit intobazel-contrib:mainfrom
Conversation
87d421e to
cb81d62
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cb81d622e3
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| "srcs": attr.label_list( | ||
| allow_empty = False, | ||
| allow_files = True, | ||
| cfg = _transition_platform, |
There was a problem hiding this comment.
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 👍 / 👎.
|
I'm currently running into this error:
$ bazel build //lib/tests/transitions:transitioned_dynamic_path
INFO: Invocation ID: ea3f3d4e-ea1a-49cc-84b5-e5d5e1577aaa
ERROR: /home/philipp.schrader/repos/bazel-lib/lib/tests/transitions/BUILD.bazel:104:30: in srcs attribute of platform_transition_filegroup rule //lib/tests/transitions:transitioned_dynamic_path: generated file '//lib/tests/transitions:dynamic_path.txt' is misplaced here (expected no files)
ERROR: /home/philipp.schrader/repos/bazel-lib/lib/tests/transitions/BUILD.bazel:104:30: Analysis of target '//lib/tests/transitions:transitioned_dynamic_path' (config: 4996c2f) failed
ERROR: Analysis of target '//lib/tests/transitions:transitioned_dynamic_path' failed; build aborted
INFO: Elapsed time: 0.077s, Critical Path: 0.00s
INFO: 1 process: 1 internal.
ERROR: Build did NOT complete successfully
Fix the issue by allowing files in the `srcs` attribute.
This is useful if the `genrule` is operating on a transitioned binary
of some kind.
cb81d62 to
f152912
Compare

I'm currently running into this error:
Fix the issue by allowing files in the
srcsattribute.This is useful if the
genruleis operating on a transitioned binaryof some kind.