2023-12-06 18:47:47 +00:00
|
|
|
"""bazelbuild/rules_rust"""
|
|
|
|
|
2023-03-29 08:56:01 +00:00
|
|
|
module(
|
|
|
|
name = "rules_rust",
|
2024-10-18 18:01:09 +00:00
|
|
|
version = "0.53.0",
|
2023-03-29 08:56:01 +00:00
|
|
|
)
|
|
|
|
|
2024-03-27 15:38:30 +00:00
|
|
|
bazel_dep(
|
|
|
|
name = "bazel_features",
|
|
|
|
version = "1.9.1",
|
|
|
|
)
|
2023-12-12 13:52:58 +00:00
|
|
|
bazel_dep(
|
|
|
|
name = "bazel_skylib",
|
|
|
|
version = "1.5.0",
|
|
|
|
)
|
|
|
|
bazel_dep(
|
|
|
|
name = "platforms",
|
|
|
|
version = "0.0.8",
|
|
|
|
)
|
|
|
|
bazel_dep(
|
|
|
|
name = "rules_cc",
|
|
|
|
version = "0.0.9",
|
|
|
|
)
|
2024-02-14 00:37:38 +00:00
|
|
|
bazel_dep(
|
|
|
|
name = "rules_license",
|
|
|
|
version = "0.0.8",
|
|
|
|
)
|
2023-12-12 13:52:58 +00:00
|
|
|
bazel_dep(
|
|
|
|
name = "rules_proto",
|
2024-07-19 08:10:10 +00:00
|
|
|
version = "6.0.2",
|
2023-12-12 13:52:58 +00:00
|
|
|
)
|
2023-10-25 14:23:31 +00:00
|
|
|
bazel_dep(
|
|
|
|
name = "apple_support",
|
2024-02-21 09:27:30 +00:00
|
|
|
version = "1.13.0",
|
2023-10-25 14:23:31 +00:00
|
|
|
repo_name = "build_bazel_apple_support",
|
|
|
|
)
|
2023-12-12 13:52:58 +00:00
|
|
|
bazel_dep(
|
|
|
|
name = "protobuf",
|
|
|
|
version = "21.7",
|
|
|
|
repo_name = "com_google_protobuf",
|
|
|
|
)
|
2024-04-23 09:58:13 +00:00
|
|
|
bazel_dep(
|
|
|
|
name = "aspect_rules_js",
|
|
|
|
version = "1.39.0",
|
|
|
|
)
|
2023-03-29 08:56:01 +00:00
|
|
|
|
2024-06-06 10:28:40 +00:00
|
|
|
bazel_dep(
|
|
|
|
name = "bazel_ci_rules",
|
|
|
|
version = "1.0.0",
|
|
|
|
dev_dependency = True,
|
|
|
|
)
|
2024-04-03 15:38:38 +00:00
|
|
|
bazel_dep(
|
|
|
|
name = "rules_python",
|
|
|
|
version = "0.31.0",
|
|
|
|
dev_dependency = True,
|
|
|
|
)
|
|
|
|
bazel_dep(
|
|
|
|
name = "rules_testing",
|
|
|
|
version = "0.6.0",
|
|
|
|
dev_dependency = True,
|
|
|
|
)
|
|
|
|
|
2024-02-23 12:55:58 +00:00
|
|
|
internal_deps = use_extension("//rust/private:extensions.bzl", "i")
|
2023-03-29 08:56:01 +00:00
|
|
|
use_repo(
|
|
|
|
internal_deps,
|
2023-12-28 18:53:57 +00:00
|
|
|
"cargo_bazel.buildifier-darwin-amd64",
|
|
|
|
"cargo_bazel.buildifier-darwin-arm64",
|
|
|
|
"cargo_bazel.buildifier-linux-amd64",
|
|
|
|
"cargo_bazel.buildifier-linux-arm64",
|
|
|
|
"cargo_bazel.buildifier-windows-amd64.exe",
|
2023-12-12 13:52:58 +00:00
|
|
|
"cui",
|
2024-10-21 05:39:37 +00:00
|
|
|
"cui__anyhow-1.0.89",
|
|
|
|
"cui__camino-1.1.9",
|
|
|
|
"cui__cargo-lock-10.0.0",
|
|
|
|
"cui__cargo-platform-0.1.7",
|
2023-12-12 13:52:58 +00:00
|
|
|
"cui__cargo_metadata-0.18.1",
|
2024-10-21 05:39:37 +00:00
|
|
|
"cui__cargo_toml-0.20.5",
|
2024-10-01 20:31:32 +00:00
|
|
|
"cui__cfg-expr-0.17.0",
|
2023-12-12 13:52:58 +00:00
|
|
|
"cui__clap-4.3.11",
|
2024-10-21 05:39:37 +00:00
|
|
|
"cui__crates-index-3.2.0",
|
2023-12-12 13:52:58 +00:00
|
|
|
"cui__hex-0.4.3",
|
2024-10-21 05:39:37 +00:00
|
|
|
"cui__indoc-2.0.5",
|
|
|
|
"cui__itertools-0.13.0",
|
2023-12-12 13:52:58 +00:00
|
|
|
"cui__maplit-1.0.2",
|
2024-10-21 05:39:37 +00:00
|
|
|
"cui__normpath-1.3.0",
|
|
|
|
"cui__once_cell-1.20.2",
|
|
|
|
"cui__pathdiff-0.2.2",
|
|
|
|
"cui__regex-1.11.0",
|
|
|
|
"cui__semver-1.0.23",
|
|
|
|
"cui__serde-1.0.210",
|
|
|
|
"cui__serde_json-1.0.129",
|
|
|
|
"cui__serde_starlark-0.1.16",
|
2023-12-12 13:52:58 +00:00
|
|
|
"cui__sha2-0.10.8",
|
2024-10-21 05:39:37 +00:00
|
|
|
"cui__spdx-0.10.6",
|
2023-12-12 13:52:58 +00:00
|
|
|
"cui__spectral-0.6.0",
|
2024-10-21 05:39:37 +00:00
|
|
|
"cui__tempfile-3.13.0",
|
2023-12-12 13:52:58 +00:00
|
|
|
"cui__tera-1.19.1",
|
2024-10-21 05:39:37 +00:00
|
|
|
"cui__textwrap-0.16.1",
|
|
|
|
"cui__toml-0.8.19",
|
2023-12-12 13:52:58 +00:00
|
|
|
"cui__tracing-0.1.40",
|
2024-10-21 05:39:37 +00:00
|
|
|
"cui__tracing-subscriber-0.3.18",
|
2024-08-08 21:18:35 +00:00
|
|
|
"cui__url-2.5.2",
|
2023-12-12 13:52:58 +00:00
|
|
|
"generated_inputs_in_external_repo",
|
|
|
|
"libc",
|
|
|
|
"llvm-raw",
|
|
|
|
"rrra__anyhow-1.0.71",
|
|
|
|
"rrra__clap-4.3.11",
|
|
|
|
"rrra__env_logger-0.10.0",
|
|
|
|
"rrra__itertools-0.11.0",
|
|
|
|
"rrra__log-0.4.19",
|
|
|
|
"rrra__serde-1.0.171",
|
|
|
|
"rrra__serde_json-1.0.102",
|
2024-09-18 16:01:06 +00:00
|
|
|
"rules_rust_bindgen__bindgen-0.70.1",
|
|
|
|
"rules_rust_bindgen__bindgen-cli-0.70.1",
|
|
|
|
"rules_rust_bindgen__clang-sys-1.8.1",
|
|
|
|
"rules_rust_bindgen__clap-4.5.17",
|
|
|
|
"rules_rust_bindgen__clap_complete-4.5.26",
|
|
|
|
"rules_rust_bindgen__env_logger-0.10.2",
|
2023-12-12 13:52:58 +00:00
|
|
|
"rules_rust_prost",
|
2024-08-26 18:36:41 +00:00
|
|
|
"rules_rust_prost__h2-0.4.6",
|
2023-12-12 13:52:58 +00:00
|
|
|
"rules_rust_prost__heck",
|
2024-08-26 18:36:41 +00:00
|
|
|
"rules_rust_prost__prost-0.13.1",
|
|
|
|
"rules_rust_prost__prost-types-0.13.1",
|
|
|
|
"rules_rust_prost__protoc-gen-prost-0.4.0",
|
|
|
|
"rules_rust_prost__protoc-gen-tonic-0.4.1",
|
|
|
|
"rules_rust_prost__tokio-1.39.3",
|
|
|
|
"rules_rust_prost__tokio-stream-0.1.15",
|
|
|
|
"rules_rust_prost__tonic-0.12.1",
|
2024-04-03 15:38:38 +00:00
|
|
|
"rules_rust_proto__grpc-0.6.2",
|
|
|
|
"rules_rust_proto__grpc-compiler-0.6.2",
|
|
|
|
"rules_rust_proto__log-0.4.17",
|
|
|
|
"rules_rust_proto__protobuf-2.8.2",
|
|
|
|
"rules_rust_proto__protobuf-codegen-2.8.2",
|
|
|
|
"rules_rust_proto__tls-api-0.1.22",
|
|
|
|
"rules_rust_proto__tls-api-stub-0.1.22",
|
2023-12-12 13:52:58 +00:00
|
|
|
"rules_rust_test_load_arbitrary_tool",
|
2023-03-29 08:56:01 +00:00
|
|
|
"rules_rust_tinyjson",
|
2023-12-12 13:52:58 +00:00
|
|
|
"rules_rust_toolchain_test_target_json",
|
|
|
|
"rules_rust_wasm_bindgen__anyhow-1.0.71",
|
|
|
|
"rules_rust_wasm_bindgen__assert_cmd-1.0.8",
|
|
|
|
"rules_rust_wasm_bindgen__diff-0.1.13",
|
|
|
|
"rules_rust_wasm_bindgen__docopt-1.1.1",
|
|
|
|
"rules_rust_wasm_bindgen__env_logger-0.8.4",
|
|
|
|
"rules_rust_wasm_bindgen__log-0.4.19",
|
|
|
|
"rules_rust_wasm_bindgen__predicates-1.0.8",
|
|
|
|
"rules_rust_wasm_bindgen__rayon-1.7.0",
|
|
|
|
"rules_rust_wasm_bindgen__rouille-3.6.2",
|
|
|
|
"rules_rust_wasm_bindgen__serde-1.0.171",
|
|
|
|
"rules_rust_wasm_bindgen__serde_derive-1.0.171",
|
|
|
|
"rules_rust_wasm_bindgen__serde_json-1.0.102",
|
|
|
|
"rules_rust_wasm_bindgen__tempfile-3.6.0",
|
|
|
|
"rules_rust_wasm_bindgen__ureq-2.8.0",
|
2024-01-02 14:12:12 +00:00
|
|
|
"rules_rust_wasm_bindgen__walrus-0.20.3",
|
2024-06-24 20:33:21 +00:00
|
|
|
"rules_rust_wasm_bindgen__wasm-bindgen-0.2.92",
|
|
|
|
"rules_rust_wasm_bindgen__wasm-bindgen-cli-support-0.2.92",
|
|
|
|
"rules_rust_wasm_bindgen__wasm-bindgen-shared-0.2.92",
|
2023-12-12 13:52:58 +00:00
|
|
|
"rules_rust_wasm_bindgen__wasmparser-0.102.0",
|
|
|
|
"rules_rust_wasm_bindgen__wasmprinter-0.2.60",
|
|
|
|
"rules_rust_wasm_bindgen_cli",
|
2023-03-29 08:56:01 +00:00
|
|
|
)
|
2023-10-25 14:23:31 +00:00
|
|
|
|
|
|
|
rust = use_extension("//rust:extensions.bzl", "rust")
|
|
|
|
rust.toolchain(edition = "2021")
|
|
|
|
use_repo(rust, "rust_toolchains")
|
|
|
|
|
|
|
|
register_toolchains(
|
|
|
|
"@rust_toolchains//:all",
|
|
|
|
)
|
|
|
|
|
2024-04-03 15:38:38 +00:00
|
|
|
register_toolchains(
|
|
|
|
"//proto/protobuf:default-proto-toolchain",
|
|
|
|
)
|
|
|
|
|
|
|
|
register_toolchains(
|
|
|
|
"//proto/prost:default_prost_toolchain",
|
|
|
|
)
|
|
|
|
|
|
|
|
register_toolchains(
|
|
|
|
"//bindgen:default_bindgen_toolchain",
|
|
|
|
)
|
|
|
|
|
Make bazel lock file cross-platform (#2453)
Since the host tools are os and arch specific, previously bazel would
cache the resolution of these in the lock file, causing the repo for the
wrong OS or arch to be used when moving between machines.
Since bazel 7.1.0, module extensions can be marked as reproducible to
exclude these from the lock file. However, the `rust` module extension
handles fetching of all the other toolchains as well as the host tools,
and we don't really want to exclude those too. Therefore the host tools
are moved to their own module extension. This means we can no longer
match the host toolchain's version, edition, etc with the toolchain
registered via `rust.toolchain` by default, and instead default to a
fixed version. This can still be overridden separately in the root
module. I think this is okay, because the host tools are only used for
bootstrapping and I don't think there's much need to have them match.
This is tested by now checking in the MODULE.bazel.lock file of the
bzlmod example, and running the bzlmod examples on multiple platforms
with `--lockfile_mode` set to `error`.
Resolves #2452
Resolves #2549
2024-04-05 09:58:07 +00:00
|
|
|
rust_host_tools = use_extension("//rust:extensions.bzl", "rust_host_tools")
|
|
|
|
use_repo(rust_host_tools, "rust_host_tools")
|
2023-10-25 14:23:31 +00:00
|
|
|
|
|
|
|
cargo_bazel_bootstrap = use_extension("//crate_universe/private/module_extensions:cargo_bazel_bootstrap.bzl", "cargo_bazel_bootstrap")
|
|
|
|
use_repo(cargo_bazel_bootstrap, "cargo_bazel_bootstrap")
|