From 809d51866a403f814aaefb16101b0edd46b7f122 Mon Sep 17 00:00:00 2001 From: Martin Stjernholm Date: Thu, 10 Sep 2020 01:46:05 +0100 Subject: [PATCH] Heed SkipInstall flag when adding install rules for vendor-snapshot. The prebuilt-vs-source selection operates by setting SkipInstall on either module. When the vendor-snapshot module visits all modules it will visit both, and if it is a static library it will then add duplicate install rules for both source and prebuilt unless it looks at SkipInstall. Test: `m nothing` in a tree with prebuilts/runtime present, that has been updated with a snapshot after https://r.android.com/1398472, which started to propagate vendor_available flags to prebuilts snapshots. Bug: 151303681 Change-Id: Ie425f0115e4180b7f4a8e682696697d55d666845 --- cc/vendor_snapshot.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cc/vendor_snapshot.go b/cc/vendor_snapshot.go index 0219b847d..2819f4958 100644 --- a/cc/vendor_snapshot.go +++ b/cc/vendor_snapshot.go @@ -541,6 +541,11 @@ func isVendorSnapshotModule(m *Module, inVendorProprietaryPath bool) bool { if !m.Enabled() || m.Properties.HideFromMake { return false } + // When android/prebuilt.go selects between source and prebuilt, it sets + // SkipInstall on the other one to avoid duplicate install rules in make. + if m.IsSkipInstall() { + return false + } // skip proprietary modules, but include all VNDK (static) if inVendorProprietaryPath && !m.IsVndk() { return false