Skip to content

[release/v7.4.15] Mirror .NET/runtime ICU version range in PowerShell#27138

Merged
adityapatwardhan merged 1 commit intoPowerShell:release/v7.4.15from
adityapatwardhan:backport/release/v7.4.15/26304-bb44aa1bc
Apr 2, 2026
Merged

[release/v7.4.15] Mirror .NET/runtime ICU version range in PowerShell#27138
adityapatwardhan merged 1 commit intoPowerShell:release/v7.4.15from
adityapatwardhan:backport/release/v7.4.15/26304-bb44aa1bc

Conversation

@adityapatwardhan
Copy link
Copy Markdown
Member

Backport of #26304 to release/v7.4.15

Triggered by @adityapatwardhan on behalf of @kasperk81

Original CL Label: CL-BuildPackaging

/cc @PowerShell/powershell-maintainers

Impact

REQUIRED: Choose either Tooling Impact or Customer Impact (or both). At least one checkbox must be selected.

Tooling Impact

  • Required tooling change
  • Optional tooling change (include reasoning)

Updates the Get-PackageDependencies function to use a dynamic ICU version range instead of a hardcoded list. This change applies to deb package dependencies and provides forward compatibility for future ICU releases while maintaining compatibility down to ICU 60.

Customer Impact

  • Customer reported
  • Found internally

Regression

REQUIRED: Check exactly one box.

  • Yes
  • No

This is not a regression.

Testing

Verified that the dynamic ICU version range calculation works correctly with $BuildICUVersion=74 for v7.4.15, generating the expected version range from 60 to 104 for deb packages. This mirrors the .NET runtime approach for broader compatibility with different ICU versions.

Risk

REQUIRED: Check exactly one box.

  • High
  • Medium
  • Low

The change expands the acceptable ICU versions for deb packages from a fixed list to a dynamic range (60-104 for v7.4.15), which increases compatibility without breaking existing functionality. The .NET runtime uses the same approach, providing validation for this pattern.

@adityapatwardhan adityapatwardhan added the CL-BuildPackaging Indicates that a PR should be marked as a build or packaging change in the Change Log label Apr 1, 2026
@adityapatwardhan adityapatwardhan requested a review from a team as a code owner April 1, 2026 22:26
@adityapatwardhan adityapatwardhan added the CL-BuildPackaging Indicates that a PR should be marked as a build or packaging change in the Change Log label Apr 1, 2026
Copilot AI review requested due to automatic review settings April 1, 2026 22:26
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Backports the ICU dependency handling change to release/v7.4.15 by replacing a hardcoded Debian libicuXX alternation list with a computed ICU version range intended to mirror the .NET runtime’s compatibility policy.

Changes:

  • Introduces Min/Build/Max ICU version variables and computes a deb dependency alternation string from a version range.
  • Updates the Debian dependency list to use the computed ICU dependency string instead of a hardcoded set of ICU package names.
  • Adjusts/extends distro branching logic in Get-PackageDependencies (currently includes a duplicated rh branch).
Comments suppressed due to low confidence (1)

tools/packaging/packaging.psm1:2163

  • There are two consecutive elseif ($Distribution -eq 'rh') branches with identical dependency lists; the second one (starting here) is unreachable and looks like an accidental duplication from the backport. Remove the duplicate branch so there is only one rh case.
        } elseif ($Distribution -eq 'rh') {
            $Dependencies = @(
                "openssl-libs",
                "libicu"
            )

# - ICU typically releases about twice per year, so +30 provides roughly
# 15 years of forward compatibility.
# - On some platforms, the minimum supported version may be lower
# than the build version and we know that older versions just works.
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

Grammar in comment: “older versions just works” should be “older versions just work”.

Suggested change
# than the build version and we know that older versions just works.
# than the build version and we know that older versions just work.

Copilot uses AI. Check for mistakes.
Comment on lines +2140 to 2152
$MinICUVersion = 60 # runtime minimum supported
$BuildICUVersion = 74 # current build version for v7.4.15
$MaxICUVersion = $BuildICUVersion + 30 # headroom

if ($Distribution -eq 'deb') {
$Dependencies = @(
"libc6",
"libgcc1",
"libgssapi-krb5-2",
"libstdc++6",
"zlib1g",
"libicu74|libicu72|libicu71|libicu70|libicu69|libicu68|libicu67|libicu66|libicu65|libicu63|libicu60|libicu57|libicu55|libicu52",
(($MaxICUVersion..$MinICUVersion).ForEach{ "libicu$_" } -join '|'),
"libssl3|libssl1.1|libssl1.0.2|libssl1.0.0"
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

The new dynamic ICU dependency range logic isn’t covered by existing Pester tests (see test/packaging/packaging.tests.ps1). Consider adding a test for Get-PackageDependencies -Distribution deb that asserts the generated dependency string includes both the expected min (libicu60) and the computed max (libicu$($BuildICUVersion+30)) to prevent regressions.

Copilot uses AI. Check for mistakes.
@adityapatwardhan adityapatwardhan merged commit 44d1c63 into PowerShell:release/v7.4.15 Apr 2, 2026
44 checks passed
@adityapatwardhan adityapatwardhan deleted the backport/release/v7.4.15/26304-bb44aa1bc branch April 2, 2026 19:28
@kasperk81
Copy link
Copy Markdown
Contributor

Alternative approach to keep it static for official build and automate the update process via PR on monthly basis #27156. The idea is we don't need to remember to update it manually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

5 participants