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
Turn on ReadyToRun
#12361
Turn on ReadyToRun
#12361
Conversation
We should disable the crossgen, but only for our binaries... let me see if I can do this change... |
I need to do some testing. |
@daxian-dbw FYI |
} | ||
|
||
$fullAssemblyList = $commonAssembliesForAddType + $psCoreAssemblyList | ||
$fullAssemblyList = $commonAssembliesForAddType |
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 seems we should disable Start-CrossGen function.
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 should probably disable Start-CrossGen
until we can verify PublishReadyToRun is a good replacement
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.
Done.
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.
CrossGen and ReadyToRun are the same thing, well, it's a switch to crossgen.
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 can use set COMPlus_ReadyToRunLogFile=log.txt
from issue I referenced above to check dll-s. Start-CrossGen does not create R2R dll-s.
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.
@iSazonov crossgen with a switch is what is used to generate readytorun binaries in the dotnet project
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.
And I switched us to that method, but per DotNet we need to use the csproj if we want our symbols to work: https://github.com/PowerShell/PowerShell/blob/master/build.psm1#L2217
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.
But can your explain why crossgen should be disabled on the rest of the binaries?
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 forgot that we also crossgen assemblies not part of the build that we include in the package. We should probably still crossgen those.
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.
This make sense for third-party assemblies. For PSReadline and MI we could move to R2R format.
@iSazonov crossgen with a switch is what is used to generate readytorun binaries in the dotnet project
With set COMPlus_ReadyToRunLogFile=log.txt
logs show that after Start-CrossGen our dll-s are not initialized as R2R but with PublishReadyToRun are initialized.
34ce76f
to
85fe743
Compare
build.psm1
Outdated
Write-Log "Run ResGen (generating C# bindings for resx files)" | ||
Start-ResGen | ||
} | ||
# TODO: remove Start-ResGen after testing ReadyToRun |
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.
Please revert this change. This is the wrong PR
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.
Oops, sorry.
This reverts commit 948b5f8.
@iSazonov You reverted a commit and then applied the same commit again. |
build.psm1
Outdated
@@ -2233,6 +2233,9 @@ function Start-CrossGen { | |||
$CrossgenPath | |||
) | |||
|
|||
# TODO: remove Start-CrossGen after testing ReadyToRun. | |||
return |
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.
This isn't true, and we should still crossgen the un-optimized binaries.
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.
Please address changes. I made ALL the needed changes the the crossgen function. Please revert back to my commit.
@PoshChan Please remind me in 1 hour |
If we need to disable crossgen on the other assemblies, please submit a separate PR. Combining items in PRs makes it difficult if we need to backport. |
@TravisEz13, this is the reminder you requested 1 hour ago |
I have only question about PSRL and MI. We could make it readytorun in their repos. If yes I can open tracking issues. Thoughts? |
I think it's bad practices in publish the readytorun in the nuget. But I would open a new issue, and just be sure to ask that question. |
"At present, libraries can only be R2R compiled as part of an application, not for delivery as a NuGet package."
|
In our publish folder we get .Net dll-s in R2R format and trace shows this. If we compiled them locally into this format, then PSRL and MI would also be converted in it. Yes? It makes me think that we get them already in R2R format and I'd expect we could get PSRL and MI in R2R format too. |
🎉 Handy links: |
PR Summary
Turn on ReadyToRun for PowerShell dll-s.
We can use dotnet/runtime#35062 (comment) to check dll-s.
PR Context
Now all .Net dll-s is in ReadyToRun format and PowerShell distributive doubled in size. So we can turn on the feature too. It will add ~20Mb (10%).
Docs https://docs.microsoft.com/en-us/dotnet/core/whats-new/dotnet-core-3-0#readytorun-images
PR Checklist
.h
,.cpp
,.cs
,.ps1
and.psm1
files have the correct copyright headerWIP:
or[ WIP ]
to the beginning of the title (theWIP
bot will keep its status check atPending
while the prefix is present) and remove the prefix when the PR is ready.