bazelbuild / rules_foreign_cc

Build rules for interfacing with "foreign" (non-Bazel) build systems (CMake, configure-make, GNU Make, boost, ninja, Meson)
https://bazelbuild.github.io/rules_foreign_cc
Apache License 2.0
650 stars 232 forks source link

Remove cpu:x86_64 from mac ninja target #1181

Closed martinblech closed 3 months ago

martinblech commented 3 months ago

Ninja provides universal binaries, the cpu restriction is unnecessary and causes toolchain resolution issues when running on Apple Silicon. E.g.:

INFO: ToolchainResolution: Performing resolution of @@rules_foreign_cc~0.10.1//toolchains:ninja_toolchain for target platform @@local_config_platform//:host
      ToolchainResolution:   Toolchain @@rules_foreign_cc~0.10.1~tools~ninja_1.11.1_linux//:ninja_tool is compatible with target plaform, searching for execution platforms:
      ToolchainResolution:     Incompatible execution platform @@local_config_platform//:host; mismatching values: x86_64, linux
      ToolchainResolution:   Toolchain @@rules_foreign_cc~0.10.1~tools~ninja_1.11.1_mac//:ninja_tool is compatible with target plaform, searching for execution platforms:
      ToolchainResolution:     Incompatible execution platform @@local_config_platform//:host; mismatching values: x86_64
      ToolchainResolution:   Toolchain @@rules_foreign_cc~0.10.1~tools~ninja_1.11.1_win//:ninja_tool is compatible with target plaform, searching for execution platforms:
      ToolchainResolution:     Incompatible execution platform @@local_config_platform//:host; mismatching values: x86_64, windows
      ToolchainResolution: No @@rules_foreign_cc~0.10.1//toolchains:ninja_toolchain toolchain found for target platform @@local_config_platform//:host.
jsharpe commented 3 months ago

1176 is the more complete fix for this as it handles updating the logic for older ninja versions which didn't support Apple Silicon.

martinblech commented 3 months ago

Got it, thank you! Closing this PR in favor of #1176