summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHsin-Yi Chen <hsinyichen@google.com>2021-05-26 07:26:54 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2021-05-26 07:26:54 +0000
commit31af14a65f8afbd0b0af9634e06727013a1607e8 (patch)
treef5f8d1298391048b94af049f7484de7c332e9cac
parent5b06c09ada8b58da8d9a64a92d971296a496d559 (diff)
parent8fb8023bfccdaf5ab3ef3ce1526472b108262cbd (diff)
downloaddevelopment-31af14a65f8afbd0b0af9634e06727013a1607e8.tar.gz
Select apex variants from lsdump paths am: 8fb8023bfc
Original change: https://googleplex-android-review.googlesource.com/c/platform/development/+/14701627 Change-Id: Icd934548da9ed65318c6a71f32779842ca369cda
-rw-r--r--vndk/tools/header-checker/utils/utils.py19
1 files changed, 10 insertions, 9 deletions
diff --git a/vndk/tools/header-checker/utils/utils.py b/vndk/tools/header-checker/utils/utils.py
index 9256e1800..e0fd5cf42 100644
--- a/vndk/tools/header-checker/utils/utils.py
+++ b/vndk/tools/header-checker/utils/utils.py
@@ -2,6 +2,7 @@
import gzip
import os
+import re
import shutil
import subprocess
import sys
@@ -177,9 +178,12 @@ def get_lsdump_paths_file_path(product, variant):
return os.path.join(product_out, 'lsdump_paths.txt')
-def _is_sanitizer_variation(variation):
- """Check whether the variation is introduced by a sanitizer."""
- return variation in {'asan', 'hwasan', 'tsan', 'intOverflow', 'cfi', 'scs'}
+def _get_module_variant_sort_key(suffix):
+ for variant in suffix.split('_'):
+ match = re.match(r'apex(\d+)$', variant)
+ if match:
+ return (int(match.group(1)), suffix)
+ return (-1, suffix)
def _get_module_variant_dir_name(tag, vndk_version, arch_cpu_str):
@@ -232,13 +236,10 @@ def _read_lsdump_paths(lsdump_paths_file_path, vndk_version, targets):
if not variant.startswith(prefix):
continue
new_suffix = variant[len(prefix):]
- # Skip if the suffix contains APEX variations.
- new_variations = [x for x in new_suffix.split('_') if x]
- if new_variations and not all(_is_sanitizer_variation(x)
- for x in new_variations):
- continue
old_suffix = suffixes[libname].get(arch_cpu)
- if not old_suffix or new_suffix > old_suffix:
+ if (not old_suffix or
+ _get_module_variant_sort_key(new_suffix) >
+ _get_module_variant_sort_key(old_suffix)):
lsdump_paths[libname][arch_cpu][tag] = path
suffixes[libname][arch_cpu] = new_suffix
return lsdump_paths