From 4c3b83fe70dbb05f6aefb7a944e74c46368aca62 Mon Sep 17 00:00:00 2001 From: Sam Delmerico Date: Tue, 21 Feb 2023 13:54:27 -0500 Subject: [PATCH] add PRODUCT_SOURCE_ROOT_DIRS product variable Change-Id: I31590eb133511a5dbdb8d6fe436cf511d1a160a2 --- core/main.mk | 3 +++ core/product.mk | 3 +++ core/soong_config.mk | 1 + core/tasks/tools/package-modules.mk | 4 ++-- 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/core/main.mk b/core/main.mk index 3866037b4f..18f9611fd8 100644 --- a/core/main.mk +++ b/core/main.mk @@ -764,6 +764,9 @@ ifneq (,$(_nonexistent_required)) $(info $(word 1,$(r)) module $(word 2,$(r)) requires non-existent $(word 3,$(r)) module: $(word 4,$(r))) \ ) $(warning Set BUILD_BROKEN_MISSING_REQUIRED_MODULES := true to bypass this check if this is intentional) + ifneq (,$(PRODUCT_SOURCE_ROOT_DIRS)) + $(warning PRODUCT_SOURCE_ROOT_DIRS is non-empty. Some necessary modules may have been skipped by Soong) + endif $(error Build failed) endif # _nonexistent_required != empty endif # check_missing_required_modules == true diff --git a/core/product.mk b/core/product.mk index f4d5a4fe8c..4c254bffb2 100644 --- a/core/product.mk +++ b/core/product.mk @@ -269,6 +269,9 @@ _product_single_value_vars += PRODUCT_RETROFIT_DYNAMIC_PARTITIONS # List of tags that will be used to gate blueprint modules from the build graph _product_list_vars += PRODUCT_INCLUDE_TAGS +# List of directories that will be used to gate blueprint modules from the build graph +_product_list_vars += PRODUCT_SOURCE_ROOT_DIRS + # When this is true, various build time as well as runtime debugfs restrictions are enabled. _product_single_value_vars += PRODUCT_SET_DEBUGFS_RESTRICTIONS diff --git a/core/soong_config.mk b/core/soong_config.mk index 0101796d8a..0c6ab702e1 100644 --- a/core/soong_config.mk +++ b/core/soong_config.mk @@ -306,6 +306,7 @@ $(call add_json_bool, GenerateAidlNdkPlatformBackend, $(filter true,$(NEED_AIDL_ $(call add_json_bool, IgnorePrefer32OnDevice, $(filter true,$(IGNORE_PREFER32_ON_DEVICE))) $(call add_json_list, IncludeTags, $(PRODUCT_INCLUDE_TAGS)) +$(call add_json_list, SourceRootDirs, $(PRODUCT_SOURCE_ROOT_DIRS)) $(call json_end) diff --git a/core/tasks/tools/package-modules.mk b/core/tasks/tools/package-modules.mk index c41aec5fc4..b15df28cf8 100644 --- a/core/tasks/tools/package-modules.mk +++ b/core/tasks/tools/package-modules.mk @@ -50,12 +50,12 @@ ifneq ($(filter-out true false,$(my_modules_strict)),) $(error done) endif -my_missing_files = $(shell $(call echo-warning,$(my_makefile),$(my_package_name): Unknown installed file for module '$(1)')) +my_missing_files = $(shell $(call echo-warning,$(my_makefile),$(my_package_name): Unknown installed file for module '$(1)'))$(shell$(call echo-warning,$(my_makefile),$(my_package_name): Some necessary modules may have been skipped by Soong. Check if PRODUCT_SOURCE_ROOT_DIRS is pruning necessary Android.bp files.)) ifeq ($(ALLOW_MISSING_DEPENDENCIES),true) # Ignore unknown installed files on partial builds my_missing_files = else ifneq ($(my_modules_strict),false) - my_missing_files = $(shell $(call echo-error,$(my_makefile),$(my_package_name): Unknown installed file for module '$(1)'))$(eval my_missing_error := true) + my_missing_files = $(shell $(call echo-error,$(my_makefile),$(my_package_name): Unknown installed file for module '$(1)'))$(shell$(call echo-warning,$(my_makefile),$(my_package_name): Some necessary modules may have been skipped by Soong. Check if PRODUCT_SOURCE_ROOT_DIRS is pruning necessary Android.bp files.))$(eval my_missing_error := true) endif # Iterate over modules' built files and installed files;