Prebuilt-protoc broken in 37.0-rc1
Maintainers usually reply within 1 day
@haberman is already working on this.
Since Oct 20, 2026.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- cpp
- Domain
- build-system, tooling
Research direction
Start by reproducing the failure with the issue’s minimal MODULE.bazel, BUILD.bazel, and .bazelrc setup using bazel build //...; the poison-pill compile option shows that protobuf is being built despite the prebuilt-protoc settings. Read the Bazel toolchain-resolution and prebuilt-protoc flag configuration referenced in the .bazelrc, then compare behavior with protobuf 36.2. Done means the 37.0-rc1 build uses prebuilt protoc without compiling protobuf.
Written by the indexing model from the issue text.
Description
What version of protobuf and what language are you using?
Version: 37.0-rc1
Language: Proto
What
supported operating system version
are you using (e.g. Linux, Windows) ?
Linux
What
supported runtime / compiler version
are you using (e.g. python version, gcc version)
bazel --version
bazel 9.3.0
I am not configuring a c++ or python toolchain in bazel explicitly. These are my host toolchains.
gcc --version
gcc (GCC) 16.2.1 20260819 (Red Hat 16.2.1-2)
Copyright (C) 2026 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
python --version
Python 3.14.8
What did you do?
Steps to reproduce the behavior:
You can reproduce this with a super simple repo.
.
├── .bazelrc
├── BUILD.bazel
├── foo.proto
├── MODULE.bazel
└── MODULE.bazel.lock
.bazelrc
# Force pre-built protoc
common --incompatible_enable_proto_toolchain_resolution
common --@protobuf//bazel/flags:allow_nonstandard_protoc=true
common --@protobuf//bazel/toolchains:prefer_prebuilt_protoc=true
common --@protobuf//bazel/flags:prefer_prebuilt_protoc=true
# Set toolchain to pre-built protoc
common --noincompatible_exclude_starlark_flags_from_exec_config
common --experimental_propagate_custom_flag=@protobuf//bazel/flags:prefer_prebuilt_protoc
# Poison pill that fails build if protoc is compiled
common --host_per_file_copt=external/.*protobuf.*@--PROTOBUF_WAS_NOT_SUPPOSED_TO_BE_BUILT
BUILD.bazel
load("@protobuf//bazel:proto_library.bzl", "proto_library")
proto_library(
name = "foo",
srcs = ["foo.proto"],
)
foo.proto
syntax = "proto3";
package foo;
MODULE.bazel
module(name = "test")
bazel_dep(name = "protobuf", version = "37.0-rc1")
You can trigger the poison pill by building all targets.
bazel build //...
INFO: Analyzed target //:foo (1 packages loaded, 5 targets configured).
ERROR: /home/my-user/.cache/bazel/_bazel_monolith/9e64523796ff1373614a9e266ee6e99b/external/protobuf+/third_party/utf8_range/BUILD.bazel:40:11: Compiling third_party/utf8_range/utf8_range.c [for tool] failed: (Exit 1): gcc failed: error executing CppCompile command (from cc_library rule target @@protobuf+//third_party/utf8_range:utf8_range) /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections ... (remaining 21 arguments skipped)
Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
gcc: error: unrecognized command-line option '--PROTOBUF_WAS_NOT_SUPPOSED_TO_BE_BUILT'
Target //:foo failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 0.237s, Critical Path: 0.06s
INFO: 54 processes: 54 internal.
ERROR: Build did NOT complete successfully
You can get this to build again by rolling back to 36.2.
sed -i s/37.0-rc1/36.2/ MODULE.bazel
bazel build //...
WARNING: Build option --flag_alias has changed, discarding analysis cache (this can be expensive, see https://bazel.build/advanced/performance/iteration-speed).
INFO: Analyzed target //:foo (95 packages loaded, 1402 targets configured).
INFO: Found 1 target...
Target //:foo up-to-date:
bazel-bin/foo-descriptor-set.proto.bin
INFO: Elapsed time: 0.547s, Critical Path: 0.00s
INFO: 1 process: 2 action cache hit, 1 internal.
INFO: Build completed successfully, 1 total action
Anything else we should know about your project / environment
- Dominant language
- C++
- Stars
- 72.2k
- Forks
- 16.4k
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 342
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from protocolbuffers/protobuf
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
protocolbuffers/protobuf#31768 ·
Maintainers usually reply within 1 day
-
feature request packaging & distribution python
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
protocolbuffers/protobuf#31654 ·
Maintainers usually reply within 1 day
-
google-protobuf 0.36.2-release fails to compile for ARMv7: @progbits rejected in global_asm!Possibly taken @farisbasha claimed this 1 day ago. Openbug help wanted rust
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
protocolbuffers/protobuf#31619 · 3 comments ·
Maintainers usually reply within 1 day
-
Null pointer passed to memcpy in lupb_decode() when the second argument is nilPossibly taken A pull request linked to this issue is open or already merged. Openbug help wanted lua
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
protocolbuffers/protobuf#31392 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
protocolbuffers/protobuf#31032 ·
Maintainers usually reply within 1 day
All issues in protocolbuffers/protobuf
Similar issues
-
agent:Windows bug in progress pri:medium sev:low testing windows
Difficulty 1/5 Under an hour Newbie friendliness 91/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
godotengine/godot#125651 ·
Maintainers usually reply within 1 day
-
Android: with view recycling on, a recycled View keeps its nextFocusLeftPossibly taken A pull request linked to this issue is open or already merged. OpenNeeds: Triage :mag: Platform: Android
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
react/react-native#60167 ·
Maintainers usually reply within 2 days
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 63/100
-
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 2 days