protocolbuffers / protocolbuffers/protobuf
Bazel: "`crates` is in a non-root module but has no lockfile" since rules_rust 0.71.1
@esrauchg is already working on this.
Since Jun 30, 2026.
- Dominant language
- C++
- Stars
- 72k
- Forks
- 16.3k
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 140
Description
What version of protobuf and what language are you using?
Version: 35.1
Language: Rust
What supported operating system version are you using (e.g. Linux, Windows)?
Linux
What supported runtime / compiler version are you using (e.g. python version, gcc version)
Bazel 9.1.1 with rules_rust 0.71.1
What did you do?
In a root Bazel module that transitively depends on protobuf, force rules_rust to 0.71.1 and run bazel mod deps.
protobuf invokes the crate_universe extension unconditionally because it is not a dev dependency, and calls crate.from_specs() without a lockfile.
What did you expect to see
Resolution succeeds, because protobuf's crate_universe usage only supports protobuf's own Rust targets, which consumers do not depend on.
What did you see instead?
Resolution fails, because rules_rust 0.71.1 rejects any non-root crate_universe call that does not set lockfile:
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.
Anything else we should know about your project / environment
Would it possible to supply a lockfile?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.