Support for "runs-before" executable rule dependencies #24468
Labels
team-Rules-API
API for writing rules/aspects: providers, runfiles, actions, artifacts
type: feature request
untriaged
Description of the feature request:
Bazel executable and test rules should be able to express dependencies on other executable rules that should always run before the given exe/test rule. This could probably be implemented as an extension to
DefaultInfo
that allows specifying "runs-before" executable dependencies for executable and test rules. This should only be available to executable and test rules, not build rules.Which category does this issue belong to?
Rules API
What underlying problem are you trying to solve with this feature?
Bazel hates side effects. Fair enough. But bazel also supports side effects with
bazel run
for executable rules. There are use-cases where the side effects of one executable rule are important for the execution of another executable rule. I have a motivating case where the system I'm testing insists on pulling an image from an OCI container registry. AFAIK bazel cannot realistically support container registry artifacts as build outputs, so I'm stuck with manually running the side-effectfuloci_push
to create the necessary conditions for the test to run. It's error-prone and makes Bazel IDE integrations much less usable.Which operating system are you running Bazel on?
Linux / x86_64
What is the output of
bazel info release
?release 7.3.1
If
bazel info release
returnsdevelopment version
or(@non-git)
, tell us how you built Bazel.No response
What's the output of
git remote get-url origin; git rev-parse HEAD
?Have you found anything relevant by searching the web?
No response
Any other information, logs, or outputs that you want to share?
No response
The text was updated successfully, but these errors were encountered: