Skip to content

Commit ca5dfdf

Browse files
MichalStrehovskyam11
andauthoredAug 28, 2024··
Clean up unsupported native AOT flags (#2616)
* 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>
1 parent 475ab45 commit ca5dfdf

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
 

‎src/BenchmarkDotNet/Toolchains/NativeAot/Generator.cs

+3-2
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,12 @@ private string GenerateProjectForNuGetBuild(BuildPartition buildPartition, Artif
133133
<UseSharedCompilation>false</UseSharedCompilation>
134134
<Deterministic>true</Deterministic>
135135
<RunAnalyzers>false</RunAnalyzers>
136-
<PublishAot Condition="" '$(TargetFramework)' != 'net6.0' "">true</PublishAot>
136+
<PublishAot Condition=""$([MSBuild]::VersionGreaterThan('$(NETCoreSdkVersion)', '6.0'))"">true</PublishAot>
137137
<IlcOptimizationPreference>{ilcOptimizationPreference}</IlcOptimizationPreference>
138+
<OptimizationPreference>{ilcOptimizationPreference}</OptimizationPreference>
138139
{GetTrimmingSettings()}
139-
<IlcGenerateCompleteTypeMetadata>{ilcGenerateCompleteTypeMetadata}</IlcGenerateCompleteTypeMetadata>
140140
<IlcGenerateStackTraceData>{ilcGenerateStackTraceData}</IlcGenerateStackTraceData>
141+
<StackTraceSupport>{ilcGenerateStackTraceData}</StackTraceSupport>
141142
<EnsureNETCoreAppRuntime>false</EnsureNETCoreAppRuntime> <!-- workaround for 'This runtime may not be supported by.NET Core.' error -->
142143
<ErrorOnDuplicatePublishOutputFiles>false</ErrorOnDuplicatePublishOutputFiles> <!-- workaround for 'Found multiple publish output files with the same relative path.' error -->
143144
<ValidateExecutableReferencesMatchSelfContained>false</ValidateExecutableReferencesMatchSelfContained>

0 commit comments

Comments
 (0)
Please sign in to comment.