Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI run-tests script now attempts to detect Apple Clang 15 and other unsupported regression-tests compiler versions #972

Merged
merged 2 commits into from
Feb 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 19 additions & 11 deletions regression-tests/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -130,31 +130,39 @@ if [[ "$cxx_compiler" == *"cl.exe"* ]]; then
compiler_version=$(cl.exe)
else
compiler_cmd="$cxx_compiler -I../../../include -std=c++20 -pthread -o "

compiler_ver=$("$cxx_compiler" --version)
if [[ "$compiler_ver" == *"Apple clang version 14.0"* ]]; then
compiler_version=$("$cxx_compiler" --version)

# We don't currently support Apple Clang 15 so try and switch to 14
if [[ "$compiler_version" == *"Apple clang version 15.0"* ]]; then
Copy link
Contributor

@jarzec jarzec Feb 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Question] Are you sure Apple Clang 15 was selected? The GitHub runner states that Clang 15 s installed from Homebrew. I checked and the output of $(brew --prefix llvm@15)/bin/clang --version is:

Homebrew clang version 15.0.7
Target: x86_64-apple-darwin22.6.0
Thread model: posix
InstalledDir: /usr/local/opt/llvm@15/bin

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I'm not 100% sure, this is very much some investigative work!

All I can say for certain right now is that on some macOS job runs (e.g. the one linked above, and I've seen it other times too), clang++ does not resolve to Apple Clang 14. That's why the script produces the not found for compiler: 'clang++' error message.

One of the updates in this PR is to provide more info about why the job fails. If this PR is merged then in the future we'll get more info due to this:

printf "Unhandled compiler version:\n$compiler_version\n\n"

That may show Apple clang 15.0 etc or something else.

Yeah, the macos-13 runner confusingly has both LLVM Clang installed as well as multiple versions of Xcode (with Apple Clang).

image

Xcode 14.3 is meant to be the default so clang++ would resolve to Apple Clang 14, but I suspect there's a problem which is causing Xcode 15 to be active. But, it could also somehow be invoking LLVM Clang 15. To me that seemed less likely because, like you noted, it's installed via Homebrew and needs the brew --prefix llvm@15 to get the correct path.

printf "Found Apple Clang 15, attempting to switch to Apple Clang 14"
cxx_compiler=$(xcodebuild -find clang++)
compiler_version=$("$cxx_compiler" --version)
fi

if [[ "$compiler_version" == *"Apple clang version 14.0"* ]]; then
exec_out_dir="$expected_results_dir/apple-clang-14"
elif [[ "$compiler_ver" == *"clang version 12.0"* ]]; then
elif [[ "$compiler_version" == *"clang version 12.0"* ]]; then
exec_out_dir="$expected_results_dir/clang-12"
elif [[ "$compiler_ver" == *"clang version 15.0"* ]]; then
elif [[ "$compiler_version" == *"clang version 15.0"* ]]; then
exec_out_dir="$expected_results_dir/clang-15"
elif [[ "$compiler_ver" == *"g++-10"* ]]; then
elif [[ "$compiler_version" == *"g++-10"* ]]; then
exec_out_dir="$expected_results_dir/gcc-10"
elif [[ "$compiler_ver" == *"g++-12"* ||
"$compiler_ver" == *"g++-13"*
elif [[ "$compiler_version" == *"g++-12"* ||
"$compiler_version" == *"g++-13"*
]]; then
exec_out_dir="$expected_results_dir/gcc-13"
else
printf "Unhandled compiler version:\n$compiler_version\n\n"
fi

compiler_version=$("$cxx_compiler" --version)
fi

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

printf "Directory with reference compilation/execution files to use:\n$exec_out_dir\n\n"
else
printf "not found for compiler: '$cxx_compiler'\n\n"
printf "Directory with reference compilation/execution files not found for compiler: '$cxx_compiler'\n\n"
exit 2
fi

################
Expand Down
Loading