rust: Shorten name of generated Rust staticlibs
Some modules may have very long module names. Combined with the
intermediates produced by rustc, this may result in filepaths that are
too long. We can mitigate this somewhat by changing the generated crate
name for the staticlib to not be based on the parent module name.
Bug: 376452102
Test: m blueprint_tests
Test: m
Change-Id: I2d6210d32f7f65ddfa4d1cf1be433c1610b24949
diff --git a/rust/rust_test.go b/rust/rust_test.go
index eeedf3f..767508d 100644
--- a/rust/rust_test.go
+++ b/rust/rust_test.go
@@ -494,7 +494,7 @@
}
// Make sure the static lib is included in the ld command
- if !strings.Contains(libcc_shared_ld.Args["libFlags"], "generated_rust_staticlib/liblibcc_shared_rust_staticlib.a") {
+ if !strings.Contains(libcc_shared_ld.Args["libFlags"], "generated_rust_staticlib/librustlibs.a") {
t.Errorf("missing generated static library in linker step libFlags %#v, libFlags: %#v",
"libcc_shared.generated_rust_staticlib.a", libcc_shared_ld.Args["libFlags"])
}
@@ -511,7 +511,7 @@
}
// Make sure the static lib is included in the cc command
- if !strings.Contains(ccbin_ld.Args["libFlags"], "generated_rust_staticlib/libccBin_rust_staticlib.a") {
+ if !strings.Contains(ccbin_ld.Args["libFlags"], "generated_rust_staticlib/librustlibs.a") {
t.Errorf("missing generated static library in linker step libFlags, expecting %#v, libFlags: %#v",
"ccBin.generated_rust_staticlib.a", ccbin_ld.Args["libFlags"])
}