Skip to content

Provide pre-generated lockfiles for Protobuf Rust under Bzlmod. - #29533

Merged
copybara-service[bot] merged 1 commit into
mainfrom
test_974008598
Sep 1, 2026
Merged

Provide pre-generated lockfiles for Protobuf Rust under Bzlmod.#29533
copybara-service[bot] merged 1 commit into
mainfrom
test_974008598

Conversation

@copybara-service

@copybara-service copybara-service Bot commented Aug 31, 2026

Copy link
Copy Markdown

Provide pre-generated lockfiles for Protobuf Rust under Bzlmod.

When Protobuf is consumed as a transitive Bzlmod dependency, rules_rust
crate_universe requires non-root modules to supply a pre-generated
lockfile for crate.from_specs() because dynamic repinning across
module boundaries is disallowed. See rules_rust enforcement at:
https://github.com/bazelbuild/rules_rust/blob/f7f212ad30a58475d6252a8607cf5cdb5f59bbdd/crate_universe/extensions.bzl#L614-L625

Additionally, rules_rust requires cargo_lockfile when lockfile is
specified to avoid cargo-bazel generate failures during non-repin
evaluation.

This change adds rust/Cargo.Bazel.lock and rust/Cargo.lock and
references them in crate.from_specs().

@copybara-service
copybara-service Bot force-pushed the test_974008598 branch 3 times, most recently from 80e7a47 to b626626 Compare September 1, 2026 01:40
@copybara-service copybara-service Bot changed the title Provide pre-generated Cargo.Bazel.lock for Protobuf Rust under Bzlmod. Provide pre-generated lockfiles for Protobuf Rust under Bzlmod. Sep 1, 2026
When Protobuf is consumed as a transitive Bzlmod dependency, rules_rust
crate_universe requires non-root modules to supply a pre-generated
`lockfile` for `crate.from_specs()` because dynamic repinning across
module boundaries is disallowed. See rules_rust enforcement at:
https://github.com/bazelbuild/rules_rust/blob/f7f212ad30a58475d6252a8607cf5cdb5f59bbdd/crate_universe/extensions.bzl#L614-L625

Additionally, rules_rust requires `cargo_lockfile` when `lockfile` is
specified to avoid `cargo-bazel generate` failures during non-repin
evaluation.

This change adds `rust/Cargo.Bazel.lock` and `rust/Cargo.lock` and
references them in `crate.from_specs()`.

PiperOrigin-RevId: 974521277
@copybara-service
copybara-service Bot merged commit e5deac3 into main Sep 1, 2026
199 checks passed
@copybara-service
copybara-service Bot deleted the test_974008598 branch September 1, 2026 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant