Rust rlib vendor snapshot support.
Adds support for snapshotting Rust rlibs. This allows us vendor-specific code that uses rlib-only linkage until dylib snapshot support is added. Bug: 184042776 Test: m nothing # new Soong tests pass Test: Example test Rust vendor module builds Test: m dist vendor-snapshot # includes rlibs Change-Id: I4976d3e1efec0ee778cc97730d45be471dffb678
This commit is contained in:
@@ -59,6 +59,7 @@ var rustMockedFiles = android.MockFS{
|
||||
"liby.so": nil,
|
||||
"libz.so": nil,
|
||||
"data.txt": nil,
|
||||
"liblog.map.txt": nil,
|
||||
}
|
||||
|
||||
// testRust returns a TestContext in which a basic environment has been setup.
|
||||
@@ -77,18 +78,25 @@ func testRustVndk(t *testing.T, bp string) *android.TestContext {
|
||||
return testRustVndkFs(t, bp, rustMockedFiles)
|
||||
}
|
||||
|
||||
const vendorVariant = "android_vendor.29_arm64_armv8-a_shared"
|
||||
const (
|
||||
sharedVendorVariant = "android_vendor.29_arm64_armv8-a_shared"
|
||||
rlibVendorVariant = "android_vendor.29_arm64_armv8-a_rlib_rlib-std"
|
||||
)
|
||||
|
||||
func testRustVndkFs(t *testing.T, bp string, fs android.MockFS) *android.TestContext {
|
||||
return testRustVndkFsVersions(t, bp, fs, "current", "current", "29")
|
||||
}
|
||||
|
||||
func testRustVndkFsVersions(t *testing.T, bp string, fs android.MockFS, device_version, product_version, vndk_version string) *android.TestContext {
|
||||
skipTestIfOsNotSupported(t)
|
||||
result := android.GroupFixturePreparers(
|
||||
prepareForRustTest,
|
||||
fs.AddToFixture(),
|
||||
android.FixtureModifyProductVariables(
|
||||
func(variables android.FixtureProductVariables) {
|
||||
variables.DeviceVndkVersion = StringPtr("current")
|
||||
variables.ProductVndkVersion = StringPtr("current")
|
||||
variables.Platform_vndk_version = StringPtr("29")
|
||||
variables.DeviceVndkVersion = StringPtr(device_version)
|
||||
variables.ProductVndkVersion = StringPtr(product_version)
|
||||
variables.Platform_vndk_version = StringPtr(vndk_version)
|
||||
},
|
||||
),
|
||||
).RunTestWithBp(t, bp)
|
||||
|
Reference in New Issue
Block a user