{"action":"created","issue":{"url":"https://api.github.com/repos/bazelbuild/rules_go/issues/1675","repository_url":"https://api.github.com/repos/bazelbuild/rules_go","labels_url":"https://api.github.com/repos/bazelbuild/rules_go/issues/1675/labels{/name}","comments_url":"https://api.github.com/repos/bazelbuild/rules_go/issues/1675/comments","events_url":"https://api.github.com/repos/bazelbuild/rules_go/issues/1675/events","html_url":"https://github.com/bazelbuild/rules_go/issues/1675","id":352946869,"node_id":"MDU6SXNzdWUzNTI5NDY4Njk=","number":1675,"title":"Linux cross-compilation fails on Windows when golang.google.org/grpc is imported","user":{"login":"Xjs","id":58270,"node_id":"MDQ6VXNlcjU4Mjcw","avatar_url":"https://avatars1.githubusercontent.com/u/58270?v=4","gravatar_id":"","url":"https://api.github.com/users/Xjs","html_url":"https://github.com/Xjs","followers_url":"https://api.github.com/users/Xjs/followers","following_url":"https://api.github.com/users/Xjs/following{/other_user}","gists_url":"https://api.github.com/users/Xjs/gists{/gist_id}","starred_url":"https://api.github.com/users/Xjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Xjs/subscriptions","organizations_url":"https://api.github.com/users/Xjs/orgs","repos_url":"https://api.github.com/users/Xjs/repos","events_url":"https://api.github.com/users/Xjs/events{/privacy}","received_events_url":"https://api.github.com/users/Xjs/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-08-22T13:10:00Z","updated_at":"2018-09-17T11:15:22Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"Although `third_party/org_golang_google_grpc/internal/channelz/BUILD.bazel.in` actually declares the `golang.org/x/sys/unix` dependency as a conditional dependency (https://github.com/bazelbuild/rules_go/blob/4f3399d8ff00b1fa20d8619cc13edece1420cbd0/third_party/org_golang_google_grpc/internal/channelz/BUILD.bazel.in#L33), when trying to build a linux_amd64 binary on a Windows host, I get the error message:\r\n\r\n```\r\n(15:08:29) ERROR: C:/tmp/_bazel_jannis.schnitzer/47bkkx3e/external/org_golang_google_grpc/internal/channelz/BUILD.bazel:3:1: Couldn't build file external/org_golang_google_grpc/internal/channelz/linux_amd64_pure_stripped/go_default_library%/google.golang.org/grpc/internal/channelz.a: GoCompile external/org_golang_google_grpc/internal/channelz/linux_amd64_pure_stripped/go_default_library%/google.golang.org/grpc/internal/channelz.a failed (Exit 1)\r\nGoCompile: missing strict dependencies:\r\n        C:\\tmp\\_bazel_jannis.schnitzer\\47bkkx3e\\execroot\\com_github_Xjs_proto_test\\external\\org_golang_google_grpc\\internal\\channelz\\types_linux.go: import of \"golang.org/x/sys/unix\"\r\nKnown dependencies are:\r\n        google.golang.org/grpc/connectivity\r\n        google.golang.org/grpc/credentials\r\n        google.golang.org/grpc/grpclog\r\nCheck that imports in Go sources match importpath attributes in deps.\r\n```\r\n\r\n(reproducable with https://github.com/Xjs/protoTest/tree/grpc_dependency)\r\n\r\nI'm not sure why the conditional `select()` statement is not honoured in this case, but I get the feeling that it could lead to problems in other places as well."},"comment":{"url":"https://api.github.com/repos/bazelbuild/rules_go/issues/comments/421972971","html_url":"https://github.com/bazelbuild/rules_go/issues/1675#issuecomment-421972971","issue_url":"https://api.github.com/repos/bazelbuild/rules_go/issues/1675","id":421972971,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMTk3Mjk3MQ==","user":{"login":"mishudark","id":211144,"node_id":"MDQ6VXNlcjIxMTE0NA==","avatar_url":"https://avatars1.githubusercontent.com/u/211144?v=4","gravatar_id":"","url":"https://api.github.com/users/mishudark","html_url":"https://github.com/mishudark","followers_url":"https://api.github.com/users/mishudark/followers","following_url":"https://api.github.com/users/mishudark/following{/other_user}","gists_url":"https://api.github.com/users/mishudark/gists{/gist_id}","starred_url":"https://api.github.com/users/mishudark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mishudark/subscriptions","organizations_url":"https://api.github.com/users/mishudark/orgs","repos_url":"https://api.github.com/users/mishudark/repos","events_url":"https://api.github.com/users/mishudark/events{/privacy}","received_events_url":"https://api.github.com/users/mishudark/received_events","type":"User","site_admin":false},"created_at":"2018-09-17T11:15:22Z","updated_at":"2018-09-17T11:15:22Z","author_association":"NONE","body":"I have the same error on MacOS\r\n```\r\nbazel test //...\r\n```\r\n\r\n```\r\nGoCompile: missing strict dependencies:\r\n\t/private/var/tmp/_bazel_mishel.vera/6b2c87153a1a9c49b8acbab759a652c0/sandbox/darwin-sandbox/371/execroot/__main__/external/org_golang_google_grpc/internal/channelz/types_linux.go: import of \"golang.org/x/sys/unix\"\r\nKnown dependencies are:\r\n\tgoogle.golang.org/grpc/connectivity\r\n\tgoogle.golang.org/grpc/credentials\r\n\tgoogle.golang.org/grpc/grpclog\r\n```"}}
{"actor":{"display_login":"mishudark"}}