-
Notifications
You must be signed in to change notification settings - Fork 648
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
enable windows/arm64 go build with bazel #3072
Conversation
899d90d
to
3f56d2e
Compare
@linzhp Can you help with review please ? |
go/private/sdk.bzl
Outdated
goos, goarch = "windows", "amd64" | ||
if _get_env_var(ctx, "PROCESSOR_ARCHITECTURE") == "ARM64": | ||
goarch = "arm64" | ||
elif _get_env_var(ctx, "PROCESSOR_ARCHITEW6432") == "ARM64": | ||
goarch = "arm64" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you try ctx.os.arch
?
goos, goarch = "windows", "amd64" | |
if _get_env_var(ctx, "PROCESSOR_ARCHITECTURE") == "ARM64": | |
goarch = "arm64" | |
elif _get_env_var(ctx, "PROCESSOR_ARCHITEW6432") == "ARM64": | |
goarch = "arm64" | |
goos = "windows" | |
if ctx.os.arch == "<some archecture>": | |
goarch = "arm64" | |
else: | |
goarch = "amd64" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much better! Seems to work
@linzhp Unfortunately, one test is failing on CI now with the latest change. Any guess?
|
Yeah, |
Thanks. Shall I revert latest commit and use previous approach of using environment variables ? |
You can decide which way you want to go |
This reverts commit 92d0012.
Ok I will use env. variable for the time being. |
I am hoping to get #3083 in so next release will be for Go 1.18 support. |
What type of PR is this?
What does this PR do? Why is it needed?
Other notes for review
Go for windows/arm64 is available from version 17. This patch adds the missing pieces to build go programs with bazel.