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

MacOS - compilepkg: missing strict dependencies #308

Closed
UebelAndre opened this issue Jul 8, 2020 · 9 comments
Closed

MacOS - compilepkg: missing strict dependencies #308

UebelAndre opened this issue Jul 8, 2020 · 9 comments

Comments

@UebelAndre
Copy link

Building from d8e6748 I run into a build error on MacOS

INFO: Invocation ID: 9e4b07c8-ff9b-48f6-aa63-929bb16c5a36
INFO: Analyzed target //:bazel-remote-image (215 packages loaded, 8667 targets configured).
INFO: Found 1 target...
INFO: Deleting stale sandbox base /private/var/tmp/_bazel_user/43f205e3e99d32a411dc6117e26a341f/sandbox
INFO: From Generating Descriptor Set proto_library @go_googleapis//google/bytestream:bytestream_proto:
google/bytestream/bytestream.proto:19:1: warning: Import google/api/annotations.proto but not used.
google/bytestream/bytestream.proto:20:1: warning: Import google/protobuf/wrappers.proto but not used.
ERROR: /private/var/tmp/_bazel_user/43f205e3e99d32a411dc6117e26a341f/external/org_golang_google_grpc/internal/syscall/BUILD.bazel:3:11: Couldn't build file external/org_golang_google_grpc/internal/syscall/linux_amd64_static_pure_stripped/go_default_library%/google.golang.org/grpc/internal/syscall.a: GoCompilePkg external/org_golang_google_grpc/internal/syscall/linux_amd64_static_pure_stripped/go_default_library%/google.golang.org/grpc/internal/syscall.a failed (Exit 1) builder failed: error executing command bazel-out/host/bin/external/go_sdk/builder compilepkg -sdk external/go_sdk -installsuffix linux_amd64 -src external/org_golang_google_grpc/internal/syscall/syscall_linux.go -src ... (remaining 15 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox
compilepkg: missing strict dependencies:
	/private/var/tmp/_bazel_user/43f205e3e99d32a411dc6117e26a341f/sandbox/darwin-sandbox/396/execroot/__main__/external/org_golang_google_grpc/internal/syscall/syscall_linux.go: import of "golang.org/x/sys/unix"
No dependencies were provided.
Check that imports in Go sources match importpath attributes in deps.
ERROR: /private/var/tmp/_bazel_user/43f205e3e99d32a411dc6117e26a341f/external/org_golang_google_grpc/internal/channelz/BUILD.bazel:3:11: Couldn't build file external/org_golang_google_grpc/internal/channelz/linux_amd64_static_pure_stripped/go_default_library%/google.golang.org/grpc/internal/channelz.a: GoCompilePkg external/org_golang_google_grpc/internal/channelz/linux_amd64_static_pure_stripped/go_default_library%/google.golang.org/grpc/internal/channelz.a failed (Exit 1) builder failed: error executing command bazel-out/host/bin/external/go_sdk/builder compilepkg -sdk external/go_sdk -installsuffix linux_amd64 -src external/org_golang_google_grpc/internal/channelz/funcs.go -src ... (remaining 31 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox
compilepkg: missing strict dependencies:
	/private/var/tmp/_bazel_user/43f205e3e99d32a411dc6117e26a341f/sandbox/darwin-sandbox/397/execroot/__main__/external/org_golang_google_grpc/internal/channelz/types_linux.go: import of "golang.org/x/sys/unix"
No dependencies were provided.
Check that imports in Go sources match importpath attributes in deps.
Target //:bazel-remote-image failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 81.325s, Critical Path: 20.63s
INFO: 395 processes: 395 darwin-sandbox.
FAILED: Build did NOT complete successfully
FAILED: Build did NOT complete successfully
@mostynb
Copy link
Collaborator

mostynb commented Jul 8, 2020

Building this on mac is a little complicated, because docker images are inherently linux-oriented.

Please try: bazel build --platforms=@io_bazel_rules_go//go/toolchain:linux_amd64 //:bazel-remote-image

@UebelAndre
Copy link
Author

Thanks! That does indeed work. Out of curiosity, why does that work?

@mostynb
Copy link
Collaborator

mostynb commented Jul 8, 2020

Since docker containers are linux based, we need to tell bazel that it should use the linux toolchain when building them (without that you get the error messages referring to _linux.go files that you saw). I don't know why specifying goos and goarch in the go_image target is not sufficient.

The issue is being discussed over here: bazelbuild/rules_docker#690

@UebelAndre
Copy link
Author

Awesome! Thank you so much for the info and the link! 😄

@mr-pascal
Copy link

@mostynb
unfortunately didn't worked for me:
image

Do you maybe have another idea?
Truth told I have no idea what to insert to the deps property of the go_library rule since I don't really get the Bazel configuration to 100% yet.

@mostynb
Copy link
Collaborator

mostynb commented Mar 5, 2021

@Abszissex: That looks like a general bazel question. Maybe you can ask for help on the bazel slack? https://bazelbuild.slack.com/join/shared_invite/zt-dzm4qj0h-maSR3EcEr8SWE1f7dA55zw#/

@mr-pascal
Copy link

@mostynb
thanks for pointing out the slack channel and sorry for hijacking this thread.

@saikiran2021
Copy link

Unable To Build Gviser
even after import package i am unable to build
could you please found a solution for me Screenshot from 2022-02-01 19-13-57

@mostynb
Copy link
Collaborator

mostynb commented Feb 1, 2022

@saikiran2021: I don't think your error is related to bazel-remote, I can't see any references to it there. I would try asking for help from the gvisor project.

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

4 participants