-
Notifications
You must be signed in to change notification settings - Fork 306
Open
Description
We found a funny behaviour: if you use an Artifact in AnalysisActions.write() or AnalysisActions.write_json(), it won't propagate dependencies when with_inputs is True; you have to use the return value. This isn't true of e.g. ctx.actions.run, e.g., I think?
@JakobDegen says this is still a bug in main.
This gets annoying if one is using dynamic actions since the dynamic actions cannot pass anything out to the non-dynamic world except by putting something into an artifact, and you can't just .. replace the identity of the artifact like we have to do in this example:
Good:
written = ctx.actions.write(
"container_upload.sh",
cmd_args(
"#!/usr/bin/env bash",
"set -euo pipefail",
cmd_args(
# ctx.attrs.build_container,
"FIXME",
cmd_args(build_plan, quote = "shell"),
"\"$@\"",
delimiter = " ",
),
),
is_executable = True,
with_inputs = True,
)Bad:
runner = ctx.actions.declare_output("container_upload.sh")
ctx.actions.write(
runner.as_output(),
cmd_args(
"#!/usr/bin/env bash",
"set -euo pipefail",
cmd_args(
# ctx.attrs.build_container,
"FIXME",
cmd_args(build_plan, quote = "shell"),
"\"$@\"",
delimiter = " ",
),
),
is_executable = True,
with_inputs = True,
)Metadata
Metadata
Assignees
Labels
No labels