Build self-contained minimal size package for Guest Config team#14976
Build self-contained minimal size package for Guest Config team#14976anmenaga merged 22 commits intoPowerShell:masterfrom
Conversation
|
@daxian-dbw - seems like there are some merge conflicts. please have a look. |
tools/releaseBuild/Images/microsoft_powershell_windowsservercore/PowerShellPackage.ps1
Outdated
Show resolved
Hide resolved
tools/releaseBuild/Images/microsoft_powershell_windowsservercore/PowerShellPackage.ps1
Outdated
Show resolved
Hide resolved
tools/releaseBuild/Images/microsoft_powershell_windowsservercore/PowerShellPackage.ps1
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
I'm not sure. This was existing code, see below:
@TravisEz13, shall we remove $projectAssetsCounter?
global.json
Outdated
There was a problem hiding this comment.
This should not change in this PR right?
There was a problem hiding this comment.
The 21104.4 is not the official .NET 6 preview.1 SDK version. The nuget package versions are all correct, so this is the only place we need to change to make it use the official 6-preview.1 sdk.
tools/releaseBuild/Images/GenericLinuxFiles/PowerShellPackage.ps1
Outdated
Show resolved
Hide resolved
tools/releaseBuild/Images/microsoft_powershell_windowsservercore/PowerShellPackage.ps1
Outdated
Show resolved
Hide resolved
tools/releaseBuild/Images/microsoft_powershell_windowsservercore/PowerShellPackage.ps1
Outdated
Show resolved
Hide resolved
|
Would this PR address this issue #5681 ? |
|
@kilasuit This is considered to be one step toward that goal, but doesn't resolve that issue. This package is produced mainly for using PowerShell in a service, where startup perf is not a concern (thus no R2R/Crossgen) and GUI won't work (thus no WPF/WinForm). |
|
@adityapatwardhan and @rjmholt Thanks for the review! I have addressed or replied to your comments, please take another look. Here is the new release build run: https://dev.azure.com/mscodehub/PowerShellCore/_build/results?buildId=175764&view=results |
After that why do you build self-contained application? With shared framework you could significantly reduce a size of the packages. |
This is a requirement from the Azure Guest Configuration service. There is no shared framework available and the service depends on PS package to bring in the .NET runtime. |
|
@adityapatwardhan please take another look; thank you. |
|
🎉 Handy links: |
PR Summary
This PR includes changes in
Build.psm1,packaging.psm1and the release build template files.For
Build.psm1,-ForMinimalSizeis added toStart-PSBuildto build self-contained application for "linux-x64", "win7-x64", or "osx-x64" runtimes. It reduces the size of package by:For
packaging.psm1,min-sizeis added as a new value for-Typeparameter ofStart-PSPackage.For Windows release build, a new build configuration
minSizeis added, to build and packaging the min-size package.For Linux release build,
-TarMinSizeis added toPowerShellPackage.ps1as well asbuild.jsonto build and package for the min-size package.The min-size package has the
-gcsuffix to indicate that it's for the Guest Config team. In the Azure Blob, the min-size packages are uploaded to the container with the-gcsuffix, not in the main package maintainer (e.g. v7-2-0-preview-4), so that they don't get uploaded to the GitHub release page.Here is the release build run: https://dev.azure.com/mscodehub/PowerShellCore/_build/results?buildId=175764&view=results
The package size is reduced:
PR Context
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:or[ WIP ]to the beginning of the title (theWIPbot will keep its status check atPendingwhile the prefix is present) and remove the prefix when the PR is ready.