rust: Make dylib-std the canonical rlib form
This removes the dylib-std suffix from rlib variants which link against libstd dynamically. This is by far the common case. This fixes an issue where 'm <rust_library_rlib>' would fail since Make would expect the suffix to be included (e.g. 'm libfoo.dylib-std'). Bug: 173312517 Bug: 268086496 Test: m <rust_library_rlib> # without a suffix Change-Id: I1e5778c57468302a8d672d5eb540047d8bb79314
This commit is contained in:
@@ -25,8 +25,7 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
DylibStdlibSuffix = ".dylib-std"
|
||||
RlibStdlibSuffix = ".rlib-std"
|
||||
RlibStdlibSuffix = ".rlib-std"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -756,7 +755,6 @@ func LibstdMutator(mctx android.BottomUpMutatorContext) {
|
||||
dylib.Disable()
|
||||
}
|
||||
rlib.Properties.RustSubName += RlibStdlibSuffix
|
||||
dylib.Properties.RustSubName += DylibStdlibSuffix
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -247,10 +247,10 @@ func TestAutoDeps(t *testing.T) {
|
||||
if !android.InList("libbar", dyn.Module().(*Module).Properties.AndroidMkDylibs) {
|
||||
t.Errorf("libbar not present as dynamic dependency in dynamic lib")
|
||||
}
|
||||
if android.InList("libbar.dylib-std", dyn.Module().(*Module).Properties.AndroidMkRlibs) {
|
||||
if android.InList("libbar", dyn.Module().(*Module).Properties.AndroidMkRlibs) {
|
||||
t.Errorf("libbar present as rlib dependency in dynamic lib")
|
||||
}
|
||||
if !android.InList("librlib_only.dylib-std", dyn.Module().(*Module).Properties.AndroidMkRlibs) {
|
||||
if !android.InList("librlib_only", dyn.Module().(*Module).Properties.AndroidMkRlibs) {
|
||||
t.Errorf("librlib_only should be selected by rustlibs as an rlib.")
|
||||
}
|
||||
}
|
||||
|
@@ -377,11 +377,11 @@ func TestSourceProviderDeps(t *testing.T) {
|
||||
|
||||
// Check that our bindings are picked up as crate dependencies as well
|
||||
libfooMod := ctx.ModuleForTests("libfoo", "android_arm64_armv8-a_dylib").Module().(*Module)
|
||||
if !android.InList("libbindings.dylib-std", libfooMod.Properties.AndroidMkRlibs) {
|
||||
if !android.InList("libbindings", libfooMod.Properties.AndroidMkRlibs) {
|
||||
t.Errorf("bindgen dependency not detected as a rlib dependency (dependency missing from AndroidMkRlibs)")
|
||||
}
|
||||
fizzBuzzMod := ctx.ModuleForTests("fizz-buzz-dep", "android_arm64_armv8-a").Module().(*Module)
|
||||
if !android.InList("libbindings.dylib-std", fizzBuzzMod.Properties.AndroidMkRlibs) {
|
||||
if !android.InList("libbindings", fizzBuzzMod.Properties.AndroidMkRlibs) {
|
||||
t.Errorf("bindgen dependency not detected as a rlib dependency (dependency missing from AndroidMkRlibs)")
|
||||
}
|
||||
libprocmacroMod := ctx.ModuleForTests("libprocmacro", "linux_glibc_x86_64").Module().(*Module)
|
||||
|
Reference in New Issue
Block a user