Open apesternikov opened 5 years ago
Downgrading rules_go to 0.16.8 fixes the issue.
This is a known issue, described in Note on goos and goarch attributes. Please use --platforms
for cross-compilation instead of these attributes.
The implementation of these attributes can be fixed after Bazel has fully implemented Starlark Build Configuration. We'll use configuration transitions instead of aspects, and that will work with select
expressions.
golang.org/x/sys/unix
on platforms where it's safe to do so. That may be an acceptable workaround.If I remember correctly, downgrading rules_go to 0.16.8 would fix this because the older version of gRPC provided there did not depend on golang.org/x/sys/unix
.
I'll leave this issue open to verify goos
and goarch
work for this library after they're reimplemented.
@apesternikov I had the same issue (with grpc), and can confirm that using rules_go after #2009 unblocks your use-case.
Anything with dependency on grpc built with goarch = "amd64" goos = "linux" on mac is failing to compile with the following error:
This issue was reported as https://github.com/bazelbuild/rules_docker/issues/690, but looks like it belongs to rules_go The recommended approach of using
--platforms=@io_bazel_rules_go//go/toolchain:linux_amd64
does not work since local binary is not able to run anymore.What version of rules_go are you using?
0.18.1
What version of gazelle are you using?
N/A
What version of Bazel are you using?
0.22.0-homebrew 0.23.2-homebrew
Does this issue reproduce with the latest releases of all the above?
Yes
What operating system and processor architecture are you using?
MacOS: Darwin Kernel Version 17.7.0: Thu Jun 21 22:53:14 PDT 2018; root:xnu-4570.71.2~1/RELEASE_X86_64 x86_64
Any other potentially useful information about your toolchain?
What did you do?
git clone https://github.com/apesternikov/poc-bazel-690.git cd poc-bazel-690 bazel build ...
What did you expect to see?
Successful compilation of bazel-poc-690 and bazel-poc-690-linux binaries.
What did you see instead?