Skip to content

Commit 655de58

Browse files
committed
Pin cxx dependency in netsim to fix build
As of version 1.0.89, cxx started versioning their generated symbols to detect version mismatches between the version of cxx used for rust and c++ code in the same project. Netsim was automatically using the latest cxx, while bazel was pinned at 1.0.68. The bazel registry only goes up to 1.0.88, so pin both projects there. See https://www.github.com/dtolnay/cxx/pull/1665 Bug: b/462513519
1 parent 749cd9d commit 655de58

File tree

4 files changed

+28
-2
lines changed

4 files changed

+28
-2
lines changed

base/cvd/BUILD.android_tools_netsim.bazel

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,17 @@ cc_library(
230230
],
231231
)
232232

233+
cc_library(
234+
name = "netsim_daemon_ffi_cc_library",
235+
srcs = ["netsim-daemon/src/ffi.rs.cc"],
236+
hdrs = ["netsim-daemon/src/ffi.rs.h"],
237+
deps = [
238+
":lib-netsim",
239+
],
240+
alwayslink = True,
241+
linkstatic = True,
242+
)
243+
233244
rust_library(
234245
name = "libnetsim_daemon",
235246
srcs = glob([
@@ -271,6 +282,7 @@ cc_binary(
271282
deps = [
272283
":lib-netsim",
273284
":libnetsim_daemon",
285+
":netsim_daemon_ffi_cc_library",
274286
":netsim_cc_proto",
275287
"@grpc//:grpc++",
276288
"@netsim_crates//:grpcio-sys",

base/cvd/MODULE.bazel

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ bazel_dep(name = "boringssl", version = "0.20241024.0")
1313
bazel_dep(name = "brotli", version = "1.1.0")
1414
bazel_dep(name = "crc32c", version = "1.1.0")
1515
bazel_dep(name = "curl", version = "8.8.0.bcr.2")
16-
bazel_dep(name = "cxx.rs", version = "1.0.168")
16+
bazel_dep(name = "cxx.rs", version = "1.0.188")
1717
bazel_dep(name = "fmt", version = "11.2.0.bcr.1")
1818
bazel_dep(name = "freetype", version = "2.13.3")
1919
bazel_dep(name = "gflags", version = "2.2.2")
@@ -758,6 +758,7 @@ git_repository(
758758
patches = [
759759
"@//build_external/netsim:0001-Drop-pica-from-daemon-Cargo.toml.patch",
760760
"@//build_external/netsim:0002-Fix-build-with-tungstenite-0.26.0.patch",
761+
"@//build_external/netsim:0003-Pin-cxx.patch",
761762
],
762763
patch_strip = 1,
763764
)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/rust/daemon/Cargo.toml b/rust/daemon/Cargo.toml
2+
index 30f705ad..3a1819d4 100644
3+
--- a/rust/daemon/Cargo.toml
4+
+++ b/rust/daemon/Cargo.toml
5+
@@ -11,7 +11,7 @@ doctest = false
6+
[dependencies]
7+
bytes = { version = ">=1.4.0"}
8+
clap = { version = "4.1.8", default-features = false, features = ["derive", "error-context", "help", "std", "usage", "env" ] }
9+
-cxx = { version = ">=1.0.85", features = ["c++17"] }
10+
+cxx = { version = "=1.0.188", features = ["c++17"] }
11+
data-encoding = "2.4.0"
12+
futures = "0.3.30"
13+
glam = { version = "0.25.0", features = ["libm"] }

base/cvd/cuttlefish/package/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ package_files(
7474
"cuttlefish-common/bin/ms-tpm-20-ref": "@ms-tpm-20-ref//:simulator",
7575
"cuttlefish-common/bin/mtools": "@mtools//:mtools",
7676
"cuttlefish-common/bin/netsim": "@android_tools_netsim//:netsim",
77-
# "cuttlefish-common/bin/netsimd": "@android_tools_netsim//:netsimd",
77+
"cuttlefish-common/bin/netsimd": "@android_tools_netsim//:netsimd",
7878
"cuttlefish-common/bin/openwrt_control_server": "//cuttlefish/host/commands/openwrt_control_server",
7979
"cuttlefish-common/bin/operator_proxy": "//cuttlefish/host/frontend/operator_proxy",
8080
"cuttlefish-common/bin/pica": "@netsim_crates//:pica__pica",

0 commit comments

Comments
 (0)