rust: Alias rust_ffi_rlib to rust_library_rlib
With the new transition mutators, the distinctions between rust_ffi_rlib
and rust_library_rlib are not necessary. This CL removes the remaining
distinctions to allow an unusual use case where a rust_library and a
rust_ffi_rlib would otherwise be created from the same source. This
would allow defining a single rust_library_rlib that works for both rust
modules and cc modules.
One key change is that rust_ffi_rlibs only produced an rlib-std variant
previously, and now produce dylib-std variants as well.This surfaced an
issue where a libstd linkage mismatch would cause rustc to throw a
consufing missing crate error. We instead add logic to catch this in
Soong and provide a more useful error message.
Bug: 383552450
Test: m rust
Test: m blueprint_tests
Change-Id: I611ca46934059735d06229952cfd8e0ab7050486
diff --git a/rust/testing.go b/rust/testing.go
index 32cc823..2e50e1e 100644
--- a/rust/testing.go
+++ b/rust/testing.go
@@ -188,12 +188,12 @@
ctx.RegisterModuleType("rust_fuzz_host", RustFuzzHostFactory)
ctx.RegisterModuleType("rust_ffi", RustFFIFactory)
ctx.RegisterModuleType("rust_ffi_shared", RustFFISharedFactory)
- ctx.RegisterModuleType("rust_ffi_rlib", RustFFIRlibFactory)
- ctx.RegisterModuleType("rust_ffi_static", RustFFIRlibFactory)
+ ctx.RegisterModuleType("rust_ffi_rlib", RustLibraryRlibFactory)
+ ctx.RegisterModuleType("rust_ffi_static", RustLibraryRlibFactory)
ctx.RegisterModuleType("rust_ffi_host", RustFFIHostFactory)
ctx.RegisterModuleType("rust_ffi_host_shared", RustFFISharedHostFactory)
- ctx.RegisterModuleType("rust_ffi_host_rlib", RustFFIRlibHostFactory)
- ctx.RegisterModuleType("rust_ffi_host_static", RustFFIRlibHostFactory)
+ ctx.RegisterModuleType("rust_ffi_host_rlib", RustLibraryRlibHostFactory)
+ ctx.RegisterModuleType("rust_ffi_host_static", RustLibraryRlibHostFactory)
ctx.RegisterModuleType("rust_proc_macro", ProcMacroFactory)
ctx.RegisterModuleType("rust_protobuf", RustProtobufFactory)
ctx.RegisterModuleType("rust_protobuf_host", RustProtobufHostFactory)