Skip to content

Commit

Permalink
Clean up unsupported native AOT flags (#2616)
Browse files Browse the repository at this point in the history
* Clean up unsupported native AOT flags

* `llcOptimizationPreference` was renamed to `OptimizationPreference` and became supported in .NET 8 (or maybe .NET 7, it doesn't matter)
* `IlcGenerateStackTraceData` is now `StackTraceSupport` and supported. (Also got renamed in .NET 8 or earlier.)

I'm leaving the old names of properties for backcompat. We could also delete them. I don't know how much BDN cares about .NET versions that are out of support.

IlcGenerateCompleteTypeMetadata is unsupported, we don't test it, it's a mode for troubleshooting trimming issues for people who ignore trimming warnings. I don't think BDN should be setting this. You'll only find bugs (dotnet/runtime#106439). So deleting that. Not deleting the API because it looks to be a public API.

Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
  • Loading branch information
MichalStrehovsky and am11 authored Aug 28, 2024
1 parent 475ab45 commit ca5dfdf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/BenchmarkDotNet/Toolchains/NativeAot/Generator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,12 @@ private string GenerateProjectForNuGetBuild(BuildPartition buildPartition, Artif
<UseSharedCompilation>false</UseSharedCompilation>
<Deterministic>true</Deterministic>
<RunAnalyzers>false</RunAnalyzers>
<PublishAot Condition="" '$(TargetFramework)' != 'net6.0' "">true</PublishAot>
<PublishAot Condition=""$([MSBuild]::VersionGreaterThan('$(NETCoreSdkVersion)', '6.0'))"">true</PublishAot>
<IlcOptimizationPreference>{ilcOptimizationPreference}</IlcOptimizationPreference>
<OptimizationPreference>{ilcOptimizationPreference}</OptimizationPreference>
{GetTrimmingSettings()}
<IlcGenerateCompleteTypeMetadata>{ilcGenerateCompleteTypeMetadata}</IlcGenerateCompleteTypeMetadata>
<IlcGenerateStackTraceData>{ilcGenerateStackTraceData}</IlcGenerateStackTraceData>
<StackTraceSupport>{ilcGenerateStackTraceData}</StackTraceSupport>
<EnsureNETCoreAppRuntime>false</EnsureNETCoreAppRuntime> <!-- workaround for 'This runtime may not be supported by.NET Core.' error -->
<ErrorOnDuplicatePublishOutputFiles>false</ErrorOnDuplicatePublishOutputFiles> <!-- workaround for 'Found multiple publish output files with the same relative path.' error -->
<ValidateExecutableReferencesMatchSelfContained>false</ValidateExecutableReferencesMatchSelfContained>
Expand Down

0 comments on commit ca5dfdf

Please sign in to comment.