mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-09 22:45:08 +00:00
cb5946cd93
Envoy 1.32 has added some more dependencies on rules_rust bits, so we need to support that now. In particular, for some reason, we always fail with a message about needing repinning, so we repin during the IFD phase, but we need to point rules_rust at the nixpkgs Rust toolchain, make it build the cargo-bazel tool (because the one in nixpkgs is the wrong version), and then clean up afterwards.
55 lines
1.3 KiB
Plaintext
55 lines
1.3 KiB
Plaintext
load("@bazel_tools//tools/sh:sh_toolchain.bzl", "sh_toolchain")
|
|
load("@rules_rust//rust:toolchain.bzl", "rust_toolchain")
|
|
|
|
toolchains = {
|
|
"x86_64": "x86_64-unknown-linux-gnu",
|
|
"aarch64": "aarch64-unknown-linux-gnu",
|
|
}
|
|
|
|
exports_files(["cargo", "rustdoc", "ruststd", "rustc"])
|
|
|
|
[
|
|
rust_toolchain(
|
|
name = "rust_nix_" + k + "_impl",
|
|
binary_ext = "",
|
|
dylib_ext = ".so",
|
|
exec_triple = v,
|
|
cargo = ":cargo",
|
|
rust_doc = ":rustdoc",
|
|
rust_std = ":ruststd",
|
|
rustc = ":rustc",
|
|
stdlib_linkflags = ["-ldl", "-lpthread"],
|
|
staticlib_ext = ".a",
|
|
target_triple = v,
|
|
)
|
|
for k, v in toolchains.items()
|
|
]
|
|
|
|
[
|
|
toolchain(
|
|
name = "rust_nix_" + k,
|
|
exec_compatible_with = [
|
|
"@platforms//cpu:" + k,
|
|
"@platforms//os:linux",
|
|
],
|
|
target_compatible_with = [
|
|
"@platforms//cpu:" + k,
|
|
"@platforms//os:linux",
|
|
],
|
|
toolchain = ":rust_nix_" + k + "_impl",
|
|
toolchain_type = "@rules_rust//rust:toolchain_type",
|
|
)
|
|
for k in toolchains.keys()
|
|
]
|
|
|
|
sh_toolchain(
|
|
name = "local_sh_impl",
|
|
path = "@bash@",
|
|
)
|
|
|
|
toolchain(
|
|
name = "local_sh",
|
|
toolchain = ":local_sh_impl",
|
|
toolchain_type = "@bazel_tools//tools/sh:toolchain_type",
|
|
)
|