blob: b507ef0d553b8e01f31f4cd493cd030cc2a8d261 [file] [log] [blame]
module(
name = "rules_rust_test_no_std",
version = "0.0.0",
)
bazel_dep(name = "rules_rust", version = "0.0.0")
local_path_override(
module_name = "rules_rust",
path = "../../..",
)
bazel_dep(name = "rules_cc", version = "0.2.4")
bazel_dep(name = "platforms", version = "1.0.0")
rust = use_extension("@rules_rust//rust:extensions.bzl", "rust")
rust.toolchain(
edition = "2021",
target_settings = [
"@rules_rust//rust/settings:experimental_use_allocator_libraries_with_mangled_symbols_off",
],
versions = [
"nightly/2024-10-17",
"1.82.0",
],
)
# Generate a toolchain to be used for rust-based allocator symbols.
# A recent enough version of rustc that mangles the internal allocator symbols.
VERSION = "nightly/2025-04-08"
rust.repository_set(
name = "rust_with_alloc_mangling_linux_x86_64",
allocator_library = "@rules_rust//ffi/rs:empty",
edition = "2021",
exec_triple = "x86_64-unknown-linux-gnu",
target_compatible_with = [
"@platforms//cpu:x86_64",
"@platforms//os:linux",
],
target_settings = [
"@rules_rust//rust/settings:experimental_use_allocator_libraries_with_mangled_symbols_on",
],
target_triple = "x86_64-unknown-linux-gnu",
versions = [VERSION],
)
use_repo(rust, "rust_toolchains")
register_toolchains("@rust_toolchains//:all")
crate = use_extension("@rules_rust//crate_universe:extensions.bzl", "crate")
crate.spec(
package = "libc_alloc",
version = "1.0.3",
)
crate.from_specs(name = "no_std_crate_index")
use_repo(crate, "no_std_crate_index")