You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The implementation of --incompatible_allow_tags_propagation deliberately only propagates certain tags to the ExecutionInfo of an action. The filtering on tags appears to be accomplished via legalExecInfoKeys() in src/main/java/com/google/devtools/build/lib/packages/TargetUtils.java.
The surprise is that the keys of the execution_requirements dict parameter to ctx.actions.run() and cts.actions.run_shell() are also filtered in this way.
By contrast, the keys of the implicit rule attribute exec_properties are not filtered.
I can understand wanting to limit what tags propagate into ExecutionInfo. But since execution_requirements is explicitly there only for augmenting ExecutionInfo it is most surprising and counterintuitive that its keys would be filtered, especially because the keys of exec_properties are not filtered.
Which category does this issue belong to?
Core
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
With the following BUILD.bazel:
load(":repro.bzl", "repro_run", "repro_run_shell")
# The tags are filtered by legalExecInfoKeys(), so only
# "supports-repro-tag" makes it into ExecutionInfo, as intended.
REPRO_TAGS = [
"RENEGADE-repro-tag", # does not satisfy legalExecInfoKeys()
"supports-repro-tag", # satisfies legalExecInfoKeys()
]
# Both entries in this exec_properties dict make it into ExecutionInfo,
# as expected.
REPRO_EXEC_PROPERTIES = {
"RENEGADE-repro-exec-property": "", # does not satisfy legalExecInfoKeys()
"supports-repro-exec-property": "", # satisfies legalExecInfoKeys()
}
# The surprise is that the keys of this execution_requirements
# dict get filtered by legalExecInfoKeys(), so only
# "supports-repro-execution-requirement" makes it into ExecutionInfo.
REPRO_EXECUTION_REQUIREMENTS = {
"RENEGADE-repro-execution-requirement": "", # does not satisfy legalExecInfoKeys()
"supports-repro-execution-requirement": "", # satisfies legalExecInfoKeys()
}
repro_run(
name = "repro-run",
out = "repro-run.out",
tags = REPRO_TAGS,
exec_properties = REPRO_EXEC_PROPERTIES,
execution_requirements = REPRO_EXECUTION_REQUIREMENTS,
)
repro_run_shell(
name = "repro-run-shell",
out = "repro-run-shell.out",
tags = REPRO_TAGS,
exec_properties = REPRO_EXEC_PROPERTIES,
execution_requirements = REPRO_EXECUTION_REQUIREMENTS,
)
In other words, I would expect to see legalExecInfoKeys() apply only to tags, and not to the keys of the execution_requirements parameter to ctx.actions.run() or ctx.actions.run_shell().
Which operating system are you running Bazel on?
Ubuntu 20.04
What is the output of bazel info release?
release 8.0.0
If bazel info release returns development 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 ?
No response
If this is a regression, please try to identify the Bazel commit where the bug was introduced with bazelisk --bisect.
This also occurs in Bazel 7.2.1. I did not try to see just how far back this behavior goes.
Have you found anything relevant by searching the web?
No
Any other information, logs, or outputs that you want to share?
No response
The text was updated successfully, but these errors were encountered:
Does this also happen with the propagation flag unflipped?
Yes.
With --noincompatible_allow_tags_propagation the tags no longer get added to the ExecutionInfo, but the execution_requirements dict keys are still filtered.
Description of the bug:
The implementation of
--incompatible_allow_tags_propagation
deliberately only propagates certain tags to theExecutionInfo
of an action. The filtering on tags appears to be accomplished vialegalExecInfoKeys()
insrc/main/java/com/google/devtools/build/lib/packages/TargetUtils.java
.The surprise is that the keys of the
execution_requirements
dict parameter toctx.actions.run()
andcts.actions.run_shell()
are also filtered in this way.By contrast, the keys of the implicit rule attribute
exec_properties
are not filtered.I can understand wanting to limit what
tags
propagate intoExecutionInfo
. But sinceexecution_requirements
is explicitly there only for augmentingExecutionInfo
it is most surprising and counterintuitive that its keys would be filtered, especially because the keys ofexec_properties
are not filtered.Which category does this issue belong to?
Core
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
With the following
BUILD.bazel
:and the following
repro.bzl
:and an empty
MODULE.bazel
file, I see the following:but I would expect to see the following:
In other words, I would expect to see
legalExecInfoKeys()
apply only totags
, and not to the keys of theexecution_requirements
parameter toctx.actions.run()
orctx.actions.run_shell()
.Which operating system are you running Bazel on?
Ubuntu 20.04
What is the output of
bazel info release
?release 8.0.0
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
?No response
If this is a regression, please try to identify the Bazel commit where the bug was introduced with bazelisk --bisect.
This also occurs in Bazel 7.2.1. I did not try to see just how far back this behavior goes.
Have you found anything relevant by searching the web?
No
Any other information, logs, or outputs that you want to share?
No response
The text was updated successfully, but these errors were encountered: