Add link_deps crate_universe annotation - #4109
Merged
Merged
Conversation
UebelAndre
force-pushed
the
crate_universe_cleanup
branch
from
June 26, 2026 00:48
369519b to
abacba6
Compare
UebelAndre
marked this pull request as ready for review
June 26, 2026 00:50
UebelAndre
force-pushed
the
crate_universe_cleanup
branch
from
June 26, 2026 01:06
abacba6 to
a9c26e1
Compare
UebelAndre
force-pushed
the
crate_universe_cleanup
branch
from
June 26, 2026 01:22
a9c26e1 to
7331f02
Compare
UebelAndre
enabled auto-merge
June 26, 2026 01:23
UebelAndre
force-pushed
the
crate_universe_cleanup
branch
4 times, most recently
from
June 26, 2026 04:11
a327c2c to
f4b1d1f
Compare
slackito
approved these changes
Jun 26, 2026
| if start > 0 && bytes[start - 1] == b'@' { | ||
| continue; | ||
| } | ||
| let after = start + apparent.len(); |
Collaborator
There was a problem hiding this comment.
Are the indices in input (a str) guaranteed to match the indices in bytes? (i.e. is input only made of non-multibyte characters?)
Collaborator
Author
There was a problem hiding this comment.
Yeah, based on this:
https://doc.rust-lang.org/std/primitive.str.html#method.len
This length is in bytes, not chars or graphemes. In other words, it might not be what a human considers the length of the string.
UebelAndre
force-pushed
the
crate_universe_cleanup
branch
from
June 26, 2026 14:39
f4b1d1f to
f0c543a
Compare
UebelAndre
disabled auto-merge
June 26, 2026 14:49
rdesgroppes
added a commit
to rdesgroppes/protobuf
that referenced
this pull request
Jun 27, 2026
…umers Fixes protocolbuffers#28224. `rules_rust` 0.71.1 (bazelbuild/rules_rust#4109) rejects any non-root `crate_universe` extension call that does not set `lockfile`. Therefore any Bazel build that depends on `protobuf` and use `rules_rust` 0.71.1 fails to resolve: ``` crate_universe extension call `crates` is in a non-root module but has no lockfile. Transitive crate_universe repositories must ship a `lockfile = ...` because repinning is not supported across module boundaries. ``` Pin the resolution by committing both lockfiles and passing them to `from_specs`: - the `cargo-bazel-lock.json` render lockfile is what `rules_rust` 0.71.1 requires, - the Cargo lockfile `Cargo.lock` is needed too to generate the former. `dev_dependency = True` is not viable because `@crate_index` feeds the **public** `protobuf` Rust crate. Here's a command to regenerate both lock files after changing the crate specs: ``` bazel mod --repo_env=REPIN=1 deps ```
rdesgroppes
added a commit
to DataDog/datadog-agent
that referenced
this pull request
Jun 30, 2026
### What does this PR do? Bumps rules_rust_prost to 0.71.2 (same release as rules_rust, they must stay in sync) and adds a protobuf patch that fixes a build break introduced by rules_rust 0.71.1. ### Motivation Renovate bumped rules_rust but left rules_rust_prost at 0.71.0. rules_rust 0.71.1 (bazelbuild/rules_rust#4109) added a strict check: non-root crate_universe extension calls must set a lockfile; protobuf 35.1 has no such lockfile, causing bazel mod deps to fail. The fix (protocolbuffers/protobuf#28230) is pending upstream; the patch is a workaround in the meantime. ### Describe how you validated your changes bazel mod deps passes. ### Additional Notes The patch marks protobuf's crate_universe extension as dev_dependency = True. Bazel then skips it when protobuf is a transitive dependency, sidestepping the lockfile requirement. Safe here: Rust proto targets use rules_rust_prost, not protobuf's native Rust aspect (which depends on @crate_index).
rdesgroppes
added a commit
to rdesgroppes/protobuf
that referenced
this pull request
Jul 1, 2026
Fixes protocolbuffers#28224. `rules_rust` 0.71.1 (bazelbuild/rules_rust#4109) rejects any non-root `crate_universe` extension call that does not set `lockfile`. Therefore any Bazel build that depends on `protobuf` and uses `rules_rust` 0.71.1 fails to resolve: ``` crate_universe call `crates` is non-root but has no lockfile. Transitive crate_universe repos must ship a `lockfile` because repinning is not supported across module boundaries. ``` Adding lockfiles to the existing unified setup would impose `googletest` and its transitive deps (`aho-corasick`, `regex`, ...) to downstream consumers. The `crate_universe` extension is therefore split into: 1. `crate` now has the required lockfiles with only crates needed for local and transitive builds: `linkme`, `paste`, `quote` and `syn`[^1], 2. `crate_dev` with `dev_dependency = True` (no lockfile needed) for crates only used in local tests: `googletest`[^2] and its transitive deps. [^1]: `syn`'s `full` feature was previously satisfied incidentally via `googletest`'s transitive dep. It is now declared explicitly since `protobuf_macros` needs `Stmt` and `Expr*` at compile-time. [^2]: `repositories = ["crates_dev"]` prevents `googletest` from becoming a common spec that bleeds into the production `Cargo.lock`.
rdesgroppes
added a commit
to rdesgroppes/protobuf
that referenced
this pull request
Jul 1, 2026
Fixes protocolbuffers#28224. `rules_rust` 0.71.1 (bazelbuild/rules_rust#4109) rejects any non-root `crate_universe` extension call that does not set `lockfile`. Therefore any Bazel build that depends on `protobuf` and uses `rules_rust` 0.71.1 fails to resolve: ``` crate_universe call `crates` is non-root but has no lockfile. Transitive crate_universe repos must ship a `lockfile` because repinning is not supported across module boundaries. ``` Adding lockfiles to the existing unified setup would impose `googletest` and its transitive deps (`aho-corasick`, `regex`, ...) to downstream consumers. The `crate_universe` extension is therefore split into: 1. `crate` now has the required lockfiles with only crates needed for local and transitive builds: `linkme`, `paste`, `quote` and `syn`[^1], 2. `crate_dev` with `dev_dependency = True` (no lockfile needed) for crates only used in local tests: `googletest`[^2] and its transitive deps. [^1]: `syn`'s `full` feature was previously satisfied incidentally via `googletest`'s transitive dep. It is now declared explicitly since `protobuf_macros` needs `Stmt` and `Expr*` at compile-time. [^2]: `repositories = ["crates_dev"]` prevents `googletest` from becoming a common spec that bleeds into `Cargo.lock`.
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.
#4024 now adds noisy prints that users have no way to handle when using crate_universe. This change adds annotations so the prints can be actioned.