-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Get System.Runtime.InteropServices.Tests passing with NativeAOT #73145
Comments
@MichalStrehovsky Is there a workflow document for building and running individual tests with NativeAOT? My normal workflow is to build the Clr and Libraries subset using the How would I modify that workflow to use NativeAOT? |
The libraries test workflow for NativeAOT is documented at https://github.com/dotnet/runtime/blob/main/docs/workflow/building/coreclr/nativeaot.md#running-library-tests |
ILC is crashing a lot. I'll try to get back to this at some point, but the workflow here is rather annoying if I can't build a single test at a time. |
Got this building and running locally.
What is our trigger here? Are we checking for feature flags via attributes? |
I think I'm going to need a public API for this detection. Any concerns with me creating a new |
We should not need a public API to make the tests work. We do have |
Right, but that assumes Windows always has this support, which isn't true because it can be disabled. It has enough for NativeAOT, but I'd prefer to just thread this through now instead of needing to do it later. |
PlatformDetection has many IsSupported properties like that. We stayed away from introducing them as public APIs since they would not be very useful. Catching the NotSuppportedException works equally well if the app needs to do something about the unsupported API. I would just tweak PlatformDetection as necessary. |
I'd expect we can just make use of |
Was it crashing because of a missing The test fixes are usually in the shape of:
I think a lot of this would also be testable with CoreCLR where we would disable COM support and try to make the test pass in that configuration. Once all the tests are annotated, we could even have extra weekly test passes that just run all the libs tests with COM disabled. If you're looking at this with NativeAOT already, there's a known issue with NativeMemory that crashes the process: #73143. |
Twenty of the tests are using Lines 152 to 163 in d2264b2
|
They need to get: |
Down to 56 failures.
|
Spot checking the results:
General test improvement:
NativeAOT fixes:
A lot of this would also benefit Mono testing that decided to just not run any of the tests because it's too much of a hassle when this is just one of the 200+ libraries tests that needed to be brought up 2 years ago:
runtime/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/AssemblyInfo.cs
Line 6 in cfa4f6f
Attached logs here, apparently Github has a 64k character comment limit and this just fails too much: testfails.txt
Cc @AaronRobinsonMSFT @elinor-fung @jkoritzinsky if any of you have cycles to help with some of this.
The text was updated successfully, but these errors were encountered: