build: prefer local protoc for Rust bindings
What changed, and why it matters
This commit changes the build script that generates Rust code from protobuf definitions. It makes the build prefer a specific local copy of the protobuf compiler (protoc) installed in the repository's virtual environment, rather than relying on whatever version happens to be found on the developer's system. This is a build reproducibility and consistency improvement, not a security fix for a vulnerability.
No security action required. Treat as a normal build-hygiene/reproducibility change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change in scripts/generate-protobuf-rust.sh sets the PROTOC environment variable to ${ROOT_DIR}/.venv/bin/protoc when that executable exists. This ensures that direct Cargo builds (which do not inherit the Makefile’s virtualenv PATH) use the same protoc version as Makefile-based builds. If the local protoc is not present, the script falls back to prost-build-proto’s existing behavior. There is no change to runtime code, cryptographic logic, message parsing, or any attack surface exposed to users or devices.
Changed components
scripts/generate-protobuf-rust.shInspect captured patch +4 / −0
### scripts/generate-protobuf-rust.sh
@@ -15,6 +15,10 @@ trap cleanup EXIT
mkdir -p "${OUT_DIR}"
+if [[ -x "${ROOT_DIR}/.venv/bin/protoc" ]]; then
+ export PROTOC="${ROOT_DIR}/.venv/bin/protoc"
+fi
+
prost-build-proto \
"${ROOT_DIR}/messages" \
"${TMP_DIR}"Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.