chore: Modify NativeAotToolchain and suppress some warnings - #3223
chore: Modify NativeAotToolchain and suppress some warnings#3223filzrev wants to merge 9 commits into
Conversation
Co-authored-by: Tim Cassell <cassell.timothy@gmail.com>
Co-authored-by: Tim Cassell <cassell.timothy@gmail.com>
We should simply remove NativeAot 6.0. It was experimental until .Net 7. |
| /// compiled as net11.0. | ||
| /// </summary> | ||
| public static readonly IToolchain Net11_0 = CreateBuilder() | ||
| .UseNuGet("", "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet11/nuget/v3/index.json") |
There was a problem hiding this comment.
Does NativeAot11.0 work without that feed?
There was a problem hiding this comment.
I guess it should since .Net 11 preview is already public. We should at least leave a comment to include the .Net 12 feed when it's needed in the future.
There was a problem hiding this comment.
ILCompiler package is continuously published to NuGet.org from .NET 11 preview.2.
https://www.nuget.org/packages/Microsoft.DotNet.ILCompiler
So it's expected to be works.
As far as I've confirmed, specified NuGet feed seems not used after #2095 is merged
Though, It's not tested on my local environment,
Because NativeAot related tests failed on my local environment with following error.
LINK : fatal error LNK1104: cannot open file 'C:\Projects\GitHub\thirdparty\BenchmarkDotNet\tests\BenchmarkDotNet.IntegrationTests\bin\Release\net10.0\BenchmarkDotNet.IntegrationTests-1/.artifacts/\obj\BenchmarkDotNet.Autogenerated\release_net10.0_win-x64\native\BenchmarkDotNet.IntegrationTests-1.sourcelink' .0]
|
I've added following changes on latest commit.
|
72a2f2c to
74d9bf5
Compare
This PR contains following NativeAotToolchain related changes.
1. Modify NuGet feed URL for
NativeAot90/NativeAot100/NativeAotToolchain.Net10_0Replace to normal NuGet feed URL.
This URL seems not be actually used.
Because
PackageReferencetoMicrosoft.DotNet.ILCompileris added when ilCompilerVersion is empty. and it's handled by<PublishAot>true</PublishAot>setting.It might be better to remove these URLs on another PR.
(It need to verify .NET 6 NativeAot behavior because it don't support
PublishAot)2. Add
RuntimeInformation.GetCoreLibDllLocation()helper methodAdd helper method to get
System.Private.CoreLib.dlllocation and suppress IL Linker related warning.And replace existing code that using
typeof(object).Assembly.Location.3. Modify
NativeAot/Generator.cs<TrimMode>link</TrimMode>and<TrimmerDefaultAction>link</TrimmerDefaultAction>seems not supported by .NET 7 or later.So I've modified setting to use
<TrimMode>full</TrimMode>