@@ -291,6 +291,47 @@ pica_crates.from_cargo(
291291
292292use_repo (pica_crates , "pica_crates" )
293293
294+ netsim_crates = use_extension ("@rules_rust//crate_universe:extensions.bzl" , "crate" )
295+ netsim_crates .spec (
296+ package = "grpcio-sys" ,
297+ version = "0.13.0+1.56.2-patched" ,
298+ )
299+ netsim_crates .annotation (
300+ crate = "grpcio-sys" ,
301+ gen_build_script = "off" ,
302+
303+ # Mimic build.rs to use grpc from bazel_dep()
304+ deps = [
305+ ":grpc_wrap" ,
306+ ],
307+ rustc_env = {
308+ "BINDING_PATH" : "$(execpath bindings/bindings.rs)" ,
309+ },
310+ additive_build_file_content = """
311+
312+ cc_library(
313+ name = "grpc_wrap",
314+ srcs = [
315+ "grpc_wrap.cc",
316+ "@@//build_external/grpcio-sys:gpr_assert",
317+ ],
318+ copts = [
319+ "-include",
320+ "$(execpath @@//build_external/grpcio-sys:gpr_assert)",
321+ ],
322+ deps = ["@@//build_external/grpcio-sys:grpc_wrap_deps"],
323+ )
324+ """ ,
325+ )
326+ netsim_crates .from_specs (
327+ name = "netsim_crates" ,
328+ # Needed because it shares the extension with crosvm
329+ cargo_config = "@//build_external/crosvm:crosvm.config.toml" ,
330+ host_tools_repo = "rust_host_tools_nightly" ,
331+ )
332+
333+ use_repo (netsim_crates , "netsim_crates" )
334+
294335http_archive = use_repo_rule ("@bazel_tools//tools/build_defs/repo:http.bzl" , "http_archive" )
295336
296337# Upstream mtools is in subversion, which bazel doesn't support
@@ -624,7 +665,7 @@ git_repository(
624665git_repository (
625666 name = "ms-tpm-20-ref" ,
626667 build_file = "@//:BUILD.ms-tpm-20-ref.bazel" ,
627- commit = "ee21db0a941decd3cac67925ea3310873af60ab3" , # v1.83r1
668+ commit = "ee21db0a941decd3cac67925ea3310873af60ab3" , # v1.83r1
628669 remote = "https://github.com/microsoft/ms-tpm-20-ref" ,
629670 patches = [
630671 "@//build_external/ms-tpm-20-ref:0001-Turn-off-ALG_CAMELLIA.patch" ,
0 commit comments