Closed lberki closed 2 weeks ago
@alexeagle maybe you have an idea?
I dug a bit deeper and it turns out that in the non-working case, protoc seems to come from the protoc_toolchains.linux_x86_64
repository, whereas in the working case, it's toolchains_protoc~~protoc~toolchains_protoc_hub.linux_x86_64
.
My guess: the protoc_toolchains()
stanza makes Bazel use the wrong protoc version, for some values of "wrong".
Argh. Got it. Turns out, the for some reason, without the protoc_toolchains()
stanza, protoc 27.1 was used, with it, 25.3. If I update the version to 27.1 it starts working.
//stardoc/proto:stardoc_output_java_proto
with both values of --enable_bzlmod
and --incompatible_enable_proto_toolchain_resolution
. Let's see what the presubmits say.Fixed by @lberki in #237
I'm trying to upgrade Stardoc to work with
--incompatible_enable_proto_toolchain_resolution
as part of yak shaving to make rules_go work with--experimental_sibling_repository_layout
(I need to upgrade the Stardoc version there, see https://github.com/bazelbuild/rules_go/pull/3966)I'm failing. My best attempt can be seen here:
https://github.com/bazelbuild/stardoc/compare/0.6.2...lberki-proto-toolchains?expand=1
, which works for
--enable_bzlmod
, but not for--noenable_bzlmod
, which, regrettably, I also need to support.The command to reproduce the breakage is
bazel build //stardoc/proto:stardoc_output_java_proto --incompatible_enable_proto_toolchain_resolution --enable_bzlmod
and the error message is something like this (but a lot more):This looks like a mismatch between the protoc plugin and the runtime version, but I have no idea how that came to be and how to fix it.
Funnily enough, the diff in its current state doesn't work with either value of
--enable_bzlmod
, but if I comment out theprotoc_toolchains()
invocations in the WORKSPACE file, it start to work with--enable_bzlmod
but not with--noenable_bzlmod
, somewhat expectedly citing the inability to find some toolchains.The obvious shot in the dark to replace the
protoc_toolchains
version with 21.7 instead of 25.3 does not help.How do I fix this? Or how do I even debug this?