-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Roslyn apis to generate Platform Not Supported Assemblies #40296
Conversation
Note regarding the This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change. |
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.
Would you mind adding comments to code paths which aren't self-explanory like the string replacement, the rooted check, etc. Also would it make sense to move the added infra code to a separate file instead, ie notsupported.targets?
src/libraries/System.ComponentModel.TypeConverter/ref/System.ComponentModel.manual.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.DirectoryServices/src/System.DirectoryServices.csproj
Outdated
Show resolved
Hide resolved
src/libraries/System.ComponentModel.Composition/src/System.ComponentModel.Composition.csproj
Outdated
Show resolved
Hide resolved
src/libraries/System.Net.NameResolution/src/ExcludeApiList.PNSE.Browser.txt
Outdated
Show resolved
Hide resolved
System.IO.Filesystem tests are being shown as failures on wasm, but the log doesnt show any failing tests. @lewing and @steveisok are u aware of such issues ? |
Tagging subscribers to this area: @safern, @ViktorHofer |
@akoeplinger @marek-safar can you help with this failure ?
|
@Anipik it looks like the finalizer is throwing PNSE which shouldn't happen. Did something change with the PNSE assembly generator? GenAPI has code to omit the destructor when generating PNSE: https://github.com/dotnet/arcade/blob/89b5ce0df8958006752f50264eab47f6e4866081/src/Microsoft.Cci.Extensions/Writers/CSharp/CSDeclarationWriter.Methods.cs#L28-L35 |
yes we are adding the platform not supported exception to the destructor as well. |
that's a problem then since finalizers aren't supposed to throw exceptions. |
is there a specific reason behind everything throwing the exception beside destructor. The fix should be in tooling or in implementation ? |
the problem with throwing from the destructor is that you can't catch that exception, e.g. the following code would still crash the process once the object is finalized: try {
var p = new ClassThatThrowsPNSE();
} catch (PlatformNotSupportedException) {
// alternate logic
} so yeah the PNSE generation tooling needs to ensure not to generate an exception for the destructor. |
@Anipik I merged my change yesterday to mode the Drawing Converters down to System.Drawing.Common and that's using the old exclude api list argument, so that we don't forget to update it here as well. |
yeah i already added that. |
Thanks @akoeplinger for the example. the ask seems reasonable, i can add this to the tooling. |
#40961) * fixes on the runtime side * address feedback * update arcade version * merge conflicts * update the version
Yep, just for reference: https://docs.microsoft.com/en-us/visualstudio/code-quality/ca1065?view=vs-2019#finalizers
|
Actually, I take that back. It looks like .NETFramework will run the finalizer on a partially constructed object but .NETCore will not. Perhaps mono should be changed to match .NETCore? Still this argues for making our behavior support the running of finalizers since some of these assemblies need to work on .NETFramework, but I will correct that fact filed away to remember that this is actually something a little more subtle than it seems. |
Made tracking issue for the finalizer behaviour on MonoVM -- #41272 |
Fixes #33631