fork/rules_rust
git clone https://git.julia.blue/fork/rules_rust
1625cd1e
patching
1local_repository ( 2name = "rules_rust" , 3path = "../.." , 4) 5 6load ( "@rules_rust//rust:repositories.bzl" , "rules_rust_dependencies" , "rust_register_toolchains" , "rust_repository_set" ) 7 8rules_rust_dependencies () 9 10EDITION = "2021" 11 12# Before 1.80.0, proc macros couldn't be used when exec!=target where exec and target platforms use different shared library extension (i.e. so vs dylib) because of an error in rustc's handling of extensions. 13RUST_VERSION = "1.80.0" 14 15rust_register_toolchains ( 16edition = EDITION , 17) 18 19rust_repository_set ( 20name = "darwin_x86_64_to_x86_64_musl_tuple" , 21edition = EDITION , 22exec_triple = "x86_64-apple-darwin" , 23# Setting this extra_target_triples allows differentiating the musl case from the non-musl case, in case multiple linux-targeting toolchains are registered. 24extra_target_triples = { "x86_64-unknown-linux-musl" : [ 25"@//linker_config:musl" , 26"@platforms//cpu:x86_64" , 27"@platforms//os:linux" , 28]}, 29versions = [ RUST_VERSION ], 30) 31 32rust_repository_set ( 33name = "darwin_arm64_to_x86_64_musl_tuple" , 34edition = EDITION , 35exec_triple = "aarch64-apple-darwin" , 36extra_target_triples = { "x86_64-unknown-linux-musl" : [ 37"@//linker_config:musl" , 38"@platforms//cpu:x86_64" , 39"@platforms//os:linux" , 40]}, 41versions = [ RUST_VERSION ], 42) 43 44rust_repository_set ( 45name = "darwin_x86_64_to_arm64_musl_tuple" , 46edition = EDITION , 47exec_triple = "x86_64-apple-darwin" , 48# Setting this extra_target_triples allows differentiating the musl case from the non-musl case, in case multiple linux-targeting toolchains are registered. 49extra_target_triples = { "aarch64-unknown-linux-musl" : [ 50"@//linker_config:musl" , 51"@platforms//cpu:arm64" , 52"@platforms//os:linux" , 53]}, 54versions = [ RUST_VERSION ], 55) 56 57rust_repository_set ( 58name = "darwin_arm64_to_arm64_musl_tuple" , 59edition = EDITION , 60exec_triple = "aarch64-apple-darwin" , 61extra_target_triples = { "aarch64-unknown-linux-musl" : [ 62"@//linker_config:musl" , 63"@platforms//cpu:arm64" , 64"@platforms//os:linux" , 65]}, 66versions = [ RUST_VERSION ], 67) 68 69load ( "@bazel_tools//tools/build_defs/repo:http.bzl" , "http_archive" ) 70 71http_archive ( 72name = "aspect_bazel_lib" , 73sha256 = "f5ea76682b209cc0bd90d0f5a3b26d2f7a6a2885f0c5f615e72913f4805dbb0d" , 74strip_prefix = "bazel-lib-2.5.0" , 75url = "https://github.com/aspect-build/bazel-lib/releases/download/v2.5.0/bazel-lib-v2.5.0.tar.gz" , 76) 77 78load ( "@aspect_bazel_lib//lib:repositories.bzl" , "aspect_bazel_lib_dependencies" , "aspect_bazel_lib_register_toolchains" ) 79 80aspect_bazel_lib_dependencies () 81 82aspect_bazel_lib_register_toolchains () 83 84http_archive ( 85name = "musl_toolchains" , 86sha256 = "1e6cf99f35277dbb9c3b341a9986d0f33cf70e0cc76a58f062d2d9b7ab56eeeb" , 87url = "https://github.com/bazel-contrib/musl-toolchain/releases/download/v0.1.17/musl_toolchain-v0.1.17.tar.gz" , 88) 89 90load ( "@musl_toolchains//:repositories.bzl" , "load_musl_toolchains" ) 91 92# Setting this extra_target_triples allows differentiating the musl case from the non-musl case, in case multiple linux-targeting toolchains are registered. 93load_musl_toolchains ( extra_target_compatible_with = [ "@//linker_config:musl" ]) 94 95load ( "@musl_toolchains//:toolchains.bzl" , "register_musl_toolchains" ) 96 97register_musl_toolchains () 98 99load ( "@rules_rust//crate_universe:repositories.bzl" , "crate_universe_dependencies" ) 100 101crate_universe_dependencies ( bootstrap = True ) 102 103load ( "@rules_rust//crate_universe:defs.bzl" , "crates_repository" ) 104 105crates_repository ( 106name = "cu" , 107cargo_lockfile = "//:Cargo.Bazel.lock" , 108# `generator` is not necessary in official releases. 109# See load statement for `cargo_bazel_bootstrap`. 110generator = "@cargo_bazel_bootstrap//:cargo-bazel" , 111lockfile = "//:Cargo.Bazel.lock.json" , 112manifests = [ 113"//:Cargo.toml" , 114"//:local_proc_macro/Cargo.toml" , 115], 116) 117 118load ( "@cu//:defs.bzl" , "crate_repositories" ) 119 120crate_repositories ()