-
Notifications
You must be signed in to change notification settings - Fork 355
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
Remove hardcoded list of compiler versions in init-compiler.sh #14696
Remove hardcoded list of compiler versions in init-compiler.sh #14696
Conversation
d8e7a35
to
6f4c49a
Compare
I tested building the VMR on Fedora with this. That worked. Any particular environments I should try out? |
…iler.sh This commit is just to exercise CI for dotnet/arcade#14696
eng/common/native/init-compiler.sh
Outdated
EOF | ||
unset patchVersion | ||
|
||
if [ "$compiler" = "clang" ] && [ "$majorVersion" -lt 5 ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the old script errored for clang < 3.5 and gcc < 4.9, I think those are probably old enough that we don't need to care, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Release dates:
These will be more than 10 years old by the time of .NET 9 GA. I am okay with dropping these both.
/cc @am11 |
Building runtime should be a good test case, I see you're hitting some issues in dotnet/runtime#100761 so let's hold off on merging this. |
The rationale behind having explicit versions was @janvorli's: we validate each version before adding it to the list. We do not want to use any version on the PATH. That's why we have maintained it this way over years. |
Yeah he mentioned that in #14572 (comment). I don't think it's worth being explicit anymore, especially given that we use |
Apple versions are always behind the Linux versions in our environments. |
6f4c49a
to
b17cbc5
Compare
I have reworked the change entirely. Please see the new commit message:
And here's CI exercising the change: dotnet/runtime#100828 |
6e5805f
to
a3c7a59
Compare
If a version-specific compiler (eg, clang-17) is passed to the script, it works as before. And like before, if a generic compiler (eg clang) is passed to the script, it prefers to find and use the few specific/known/tested versions of compilers (eg, clang means use clang-18 if possible). However, unlike before, if none of those specific known versions are found, it correctly falls back to the generic compiler binary (eg clang) in $PATH. The script was actually supposed to do all this already, but it seems to have been broken when warning messages were added. These warning messages were parsed by msbuild. Msbuild would see the warning messages and fail the build. With a generic compiler, this script now also invokes it via $compiler -dumpversion (which works on both clang and gcc) to find the version for various (existing) version checks. The compiler was already being invoked to check if -fuse-ld=lld is supported. Fixes: dotnet#14632
a3c7a59
to
b8698e4
Compare
Any further thoughts or comments? Is this okay to go in? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you!
We're seeing a build break caused by this in dotnet/installer#19562, reverting this for now: #14734
|
else | ||
echo "No usable version of $compiler found." | ||
if [ "$(uname)" == "Darwin" ]; then | ||
echo "Error: Specific version of $compiler not found" | ||
exit 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this be "$(uname)" != "Darwin
? we won't have majorVersion set on Darwin.
It should also stay a warning and not fail the build on other platforms I think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, good point. Let me think about this some more.
Any warning printed by this script (especially if it is prefixed by error:
or warning:
) will fail the build.
This change caused issue in coverage repo on macOS:
before this change output was:
I've tried to specify: |
If a version-specific compiler (eg,
clang-17
) is passed to the script, it works as before. However, if a generic compiler (eg,clang
) is passed to the script, it uses the version in $PATH. This is a change from earlier, where it was iterating through a known list of versions to find the latest version of the compiler and using that.This change can break or modify existing build scenarios where the following are all true:
$compiler
) is not the latest versionIn this scenario, an older version of the compiler will be used, which may not be desired.
With a generic compiler, this script now also invokes it via
$compiler -dumpversion
(which works on both clang and gcc) to find the version for various (existing) version checks. The compiler was already being invoked to check if-fuse-ld=lld
is supported.Fixes: #14632