Repository navigation
fix(build): honor PROTOC when generating protobuf code - #4441
Merged
TaylorMutch merged 1 commit intoOct 14, 2026
Merged
TaylorMutch merged 1 commit into
TaylorMutch merged 1 commit into
Conversation
The core, server, and sandbox-backend build scripts always used the vendored protoc binary and ignored PROTOC, so a distro build could not use its system compiler. When PROTOC is set, use it and let prost resolve the includes (PROTOC_INCLUDE still applies); otherwise behave exactly as before. Contributes to NVIDIA#3510. Signed-off-by: politerealism <burdcat17@gmail.com>
4 tasks done
politerealism
marked this pull request as ready for review
October 14, 2026 16:33
Collaborator
|
/ok to test b1ba429 |
1 similar comment
Collaborator
|
/ok to test b1ba429 |
TaylorMutch
approved these changes
Oct 14, 2026
2 of 37 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Make the protobuf build scripts honor
PROTOC. Theopenshell-core,openshell-serverandopenshell-sandbox-backendbuild scripts always used the vendoredprotocbinary and ignoredPROTOC, so a distro build could not use its system compiler (#3510, item 10).Related Issue
Contributes to #3510
Changes
crates/openshell-core/build.rs,crates/openshell-server/build.rs,crates/openshell-sandbox-backend/build.rs: whenPROTOCis set, use it and let prost resolve the well-known includes (PROTOC_INCLUDEstill applies). WhenPROTOCis unset, behavior is unchanged: the vendored compiler and include tree are used, along with the existing re-entry that removesPROTOC_INCLUDE.cargo:rerun-if-env-changedforPROTOCandPROTOC_INCLUDEso switching modes rebuilds.All protos in the repo are plain proto3 and import only
google/protobuf/{descriptor,duration,struct,timestamp}.proto.Testing
Checked with Fedora 44's
protoc3.19.6 (protobuf-compilerandprotobuf-devel), usingcargo checkon the three crates:cargo clippy --all-targets -- -D warningspasses.PROTOCandPROTOC_INCLUDEset to the Fedora files: builds.PROTOCset,PROTOC_INCLUDEunset (protoc finds its own includes): builds.PROTOC_INCLUDEset (vendored mode, existing workaround path): builds.PROTOC=/nonexistent/protoc: fails with prost's "Could not findprotoc", confirming the variable is honored and the vendored binary is not used silently.cargo fmt --all -- --checkpasses.rpmbuildusing this, or the unit test suite.protoc-bin-vendored*crates ship prebuiltprotocbinaries in the vendored source tree, which a distro build may still need to remove or avoid. A default-on cargo feature could address that if Fedora review requires it.Checklist