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

Missing CC Toolchains for macOS AMD and ARM #3997

Open
YukiDayDreamer opened this issue Jul 26, 2024 · 1 comment
Open

Missing CC Toolchains for macOS AMD and ARM #3997

YukiDayDreamer opened this issue Jul 26, 2024 · 1 comment

Comments

@YukiDayDreamer
Copy link

What version of rules_go are you using?

0.42.0

What version of gazelle are you using?

0.33.0

What version of Bazel are you using?

6.4.0

Does this issue reproduce with the latest releases of all the above?

Yes.

What operating system and processor architecture are you using?

Linux, AMD64

Any other potentially useful information about your toolchain?

Also use 0.10.3 LLVM toolchain.

What did you do?

I ran bazel build //FOO_TARGET --platforms=@io_bazel_rules_go//go/toolchain:darwin_amd64 and bazel build //FOO_TARGET --platforms=@io_bazel_rules_go//go/toolchain:darwin_arm64.

When we upgraded from bazel version from 5.4.0 to 6.4.0, we found a missing cc toolchain error: in cc_toolchain_alias rule @bazel_tools//tools/cpp:current_cc_toolchain: Unable to find a CC toolchain using toolchain resolution. Did you properly set --platforms?

But this build succeed on Windows:
bazel build //FOO_TARGET --platforms=@io_bazel_rules_go//go/toolchain:windows_amd64

What did you expect to see?

It should build successfully.

What did you see instead?

The current workaround we have is to add https://github.com/uber/hermetic_cc_toolchain to make the cc toolchain to be discovered again.

load("@hermetic_cc_toolchain//toolchain:defs.bzl", zig_toolchains = "toolchains")

zig_toolchains()

register_toolchains(
    "@zig_sdk//toolchain:darwin_amd64",
    "@zig_sdk//toolchain:darwin_arm64",
)
@aaomidi
Copy link

aaomidi commented Aug 30, 2024

There are some issues with hermetic_cc_toolchain and MacOS specifically: uber/hermetic_cc_toolchain#10

I was running Bazel in a Nix shell environment, and had to setup llvm toolchains to get it working on MacOS consistently.

If I don't use a Nix shell environment though, bazel builds worked fine (TM)

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