Add Rust support to MODULE.bazel

PiperOrigin-RevId: 640804047
pull/17044/head
Protobuf Team Bot 9 months ago committed by Copybara-Service
parent b2a6cdb910
commit f3c140f96c
  1. 1
      .bcr/presubmit.yml
  2. 10
      BUILD.bazel
  3. 19
      MODULE.bazel

@ -13,6 +13,7 @@ tasks:
build_targets:
- '@protobuf//:protobuf'
- '@protobuf//:protobuf_lite'
- '@protobuf//:protobuf_rust'
- '@protobuf//:protoc'
- '@protobuf//:test_messages_proto2_cc_proto'
- '@protobuf//:test_messages_proto3_cc_proto'

@ -444,6 +444,16 @@ alias(
visibility = ["//visibility:public"],
)
################################################################################
# Rust support
################################################################################
alias(
name = "protobuf_rust",
actual = "//rust:protobuf",
visibility = ["//visibility:public"],
)
################################################################################
# Test protos
################################################################################

@ -21,8 +21,25 @@ bazel_dep(name = "rules_java", version = "5.3.5")
bazel_dep(name = "rules_jvm_external", version = "5.1")
bazel_dep(name = "rules_pkg", version = "0.7.0")
bazel_dep(name = "rules_python", version = "0.10.2")
bazel_dep(name = "rules_rust", version = "0.45.1")
bazel_dep(name = "platforms", version = "0.0.8")
bazel_dep(name = "zlib", version = "1.2.11")
# TODO: remove after toolchain types are moved to protobuf
bazel_dep(name = "rules_proto", version = "4.0.0")
bazel_dep(name = "rules_proto", version = "4.0.0")
rust = use_extension("@rules_rust//rust:extensions.bzl", "rust")
rust.toolchain(edition = "2021")
use_repo(rust, "rust_toolchains")
register_toolchains("@rust_toolchains//:all")
crate = use_extension("@rules_rust//crate_universe:extension.bzl", "crate")
crate.spec(
package = "googletest",
version = ">0.0.0",
)
crate.spec(
package = "paste",
version = ">=1",
)
crate.from_specs()
use_repo(crate, crate_index = "crates")

Loading…
Cancel
Save