From 776e4da5c48c658629564e47533497dd1b4f4741 Mon Sep 17 00:00:00 2001 From: Justin Yun Date: Mon, 30 Sep 2024 20:36:34 +0900 Subject: [PATCH] Update error message for easier error resolution Update the error message of file_list_diff tool for users to resolve the errors easily. Also, add comments to classify the modules in the allowlist. Bug: 368185982 Test: m Change-Id: Id9925f700c48894f073157b6187d5aa4bde78398 --- tools/filelistdiff/allowlist | 4 +++- tools/filelistdiff/file_list_diff.py | 21 +++++++++++---------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/tools/filelistdiff/allowlist b/tools/filelistdiff/allowlist index e7b1d01a99..e215b22a5e 100644 --- a/tools/filelistdiff/allowlist +++ b/tools/filelistdiff/allowlist @@ -1,12 +1,14 @@ # Known diffs only in the KATI system image -etc/NOTICE.xml.gz 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 +# Known diffs that are installed in either system image with the configuration # b/353429422 init.environ.rc +# b/338342381 +etc/NOTICE.xml.gz # Known diffs only in the Soong system image lib/libhidcommand_jni.so diff --git a/tools/filelistdiff/file_list_diff.py b/tools/filelistdiff/file_list_diff.py index cdc5b2ee41..30ed107623 100644 --- a/tools/filelistdiff/file_list_diff.py +++ b/tools/filelistdiff/file_list_diff.py @@ -34,23 +34,24 @@ def find_unique_items(kati_installed_files, soong_installed_files, allowlist, sy unique_in_soong = set(filter(is_unknown_diff, soong_files - kati_files)) if unique_in_kati: - print(f'{COLOR_ERROR}Please add following modules into system image module {system_module_name}.{COLOR_NORMAL}') - print(f'{COLOR_WARNING}KATI only module(s):{COLOR_NORMAL}') + print('') + print(f'{COLOR_ERROR}Missing required modules in {system_module_name} module.{COLOR_NORMAL}') + print(f'To resolve this issue, please add the modules to the Android.bp file for the {system_module_name} to install the following KATI only installed files.') + print(f'You can find the correct Android.bp file using the command "gomod {system_module_name}".') + print(f'{COLOR_WARNING}KATI only installed file(s):{COLOR_NORMAL}') for item in sorted(unique_in_kati): - print(item) + print(' '+item) if unique_in_soong: - if unique_in_kati: - print('') - - print(f'{COLOR_ERROR}Please add following modules into build/make/target/product/base_system.mk.{COLOR_NORMAL}') - print(f'{COLOR_WARNING}Soong only module(s):{COLOR_NORMAL}') + print('') + print(f'{COLOR_ERROR}Missing packages in base_system.mk.{COLOR_NORMAL}') + print('Please add packages into build/make/target/product/base_system.mk or build/make/tools/filelistdiff/allowlist to install or skip the following Soong only installed files.') + print(f'{COLOR_WARNING}Soong only installed file(s):{COLOR_NORMAL}') for item in sorted(unique_in_soong): - print(item) + print(' '+item) if unique_in_kati or unique_in_soong: print('') - print(f'{COLOR_ERROR}FAILED: System image from KATI and SOONG differs from installed file list.{COLOR_NORMAL}') sys.exit(1) -- GitLab