Tests: Add 'with ASAN' knowledge to Linux release checks.

Builds with sanitizer will get addition asan/ubsan libraries linked in,
these need to be allowed in the static binaries check.

Pull Request: https://projects.blender.org/blender/blender/pulls/133319
This commit is contained in:
Bastien Montagne
2025-01-20 15:27:32 +01:00
committed by Gitea
parent db6cbcef5b
commit d251f8af30
3 changed files with 22 additions and 2 deletions

View File

@@ -1119,10 +1119,18 @@ add_subdirectory(collada)
if(WITH_LINUX_OFFICIAL_RELEASE_TESTS)
get_filename_component(release_root_folder ${TEST_BLENDER_EXE} DIRECTORY)
set(extra_args "")
if(WITH_COMPILER_ASAN)
set(extra_args
${extra_args}
--sanitizer-build
)
endif()
add_python_test(
linux_release_sanity_checks
${CMAKE_SOURCE_DIR}/tools/check_blender_release/check_release.py
-- ${release_root_folder}
-- --directory "${release_root_folder}" ${extra_args}
)
unset(extra_args)
unset(release_root_folder)
endif()

View File

@@ -196,6 +196,12 @@ class UnitTesting(unittest.TestCase):
self.assertTrue(os.path.isdir(args.directory),
"Given path is not a directory: {}" .
format(args.directory))
# Add sanitizer libraries if needed.
if args.is_sanitizer_build:
ALLOWED_LIBS.extend([
"libasan.so",
"libubsan.so",
])
# Add all libraries the we bundle to the allowed list
ALLOWED_LIBS.extend(glob.glob("*.so", root_dir=args.directory + "/lib"))
# Add OIDN libs that do not have an `.so` symbolic-link.

View File

@@ -36,7 +36,13 @@ def parseArguments():
# Construct argument parser.
parser = argparse.ArgumentParser(description="Static binary checker")
parser.add_argument('directory', help='Directories to check')
parser.add_argument('--directory', help='Directories to check')
# ASAN builds link additional libraries, so check_static_binaries.py needs to know about it.
parser.add_argument(
'--sanitizer-build',
dest='is_sanitizer_build',
action='store_true',
help='Whether the checked binaries were built with the sanitizer option (`WITH_COMPILER_ASAN` CMake option)')
# Parse arguments which are not handled by unit testing framework.
unittest_args, parser_args = sliceCommandLineArguments()
args = parser.parse_args(args=parser_args)