Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9424b069 authored by Dan Willemsen's avatar Dan Willemsen Committed by Bruno Martins
Browse files

Export list of "installable" files to soong_ui

These are a (partial) list of files that we'd install with a default
build. The idea is that if something is removed from this list, soong_ui
can remove it from the installed location before running ninja.

It's okay if there are things missing from this list, it's not intended
to be a 100% solution replacing installclean / CleanSpec.mk, just
something that handles 80% of the cases without user involvement.

In particular, if something is removed from PRODUCT_PACKAGES, we'll
remove it from disk, but not necessarily rebuild the image files. That's
the same as most use cases of CleanSpec.mk today, and often some other
change will trigger the necessary images to be rebuilt.

We should be able to fix that by changing all of the image creation
rules to depend on the (partial) list of files they care about, or by
fixing ninja to rebuild things when their list of dependencies change.
(Other tools run into this same problem)

The list of test files is also included so that we can remove obsolete
tests from their "installed" locations within test suites and the
testcases folders.

Test: remove a module from PRODUCT_PACKAGES, see the print and file removed
Test: change the name of a cts test, see the old one removed from cts
Change-Id: I67f270a6713369099ca523aaf991ee3beb815c0a
parent 64401b38
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -108,6 +108,9 @@ ALL_VINTF_MANIFEST_FRAGMENTS_LIST:=
# All tests that should be skipped in presubmit check.
ALL_DISABLED_PRESUBMIT_TESTS :=

# All compatibility suites mentioned in LOCAL_COMPATIBILITY_SUITES
ALL_COMPATIBILITY_SUITES :=

# All LINK_TYPE entries
ALL_LINK_TYPES :=

@@ -3010,6 +3013,7 @@ endef
#    and use my_compat_dist_$(suite) to define the others.
define create-suite-dependencies
$(foreach suite, $(LOCAL_COMPATIBILITY_SUITE), \
  $(if $(filter $(suite),$(ALL_COMPATIBILITY_SUITES)),,$(eval ALL_COMPATIBILITY_SUITES += $(suite))) \
  $(eval COMPATIBILITY.$(suite).FILES := \
    $$(COMPATIBILITY.$(suite).FILES) $$(foreach f,$$(my_compat_dist_$(suite)),$$(call word-colon,2,$$(f))) \
      $$(foreach f,$$(my_compat_dist_config_$(suite)),$$(call word-colon,2,$$(f)))) \
+22 −0
Original line number Diff line number Diff line
@@ -1419,6 +1419,28 @@ modules_to_install := $(sort \
    $(CUSTOM_MODULES) \
  )

#
# Used by the cleanup logic in soong_ui to remove files that should no longer
# be installed.
#

# Include all tests, so that we remove them from the test suites / testcase
# folders when they are removed.
test_files := $(foreach ts,$(ALL_COMPATIBILITY_SUITES),$(COMPATIBILITY.$(ts).FILES))

$(shell mkdir -p $(PRODUCT_OUT) $(HOST_OUT))

$(file >$(PRODUCT_OUT)/.installable_files$(if $(filter address,$(SANITIZE_TARGET)),_asan), \
  $(sort $(patsubst $(PRODUCT_OUT)/%,%,$(filter $(PRODUCT_OUT)/%, \
    $(modules_to_install) $(test_files)))))

$(file >$(HOST_OUT)/.installable_test_files,$(sort \
  $(patsubst $(HOST_OUT)/%,%,$(filter $(HOST_OUT)/%, \
    $(test_files)))))

test_files :=


# Don't include any GNU General Public License shared objects or static
# libraries in SDK images.  GPL executables (not static/dynamic libraries)
# are okay if they don't link against any closed source libraries (directly