-
Notifications
You must be signed in to change notification settings - Fork 655
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
Support Apple Silicon #2795
Comments
It will be good to support Apple Silicon, and I'm happy to take PRs working toward that. However, I'll note that Bazel doesn't yet officially support Apple Silicon (bazelbuild/bazel#11628), and we don't have arm64 hardware in CI yet. Go support is also close but not there yet (coming in 1.16). So this may not happen right away. |
Thanks!
Sure. At least bazelbuild/bazel#11628 is now fixed (i.e. Bazel officially supports AArch64). |
FYI that Bazel now has an Apple Silicon binary (with support for darwin-arm64): bazelbuild/bazel@8c7e11a that is available for easy download through homebrew. Would be great to work towards toolchain support in rules_go |
Go 1.16 has been released today with AArch64 support: https://tip.golang.org/doc/go1.16#darwin |
Once #2829 is fixed, I'll check whether ARM works. |
It looks like #2829 didn't update all needed dependencies. At least I get the same errors about outdated versions of golang.org/x/net and golang.org/x/sys as before. We still need something like #2827 and #2828. https://github.com/bazelbuild/rules_go/pull/2837/files#diff-47e2b5bc058238377d9e37d788633c409b47cdfce5f9fe4da2937eb7887fb552 only updates golang.org/x/tools and misses everything else. |
Apart from #2795 (comment), tests now generally succeed on ARM-64, with a few minor exceptions:
|
Ah, sorry. In my haste, I didn't realize I'll send a PR to update them shortly. |
Thanks! Unfortunately 64bba9f is still not enough; at least I still get ancient versions of golang.org/x/sys, even after |
@phst Sorry for the oversight. I just tagged rules_go v0.27.0, which updates |
Thanks again! |
I've compared the generated command lines for a |
Sorry for the very delayed reply. I'm afraid the only update I have to share is that plugins should work on darwin/arm64. supported.go is the code the toolchain uses to decide whether something's supported or not, and I'm afraid I don't have bandwidth to dig into it further than that though. |
OK, after a few more hours of debugging, I found the problem, and of course it's a trivial one-liner: |
operating system and processor architecture
bazel version
bazel rules_go version
Error when I tried to build project running
Any ideas how to solve this? plz |
Try |
Now, I've updated the Bazel version and tried to build again my project, but I got this new error shown bellow. Just in case, I've cloned the bazel project and I'd tried to build the project running
Looks like a problem with C/C++ compiler. Any thoughts? |
FYI the fix for bazelbuild/bazel#12671 is not included in Bazel 4.1. |
FWIW I picked up an Apple Silicon machine today and have confirmed the same behaviour @joice is seeing.
|
Good point, I guess we should wait for Bazel 4.2 then. |
No idea, sorry. The Go rules work reasonably well on my machine (with Bazel 4.1 and rules_go 0.27). |
One failure mode that I still see even with
The problem is that this test executable uses a relative filename to reference a dynamic library:
That doesn't work for tests because they are run from the workspace subdirectory of the runfiles root, not the execution root. No idea how to best fix this though; using a relative filename makes sense so that people can e.g. pick a different output base. But to produce binaries that work in both actions and tests, the dynamic linker needs to search both the execution root and the runfiles root. |
Bazel version We just updated the project on 4.1 bazel and now it's not working, strange with 3.7 it was okay. |
got the |
Is there any progress for this topic? Can we use bazel-4.2.1-darwin-arm64 to compile go code in Apple Silicon? |
@linzhp is using rules_go on Apple Silicon as his daily driver, so I think we can close this. Any bugs in the support should be opened as separate issues. |
@weixiao-huang Yes, you can use Bazel 4.2.1 and rules_go 0.29 to build Go code in Apple Silicon. For all other people having issues, please upgrade Bazel and rules_go |
I upgrade new version of Bazel (4.2.2) and rules_go(0.29), but I still get error Which version I can use? |
Please open a new issue along with enough information to reproduce the problem, ideally in the form of a github repo where we can run a command and see the issue. Thanks |
Do make sure your version of rules_go is actually 0.29 and not being pinned transitively to an older version via some other repo. |
starting to also get the above after an os update. will file a ticket. |
Also hitting this issue. Cloning intel darwin bazel project over to M1 mac, see this error :
arch :
|
I am getting this error again on my M1 with Bazel-5.0.0-homebrew
WORKSPACE
BUILD (root)
BUILD(under cmd)
Output
|
Wanted to note: we too have been seeing this issue recently, right after enabling We are on
We've found that after the change, if they do a Raising it in case there's anything to be done from y'all's perspective for this. We're going to update to Our WORKSPACE load for
|
Can you submit a new issue for that? We see this as well, another workaround I've been using is to bump the go_version, which seems to force it to fix itself |
I'm also seeing this error as well on an M1 with different combinations
This in combination with the latest rules_scala |
Oh my, I just figured something.. after I found this line: I tried in my iterm |
What version of rules_go are you using?
Current head, commit hash da0f36c
What version of gazelle are you using?
None
What version of Bazel are you using?
4.0.0
Does this issue reproduce with the latest releases of all the above?
Yes
What operating system and processor architecture are you using?
macOS, ARM64
Any other potentially useful information about your toolchain?
rules_go/go/private/sdk.bzl
Line 232 in a322b06
uname -m
orarch
, like the Linux branch.What did you do?
Download the current master of
rules_go
and runbazel test //...
on an Apple Silicon machine.What did you expect to see?
Tests should succeed.
What did you see instead?
Toolchain resolution fails:
The text was updated successfully, but these errors were encountered: