Retry publish crossgen as AOT (#65948)#67636
Conversation
…5948) Publishes crossgen as an AOT binary on Windows+Linux x64+ARM64, otherwise publishes as an R2R single file. Closes dotnet#60016 (cherry picked from commit 0d1e04b)
|
With much help from @hoyosjs, @carlossanlop, and @krwq I think I have figured this out: the problem is that sometimes the crossgen2 package was restored as net6.0 and sometimes as net7.0. I can't identify from the logs where the net7.0 was coming from, but I think I can pass it down from the package build, which should hopefully ensure that it's always 6.0 at the time it matters. |
|
So, digging in more, I'm more confused about what's going on here. I wonder if there's something I don't understand about MSBuild static graph restore. @rainersigwald Any chance you can provide any insight here? The problem is that the The build I'm having trouble with is at https://dev.azure.com/dnceng/public/_build/results?buildId=1709594&view=logs&j=000ba8e3-34f8-51d2-8d06-9b61f10256d0&t=ca9b6e26-8c16-57f9-673e-2bc0dc655f25 The important part of the log is The important bits are and I don't understand why that is not The RuntimeIdentifier should be a global property, and I don't understand why it's not factoring into the restore. |
|
also + @dsplaisted in case you have any ideas or can point me in the right direction |
|
Even if a RuntimeIdentifier is specified, the assets file will still have a RID-less "targets" entry in it, and it will be the first one. Later on in the file there should also be a target for "net6.0/centos.7-x64". |
ViktorHofer
left a comment
There was a problem hiding this comment.
Just a few remaining questions 👍
src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj
Outdated
Show resolved
Hide resolved
| <_TargetsToRun>Restore;Publish;PublishItemsOutputGroup</_TargetsToRun> | ||
| </PropertyGroup> | ||
|
|
||
| <MSBuild Projects="$(RepoRoot)src/coreclr/tools/aot/crossgen2/crossgen2.csproj" |
There was a problem hiding this comment.
Why can't this be a ProjectReference instead? ProjectReferences allow to specify additional properties and target(s) to invoke. They also allow to capture their output.
There was a problem hiding this comment.
I had no idea. I'd rather do that in a follow-up PR, since this is a very important deliverable for .NET 7 and I'd like to get dogfooding feedback as soon as possible.
src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj
Outdated
Show resolved
Hide resolved
src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj
Outdated
Show resolved
Hide resolved
…App.Crossgen2.sfxproj Co-authored-by: Viktor Hofer <[email protected]>
|
@ViktorHofer Anything else high-priority? I've opened an issue for follow-up work. |
|
@jkoritzinsky Does this new strategy also look OK to you? I don't think much has changed except including the RID in the list of RuntimeIdentifiers in the first restore, so even if the assets.json is cached, it will still have compatible content. |
src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj
Outdated
Show resolved
Hide resolved
…App.Crossgen2.sfxproj Co-authored-by: Viktor Hofer <[email protected]>
|
@ViktorHofer Done, anything else? |
|
I do have a lot more questions on why we need to restore that project separately outside of the upfront static graph repo restore but I don't think they should block this PR to going in. Just wanted to make sure that you understand that a lazy just-in-time restore is the thing that eventually causes a build to fail in the middle. I saw such cases with the libraries linker tests which do something similar. But we can discuss that in your follow-up issue, if you want to :) |
|
Makes sense. First thing in the follow-up can be to remove the restore. It may no longer be necessary. |
Trying to work through the problems with source build