From b23d574655a790c903456b41ac6f6ef63c4c37d7 Mon Sep 17 00:00:00 2001 From: Cole Faust Date: Fri, 18 Aug 2023 16:05:44 -0700 Subject: [PATCH] Add apex compat symlinks to LOCAL_SOONG_INSTALL_SYMLINKS We want to make FULL_SYSTEMIMAGE_DEPS more accurate so that we can remove the need for `m installclean`. Currently, the compat symlinks are installed by adding them as dependencies of other installed files. Doing this doesn't end up propagaing the compat symlinks all the way to FULL_SYSTEMIMAGE_DEPS. Add them to LOCAL_SOONG_INSTALL_SYMLINKS, which will cause them to be propagated to FULL_SYSTEMIMAGE_DEPS. Bug: 205632228 Test: Full build with a change to delete files not in FULL_SYSTEMIMAGE_DEPS from the staging dir Change-Id: I0600ccf8d863d5e29e044c82293ece730fc98d43 --- apex/androidmk.go | 1 + apex/prebuilt.go | 1 + 2 files changed, 2 insertions(+) diff --git a/apex/androidmk.go b/apex/androidmk.go index f4690620c..b0c391846 100644 --- a/apex/androidmk.go +++ b/apex/androidmk.go @@ -287,6 +287,7 @@ func (a *apexBundle) androidMkForType() android.AndroidMkData { if a.installable() { fmt.Fprintln(w, "LOCAL_SOONG_INSTALLED_MODULE :=", a.installedFile.String()) fmt.Fprintln(w, "LOCAL_SOONG_INSTALL_PAIRS :=", a.outputFile.String()+":"+a.installedFile.String()) + fmt.Fprintln(w, "LOCAL_SOONG_INSTALL_SYMLINKS := ", strings.Join(a.compatSymlinks.Strings(), " ")) } // Because apex writes .mk with Custom(), we need to write manually some common properties diff --git a/apex/prebuilt.go b/apex/prebuilt.go index 3509e6cbe..f2e87c829 100644 --- a/apex/prebuilt.go +++ b/apex/prebuilt.go @@ -235,6 +235,7 @@ func (p *prebuiltCommon) AndroidMkEntries() []android.AndroidMkEntries { entries.SetString("LOCAL_MODULE_STEM", p.installFilename) entries.SetPath("LOCAL_SOONG_INSTALLED_MODULE", p.installedFile) entries.SetString("LOCAL_SOONG_INSTALL_PAIRS", p.outputApex.String()+":"+p.installedFile.String()) + entries.AddStrings("LOCAL_SOONG_INSTALL_SYMLINKS", p.compatSymlinks.Strings()...) entries.SetBoolIfTrue("LOCAL_UNINSTALLABLE_MODULE", !p.installable()) entries.AddStrings("LOCAL_OVERRIDES_MODULES", p.prebuiltCommonProperties.Overrides...) p.addRequiredModules(entries)