From b983c8971bc02c15897c198bca15284579a378ae Mon Sep 17 00:00:00 2001 From: Matthew Maurer Date: Mon, 1 Aug 2022 21:59:00 +0000 Subject: [PATCH] Revert "rust: Only allow bindgen to produce `rlib`s." This reverts commit 53a452d1ff172fba9060f2997fec006a70e44c8d. Reason for revert: Broken build Change-Id: I4c1c6f2166c3729ef1916ad7c21e32599c5e692f --- rust/bindgen.go | 10 +--------- rust/protobuf.go | 2 +- rust/source_provider.go | 5 +---- 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/rust/bindgen.go b/rust/bindgen.go index 0199d3a37..72cc894cc 100644 --- a/rust/bindgen.go +++ b/rust/bindgen.go @@ -299,15 +299,7 @@ func NewRustBindgen(hod android.HostOrDeviceSupported) (*Module, *bindgenDecorat ClangProperties: cc.RustBindgenClangProperties{}, } - module := NewSourceProviderModule(hod, bindgen, false, true) - - android.AddLoadHook(module, func(ctx android.LoadHookContext) { - type stub_props struct { - Visibility []string - } - props := &stub_props{[]string{":__subpackages__"}} - ctx.PrependProperties(props) - }) + module := NewSourceProviderModule(hod, bindgen, false) return module, bindgen } diff --git a/rust/protobuf.go b/rust/protobuf.go index 88e80fe35..9fe27c4c9 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, false) + module := NewSourceProviderModule(hod, protobuf, false) return module, protobuf } diff --git a/rust/source_provider.go b/rust/source_provider.go index 4f8d22b1f..7719611d5 100644 --- a/rust/source_provider.go +++ b/rust/source_provider.go @@ -65,12 +65,9 @@ func NewSourceProvider() *BaseSourceProvider { } } -func NewSourceProviderModule(hod android.HostOrDeviceSupported, sourceProvider SourceProvider, enableLints bool, rlibOnly bool) *Module { +func NewSourceProviderModule(hod android.HostOrDeviceSupported, sourceProvider SourceProvider, enableLints bool) *Module { _, library := NewRustLibrary(hod) library.BuildOnlyRust() - if rlibOnly { - library.BuildOnlyRlib() - } library.sourceProvider = sourceProvider module := newModule(hod, android.MultilibBoth)