-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Copy published crossgen2 in artifacts/tests #80154
base: main
Are you sure you want to change the base?
Conversation
Tagging subscribers to this area: @hoyosjs Issue DetailsFixes #80110
|
50a8fa9
to
5cb264a
Compare
300ce0d
to
25514ef
Compare
583f275
to
72fe8e5
Compare
931c0ee
to
db8b174
Compare
a7d30ec
to
79c6554
Compare
Overall looks good to me, thanks Adeel, in general I believe this to be heading in the right direction. We probably need to soften some rough edges though. It seems to me that quite a few R2R tests failed in your PR run, that will require investigation and fixing (theoretically these could be caused by the weird addition of ".." in populating |
In our today .NET core runtime sync several people emphasized that we should coordinate this work with the diagnostics team to make sure we don't paint ourselves in a corner due to the fact that today NativeAOT bugs are in general harder to analyze and investigate. /cc-ing @tommcdon for visibility. |
@@ -42,7 +42,7 @@ | |||
<MSBuild Condition="'$(Crossgen2Supported)' == 'true'" | |||
Targets="Restore;PublishToDisk" | |||
BuildInParallel="true" | |||
Properties="NativeAotSupported=$(NativeAotSupported);OutputPath=$(CORE_ROOT)\crossgen2" | |||
Properties="NativeAotSupported=$(NativeAotSupported);OutputPath=$(CORE_ROOT)\crossgen2;MSBuildRestoreSessionId=$([System.Guid]::NewGuid());" |
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 you split this into two <MSBuild>
invocations, one with Restore and the session ID and one with PublishToDisk and no session ID?
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.
Assuming MSBuildRestoreSessionId
applies only to restore, will split make any difference?
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, as it will force a re-evaluation of the MSBuild project for the PublishToDisk
target as the global properties differ from the Restore
target invocation.
@jkoritzinsky, here is the error from
It's affecting all archs. |
@@ -29,6 +27,7 @@ | |||
<!-- Disable crossgen on FreeBSD when cross building from Linux. --> | |||
<PublishReadyToRun Condition="'$(TargetOS)' == 'freebsd' and '$(CrossBuild)' == 'true'">false</PublishReadyToRun> | |||
<PublishReadyToRunComposite>$(PublishReadyToRun)</PublishReadyToRunComposite> | |||
<UseLocalAppHostPack>true</UseLocalAppHostPack> |
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 you move this line back up to the unconditional property group? I think this is what's causing the failures (as the local apphost pack can't be found).
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.
After reverting, next place where it looks for apphost is:
.dotnet/sdk/9.0.100-preview.3.24204.13/Microsoft.Common.CurrentVersion.targets(5270,5): error MSB3030: Could not copy the file "/__w/1/s/artifacts/obj/coreclr/crossgen2_publish/linux.x64.Checked/apphost" because it was not found.
(from Build coreclr Pri0 Runtime Tests Run linux x64 checked failed
)
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.
Is crossgen2_publish NativeAOT'd here?
We just updated the repo to Preview 3 SDK that has this fix: dotnet/sdk#38644 - SDK should not even be looking for an apphost when doing NAOT publish.
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 tried a few things but this looks like a deadlock.
- crossgen2_publish project is manully publishing AOT app using live build, meaning PublishAot=true is not set
- explicitly setting UseAppHost=false with SelfContained=false for NativeAotSupported != '' failed with
error NETSDK1102: Optimizing assemblies for size is not supported for the selected publish configuration. Please ensure that you are publishing a self-contained app
- explicitly setting SelfContained=false with with SelfContained=true failed with
error NETSDK1067: Self-contained applications are required to use the application host. Either set SelfContained to false or set UseAppHost to true.
- also PublishTrimmed is requiring apphost
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 tried a few things but this looks like a deadlock.
These problems look a lot like the kind of problems one gets when running the Publish target, but not setting the _IsPublishing
property.
- We shouldn't need to set SelfContained=true. The SDK will do it when
_IsPublishing
is set to true andPublishAot
orPublishTrimmed
orPublishSingleFile
is true. - We shouldn't need to change UseAppHost. The SDK will default it to the correct value based on
_IsPublishing
andPublishTrimmed
/PublishAot
/etc.
Running the Publish target without dotnet publish
has a bunch of bad UX tracked in dotnet/sdk#26324.
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, this manual setup is likely there so crossgen2 is published with live build of ILCompiler when NativeAotSupported==true. ILCompiler itself is published using nuget package / sdk integration. crossgen2_publish.csproj line 4 is setting _IsPublishing
. Invoking Publish
/ PublishToDisk
directory gives the same missing apphost error. -v:diag dump suggests one of the linker/trimmer target is trying to copy apphost where it fails.
We will need to wait for next preview with #101213. Locally, I've verified that it fixed the alpine-arm crossbuild by copying the live version to nuget:
|
Fixes #80110