Ship localized reosurces only for MSIX packages#27725
Open
daxian-dbw wants to merge 3 commits into
Open
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the build and packaging pipeline to reduce shipped package size by limiting localized satellite assemblies to MSIX scenarios, while also fixing min-size builds to run as self-contained deployments.
Changes:
- Adjust
Start-PSBuildto default to producing localized satellite assemblies only for MSIX-relevant Windows RIDs, with a new override switch. - Disable ReadyToRun for
min-size(minimal size) self-contained builds. - Update packaging to strip unneeded files (
.pdb,.xml) and remove localized resource folders from Windows ZIP packages; includes cleanup/removal of unused packaging code.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/packaging/packaging.psm1 | Removes unused symbols/ref-assembly logic, strips .xml/.pdb by default, and removes/validates localization folders for ZIP packaging. |
| PowerShell.Common.props | Skips R2R for self-contained min-size builds via ForMinimalSize MSBuild property. |
| build.psm1 | Adds -ForceProduceLocalizedResources and updates publish arguments to restrict satellite assembly generation by default. |
| assets/AppxManifest.xml | Expands MSIX resource language declarations (and normalizes en-US casing). |
| .pipelines/templates/windows-hosted-build.yml | Removes extra blank lines (no functional change). |
Comments suppressed due to low confidence (3)
tools/packaging/packaging.psm1:179
- Inside the precheck failure path,
$Script:Optionsmay be $null (it’s one of the conditions in$precheckFailed), but the subsequent diagnostics dereference$Script:Options.Configuration/.Frameworkunconditionally. That will throw a null-reference error instead of emitting the intended warnings and guidance.
if ($Script:Options.Configuration -ne $Configuration) {
Write-Warning -Message "Start-PSPackage: Build configuration is incorrect: Expected: $Configuration Actual: $($Script:Options.Configuration)"
}
if ($Script:Options.Framework -ne $script:netCoreRuntime) {
Write-Warning -Message "Start-PSPackage: Build .NET version is incorrect: Expected: $($script:netCoreRuntime) Actual: $($Script:Options.Framework)"
tools/packaging/packaging.psm1:200
- This error path both dereferences
$Script:Options(which can be $null in the precheck failure case) and formats the warning message incorrectly (missing closing quote and array formatting). The result can be an unrelated exception or confusing guidance.
$params += '-Configuration', $Configuration
$actualParams += '-Configuration ' + $Script:Options.Configuration
Write-Warning "Build started with unexpected parameters 'Start-PSBuild $actualParams"
throw "Please ensure you have run 'Start-PSBuild $params'!"
tools/packaging/packaging.psm1:2505
- Typo in comment: "pacakge" → "package".
# The 'win-x64/x86/arm64' builds contain localized resources, but we ship localized resources for MSIX pacakge only.
# So, for their zip packages, we need to remove the resource folders before creating the zip package.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Summary
It will be easier to review this PR by ignoring the whitespaces: https://github.com/PowerShell/PowerShell/pull/27725/changes?w=1
The changes are mainly:
min-sizewithSelfContainedapp deployment and only make sure R2R is disabled for it. This fixes themin-sizebuild to allowpwshrun as a self-contained application.Start-PSBuildto only produce localized resources (satellite assemblies) forwin7-x64,win7-x86, andwin-arm64by default. This is because we will only ship localized resources for MSIX package. For the rest packages, we only support the defaulten-US, because this can reduce the package size by27 mbtoday, and another8 mbafter PowerShell resources are localized.-ForceProduceLocalizedResourcestoStart-PSBuild, to allow one to force produce the satellite assemblies for a build.*.xmlfile too inUpdate-PSSignedBuildFolder. Both.pdband.xmlfiles are not needed for packaging. This reduces package size by10.2 mb.win-x64,win-x86, andwin-arm64.packaging.psm1-IncludeSymbolsparameter fromStart-PSPackage. Symbol package is created in Coordinate-Binary build pipeline now, not in packaging pipeline. This parameter is not used anywhere in PowerShell repo. Also, it's already broken because it depends on the filetools\releaseBuild\signing.xml, which has already been deleted.New-ReferenceAssemblyfunction and its helpers. They are no longer used for.nupkgpackage creation.Build test runs
binary build -- https://dev.azure.com/mscodehub/PowerShellCore/_build/results?buildId=700492&view=results
package build -- https://dev.azure.com/mscodehub/PowerShellCore/_build/results?buildId=700553&view=results
The package build failed because the "MSIX Bundle" stage expects to get the release version from the branch name, but the branch name I used for the test is not in the expected form (
release/vd.d.d).PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright header