Repository navigation
[Rust] Rerun the SDK build script on proto change - #1049
Merged
Merged
Conversation
dimitrije-djordjevic-db
force-pushed
the
proto-rerun-fix
branch
from
November 4, 2026 20:40
fbf3715 to
e2fd180
Compare
dimitrije-djordjevic-db
marked this pull request as ready for review
November 5, 2026 11:00
prost-build emits no cargo:rerun-if-changed for the protos it compiles, so the build script relied on Cargo's default of rerunning on any package change. That default stops applying as soon as a script emits any rerun-if-changed, and the zeroparser build emits two. In builds with the zeroparser feature, a change to zerobus_service.proto was therefore ignored and the old generated code kept until a clean build. List zerobus_service.proto and build.rs explicitly. Co-authored-by: Isaac <no-reply@databricks.com> Signed-off-by: Dimitrije Đorđević <dimitrije.djordjevic@databricks.com>
The test-support build script compiles the SDK's service proto, which lives outside its package, and emits no rerun-if-changed. Cargo then reruns it only when a file inside test-support changes, so a proto change left the mock server on the old schema until a clean build. Co-authored-by: Isaac <no-reply@databricks.com> Signed-off-by: Dimitrije Đorđević <dimitrije.djordjevic@databricks.com>
dimitrije-djordjevic-db
force-pushed
the
proto-rerun-fix
branch
from
November 20, 2026 09:34
e2fd180 to
1c4ee0c
Compare
github-merge-queue
Bot
removed this pull request from the merge queue due to a conflict with the base branch
Nov 23, 2026
Co-authored-by: Isaac <no-reply@databricks.com> Signed-off-by: Dimitrije Đorđević <dimitrije.djordjevic@databricks.com>
teodordelibasic-db
approved these changes
Nov 24, 2026
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.
What changes are proposed in this pull request?
What:
rust/sdk/build.rsnow printscargo:rerun-if-changed=zerobus_service.protoandcargo:rerun-if-changed=build.rsbefore it compiles the protos.rust/test-support/build.rs, which compiles the same proto for the mock server, now lists it too.Why: in builds with the
zeroparserfeature, a change tozerobus_service.protowas silently ignored. Cargo kept the old generated gRPC code, so new messages or RPCs looked missing until a clean build.How it happens:
rerun-if-changedlines. Once it prints any, Cargo reruns the script only when one of the listed paths changes (Cargo docs).prost-build0.14 prints norerun-if-changedfor the protos it compiles, on purpose (see the TODO inprost-build/src/config.rs,compile_protos).tonic-prost-build0.14.5 has anemit_rerun_if_changedsetting, but never uses it. Withoutzeroparser, the SDK build script therefore relies on Cargo's any-change default, which works.zeroparser,src/zeroparser/proto_build.rsprintsrerun-if-changedfor its two test and bench proto directories. That turns off the default, andzerobus_service.protois not on the list.zeroparseris enabled in more builds than it seems: thetestscrate depends on the SDK withzeroparser, so feature unification turns it on forcargo test --workspace,cargo clippy --workspace(both run bymake test/make lint) and any--all-featuresbuild.Who it affects: anyone who edits
zerobus_service.protolocally, or switches between branches with different protos, and then builds the workspace. We hit it while adding theInsertRecordsRPC (#1025): after a branch switch,cargo clippy --workspacereportedno InsertRecordsRequest in proto::databricks::zerobuseven though the proto had it. CI is not affected, because it always builds from a clean target directory.The test-support build script had the same problem without any feature: the proto lives outside its package, so Cargo's any-change default never saw a proto change.
Listing
build.rskeeps the script rerunning when the script itself changes. No other file feeds the build script:zeroparser/proto_build.rsis compiled into it, so a change there rebuilds and reruns it anyway.How is this tested?
A probe that adds
message RerunProbe {}to the proto, rebuilds, and checks the generateddatabricks.zerobus.rsin the build script'sout_dir(taken from Cargo'sbuild-script-executedJSON message):--features zeroparser--all-featureszeroparser)Also:
cargo fmt --check, andcargo clippy -p databricks-zerobus-ingest-sdk --all-targets --all-features -- -D warnings.This pull request and its description were written by Isaac.