Prechádzať zdrojové kódy

CI: don't build fuzzers with Clang 11

Clang 11 fails on GitHub Actions with the following error:
ERROR: UndefinedBehaviorSanitizer failed to allocate 0x0 (0) bytes of SetAlternateSignalStack (error code: 22)
Sanitizer CHECK failed: /build/llvm-toolchain-11-mnvtwk/llvm-toolchain-11-11.1.0/compiler-rt/lib/sanitizer_common/sanitizer_common.cpp:54 ((0 && "unable to mmap")) != (0) (0, 0)
Benoit Blanchon 1 rok pred
rodič
commit
0fe202af03
1 zmenil súbory, kde vykonal 10 pridanie a 1 odobranie
  1. 10 1
      extras/fuzzing/CMakeLists.txt

+ 10 - 1
extras/fuzzing/CMakeLists.txt

@@ -52,7 +52,16 @@ macro(add_fuzzer name)
 	)
 endmacro()
 
-if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 6)
+# Needs Clang 6+ to compile
+if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 6)
+	if(DEFINED ENV{GITHUB_ACTIONS} AND CMAKE_CXX_COMPILER_VERSION MATCHES "^11\\.")
+		# Clang 11 fails on GitHub Actions with the following error:
+		# > ERROR: UndefinedBehaviorSanitizer failed to allocate 0x0 (0) bytes of SetAlternateSignalStack (error code: 22)
+		# > Sanitizer CHECK failed: /build/llvm-toolchain-11-mnvtwk/llvm-toolchain-11-11.1.0/compiler-rt/lib/sanitizer_common/sanitizer_common.cpp:54 ((0 && "unable to mmap")) != (0) (0, 0)
+		message(WARNING "Fuzzing is disabled on GitHub Actions to workaround a bug in Clang 11")
+		return()
+	endif()
+
 	add_fuzzer(json)
 	add_fuzzer(msgpack)
 endif()