Replace --define=EXECUTOR=remote with toolchains and selects#26019
Replace --define=EXECUTOR=remote with toolchains and selects#26019fmeum wants to merge 9 commits intobazelbuild:masterfrom
--define=EXECUTOR=remote with toolchains and selects#26019Conversation
--define=EXECUTOR=remote with toolchains and select--define=EXECUTOR=remote with toolchains and selects
dcff9af to
fed82d4
Compare
meteorcloudy
left a comment
There was a problem hiding this comment.
This is very smart, thanks!
/cc @pzembrod to take a look since this is affects C++ rules.
|
@bazel-io fork 8.3.0 |
|
The way launcher_maker is handled isn't quite correct. It probably needs to be depended on as a toolchain. I'll set this to draft for now. |
This allows for cross-platform builds to work seamlessly without a need to manually toggle between prebuilt and from source toolchains.
395a5e9 to
c682fca
Compare
|
@meteorcloudy I switched to a toolchain approach that rules_java, rules_python and rules_shell will be able to adopt via |
c682fca to
43947a5
Compare
|
Nice, is it possible to write a test to verify that with this approach, C++ toolchain dependency won't be propagated by depending on the launcher? |
|
I would like to add such a test (as a Starlark analysis test) to the individual rulesets that adopt the toolchain, where it fits better semantically by more generally verifying that cross-compilation works without a C++ toolchain. |
This allows for cross-platform builds to work seamlessly without a need to manually toggle between prebuilt and from source toolchains. As a positive side effect, this change also paves the way for dropping a dependency on an exec-configured C++ toolchain of Java and Python targets built for non-Windows platforms. Rulesets will need to migrate to using the launcher maker toolchain instead of the `launcher_maker` target. rules_shell wasn't affected by this as it already defined its own launcher toolchain. Work towards #19587 Closes #26019. PiperOrigin-RevId: 758697189 Change-Id: Ibfa272390056963ef35301614520fd38d018210e (cherry picked from commit e819495)
| _single_binary_toolchain_rule = rule( | ||
| implementation = _single_binary_toolchain_rule_impl, | ||
| attrs = { | ||
| "binary": attr.label( |
There was a problem hiding this comment.
should this be cfg=exec? Building on linux for windows is failing because make_launcher for windows is used. The error is from rules_python.
There was a problem hiding this comment.
actaully, maker should be exec and launcher should be target
This allows for cross-platform builds to work seamlessly without a need to manually toggle between prebuilt and from source toolchains.
As a positive side effect, this change also paves the way for dropping a dependency on an exec-configured C++ toolchain of Java and Python targets built for non-Windows platforms. Rulesets will need to migrate to using the launcher maker toolchain instead of the
launcher_makertarget. rules_shell wasn't affected by this as it already defined its own launcher toolchain.Work towards #19587