Skip to content

Ship localized reosurces only for MSIX packages#27725

Open
daxian-dbw wants to merge 3 commits into
PowerShell:masterfrom
daxian-dbw:loc-pkg
Open

Ship localized reosurces only for MSIX packages#27725
daxian-dbw wants to merge 3 commits into
PowerShell:masterfrom
daxian-dbw:loc-pkg

Conversation

@daxian-dbw

@daxian-dbw daxian-dbw commented Jul 23, 2026

Copy link
Copy Markdown
Member

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:

  1. Build min-size with SelfContained app deployment and only make sure R2R is disabled for it. This fixes the min-size build to allow pwsh run as a self-contained application.
  2. Update Start-PSBuild to only produce localized resources (satellite assemblies) for win7-x64, win7-x86, and win-arm64 by default. This is because we will only ship localized resources for MSIX package. For the rest packages, we only support the default en-US, because this can reduce the package size by 27 mb today, and another 8 mb after PowerShell resources are localized.
  3. Add -ForceProduceLocalizedResources to Start-PSBuild, to allow one to force produce the satellite assemblies for a build.
  4. Remove *.xml file too in Update-PSSignedBuildFolder. Both .pdb and .xml files are not needed for packaging. This reduces package size by 10.2 mb.
  5. Remove localized resources (satellite assemblies) from the ZIP packages for win-x64, win-x86, and win-arm64.
  6. Clean up packaging.psm1
    • Remove the unused -IncludeSymbols parameter from Start-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 file tools\releaseBuild\signing.xml, which has already been deleted.
    • Remove the New-ReferenceAssembly function and its helpers. They are no longer used for .nupkg package 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

@daxian-dbw
daxian-dbw requested review from a team and jshigetomi as code owners July 23, 2026 23:24
Copilot AI review requested due to automatic review settings July 23, 2026 23:24
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-PSBuild to 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:Options may be $null (it’s one of the conditions in $precheckFailed), but the subsequent diagnostics dereference $Script:Options.Configuration/.Framework unconditionally. 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.

Comment thread tools/packaging/packaging.psm1
Comment thread tools/packaging/packaging.psm1 Outdated
Comment thread build.psm1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backport-7.6.x-Consider CL-BuildPackaging Indicates that a PR should be marked as a build or packaging change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants