Select apex variants from lsdump paths
Bug: 188870336 Test: ./create_reference_dumps.py Change-Id: I15a1f6a7c5c4952d2deb403aa9e9d58a0733561b
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
import gzip
|
import gzip
|
||||||
import os
|
import os
|
||||||
|
import re
|
||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
@@ -177,9 +178,12 @@ def get_lsdump_paths_file_path(product, variant):
|
|||||||
return os.path.join(product_out, 'lsdump_paths.txt')
|
return os.path.join(product_out, 'lsdump_paths.txt')
|
||||||
|
|
||||||
|
|
||||||
def _is_sanitizer_variation(variation):
|
def _get_module_variant_sort_key(suffix):
|
||||||
"""Check whether the variation is introduced by a sanitizer."""
|
for variant in suffix.split('_'):
|
||||||
return variation in {'asan', 'hwasan', 'tsan', 'intOverflow', 'cfi', 'scs'}
|
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):
|
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):
|
if not variant.startswith(prefix):
|
||||||
continue
|
continue
|
||||||
new_suffix = variant[len(prefix):]
|
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)
|
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
|
lsdump_paths[libname][arch_cpu][tag] = path
|
||||||
suffixes[libname][arch_cpu] = new_suffix
|
suffixes[libname][arch_cpu] = new_suffix
|
||||||
return lsdump_paths
|
return lsdump_paths
|
||||||
|
|||||||
Reference in New Issue
Block a user