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
This commit is contained in:
Yi-Yo Chiang
2022-05-23 16:42:03 +08:00
parent 4f9305a51c
commit 43271c7bc8

View File

@@ -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)