Skip to content

Commit

Permalink
[bazel] Move rules_rust to MODULE.bazel
Browse files Browse the repository at this point in the history
  • Loading branch information
p0deje committed Apr 18, 2024
1 parent e1677cd commit bed404c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 33 deletions.
16 changes: 16 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ bazel_dep(name = "rules_pkg", version = "0.9.1")
bazel_dep(name = "rules_python", version = "0.31.0")
bazel_dep(name = "rules_proto", version = "5.3.0-21.7")
bazel_dep(name = "rules_ruby", version = "0.8.1")
bazel_dep(name = "rules_rust", version = "0.41.1")

linter = use_extension("@apple_rules_lint//lint:extensions.bzl", "linter")
linter.configure(
Expand Down Expand Up @@ -321,6 +322,21 @@ use_repo(ruby, "bundle", "ruby", "ruby_toolchains")

register_toolchains("@ruby_toolchains//:all")

rust = use_extension("@rules_rust//rust:extensions.bzl", "rust")
rust.toolchain(
edition = "2021",
versions = ["1.76.0"],
)
use_repo(rust, "rust_toolchains")

crate = use_extension("@rules_rust//crate_universe:extension.bzl", "crate")
crate.from_cargo(
name = "crates",
cargo_lockfile = "//rust:Cargo.lock",
manifests = ["//rust:Cargo.toml"],
)
use_repo(crate, "crates")

selenium_manager_artifacts = use_extension("//common:selenium_manager.bzl", "selenium_manager_artifacts")
use_repo(
selenium_manager_artifacts,
Expand Down
33 changes: 0 additions & 33 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -10,39 +10,6 @@ rules_proto_dependencies()

rules_proto_toolchains()

# Move to MODULE.bazel once a new release is out with
# https://github.com/bazelbuild/rules_rust/commit/fc601ba32f21ec034baebc487646dea92afbcd04.

http_archive(
name = "rules_rust",
integrity = "sha256-XT1YVJ6FHJTXBr1v3px2fV37/OCS3dQk3ul+XvfIIf8=",
urls = ["https://github.com/bazelbuild/rules_rust/releases/download/0.42.0/rules_rust-v0.42.0.tar.gz"],
)

load("@rules_rust//rust:repositories.bzl", "rules_rust_dependencies", "rust_register_toolchains")

rules_rust_dependencies()

rust_register_toolchains(
edition = "2021",
versions = [
"1.77.0",
],
)

load("@rules_rust//crate_universe:defs.bzl", "crates_repository")

crates_repository(
name = "crates",
cargo_lockfile = "//rust:Cargo.lock",
lockfile = "//rust:Cargo.Bazel.lock",
manifests = ["//rust:Cargo.toml"],
)

load("@crates//:defs.bzl", "crate_repositories")

crate_repositories()

# rules_closure are not published to BCR.

http_archive(
Expand Down

0 comments on commit bed404c

Please sign in to comment.