[release/v7.5] Remove usage of fpm for DEB package generation#26802
[release/v7.5] Remove usage of fpm for DEB package generation#26802daxian-dbw wants to merge 1 commit intoPowerShell:release/v7.5from
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request is a backport of #26281 to the release/v7.5 branch, which removes the Ruby-based fpm tool dependency for DEB package generation and replaces it with native dpkg-deb. This change eliminates the need for Ruby and its gems (dotenv, ffi, fpm, rexml), simplifying the build toolchain and improving maintainability by using system-native packaging tools.
Changes:
- Implements a new
New-NativeDebfunction that usesdpkg-debdirectly instead offpm - Removes all Ruby gem installation code (
Install-GlobalGemfunction and fpm installation) - Updates
Start-PSBootstrapto installdpkg-debon Mariner and removes Ruby dependencies from Debian/RedHat package lists - Adds comprehensive DEB package validation tests to ensure package quality
- Updates
Test-Dependenciesto check fordpkg-debinstead offpm
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| tools/packaging/packaging.psm1 | Adds New-NativeDeb function (217 lines) that builds DEB packages natively; removes Get-FpmArguments function (146 lines); updates Test-Dependencies to check for dpkg-deb instead of fpm; updates New-UnixPackage to call New-NativeDeb for 'deb' type |
| build.psm1 | Removes Install-GlobalGem function and all fpm gem installation code; updates Start-PSBootstrap parameter validation to include "Tools" and "All" scenarios; removes Ruby dependencies from package manager install lists; adds dpkg-deb installation logic for Debian/Mariner systems; contains unresolved merge conflict |
| test/packaging/linux/package-validation.tests.ps1 | Adds comprehensive DEB package name validation tests; changes RPM and tar.gz tests to fail when no packages found instead of skipping |
|
|
||
| >>>>>>> 7e1ef1f74 (Replace `fpm` with `dpkg-deb` for DEB package generation (#26281)) | ||
| [string]$Scenario = "Package" |
There was a problem hiding this comment.
Merge conflict markers are still present in the code. Line 2256 contains a Git conflict marker ">>>>>>> 7e1ef1f" and line 2257 has a duplicate parameter declaration for $Scenario. This will cause the code to fail when executed. Remove the conflict markers and the duplicate line 2257.
| >>>>>>> 7e1ef1f74 (Replace `fpm` with `dpkg-deb` for DEB package generation (#26281)) | |
| [string]$Scenario = "Package" |
| $Output = @("Created package {:path=>""$($result.PackageName)""}") | ||
| } | ||
| catch { | ||
| Write-Verbose -Message "!!!Handling error in native DEB creation!!!" -Verbose -ErrorAction SilentlyContinue |
There was a problem hiding this comment.
The error handling for DEB package creation is incomplete. The catch block logs an error message but doesn't re-throw the exception like the RPM and macOS package creation do. This will cause errors to be silently swallowed. Add Get-Error -InputObject $_ and throw statements to match the error handling pattern used in the RPM block (lines 1312-1317) and macOS block (lines 1372-1374).
| Write-Verbose -Message "!!!Handling error in native DEB creation!!!" -Verbose -ErrorAction SilentlyContinue | |
| Write-Verbose -Message "!!!Handling error in native DEB creation!!!" -Verbose -ErrorAction SilentlyContinue | |
| Get-Error -InputObject $_ | |
| throw |
Backport of #26281 to release/v7.5
Triggered by @daxian-dbw on behalf of @app/copilot-swe-agent
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
This change removes the Ruby-based fpm tool and uses native dpkg-deb for DEB package generation. It eliminates the Ruby dependency and uses system tools for better maintainability.
Customer Impact
Regression
REQUIRED: Check exactly one box.
This is not a regression.
Testing
Comprehensive package validation tests added to verify DEB package structure and contents. Already validated in master, 7.4, and 7.6 branches.
Risk
REQUIRED: Check exactly one box.
This change removes the Ruby gem fpm dependency and uses native dpkg-deb for DEB package generation. It's been tested in master, 7.4, and 7.6 branches with validation tests to ensure package quality.
Merge Conflicts
Resolved conflicts in build.psm1: added new scenarios (Tools, All) to ValidateSet and removed fpm installation code in favor of dpkg-deb.