From 1595d075026901ac516e9532218a87e07bcb0163 Mon Sep 17 00:00:00 2001 From: Will Smith Date: Sat, 12 Aug 2023 11:58:44 -0700 Subject: [PATCH] upgrade rules_rust (to 0.26.0) and rust (to 1.71.0) --- BUILD.bazel | 2 +- deps2.bzl | 5 +++-- deps_versions.bzl | 6 +++--- example/WORKSPACE | 6 +++--- proto/BUILD.bazel | 2 +- rust_parser/BUILD.bazel | 2 +- 6 files changed, 12 insertions(+), 11 deletions(-) diff --git a/BUILD.bazel b/BUILD.bazel index 00fabe1..2a35103 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -51,7 +51,7 @@ gazelle( ) # NOTE: need to use the version of protobuf from rules_rust so that it matches -# gazelle:resolve rust protobuf @rules_rust//proto/3rdparty/crates:protobuf +# gazelle:resolve rust protobuf @rules_rust//proto/protobuf/3rdparty/crates:protobuf # NOTE: use cargo_bazel to parse the lockfile # gazelle:resolve rust cargo_bazel @rules_rust//crate_universe:cargo_bazel diff --git a/deps2.bzl b/deps2.bzl index 70eaa45..a7296a6 100644 --- a/deps2.bzl +++ b/deps2.bzl @@ -4,7 +4,7 @@ load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies") # protobuf load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains") -load("@rules_rust//proto:repositories.bzl", "rust_proto_repositories") +load("@rules_rust//proto/protobuf:repositories.bzl", "rust_proto_protobuf_dependencies", "rust_proto_protobuf_register_toolchains") # versions of dependencies load(":deps_versions.bzl", "versions") @@ -22,4 +22,5 @@ def gazelle_rust_dependencies2(): rules_proto_dependencies() rules_proto_toolchains() - rust_proto_repositories() + rust_proto_protobuf_dependencies() + rust_proto_protobuf_register_toolchains() diff --git a/deps_versions.bzl b/deps_versions.bzl index 775ca9f..9529496 100644 --- a/deps_versions.bzl +++ b/deps_versions.bzl @@ -11,9 +11,9 @@ versions = struct( GO_VERSION = "1.21.0", # rules_rust - RULES_RUST_VERSION = "0.20.0", - RULES_RUST_SHA256 = "950a3ad4166ae60c8ccd628d1a8e64396106e7f98361ebe91b0bcfe60d8e4b60", + RULES_RUST_VERSION = "0.26.0", + RULES_RUST_SHA256 = "9d04e658878d23f4b00163a72da3db03ddb451273eb347df7d7c50838d698f49", # rust - RUST_VERSION = "1.68.2", + RUST_VERSION = "1.71.0", ) diff --git a/example/WORKSPACE b/example/WORKSPACE index e4dbf52..dab2687 100644 --- a/example/WORKSPACE +++ b/example/WORKSPACE @@ -12,8 +12,8 @@ http_archive( name = "rules_rust", # NOTE: This patch is currently necessary for gazelle_rust to parse crate_universe lockfiles. patches = ["@gazelle_rust//patches:rules_rust.patch"], - sha256 = "950a3ad4166ae60c8ccd628d1a8e64396106e7f98361ebe91b0bcfe60d8e4b60", - urls = ["https://github.com/bazelbuild/rules_rust/releases/download/0.20.0/rules_rust-v0.20.0.tar.gz"], + sha256 = "9d04e658878d23f4b00163a72da3db03ddb451273eb347df7d7c50838d698f49", + urls = ["https://github.com/bazelbuild/rules_rust/releases/download/0.26.0/rules_rust-v0.26.0.tar.gz"], ) load("@rules_rust//rust:repositories.bzl", "rules_rust_dependencies", "rust_register_toolchains") @@ -22,7 +22,7 @@ rules_rust_dependencies() rust_register_toolchains( edition = "2021", - versions = ["1.68.2"], + versions = ["1.71.0"], ) load("@rules_rust//crate_universe:defs.bzl", "crate", "crates_repository") diff --git a/proto/BUILD.bazel b/proto/BUILD.bazel index a858703..b69b70f 100644 --- a/proto/BUILD.bazel +++ b/proto/BUILD.bazel @@ -1,6 +1,6 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library") load("@rules_proto//proto:defs.bzl", "proto_library") -load("@rules_rust//proto:proto.bzl", "rust_proto_library") +load("@rules_rust//proto/protobuf:proto.bzl", "rust_proto_library") load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") proto_library( diff --git a/rust_parser/BUILD.bazel b/rust_parser/BUILD.bazel index c4e0ad6..62a94c9 100644 --- a/rust_parser/BUILD.bazel +++ b/rust_parser/BUILD.bazel @@ -33,7 +33,7 @@ rust_binary( ":parser", "//3rdparty/crates:clap", "//proto:messages_rust_proto", - "@rules_rust//proto/3rdparty/crates:protobuf", + "@rules_rust//proto/protobuf/3rdparty/crates:protobuf", ], )