Skip to content
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

target_compatible_with appears to be broken in Bazel 7.x #2442

Open
jpsim opened this issue Apr 8, 2024 · 1 comment
Open

target_compatible_with appears to be broken in Bazel 7.x #2442

jpsim opened this issue Apr 8, 2024 · 1 comment

Comments

@jpsim
Copy link
Contributor

jpsim commented Apr 8, 2024

The macos_build_test target_compatible_with field appears to no longer work as of Bazel 7.x.

Repro steps

$ docker run -it --rm swift:5.10 bash
$$ apt-get update && apt-get install -y curl
$$ curl -O -L https://github.com/bazelbuild/bazelisk/releases/download/v1.19.0/bazelisk-linux-arm64
$$ chmod +x bazelisk-linux-arm64
$$ mv bazelisk-linux-arm64 /usr/local/bin/bazel
$$ git clone https://github.com/jpsim/Yams.git
$$ cd Yams
$$ git checkout 5.1.1
$$ bazel build //Tests/...
Extracting Bazel installation...
Starting local Bazel server and connecting to it...
ERROR: /root/.cache/bazel/_bazel_root/6e1a49d43c4d1802da03fcf367427d33/external/bazel_tools/tools/cpp/BUILD:58:19: in cc_toolchain_alias rule @@bazel_tools//tools/cpp:current_cc_toolchain: 
Traceback (most recent call last):
  File "/virtual_builtins_bzl/common/cc/cc_toolchain_alias.bzl", line 26, column 48, in _impl
  File "/virtual_builtins_bzl/common/cc/cc_helper.bzl", line 219, column 17, in _find_cpp_toolchain
Error in fail: Unable to find a CC toolchain using toolchain resolution. Target: @@bazel_tools//tools/cpp:current_cc_toolchain, Platform: @@apple_support~//platforms:macos_x86_64, Exec platform: @@local_config_platform//:host
ERROR: /root/.cache/bazel/_bazel_root/6e1a49d43c4d1802da03fcf367427d33/external/bazel_tools/tools/cpp/BUILD:58:19: Analysis of target '@@bazel_tools//tools/cpp:current_cc_toolchain' failed
ERROR: Analysis of target '//Tests:macOSBuildTest' failed; build aborted: Analysis failed
INFO: Elapsed time: 6.366s, Critical Path: 0.02s
INFO: 2 processes: 1 internal, 1 processwrapper-sandbox.
ERROR: Build did NOT complete successfully
FAILED: 
    Fetching repository @@rules_swift~~non_module_deps~build_bazel_rules_swift_local_config; starting
    Fetching repository @@bazel_tools~cc_configure_extension~local_config_cc; starting

This worked with Bazel 6.x.

@c16a
Copy link

c16a commented Jun 9, 2024

Just tried to reproduce this and yes it's broken. Seems like the ios_application, watchos_application work, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants