Hi,
Currently, I'm working to improve the correctness of the input specification for build targets in Chromium. And I sometimes want to propagate inputs from action targets to dependent targets.
e.g. imported proto files for protobuf compilation, or imported TS files for TypeScript compilation
But if we want to propagate inputs in an action to dependent targets, we need to use config with public_configs like
```
config("A_input") {
inputs = [ "A.proto" ]
}
action("A") {
script = "run_protoc.py"
args = [...]
public_configs = [ ":A_input" ] # This adds A.proto as inputs for this action.
}
action("B") {
script = "run_protoc.py"
args = [ ... ]
inputs = [ "B.proto" ] # This imports A.proto
deps = [ ":A" ] # A's public_configs propagate A.proto as inputs for B.
}
```
To simplify such configs, I'd like to introduce public_inputs variable for action target and write the above action like
```
action("A") {
script = "run_protoc.py"
args = [...]
public_inputs = [ "A.proto" ]
}
action("B") {
script = "run_protoc.py"
args = [ ... ]
inputs = [ "B.proto" ] # This imports A.proto
deps = [ ":A" ] # A's public_inputs propagate A.proto as inputs for B.
}
```
I choose `public_` prefix as this also mathces with public variable for C/C++'s public header variable in source_set/shared_library/executable target.
With this feature, we can simplify some existing configs using both config and public_configs in chromium.
Let me know if you have any concerns or alternative designs to support this.
Thanks,
Takuto
-- Takuto Ikuta
Software Engineer in Tokyo
Chrome Ops (chrome browser build team)