Repository navigation
fix(rust): mark crate_universe extension as dev_dependency [arguable] - #28274
Closed
rdesgroppes wants to merge 1 commit into
Closed
rdesgroppes wants to merge 1 commit into
rdesgroppes wants to merge 1 commit into
Conversation
Fixes protocolbuffers#28224. `rules_rust` 0.71.1 (bazelbuild/rules_rust#4109) rejects any non-root `crate_universe` extension call without a `lockfile`. A Bazel build depending on `protobuf` and using `rules_rust` >= 0.71.1 therefore fails to resolve: ``` crate_universe extension call `crates` is in a non-root module but has no lockfile. [...] ``` `dev_dependency = True` makes Bazel skip the extension entirely when `protobuf` is not the root module, sidestepping the lockfile requirement without committing large generated files. This is viable for consumers that do not build protobuf's own Rust targets (those depend on `@crate_index` which becomes unavailable). See the sibling branch `fix-crate-universe-lockfile` for an alternative that works unconditionally.
rdesgroppes
marked this pull request as draft
June 30, 2026 07:51
crate_universe extension as dev_dependencycrate_universe extension as dev_dependency [arguable]
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.
Fixes #28224.
rules_rust0.71.1 (bazelbuild/rules_rust#4109) rejects any non-rootcrate_universeextension call without alockfile.A Bazel build depending on
protobufand usingrules_rust>= 0.71.1 therefore fails to resolve:dev_dependency = Truemakes Bazel skip the extension entirely whenprotobufis not the root module, sidestepping the lockfile requirement without committing large generated files.This is only viable for consumers that do not build protobuf's own Rust targets (those depend on
@crate_indexwhich becomes unavailable).See the sibling PR #28230 for an alternative that works unconditionally.