diff options
author | Hsin-Yi Chen <hsinyichen@google.com> | 2024-02-19 09:20:51 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2024-02-19 09:20:51 +0000 |
commit | 035ccb9f9a0f137763095f72e946ff1afb8920bc (patch) | |
tree | 05696f6c8de592c2826c4587bf0d68f7c5faa951 | |
parent | 2c9a6e2d2f1b0ddb25eb71b686bf233404050899 (diff) | |
parent | 2c1476666e305e72c4b460cf2c66fb95aa7b28d7 (diff) | |
download | development-035ccb9f9a0f137763095f72e946ff1afb8920bc.tar.gz |
Merge "Remove VNDK version string from intermediate dump paths" into main
-rwxr-xr-x | vndk/tools/header-checker/utils/create_reference_dumps.py | 18 | ||||
-rw-r--r-- | vndk/tools/header-checker/utils/utils.py | 24 |
2 files changed, 19 insertions, 23 deletions
diff --git a/vndk/tools/header-checker/utils/create_reference_dumps.py b/vndk/tools/header-checker/utils/create_reference_dumps.py index 901970e97..a9b510331 100755 --- a/vndk/tools/header-checker/utils/create_reference_dumps.py +++ b/vndk/tools/header-checker/utils/create_reference_dumps.py @@ -44,11 +44,10 @@ class GetVersionedRefDumpDirStem: self.binder_bitness, arch_str) -def make_libs_for_product(libs, build_target, vndk_version, arches, - exclude_tags): +def make_libs_for_product(libs, build_target, arches, exclude_tags): print('making libs for', '-'.join(filter(None, build_target))) if libs: - make_libraries(build_target, vndk_version, arches, libs, exclude_tags) + make_libraries(build_target, arches, libs, exclude_tags) else: make_tree(build_target) @@ -98,10 +97,10 @@ def create_source_abi_reference_dumps_for_all_products(args): for product in args.products: build_target = BuildTarget(product, args.release, args.build_variant) ( - platform_vndk_version, release_board_api_level, binder_32_bit, + release_board_api_level, binder_32_bit, platform_version_codename, platform_sdk_version, ) = get_build_vars( - ['PLATFORM_VNDK_VERSION', 'RELEASE_BOARD_API_LEVEL', 'BINDER32BIT', + ['RELEASE_BOARD_API_LEVEL', 'BINDER32BIT', 'PLATFORM_VERSION_CODENAME', 'PLATFORM_SDK_VERSION'], build_target ) @@ -133,12 +132,10 @@ def create_source_abi_reference_dumps_for_all_products(args): if not args.no_make_lib: # Build .lsdump for all the specified libs, or build # `findlsdumps` if no libs are specified. - make_libs_for_product(args.libs, build_target, - platform_vndk_version, arches, + make_libs_for_product(args.libs, build_target, arches, exclude_tags) - lsdump_paths = read_lsdump_paths(build_target, - platform_vndk_version, arches, + lsdump_paths = read_lsdump_paths(build_target, arches, exclude_tags, build=False) num_processed += create_source_abi_reference_dumps( @@ -208,6 +205,9 @@ def main(): # Clear SKIP_ABI_CHECKS as it forbids ABI dumps from being built. os.environ.pop('SKIP_ABI_CHECKS', None) + if os.environ.get('KEEP_VNDK') == 'true': + raise RuntimeError('KEEP_VNDK is not supported. Please undefine it.') + start = time.time() num_processed = create_source_abi_reference_dumps_for_all_products(args) end = time.time() diff --git a/vndk/tools/header-checker/utils/utils.py b/vndk/tools/header-checker/utils/utils.py index 1c6108e80..03e82554c 100644 --- a/vndk/tools/header-checker/utils/utils.py +++ b/vndk/tools/header-checker/utils/utils.py @@ -170,10 +170,10 @@ def make_tree(build_target): return make_targets(build_target, ['findlsdumps']) -def make_libraries(build_target, vndk_version, arches, libs, exclude_tags): +def make_libraries(build_target, arches, libs, exclude_tags): """Build lsdump files for specific libs.""" - lsdump_paths = read_lsdump_paths(build_target, vndk_version, arches, - exclude_tags, build=True) + lsdump_paths = read_lsdump_paths(build_target, arches, exclude_tags, + build=True) make_target_paths = [] for name in libs: if not (name in lsdump_paths and lsdump_paths[name]): @@ -197,7 +197,7 @@ def _get_module_variant_sort_key(suffix): return (-1, suffix) -def _get_module_variant_dir_name(tag, vndk_version, arch_cpu_str): +def _get_module_variant_dir_name(tag, arch_cpu_str): """Return the module variant directory name. For example, android_x86_shared, android_vendor.R_arm_armv7-a-neon_shared. @@ -205,14 +205,13 @@ def _get_module_variant_dir_name(tag, vndk_version, arch_cpu_str): if tag in ('LLNDK', 'NDK', 'PLATFORM'): return f'android_{arch_cpu_str}_shared' if tag == 'VENDOR': - return f'android_vendor.{vndk_version}_{arch_cpu_str}_shared' + return f'android_vendor_{arch_cpu_str}_shared' if tag == 'PRODUCT': - return f'android_product.{vndk_version}_{arch_cpu_str}_shared' + return f'android_product_{arch_cpu_str}_shared' raise ValueError(tag + ' is not a known tag.') -def _read_lsdump_paths(lsdump_paths_file_path, vndk_version, arches, - exclude_tags): +def _read_lsdump_paths(lsdump_paths_file_path, arches, exclude_tags): """Read lsdump paths from lsdump_paths.txt for each libname and variant. This function returns a dictionary, {lib_name: {arch_cpu: {tag: path}}}. @@ -252,8 +251,7 @@ def _read_lsdump_paths(lsdump_paths_file_path, vndk_version, arches, dirnames.append(dirname) for arch in arches: arch_cpu = arch.get_arch_cpu_str() - prefix = _get_module_variant_dir_name(tag, vndk_version, - arch_cpu) + prefix = _get_module_variant_dir_name(tag, arch_cpu) variant = next((d for d in dirnames if d.startswith(prefix)), None) if not variant: @@ -268,8 +266,7 @@ def _read_lsdump_paths(lsdump_paths_file_path, vndk_version, arches, return lsdump_paths -def read_lsdump_paths(build_target, vndk_version, arches, exclude_tags, - build): +def read_lsdump_paths(build_target, arches, exclude_tags, build): """Build lsdump_paths.txt and read the paths.""" lsdump_paths_file_path = get_lsdump_paths_file_path(build_target) lsdump_paths_file_abspath = os.path.join(AOSP_DIR, lsdump_paths_file_path) @@ -277,8 +274,7 @@ def read_lsdump_paths(build_target, vndk_version, arches, exclude_tags, if os.path.lexists(lsdump_paths_file_abspath): os.unlink(lsdump_paths_file_abspath) make_targets(build_target, [lsdump_paths_file_path]) - return _read_lsdump_paths(lsdump_paths_file_abspath, vndk_version, - arches, exclude_tags) + return _read_lsdump_paths(lsdump_paths_file_abspath, arches, exclude_tags) def find_lib_lsdumps(lsdump_paths, libs, arch): |