From 61c02cc5371395fc919b49b14ce253a151f2fa93 Mon Sep 17 00:00:00 2001 From: Ivan Lozano Date: Fri, 9 Jun 2023 14:06:44 -0400 Subject: rust: Bundle Rust shared dependencies in fuzzers Rust shared library dependencies are not always bundled in cc_fuzz or rust_fuzz modules, which can lead to difficult to debug runtime errors when running these fuzzers. It can also be hard to determine which dependencies need to be explicitly declared. This CL makes sure that we bundle the appropriate transitive dependencies for our fuzzers. Bug: 249551848 Test: Soong tests Test: m # check data/fuzz//lib dir contents Change-Id: I957ca8898079b61e2ff20d750f8c92bf61ac394f --- rust/rust.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'rust/rust.go') diff --git a/rust/rust.go b/rust/rust.go index 4324ecbb9..e524c9fb6 100644 --- a/rust/rust.go +++ b/rust/rust.go @@ -631,6 +631,15 @@ func (mod *Module) CcLibraryInterface() bool { return false } +func (mod *Module) RustLibraryInterface() bool { + if mod.compiler != nil { + if _, ok := mod.compiler.(libraryInterface); ok { + return true + } + } + return false +} + func (mod *Module) IsFuzzModule() bool { if _, ok := mod.compiler.(*fuzzDecorator); ok { return true -- cgit v1.2.3-59-g8ed1b