-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Change the way we build CoreCLR tests for NativeAOT #64738
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
Conversation
Remove NativeAOT testing added in dotnet#62704 to make room for the different strategy.
I'd be nice if when I run all tests using |
Right now (before this pull request is merged), you can set This pull request doesn't do the deletion of artifact because it's weird to do that as part of the build (and breaks incrementality). I'm hoping that nobody will try to build a full Pri-0 test pass while low on disk space because it takes 100+ GB to do that. Since artifacts are not deleted, the response files will be left intact. I realized I'll also have to update the docs. |
It looks like this PR removes support in our testing scripts for the NativeAOT multi-module testing mode. Is that intentional? |
I wanted to scope this change down because less functionality can be reviewed more easily, but on a second thought this is probably just a dozen extra lines. |
8d4eeb8
to
0e6bafa
Compare
The mild inconvenience for multi-obj-file-compilation testing is that we now have to decide how we build the test at the time of test build instead of at the time of test execution. In the old setup, we would simply re-run the tests twice - once with single obj compilation, and the other time with multi-obj compilation. Now we would basically need a new test leg and I definitely don't want that for each pull request. Here's how I'm solving it.
|
ec3f96f
to
c0c68d8
Compare
@jkoritzinsky @trylek I think this is ready - could you have a look? It's two commits - the first is basically a rollback. The second is the new testing strategy. I'm not actually hooking this into helix yet because this change is already too big but I think it should be straightforward. @jkotas could you have a look at the changes under src/coreclr/nativeaot? I had to add a couple extensibility points that hopefully make sense. |
LGTM |
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.
LGTM, thank you!
<PropertyGroup Condition="'$(TestBuildMode)' == 'nativeaot'"> | ||
<!-- NativeAOT compiled output is placed into a 'native' subdirectory: we need to tweak | ||
rpath so that the test can load its native library dependencies if there's any --> | ||
<IlcRPath Condition="'$(TargetOS)' != 'OSX'">$ORIGIN/..</IlcRPath> |
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.
These synthesized property values differ from similar definitions in Microsoft.NETCore.Native.Unix.props (by the extra /..
parent folder level), is that intentional?
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.
Yes, I tried to capture it in the comment above this line - the test build places the NativeAOT compiled artifacts in a native
subdirectory, but we might have .so/.dll files that the test depends on one level up. We tweak rpath so that it loads from there. On Windows, we search the current directory, so it seems to work fine.
object file here so it isn't passed to CSC, and instead redirect it to be picked up | ||
by the LinkNative target. | ||
--> | ||
<Target Name="RemoveObjFiles" AfterTargets="ResolveProjectReferences"> |
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.
Non-blocking - I wonder whether this logic should be rather put in one of the common scripts like Directory.Build.targets so that it doesn't need to be open-coded in the individual tests. Or is this special to just this one test?
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.
It's specific to the MultiModule compilation mode that we don't ship... it should eventually be part of the product. We don't need it for other tests.
This is two commits: the first one basically just rolls back #62704 - the original strategy for building CoreCLR tests with NativeAOT. In this mode, the test build would generate project files that the test execution script would MSBuild and then execute the result. We did it that way because AOT compiling tests takes time and it's better if we can fan in out into Helix. The main disadvantage is that this strategy requires the target Helix machine to have the necessary tools to finish the compilation (e.g. we would need a Windows SDK and VS to be installed on the ARM64 Helix machines since the AOT compilation requires those).
The need to fan out compilation will greatly disappear once we don't have 6000 tiny tests to compile. I also find it unlikely that we would run the whole Pri-0 suite as part of the CI. Most of these tests are codegen tests and there's very few NativeAOT specific codegen bugs.
So in the second commit, I'm adding a different NativeAOT test strategy - we NativeAOT compile the test as part of the test build. To run the test, we use the custom launcher infrastructure to execute the AOT compiled test instead of using corerun on a managed assembly.