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
diff --git a/tools/filelistdiff/Android.bp b/tools/filelistdiff/Android.bp
index ab766d6..3826e50 100644
--- a/tools/filelistdiff/Android.bp
+++ b/tools/filelistdiff/Android.bp
@@ -24,4 +24,9 @@
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 0000000..d7078f5
--- /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 30ed107..951325f 100644
--- a/tools/filelistdiff/file_list_diff.py
+++ b/tools/filelistdiff/file_list_diff.py
@@ -19,13 +19,16 @@
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 @@
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