Skip to content

[release/v7.5] Remove usage of fpm for DEB package generation#26802

Closed
daxian-dbw wants to merge 1 commit intoPowerShell:release/v7.5from
daxian-dbw:backport/release/v7.5/26281-7e1ef1f74
Closed

[release/v7.5] Remove usage of fpm for DEB package generation#26802
daxian-dbw wants to merge 1 commit intoPowerShell:release/v7.5from
daxian-dbw:backport/release/v7.5/26281-7e1ef1f74

Conversation

@daxian-dbw
Copy link
Copy Markdown
Member

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

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

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

  • Customer reported
  • Found internally

Regression

REQUIRED: Check exactly one box.

  • Yes
  • No

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.

  • High
  • Medium
  • Low

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.

@daxian-dbw daxian-dbw requested a review from a team as a code owner February 13, 2026 00:13
Copilot AI review requested due to automatic review settings February 13, 2026 00:13
@daxian-dbw daxian-dbw added the CL-BuildPackaging Indicates that a PR should be marked as a build or packaging change in the Change Log label Feb 13, 2026
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

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-NativeDeb function that uses dpkg-deb directly instead of fpm
  • Removes all Ruby gem installation code (Install-GlobalGem function and fpm installation)
  • Updates Start-PSBootstrap to install dpkg-deb on Mariner and removes Ruby dependencies from Debian/RedHat package lists
  • Adds comprehensive DEB package validation tests to ensure package quality
  • Updates Test-Dependencies to check for dpkg-deb instead of fpm

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

Comment on lines +2255 to 2257

>>>>>>> 7e1ef1f74 (Replace `fpm` with `dpkg-deb` for DEB package generation (#26281))
[string]$Scenario = "Package"
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
>>>>>>> 7e1ef1f74 (Replace `fpm` with `dpkg-deb` for DEB package generation (#26281))
[string]$Scenario = "Package"

Copilot uses AI. Check for mistakes.
$Output = @("Created package {:path=>""$($result.PackageName)""}")
}
catch {
Write-Verbose -Message "!!!Handling error in native DEB creation!!!" -Verbose -ErrorAction SilentlyContinue
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

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

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).

Suggested change
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

Copilot uses AI. Check for mistakes.
@daxian-dbw daxian-dbw closed this Feb 13, 2026
@daxian-dbw daxian-dbw deleted the backport/release/v7.5/26281-7e1ef1f74 branch February 13, 2026 01:11
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.

3 participants