lol

envoy: fix up Rust builds

This unblocks using wasmtime rather than wamr as the WASM runtime in
envoy (see #425065).

+18 -3
+16 -2
pkgs/by-name/en/envoy/bazel_nix.BUILD.bazel
··· 1 1 load("@bazel_tools//tools/sh:sh_toolchain.bzl", "sh_toolchain") 2 2 load("@rules_rust//rust:toolchain.bzl", "rust_toolchain") 3 + load("@rules_rust//rust:defs.bzl", "rust_stdlib_filegroup") 3 4 4 5 toolchains = { 5 6 "x86_64": "x86_64-unknown-linux-gnu", 6 7 "aarch64": "aarch64-unknown-linux-gnu", 7 8 } 8 9 9 - exports_files(["cargo", "rustdoc", "ruststd", "rustc"]) 10 + exports_files(["cargo", "rustdoc", "rustc"]) 11 + 12 + [ 13 + rust_stdlib_filegroup( 14 + name = "rust_nix_" + k + "_stdlib", 15 + srcs = glob( 16 + [ 17 + "rustcroot/lib/rustlib/" + v + "/lib/**", 18 + ], 19 + allow_empty=True, 20 + ), 21 + ) 22 + for k, v in toolchains.items() 23 + ] 10 24 11 25 [ 12 26 rust_toolchain( ··· 16 30 exec_triple = v, 17 31 cargo = ":cargo", 18 32 rust_doc = ":rustdoc", 19 - rust_std = ":ruststd", 33 + rust_std = ":rust_nix_" + k + "_stdlib", 20 34 rustc = ":rustc", 21 35 stdlib_linkflags = ["-ldl", "-lpthread"], 22 36 staticlib_ext = ".a",
+2 -1
pkgs/by-name/en/envoy/package.nix
··· 94 94 ln -sf "${cargo}/bin/cargo" bazel/nix/cargo 95 95 ln -sf "${rustc}/bin/rustc" bazel/nix/rustc 96 96 ln -sf "${rustc}/bin/rustdoc" bazel/nix/rustdoc 97 - ln -sf "${rustPlatform.rustLibSrc}" bazel/nix/ruststd 97 + ln -sf "${rustc.unwrapped}" bazel/nix/rustcroot 98 98 substituteInPlace bazel/dependency_imports.bzl \ 99 99 --replace-fail 'crate_universe_dependencies()' 'crate_universe_dependencies(rust_toolchain_cargo_template="@@//bazel/nix:cargo", rust_toolchain_rustc_template="@@//bazel/nix:rustc")' \ 100 100 --replace-fail 'crates_repository(' 'crates_repository(rust_toolchain_cargo_template="@@//bazel/nix:cargo", rust_toolchain_rustc_template="@@//bazel/nix:rustc",' ··· 239 239 "--linkopt=-Wl,-z,noexecstack" 240 240 "--config=gcc" 241 241 "--verbose_failures" 242 + "--incompatible_enable_cc_toolchain_resolution=true" 242 243 243 244 # Force use of system Java. 244 245 "--extra_toolchains=@local_jdk//:all"