From 53a452d1ff172fba9060f2997fec006a70e44c8d Mon Sep 17 00:00:00 2001 From: Matthew Maurer Date: Tue, 26 Jul 2022 14:26:33 -0700 Subject: rust: Only allow bindgen to produce `rlib`s. Generated bindings are intended to be slim translation layers, usually consisting of nothing more than type signatures and constants. Generally, they should also be used in exactly one location by the safe wrapper for these bindings. By preventing them from building as `dylib`s, we avoid the per-library overhead of these non-reused pieces of code. Additionally, default visibility restrict all bindgen modules to their subpackages. This is being done both: * to encourage use of a single safe bindings crate * to avoid diamond dependency graphs with mixed rlib/dylib dependencies Bug: 166332519 Test: m; Make sample module use dylib bindgen dependency, see build failure. Change-Id: I8e9d9cb851c2ec99f4ed63e6e18c4ba26b29721c --- rust/protobuf.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'rust/protobuf.go') diff --git a/rust/protobuf.go b/rust/protobuf.go index 9fe27c4c9..88e80fe35 100644 --- a/rust/protobuf.go +++ b/rust/protobuf.go @@ -238,7 +238,7 @@ func NewRustProtobuf(hod android.HostOrDeviceSupported) (*Module, *protobufDecor Properties: ProtobufProperties{}, } - module := NewSourceProviderModule(hod, protobuf, false) + module := NewSourceProviderModule(hod, protobuf, false, false) return module, protobuf } -- cgit v1.2.3-59-g8ed1b