New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Propagate exec_properties from toolchains #16743
Comments
It is an accident that the rule |
Hi @katre! |
I discussed this with @moroten at BazelCon (it was great to talk to you), and I think this is probably the proper solution: First, define constraints and execution platforms for your different execution clusters:
Then, define platforms for your specific target hardware:
Finally, define the toolchains you need, giving them the licensing constraints:
Then, when you |
Thanks for the input @katre! I followed your example and managed to map my targets to different remote workers depending on what I tried to solve it using I would have expected the local/remote problem to be solved using spawn strategies. The parameters |
Unfortunately, at the current time there is a divergence in support of execution platforms and execution strategies: while logically some execution platforms are only compatible with certain strategies (ie, a remote platform only works with the remote strategy, the host platform only works with the local or sandbox strategy, etc), this isn't part of Bazel's internal decision making and so it's required to keep the flags and execution platforms in sync manually. This is especially problematic with tests that are tagged as We have plans to deal with this but unfortunately not a schedule. |
…tingRule. Addresses #16743 by making the case impossible. PiperOrigin-RevId: 491995488 Change-Id: I2b2d3230b775160d9d17a7069a35f085d22ccf74
Description of the feature request:
The field
exec_properties
in a toolchain does not propagate to remote execution.As a rule can depend on multiple toolchains, I would expect all the exec_properties from all toolchains to be merged to the action. Manually propagating
exec_properties
to ctx.actions.run would be difficult because many rule developers would most probably forget to do that andctx.actions.run
is also missing the fieldexec_properties
.What underlying problem are you trying to solve with this feature?
From https://groups.google.com/g/bazel-discuss/c/YeEsT4q037c/m/CoZmpaR1AgAJ:
FWIW: My particular use case is to inform the remote execution about tests built by thread/address/memory sanitizer C++ toolchains since such tests normally require more resources to be allocated; one can invent a suitable cc_test wrapper macro and inject the desired
test.xxx
exec_properties, but I would prefer to avoid such hassle.Another use case is that some toolchains depend on installed licenses, which would be nice to propagate this way.
The workaround is to create a number of platforms that aims for a collection of toolchains for different languages and then pinpointing the toolchain resolution to connect the platforms with the specific toolchains.
Which operating system are you running Bazel on?
Linux
What is the output of
bazel info release
?release 5.3.2
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 master; git rev-parse HEAD
?No response
Have you found anything relevant by searching the web?
The only relevant GitHub issue with the word
exec_properties
is #16742 for propagating èxec_properties` constraint values.One relevant thread on bazel-discuss without any answers so far: Toolchain specific exec_properties
Any other information, logs, or outputs that you want to share?
No response
The text was updated successfully, but these errors were encountered: