bazelbuild / rules_go

Go rules for Bazel
Apache License 2.0
1.37k stars 650 forks source link

Gopackagesdriver on v0.41.0 does not work with hermetic gcc toolchain #3723

Closed juanique closed 10 months ago

juanique commented 11 months ago

What version of rules_go are you using?

v0.41.0

What version of gazelle are you using?

None

What version of Bazel are you using?

v6.3.2

Does this issue reproduce with the latest releases of all the above?

Yes

What operating system and processor architecture are you using?

AMD64 Ubuntu 22.04

Any other potentially useful information about your toolchain?

Using https://github.com/aspect-build/gcc-toolchain

What did you do?

What did you expect to see?

A json blob with a bunch of language server information.

What did you see instead?

cgo-builtin-prolog:1:10: fatal error: stddef.h: No such file or directory

I also have another minimal workspace. It is exactly the same as the one above but it uses rules-go v0.39.0 instead, and that works fine: https://github.com/juanique/bazel-examples/tree/main/bazel6/rules_go/6-rulesgo039-hermetic-gcc

alexeagle commented 11 months ago

I bisected this to https://github.com/bazelbuild/rules_go/commit/c403db655ff4db63101ea8f4e7f1aa7b46dd73ee which introduced the failure.

alexeagle commented 11 months ago

FYI @grampelberg

zecke commented 10 months ago

https://github.com/bazelbuild/rules_go/commit/5f6203e13d81edd08b0392ab4b67be1d172ed2ff should probably fix this.

juanique commented 10 months ago

It is indeed fixed in the newest release :)