Skip to content

Commit 56f550d

Browse files
CI run-tests script now attempts to detect Apple Clang 15 and other unsupported regression-tests compiler versions (#972)
* CI run-tests script now prints the compiler version if we don't support it The `macos-13` runner has both Apple Clang 14 and 15 installed, and some CI workflow runs appear to use 15, causing spurious failures. * If the CI run-tests script finds Apple Clang 15 try and switch to 14
1 parent eb5c65b commit 56f550d

File tree

1 file changed

+19
-11
lines changed

1 file changed

+19
-11
lines changed

regression-tests/run-tests.sh

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -130,31 +130,39 @@ if [[ "$cxx_compiler" == *"cl.exe"* ]]; then
130130
compiler_version=$(cl.exe)
131131
else
132132
compiler_cmd="$cxx_compiler -I../../../include -std=c++20 -pthread -o "
133-
134-
compiler_ver=$("$cxx_compiler" --version)
135-
if [[ "$compiler_ver" == *"Apple clang version 14.0"* ]]; then
133+
compiler_version=$("$cxx_compiler" --version)
134+
135+
# We don't currently support Apple Clang 15 so try and switch to 14
136+
if [[ "$compiler_version" == *"Apple clang version 15.0"* ]]; then
137+
printf "Found Apple Clang 15, attempting to switch to Apple Clang 14"
138+
cxx_compiler=$(xcodebuild -find clang++)
139+
compiler_version=$("$cxx_compiler" --version)
140+
fi
141+
142+
if [[ "$compiler_version" == *"Apple clang version 14.0"* ]]; then
136143
exec_out_dir="$expected_results_dir/apple-clang-14"
137-
elif [[ "$compiler_ver" == *"clang version 12.0"* ]]; then
144+
elif [[ "$compiler_version" == *"clang version 12.0"* ]]; then
138145
exec_out_dir="$expected_results_dir/clang-12"
139-
elif [[ "$compiler_ver" == *"clang version 15.0"* ]]; then
146+
elif [[ "$compiler_version" == *"clang version 15.0"* ]]; then
140147
exec_out_dir="$expected_results_dir/clang-15"
141-
elif [[ "$compiler_ver" == *"g++-10"* ]]; then
148+
elif [[ "$compiler_version" == *"g++-10"* ]]; then
142149
exec_out_dir="$expected_results_dir/gcc-10"
143-
elif [[ "$compiler_ver" == *"g++-12"* ||
144-
"$compiler_ver" == *"g++-13"*
150+
elif [[ "$compiler_version" == *"g++-12"* ||
151+
"$compiler_version" == *"g++-13"*
145152
]]; then
146153
exec_out_dir="$expected_results_dir/gcc-13"
154+
else
155+
printf "Unhandled compiler version:\n$compiler_version\n\n"
147156
fi
148-
149-
compiler_version=$("$cxx_compiler" --version)
150157
fi
151158

152159
if [[ -d "$exec_out_dir" ]]; then
153160
printf "Full compiler version for '$cxx_compiler':\n$compiler_version\n\n"
154161

155162
printf "Directory with reference compilation/execution files to use:\n$exec_out_dir\n\n"
156163
else
157-
printf "not found for compiler: '$cxx_compiler'\n\n"
164+
printf "Directory with reference compilation/execution files not found for compiler: '$cxx_compiler'\n\n"
165+
exit 2
158166
fi
159167

160168
################

0 commit comments

Comments
 (0)