Constrain macOS-only tool rules to macOS execution platforms - #3044
Open
mauriciogg wants to merge 1 commit into
Open
Constrain macOS-only tool rules to macOS execution platforms#3044mauriciogg wants to merge 1 commit into
mauriciogg wants to merge 1 commit into
Conversation
Several standalone tool rules run macOS-only tools but carry no execution-platform constraint: environment_plist runs xcodebuild/xcrun, apple_intent_library runs xcrun intentbuilderc, apple_metal_library runs xcrun metal/metallib, and apple_bundle_version's versiontool is resolved for the host. The bundling rules already carry this constraint via rule_factory, but in builds that register non-mac execution platforms first (e.g. Linux remote executors used to cross-compile for Apple platforms), these standalone rules resolve to a non-mac execution platform and fail. Also pin default_cc_toolchain_forwarder to macOS - it resolves the C++ toolchain apple binary rules link with, independently of the rule itself (which rule_factory pins to macOS); letting it float hands the mac-executed link action a toolchain resolved for another platform. And switch apple_mac_tools_toolchain's alticonstool to cfg = "target" like the toolchain's other tool attributes: the toolchain target is already resolved for a mac execution platform, so "exec" would re-resolve against the first registered execution platform.
mauriciogg
requested review from
aaronsky,
adincebic,
brentleyjones,
keith and
luispadron
as code owners
August 11, 2026 22:04
Member
|
shouldn't most of these platform selections be done correctly by the toolchain registered in the exec groups? the toolchain itself should be the one forcing actions to run on the right platform. rules that only fetch the "xplat" toolchain but then are being modified here seem like we must be doing something wrong since those should also be up to the toolchain to decide the platform |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Constrain macOS-only tool rules to macOS execution platforms
Several standalone tool rules run macOS-only tools but carry no execution-platform constraint which causes failures where there are multiple execution platforms available. E.g. RBE with a linux toolchains (see rules_applecross)
Also switch
apple_mac_tools_toolchainalticonstool to cfg = "target"like the toolchain's other tool attributes: the toolchain target is already resolved for a mac execution platform, so "exec" would re-resolve against the first registered execution platform.