-
-
Notifications
You must be signed in to change notification settings - Fork 16
Conversation
Remove warning workarounds for native AoT.
Need to check if this is a .NET or this-repo issue:
|
Warnings appear to be dotnet/extensions#4622. |
@martincostello - that issue will resolve those warnings, but it will take a couple servicing releases. The root underlying issue is dotnet/runtime#94119, which will hopefully be fixed in the |
src/WeatherApi/WeatherApi.csproj
Outdated
@@ -11,8 +11,6 @@ | |||
<!-- Add support for Ahead-of-Time (AoT) compilation --> | |||
<PropertyGroup Condition="!$([System.OperatingSystem]::IsMacOS())"> |
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.
macOS is supported in NativeAOT in .NET 8. So this condition can be removed if you want.
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.
So it works here, but it doesn't work in Polly 🤔 (logs)
Error: /Users/runner/.dotnet/sdk/8.0.100/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkRefe enceResolution.targets(90,5): error NETSDK1204: Ahead-of-time compilation is not supported on the current platform 'osx-x64'. [/Users/runner/work/Polly/Polly/test/Polly.AotTest/Polly.AotTest.csproj]
Looks like it's during dotnet clean
(which this repo doesn't do) so maybe that's a bug somewhere?
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.
FYI: dotnet/sdk#36960
@@ -11,8 +11,6 @@ | |||
<!-- Add support for Ahead-of-Time (AoT) compilation --> | |||
<PropertyGroup Condition="!$([System.OperatingSystem]::IsMacOS())"> | |||
<InvariantGlobalization>true</InvariantGlobalization> | |||
<!-- HACK Suppress IL warnings from Microsoft.Extensions.Http.Resilience until 8.0.0 --> |
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.
If you want to disable warnings coming from a specific set of libraries, a strategy I found that works is to use <TrimmerSingleWarn>false</TrimmerSingleWarn>
and disable the warning for IL2104
(the warning number for a single warning for a whole library).
And then turn on "single warnings" for the specific libraries you want to suppress. You can see an example of that here:
https://github.com/dotnet/eShop/blob/1e803b09ba8caa3702f037deac837fab956abe33/Directory.Build.targets#L7-L23
Apply suggested pattern to move the ILLink suppressions into their own file out of the project file.
Enable AoT for macOS.
Only update Polly.Core to 8.2.0 to resolve the AoT issue.
Improve warning workarounds for native AoT.