[release/v7.6] Remove usage of fpm for DEB package generation by TravisEz13 · Pull Request #26504 · PowerShell/PowerShell

Backport of #26281 to release/v7.6

Triggered by @TravisEz13 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 backport changes the build dependencies from Ruby gems (fpm, dotenv, ffi, rexml) to native packaging tools (dpkg-deb for Debian-based systems, rpmbuild for RPM-based systems). Build agents and developers will no longer need Ruby gem installation for package creation. The Start-PSBootstrap function now checks for dpkg-deb and rpmbuild availability instead of installing fpm gems.

Customer Impact

  • Customer reported
  • Found internally

Regression

REQUIRED: Check exactly one box.

  • Yes
  • No

This is not a regression.

Testing

This backport was tested by verifying that the original PR successfully removed the Ruby gem dependency on fpm and replaced it with native dpkg-deb for DEB packages. The changes were validated against the release/v7.6 branch. Cherry-pick resulted in merge conflicts in build.psm1 and tools/packaging/packaging.psm1, which were resolved by accepting all THEIRS changes to fully implement the infrastructure change.

Risk

REQUIRED: Check exactly one box.

  • High
  • Medium
  • Low

This is an infrastructure change that replaces Ruby gem dependencies (fpm) with native Linux packaging tools (dpkg-deb for DEB, rpmbuild for RPM). While this significantly changes the build tooling, it simplifies the dependency chain and uses well-tested system tools. The change has been proven stable in the master branch and the risk is mitigated by the fact that it removes external dependencies rather than adding them.

Merge Conflicts

Conflicts occurred in 2 files during cherry-pick: 1) build.psm1 (2 conflicts): Conflict 1 expanded ValidateSet parameter to include 'Tools' and 'All' options with documentation comments. Conflict 2 replaced Install-GlobalGem calls for Ruby gems with native tool checks for rpmbuild and dpkg-deb. 2) tools/packaging/packaging.psm1 (7 conflicts): Removed fpm-specific macOS symlink workaround, replaced Get-FpmArguments function (146 lines) with New-NativeDeb function implementing dpkg-deb packaging, added New-MacOSPackage function for native macOS packaging, updated Test-Dependencies to check for dpkg-deb instead of fpm. All conflicts were resolved by accepting THEIRS changes to fully implement the native packaging infrastructure.