bazelbuild / bazelbuild/bazel-skylib
support accepting files in analysis_test.targets
- Dominant language
- Starlark
- Stars
- 444
- Forks
- 202
- PR merge metrics
- No merged PRs in 30d
Description
One may want to specify:
```
analysis_test(
name = "my_test",
targets = ["foo.o"],
```
But currently `targets` does not support files.
At first glance, this would seem easy to implement, using `attr.label_list.allow_files`, however, this approach poses a different problem: one can then specify a file that does not actually exist, and the analysis_test thus passes.
Thus, the above example test might fail if the rule generating `foo.o` fails, but the following would pass:
```
analysis_test(
name = "my_test",
targets = ["foo.o_oopsfatfinger"],
```
We'd need some way to ensure an input file actually exists to implement this feature.
Contributor guide
Research direction
Start by locating the implementation of analysis_test and how its targets attribute is declared; the issue specifically mentions attr.label_list.allow_files. Investigate how the rule can distinguish an existing generated file from a misspelled target, and consider the examples in the issue as acceptance cases: valid files should be accepted while nonexistent files should fail.
Written by the indexing model from the issue text.
Assessment
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100