diff options
author | 2025-03-19 14:12:09 -0700 | |
---|---|---|
committer | 2025-03-19 16:25:18 -0700 | |
commit | b790b9cb8f891bf21755ccc97a5405b2ed0687d2 (patch) | |
tree | 2f62bf7fc1ae74688bfd98113a61cc6bef87e1af /rust | |
parent | 80f92da0efc1924aa30866e64b266d1dee87aa51 (diff) |
Clear as much of cc.Module as possible after GenerateBuildActions
Reduce peak memory usage by adding a CleanupAfterBuildActions method
that is called at the end GenerateBuidlActions, nad use it to clear as
much of cc.Module as possible.
This is a temporary measure, eventually the entire module should be
released by blueprint once all interactions are performed through
providers.
Test: all soong tests pass
Change-Id: Idc3390ae4506ff2eef3231691e1de7446067961a
Diffstat (limited to 'rust')
-rw-r--r-- | rust/fuzz_test.go | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/rust/fuzz_test.go b/rust/fuzz_test.go index bdcfbbba1..f462795aa 100644 --- a/rust/fuzz_test.go +++ b/rust/fuzz_test.go @@ -134,17 +134,24 @@ func TestCCFuzzDepBundling(t *testing.T) { } `) - fuzz_shared_libtest := ctx.ModuleForTests(t, "fuzz_shared_libtest", "android_arm64_armv8-a_fuzzer").Module().(cc.LinkableInterface) - fuzz_static_libtest := ctx.ModuleForTests(t, "fuzz_static_libtest", "android_arm64_armv8-a_fuzzer").Module().(cc.LinkableInterface) - fuzz_staticffi_libtest := ctx.ModuleForTests(t, "fuzz_staticffi_libtest", "android_arm64_armv8-a_fuzzer").Module().(cc.LinkableInterface) + fuzz_shared_libtest := ctx.ModuleForTests(t, "fuzz_shared_libtest", "android_arm64_armv8-a_fuzzer").Module() + fuzz_static_libtest := ctx.ModuleForTests(t, "fuzz_static_libtest", "android_arm64_armv8-a_fuzzer").Module() + fuzz_staticffi_libtest := ctx.ModuleForTests(t, "fuzz_staticffi_libtest", "android_arm64_armv8-a_fuzzer").Module() - if !strings.Contains(fuzz_shared_libtest.FuzzSharedLibraries().String(), ":libcc_transitive_dep.so") { - t.Errorf("cc_fuzz does not contain the expected bundled transitive shared libs from rust_ffi_shared ('libcc_transitive_dep'): %#v", fuzz_shared_libtest.FuzzSharedLibraries().String()) + fuzzSharedLibraries := func(module android.Module) string { + if info, ok := android.OtherModuleProvider(ctx, module, cc.LinkableInfoProvider); ok { + return info.FuzzSharedLibraries.String() + } + return "" } - if !strings.Contains(fuzz_static_libtest.FuzzSharedLibraries().String(), ":libcc_transitive_dep.so") { - t.Errorf("cc_fuzz does not contain the expected bundled transitive shared libs from rust_ffi_static ('libcc_transitive_dep'): %#v", fuzz_static_libtest.FuzzSharedLibraries().String()) + + if libs := fuzzSharedLibraries(fuzz_shared_libtest); !strings.Contains(libs, ":libcc_transitive_dep.so") { + t.Errorf("cc_fuzz does not contain the expected bundled transitive shared libs from rust_ffi_shared ('libcc_transitive_dep'): %#v", libs) + } + if libs := fuzzSharedLibraries(fuzz_static_libtest); !strings.Contains(libs, ":libcc_transitive_dep.so") { + t.Errorf("cc_fuzz does not contain the expected bundled transitive shared libs from rust_ffi_static ('libcc_transitive_dep'): %#v", libs) } - if !strings.Contains(fuzz_staticffi_libtest.FuzzSharedLibraries().String(), ":libcc_transitive_dep.so") { - t.Errorf("cc_fuzz does not contain the expected bundled transitive shared libs from rust_ffi_static ('libcc_transitive_dep'): %#v", fuzz_staticffi_libtest.FuzzSharedLibraries().String()) + if libs := fuzzSharedLibraries(fuzz_staticffi_libtest); !strings.Contains(libs, ":libcc_transitive_dep.so") { + t.Errorf("cc_fuzz does not contain the expected bundled transitive shared libs from rust_ffi_static ('libcc_transitive_dep'): %#v", libs) } } |