Skip to content

Conversation

@chrisnovakovic
Copy link
Contributor

Add a runtime_deps parameter, allowing for the declaration of run-time dependencies, to build_rule and several of the built-in build definitions that permit binary outputs.

The semantics of runtime_deps are a combination of the semantics of deps and data. If the output of a build_rule is marked as binary, targets listed in runtime_deps are:

  • guaranteed to have been built before the dependent target runs;
  • copied into build and test environments alongside the dependent target.

Like build-time dependencies declared with deps, run-time dependencies are computed transitively; i.e., if target A has a run-time dependency on target B which in turn has a run-time dependency on target C, targets B and C will be built before plz running target A, and the outputs of targets B and C will be copied into build environments (or test environments, if target A is a test) alongside the outputs of target A. Unlike build-time dependencies, downward searches for transitive run-time dependencies are not blocked by the output_is_complete parameter.

Add a `runtime_deps` parameter, allowing for the declaration of run-time
dependencies, to `build_rule` and several of the built-in build
definitions that permit binary outputs.

The semantics of `runtime_deps` are a combination of the semantics of
`deps` and `data`. If the output of a `build_rule` is marked as binary,
targets listed in `runtime_deps` are:

- guaranteed to have been built before the dependent target runs;
- copied into build and test environments alongside the dependent
  target.

Like build-time dependencies declared with `deps`, run-time dependencies
are computed transitively; i.e., if target A has a run-time dependency
on target B which in turn has a run-time dependency on target C, targets
B and C will be built before `plz run`ning target A, and the outputs of
targets B and C will be copied into build environments (or test
environments, if target A is a test) alongside the outputs of target A.
Unlike build-time dependencies, downward searches for transitive
run-time dependencies are not blocked by the `output_is_complete`
parameter.
cmd = "touch $OUTS",
)

def target(name:str, build_tests:list=[], post_build:function=None, requires:list=None, provides:dict=None,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love this ❤️

@chrisnovakovic chrisnovakovic merged commit 45c3a27 into thought-machine:master Nov 13, 2025
13 checks passed
@chrisnovakovic chrisnovakovic deleted the runtime_deps-v2 branch November 13, 2025 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants