[release/v7.4.15] Mirror .NET/runtime ICU version range in PowerShell#27138
Conversation
There was a problem hiding this comment.
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/MaxICU 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 duplicatedrhbranch).
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 onerhcase.
} 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. |
There was a problem hiding this comment.
Grammar in comment: “older versions just works” should be “older versions just work”.
| # than the build version and we know that older versions just works. | |
| # than the build version and we know that older versions just work. |
| $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" |
There was a problem hiding this comment.
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.
|
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. |
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
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
Regression
REQUIRED: Check exactly one box.
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.
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.