diff options
author | 2024-10-06 12:17:11 +0900 | |
---|---|---|
committer | 2024-10-07 11:40:46 +0900 | |
commit | f460a638f1beb32201bcdd5298984edef2f4a577 (patch) | |
tree | 32592f008b46d8df1821a99faa57db92c4b142a3 | |
parent | d356d483a1dfd253e92fa7b8a67a5de705ebbe5b (diff) |
Define file_diff allowlist for the next builds.
The current allowlist is based on trunk build configuration. the next
configuration may have more diffs. Define more allowlist for the next
build.
The allowlist can be empty when trunk goes to next.
Bug: 346873717
Test: lunch aosp_cf_x86_64_phone-next-userdebug && m
Change-Id: I47642c6b6f564b041914bccf192a9d9295eb3da0
-rw-r--r-- | core/Makefile | 12 | ||||
-rw-r--r-- | tools/filelistdiff/Android.bp | 7 | ||||
-rw-r--r-- | tools/filelistdiff/allowlist_next | 15 | ||||
-rw-r--r-- | tools/filelistdiff/file_list_diff.py | 15 |
4 files changed, 41 insertions, 8 deletions
diff --git a/core/Makefile b/core/Makefile index 96d03576ac..90668a1dee 100644 --- a/core/Makefile +++ b/core/Makefile @@ -3567,14 +3567,24 @@ ifneq ($(PRODUCT_SOONG_DEFINED_SYSTEM_IMAGE),) file_list_diff := $(HOST_OUT_EXECUTABLES)/file_list_diff$(HOST_EXECUTABLE_SUFFIX) system_file_diff_timestamp := $(systemimage_intermediates)/file_diff.timestamp +# The build configuration to build the REL version may have more files to allow. +# Use allowlist_next in addition to the allowlist in this case. +system_file_diff_allowlist_next := +ifeq (REL,$(PLATFORM_VERSION_CODENAME)) +system_file_diff_allowlist_next := $(ALL_MODULES.system_image_diff_allowlist_next.INSTALLED) +$(system_file_diff_timestamp): PRIVATE_ALLOWLIST_NEXT := $(system_file_diff_allowlist_next) +endif $(system_file_diff_timestamp): \ $(systemimage_intermediates)/file_list.txt \ $(ALL_MODULES.$(PRODUCT_SOONG_DEFINED_SYSTEM_IMAGE).FILESYSTEM_FILELIST) \ $(ALL_MODULES.system_image_diff_allowlist.INSTALLED) \ + $(system_file_diff_allowlist_next) \ $(file_list_diff) $(file_list_diff) $(systemimage_intermediates)/file_list.txt \ $(ALL_MODULES.$(PRODUCT_SOONG_DEFINED_SYSTEM_IMAGE).FILESYSTEM_FILELIST) \ - $(ALL_MODULES.system_image_diff_allowlist.INSTALLED) $(PRODUCT_SOONG_DEFINED_SYSTEM_IMAGE) + $(PRODUCT_SOONG_DEFINED_SYSTEM_IMAGE) \ + --allowlists $(ALL_MODULES.system_image_diff_allowlist.INSTALLED) \ + $(PRIVATE_ALLOWLIST_NEXT) touch $@ $(BUILT_SYSTEMIMAGE): $(system_file_diff_timestamp) diff --git a/tools/filelistdiff/Android.bp b/tools/filelistdiff/Android.bp index ab766d6d93..3826e50ff3 100644 --- a/tools/filelistdiff/Android.bp +++ b/tools/filelistdiff/Android.bp @@ -24,4 +24,9 @@ python_binary_host { prebuilt_etc_host { name: "system_image_diff_allowlist", src: "allowlist", -}
\ No newline at end of file +} + +prebuilt_etc_host { + name: "system_image_diff_allowlist_next", + src: "allowlist_next", +} diff --git a/tools/filelistdiff/allowlist_next b/tools/filelistdiff/allowlist_next new file mode 100644 index 0000000000..d7078f5d11 --- /dev/null +++ b/tools/filelistdiff/allowlist_next @@ -0,0 +1,15 @@ +# Allowlist only for the next release configuration. +# TODO(b/369678122): The list will be cleared when the trunk configurations are +# available to the next. + +# KATI only installed files +framework/oat/x86_64/apex@com.android.compos@javalib@service-compos.jar@classes.odex +framework/oat/x86_64/apex@com.android.compos@javalib@service-compos.jar@classes.odex.fsv_meta +framework/oat/x86_64/apex@com.android.compos@javalib@service-compos.jar@classes.vdex +framework/oat/x86_64/apex@com.android.compos@javalib@service-compos.jar@classes.vdex.fsv_meta + +# Soong only installed files +etc/aconfig/flag.info +etc/aconfig/flag.map +etc/aconfig/flag.val +etc/aconfig/package.map diff --git a/tools/filelistdiff/file_list_diff.py b/tools/filelistdiff/file_list_diff.py index 30ed107623..951325f431 100644 --- a/tools/filelistdiff/file_list_diff.py +++ b/tools/filelistdiff/file_list_diff.py @@ -19,13 +19,16 @@ COLOR_WARNING = '\033[93m' COLOR_ERROR = '\033[91m' COLOR_NORMAL = '\033[0m' -def find_unique_items(kati_installed_files, soong_installed_files, allowlist, system_module_name): +def find_unique_items(kati_installed_files, soong_installed_files, system_module_name, allowlists): with open(kati_installed_files, 'r') as kati_list_file, \ - open(soong_installed_files, 'r') as soong_list_file, \ - open(allowlist, 'r') as allowlist_file: + open(soong_installed_files, 'r') as soong_list_file: kati_files = set(kati_list_file.read().split()) soong_files = set(soong_list_file.read().split()) - allowed_files = set(filter(lambda x: len(x), map(lambda x: x.lstrip().split('#',1)[0].rstrip() , allowlist_file.read().split('\n')))) + + allowed_files = set() + for allowlist in allowlists: + with open(allowlist, 'r') as allowlist_file: + allowed_files.update(set(filter(lambda x: len(x), map(lambda x: x.lstrip().split('#',1)[0].rstrip() , allowlist_file.read().split('\n'))))) def is_unknown_diff(filepath): return not filepath in allowed_files @@ -60,8 +63,8 @@ if __name__ == '__main__': parser.add_argument('kati_installed_file_list') parser.add_argument('soong_installed_file_list') - parser.add_argument('allowlist') parser.add_argument('system_module_name') + parser.add_argument('--allowlists', nargs='+') args = parser.parse_args() - find_unique_items(args.kati_installed_file_list, args.soong_installed_file_list, args.allowlist, args.system_module_name)
\ No newline at end of file + find_unique_items(args.kati_installed_file_list, args.soong_installed_file_list, args.system_module_name, args.allowlists)
\ No newline at end of file |