From 43271c7bc8636ee717c745a66f7cf803b7fb765d Mon Sep 17 00:00:00 2001 From: Yi-Yo Chiang Date: Mon, 23 May 2022 16:42:03 +0800 Subject: [PATCH] create_reference_dumps.py: Always rebuild lsdump_paths.txt If the contents of lsdump_paths.txt was corrupted, create_reference_dumps.py might not rebuild lsdump_paths.txt due to incremental build mechanism. Manually unlink and rebuild lsdump_paths.txt in create_reference_dumps.py so that it always get the up-to-date lsdump_paths.txt. Bug: 233562033 Test: $ development/vndk/tools/header-checker/utils/create_reference_dumps.py -l libbinder -product aosp_arm64 $ echo "" > $ANDROID_PRODUCT_OUT/lsdump_paths.txt $ development/vndk/tools/header-checker/utils/create_reference_dumps.py -l libbinder -product aosp_arm64 Change-Id: Iedccba6ffb659b3348c4f3fb57b82e38de8e53c3 --- vndk/tools/header-checker/utils/utils.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vndk/tools/header-checker/utils/utils.py b/vndk/tools/header-checker/utils/utils.py index 5f956bf96..521355622 100644 --- a/vndk/tools/header-checker/utils/utils.py +++ b/vndk/tools/header-checker/utils/utils.py @@ -251,9 +251,11 @@ def _read_lsdump_paths(lsdump_paths_file_path, vndk_version, targets): def read_lsdump_paths(product, variant, vndk_version, targets, build=True): """Build lsdump_paths.txt and read the paths.""" lsdump_paths_file_path = get_lsdump_paths_file_path(product, variant) - if build: - make_targets(product, variant, [lsdump_paths_file_path]) lsdump_paths_file_abspath = os.path.join(AOSP_DIR, lsdump_paths_file_path) + if build: + if os.path.lexists(lsdump_paths_file_abspath): + os.unlink(lsdump_paths_file_abspath) + make_targets(product, variant, [lsdump_paths_file_path]) return _read_lsdump_paths(lsdump_paths_file_abspath, vndk_version, targets)