Optionally traverse srcs and deps for run-time dependencies
#3466
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There are circumstances under which a target might want to inherit the run-time dependencies of certain build-time dependencies, because the target's output is built in such a way that its dependencies don't have their own run-time dependencies resolved. An example of this is the shell-rules plugin's
sh_binaryrule: ash_binaryis a zip file of its dependencies (deps) concatenated onto a shell script preamble that extracts those dependencies into a temporary directory during initialisation. If one of thosedepshappens to have its own run-time dependencies, Please will not resolve them, and they will therefore not be built before the target runs (and will not be sent to the remote worker along with the target's output).Add two parameters to
build_rule-runtime_deps_from_srcsandruntime_deps_from_deps- that indicate to Please that run-time dependencies should additionally be collected from the target'ssrcsanddepsrespectively. This allows build definitions to inherit the run-time dependencies of their sources and/or build-time dependencies if they know they will be needed when running the target they generate.