Thomas

Results 176 comments of Thomas

Just logging this here. I'll try to take a closer look and make a reproducer at some point. It's quite tricky to find the problem :/ ``` (16:53:50) ERROR: /private/var/tmp/_bazel_thomas/796dd52d4d981101108548a9446ddca6/external/com_github_golang_protobuf/proto/BUILD.bazel:3:11:...

There is a `native.bazel_version` which could be used instead. Really though, I would recommend upgrading to the latest version of Bazel. Is there anything preventing you from doing so?

Per [`_go_transition_impl`](https://github.com/bazelbuild/rules_go/blob/d0d326e4a5df51b5103dcd332c9e4df06d0bbbf2/go/private/rules/transition.bzl#L119), it looks like cgo has to be explicitly toggled via [`cgo_constraint`](https://github.com/bazelbuild/rules_go/blob/4cd45a2ac59bd00ba54d23ebbdb7e5e2aed69007/go/toolchain/toolchains.bzl#L60-L72) -> [`internal_cgo_off`](https://github.com/bazelbuild/rules_go/blob/4cd45a2ac59bd00ba54d23ebbdb7e5e2aed69007/go/platform/list.bzl#L80). I suspect the documentation for `pure` is a little misleading as it states: [[1]](https://github.com/bazelbuild/rules_go/blob/master/go/core.rst#go_binary) >If...

This is likely because it's not actually building a pure binary. Providing an invalid C/C++ compiler to Bazel results in a build failure, where it shouldn't. ```sh ❯ bazel --noworkspace_rc...

I see, thank you for your investigation and clarification. So it seems that pure binaries are correctly built, but the Go toolchain incorrectly depends on a CC toolchain despite being...

https://github.com/bazelbuild/bazel/issues/14726 should help with this!

Looks like optional toolchains will make it into the next LTS (https://github.com/bazelbuild/bazel/issues/3601#issuecomment-1117368102). This will then be easy to resolve.

Just for clarity, the linked issue is https://github.com/cockroachdb/cockroach/issues/81314 as the link in the OP text is broken.

Currently we're just adding empty Go files to generated packages and excluding said files from Gazelle. The empty Go files do not have build constraints (`//go:build ignore`) as the Go...