-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
NativeAOT implement warning as errors as a compiler feature #96567
Conversation
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas Issue DetailsBoth roslyn and trimmer implement "warn as error" as a compiler feature - specifically the This implements the same behavior as the trimmer. It adds 3 new command line options to For testing this enables the existing trimmer tests for this functionality. This uncovered a small issue in substitution parser, which is also fixed here. For simplicity the test infra emulates the Open question:
|
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.
Looks like tests will need some warning disabling since the warnings now trigger a build failure.
src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets
Outdated
Show resolved
Hide resolved
src/coreclr/tools/aot/ILCompiler.Trimming.Tests/TestCasesRunner/TrimmingArgumentBuilder.cs
Show resolved
Hide resolved
Renames the command line arguments as per PR feedback Adds suppressions to smoke tests as necessary
50b1580
to
ac189ef
Compare
No strong opinion. I would probably add it in case it comes in handy for someone, but it's probably not going to be widely useful. We can also always add it later if needed. |
Thank you for doing the "nice" suppressions in the tests (instead of just blanket disabling everything). Looks like there's more failures outside nativeaot/SmokeTests. We should also run the pri0 suite since I assume there will be more of these in the test tree. If you don't want to run it locally, I suggest disabling WarnAsError in the PR temporarily so that the build doesn't just stop after a couple of these (or look at warnings in some older PRs where we did |
I added the |
/azp run runtime-nativeaot-outerloop |
Azure Pipelines successfully started running 1 pipeline(s). |
All the failures seem to be known (The S.T.Json failure is the crash without a dump problem reported elsewhere already). |
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.
Thank you! Sorry for the delay, I thought I signed off already.
…6567) Both roslyn and trimmer implement "warn as error" as a compiler feature - specifically the `TreatWarningsAsErrors` property only affects tools which explicitly react to it. There's a related MSBuild command line option which will affect all warnings, but that's not the one VS sets from the UI and what most customers use. See the comments in dotnet#94178. This implements the same behavior as the trimmer. It adds 3 new command line options to `ilc` and enable "warn as error" globally and to enable/disable specific warning codes. Note that `illink` implements a more complex command line parsing where order of parameters matters and sometimes the later ones can override the earlier ones. This was trying to emulate `csc` behavior. For `ilc` I don't see a reason to emulate that because running `ilc` on its own is not supported, only going through the SDK, which will never pass the new parameters multiple times. For testing this enables the existing trimmer tests for this functionality. This uncovered a small issue in substitution parser, which is also fixed here. For simplicity the test infra emulates the `illink` command line behavior over `ilc` (which is easy as they're very similar).
…view1 (#20268) * Align expected NativeAOT build warning messages in integration tests * Do not treat NativeAOT build warnings as errors - introduced with dotnet/runtime#96567
* Update versions * Update Versions.props * Update versions * Update Versions.props * Update Versions.props * Fix ios versions * Update versions of Tizen * Update iOS * Update Version.Details.xml * Update Versions.props * Update versions again * Update sdk * Dont build net8 * Add loging * skip this one and see * [ci] Push artifacts for the sample tests (#20269) * [ci] Always publish the artifacts * remove verbosity * Enable stable branding * NativeAOT: Update NativeAOT integration tests to run with 9.0.1xx-preview1 (#20268) * Align expected NativeAOT build warning messages in integration tests * Do not treat NativeAOT build warnings as errors - introduced with dotnet/runtime#96567 * [release/9.0.1xx-preview1] Update versions (#20279) * Update versions * Ignore blazor tests on old webview * [release/9.0.1xx-preview1] Revert "Dont build net8" (#20286) * Revert "Dont build net8" This reverts commit 4d59c64. * Update versions * Update Compatibility.csproj * Update versions * Update dotnet.cake Update dotnet.cake Set env variables before build device tests Update DotnetInternal.cs Update dotnet.cake * Don't build template tests again --------- Co-authored-by: Matthew Leibowitz <mattleibow@live.com> Co-authored-by: Ivan Povazan <55002338+ivanpovazan@users.noreply.github.com>
…n tests (#20471) * Fix RunOniOS test * Do not treat NativeAOT build warnings as errors - introduced with dotnet/runtime#96567 --------- Co-authored-by: Simon Rozsival <simon@rozsival.com>
Both roslyn and trimmer implement "warn as error" as a compiler feature - specifically the
TreatWarningsAsErrors
property only affects tools which explicitly react to it. There's a related MSBuild command line option which will affect all warnings, but that's not the one VS sets from the UI and what most customers use. See the comments in #94178.This implements the same behavior as the trimmer. It adds 3 new command line options to
ilc
and enable "warn as error" globally and to enable/disable specific warning codes. Note thatillink
implements a more complex command line parsing where order of parameters matters and sometimes the later ones can override the earlier ones. This was trying to emulatecsc
behavior. Forilc
I don't see a reason to emulate that because runningilc
on its own is not supported, only going through the SDK, which will never pass the new parameters multiple times.For testing this enables the existing trimmer tests for this functionality. This uncovered a small issue in substitution parser, which is also fixed here. For simplicity the test infra emulates the
illink
command line behavior overilc
(which is easy as they're very similar).Open question:
Trimmer introduces
ILLinkTreatWarningsAsErrors
property which defaults toTreatWarningsAsErrors
but can be overriden and it specifically applies on toillink
. I didn't introduce a new one forilc
as I don't see much value in doing so, but I may be missing something. @sbomer - do you think we should addIlcTreatWarningsAsErrors
?Update:
We agreed to add
IlcTreatWarningsAsErrors
.