Skip to content

Commit d251f8a

Browse files
mont29Gitea
authored andcommitted
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
1 parent db6cbce commit d251f8a

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

tests/python/CMakeLists.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1119,10 +1119,18 @@ add_subdirectory(collada)
11191119

11201120
if(WITH_LINUX_OFFICIAL_RELEASE_TESTS)
11211121
get_filename_component(release_root_folder ${TEST_BLENDER_EXE} DIRECTORY)
1122+
set(extra_args "")
1123+
if(WITH_COMPILER_ASAN)
1124+
set(extra_args
1125+
${extra_args}
1126+
--sanitizer-build
1127+
)
1128+
endif()
11221129
add_python_test(
11231130
linux_release_sanity_checks
11241131
${CMAKE_SOURCE_DIR}/tools/check_blender_release/check_release.py
1125-
-- ${release_root_folder}
1132+
-- --directory "${release_root_folder}" ${extra_args}
11261133
)
1134+
unset(extra_args)
11271135
unset(release_root_folder)
11281136
endif()

tools/check_blender_release/check_static_binaries.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,12 @@ def test_directoryIsStatic(self):
196196
self.assertTrue(os.path.isdir(args.directory),
197197
"Given path is not a directory: {}" .
198198
format(args.directory))
199+
# Add sanitizer libraries if needed.
200+
if args.is_sanitizer_build:
201+
ALLOWED_LIBS.extend([
202+
"libasan.so",
203+
"libubsan.so",
204+
])
199205
# Add all libraries the we bundle to the allowed list
200206
ALLOWED_LIBS.extend(glob.glob("*.so", root_dir=args.directory + "/lib"))
201207
# Add OIDN libs that do not have an `.so` symbolic-link.

tools/check_blender_release/check_utils.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,13 @@ def parseArguments():
3636

3737
# Construct argument parser.
3838
parser = argparse.ArgumentParser(description="Static binary checker")
39-
parser.add_argument('directory', help='Directories to check')
39+
parser.add_argument('--directory', help='Directories to check')
40+
# ASAN builds link additional libraries, so check_static_binaries.py needs to know about it.
41+
parser.add_argument(
42+
'--sanitizer-build',
43+
dest='is_sanitizer_build',
44+
action='store_true',
45+
help='Whether the checked binaries were built with the sanitizer option (`WITH_COMPILER_ASAN` CMake option)')
4046
# Parse arguments which are not handled by unit testing framework.
4147
unittest_args, parser_args = sliceCommandLineArguments()
4248
args = parser.parse_args(args=parser_args)

0 commit comments

Comments
 (0)