Conversation
…ing runtimes that are not longer supported (nobody should be using this combination)
…T/NativeAOT naming)
…rs(DynamicallyAccessedMemberTypes.All)]
| [PublicAPI] public GenericTypeArgumentsAttribute() => GenericTypeArguments = new Type[0]; | ||
|
|
||
| public GenericTypeArgumentsAttribute(params Type[] genericTypeArguments) => GenericTypeArguments = genericTypeArguments; | ||
| public GenericTypeArgumentsAttribute([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] params Type[] genericTypeArguments) => GenericTypeArguments = genericTypeArguments; |
There was a problem hiding this comment.
Unfortunately placing the DAMAttribute on an array is a no-op. Arrays are difficult to model in a static analysis.
This should be generating a warning along the lines of Trim analysis warning IL2098: GenericTypeArgumentsAttribute..ctor(Type[]): Parameter '#1' of method 'GenericTypeArgumentsAttribute..ctor(Type[])' has 'DynamicallyAccessedMembersAttribute', but that attribute can only be applied to parameters of type 'System.Type' or 'System.String'.
There was a problem hiding this comment.
this actually broke building dotnet/performance with dotnet/runtime. When building a wasm project, I get - https://gist.github.com/radical/b75b5e4063d97be0adac729b611990ea . Can we revert this change? @adamsitnik
There was a problem hiding this comment.
If I remove that attribute from the param, then it works fine.
There was a problem hiding this comment.
To be clear, this breaks when I update bdn reference in dotnet/performance to 0.13.1.1740.
There was a problem hiding this comment.
The attribute is a no-op - it should be removed because even in the absence of the illink bug, it generates a warning. NativeAOT doesn't have the linker bug and that's why it works there. I filed https://github.com/dotnet/linker/issues/2714 on the linker bug - that one should also be fixed independently of this removal.
With the following 3 recent fixes:
It required very little work to improve the NativeAOT support. Main changes:
--runtimesno longer supportscorert70. The proper name isnativeaot70(case and dots are ignored, so you can useNativeAOT7.0as well)CoreRtToolchainBuilderhas been upgraded to .NET 7 feedCoreRtToolchainBuilderhas been upgraded to7.0.0-*--coreRtVersionto--ilCompilerVersionas it specifies the ILCompiler version. Sample command:Demo:
In the meantime I am working on getting all dotnet/performance microbenchmarks running with NativeAOT
cc @jkotas @MichalStrehovsky @hez2010 @Beau-Gosse-dev