-
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
Update runtime repo to use Preview 7 SDK #72145
Conversation
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label. |
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. Of course, before merging we need to go through the usual process of communicating the change.
@MichalStrehovsky @LakshanF Looks like some NativeAOT libraries tests are failing after an SDK update. Ideas? |
Looking... one thing that's missing is adding handling of the new TrimMode to NativeAOT targets. But the failure mode doesn't look like that's the problem. |
It's from the new aggresse trimming default in Preview 6. xUnit is calling This is actually a very lucky catch. Only a couple of the tests fail. The rest look like this:
The fix will be along the lines of adding |
@@ -1,7 +1,7 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |||
<PropertyGroup> | |||
<TrimmerDefaultAction>link</TrimmerDefaultAction> | |||
<TrimMode>full</TrimMode> |
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.
We'll probably need to do the opposite here - nativeaot tests expect trimming and require the (now default) TrimMode=full. So this line is technically not needed. But the rest of the coreclr test tree will want to keep the partial TrimMode.
@@ -14,7 +14,7 @@ | |||
<Configurations>Debug;Release;Checked</Configurations> | |||
<ServerGarbageCollection>true</ServerGarbageCollection> | |||
<!-- Trim all dependent assemblies as though they were all marked IsTrimmable. --> | |||
<TrimmerDefaultAction>link</TrimmerDefaultAction> | |||
<TrimMode>full</TrimMode> |
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.
Do we need this line if this is now the default?
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.
No, we don't, I was just being explicit.
Does NativeAOT understand |
/azp run runtime-extra-platforms,runtime-wasm |
Azure Pipelines successfully started running 2 pipeline(s). |
I think #71117 is what's needed. Could be folded into this PR to avoid adding the TODO. |
/azp run runtime-extra-platforms,runtime-wasm |
Azure Pipelines successfully started running 2 pipeline(s). |
/azp run runtime-extra-platforms,runtime-wasm |
Azure Pipelines successfully started running 2 pipeline(s). |
It looks like the installer tests are broken by dotnet/sdk#26462. The test execution happens through Arcade, so we can't pass DOTNET_ROOT as is. I see two options for workaround:
I don't see any way to use the Preview 6+ SDK otherwise. |
@MichalStrehovsky or @vitek-karas Any thoughts on the NativeAOT failures?
|
/azp run runtime-extra-platforms,runtime-wasm |
Azure Pipelines successfully started running 2 pipeline(s). |
This is WarnAsError in action. Apparently we deleted what it means to SuppressTrimAnalysisWarnings in dotnet/linker#2930 and NativeAOT no longer suppresses these. I've inlined what that means into the targets to work around and filed a 7.0 issue to fix it because this is customer-visible (#73926). I'm puzzled why we're seeing it here because the break merged into linker repo 10 days ago and there's no way that made it into Preview 7 (in fact, troubleshooting this took longer than I'm willing to admit because the .targets in P7 SDK still have this suppression but we're picking it up from a NuGet instead). cc @sbomer |
The Linux_musl x64 Debug failure is #73930 (a test touched 4 hours ago, so I'm going with the "unrelated to what we're doing here" theory). We're good to merge once llvmfullaot is done with its thing. |
@@ -74,7 +74,7 @@ public unsafe struct LbrTraceEventData64 | |||
public Span<LbrEntry64> Entries(int totalSize) | |||
{ | |||
IntPtr entriesOffset = Unsafe.ByteOffset(ref Unsafe.As<LbrTraceEventData64, byte>(ref this), ref Unsafe.As<LbrEntry64, byte>(ref _entries)); | |||
return MemoryMarshal.CreateSpan(ref _entries, (totalSize - (int)entriesOffset) / sizeof(LbrEntry64)); | |||
return MemoryMarshal.CreateSpan(ref Unsafe.AsRef<LbrEntry64>(Unsafe.AsPointer(ref _entries)), (totalSize - (int)entriesOffset) / sizeof(LbrEntry64)); |
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.
Won't that cause a GC hole? Same with above.
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.
Good catch. We either need to make this a ref struct
with a big "DO NOT CLEAN UP THE REF PART" comment, or use fixed
to grab the pointer instead.
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 it will. I'll push a fix.
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.
We either need to make this a ref struct with a big "DO NOT CLEAN UP THE REF PART" comment, or use fixed to grab the pointer instead.
I think we can make these static functions that take the owning struct by ref.
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.
Can't we make it
return MemoryMarshal.CreateSpan(ref Unsafe.AsRef<LbrEntry64>(Unsafe.AsPointer(ref _entries)), (totalSize - (int)entriesOffset) / sizeof(LbrEntry64)); | |
return MemoryMarshal.CreateSpan(ref _entries, (totalSize - (int)entriesOffset) / sizeof(LbrEntry64)); |
and add [UnscopedRef]
to the method?
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.
Since I've also got the owner here, can we get this moved to build against the live build? Building against the repo's SDK is the root issue here.
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.
I can look into it, I'm not totally sure on the constraints about that (we are publishing dotnet-pgo as a nuget package, would that be affected?). I probably need to involve @davidwrighton here.
I assume it can be done separately?
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.
I assume it can be done separately?
Absolutely. My only concern is this project is the only one I found that seems to use the repo's SDK and could be heavily impacted by complex language changes that force updates to the public API surface. This is a longer-term concern and just something to keep in mind as the language evolves to have more of these low-level friendly features.
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.
My only concern is this project is the only one I found that seems to use the repo's SDK and could be heavily impacted by complex language changes that force updates to the public API surface
Everything under src/coreclr/tools builds against the repo's SDK. Building against live bits has build sequencing issues where one wouldn't be able to build crossgen2 without building libs first, or run crossgen2 without building the host.
If we want to switch to live, I would want to know what the VS debug experience for live built things looks like. I would still prefer we don't do that because I kind of like I don't need to build coreclr VM, host, or other stuff for NativeAOT development.
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.
Building against live bits has build sequencing issues
Ah. Thanks @MichalStrehovsky. This is an important consideration to note. Perhaps this wouldn't justify the resulting dev-loop pain.
There was no GC hole here in practice since the users have unmanaged pointers. However, the better fix is to just mark it as UnscopedRef.
/azp run runtime-wasm |
Azure Pipelines successfully started running 1 pipeline(s). |
@jakobbotsch build failed |
Hmm strange, it builds fine from within VS locally. I suppose we cannot use this attribute yet in the project. Let me go back to my other fix. |
/azp run runtime-wasm |
Azure Pipelines successfully started running 1 pipeline(s). |
dotnet/linker#2837 moved the linker targets to the nuget package, and we are only now picking up the SDK change that imports them from the package. Now the recent targets changes are lighting up because runtime depends on a more recent nuget than the one that was shipped in-box with the P7 SDK. |
Linux x64 Debug leg failure is #73930 |
All failures are accounted for. Merging this in. |
Thanks for getting this in everyone. @jkoritzinsky as usual, can you please send out the notice to the team including instructions on how to obtain the new SDK (for global installs)? |
Will do! |
No description provided.