-
Notifications
You must be signed in to change notification settings - Fork 8.1k
[release/v7.6] Remove usage of fpm for DEB package generation #26504
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[release/v7.6] Remove usage of fpm for DEB package generation #26504
Conversation
There was a problem hiding this 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 PR backports changes from #26281 to the release/v7.6 branch, removing the Ruby gem dependency (fpm, dotenv, ffi, rexml) for Linux package creation and replacing it with native packaging tools. DEB packages now use dpkg-deb, RPM packages use rpmbuild, and macOS packages use pkgbuild/productbuild.
Key changes:
- Removed
Install-GlobalGemfunction and all fpm-related installation code frombuild.psm1 - Added
New-NativeDebfunction to create DEB packages using native dpkg-deb - Added
New-MacOSPackagefunction to create macOS packages using native pkgbuild/productbuild - Updated
Start-PSBootstrapto check for and install dpkg-deb and rpmbuild instead of Ruby gems - Updated test expectations to require packages rather than skipping when not found
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 13 comments.
| File | Description |
|---|---|
| tools/packaging/packaging.psm1 | Replaces fpm-based package generation with native tools: adds New-NativeDeb for DEB packages, New-MacOSPackage for macOS packages, and removes fpm-specific workarounds and the Get-FpmArguments function |
| build.psm1 | Removes Ruby gem installation (Install-GlobalGem function), updates bootstrap to check for native packaging tools (dpkg-deb, rpmbuild), and adds new bootstrap scenarios ('Tools', 'All') |
| test/packaging/linux/package-validation.tests.ps1 | Adds DEB package validation tests and changes from skipping when packages are missing to requiring packages to exist |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| $distributionPackage = New-MacOsDistributionPackage ` | ||
| -ComponentPackage (Get-Item $componentPkgPath) ` | ||
| -PackageName $Name ` | ||
| -Version $Version ` | ||
| -OutputDirectory $CurrentLocation ` | ||
| -HostArchitecture $HostArchitecture ` | ||
| -PackageIdentifier $pkgIdentifier ` | ||
| -IsPreview:($Name -like '*-preview') |
Copilot
AI
Nov 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The New-MacOSPackage function calls New-MacOsDistributionPackage with parameters (-ComponentPackage, -PackageName, -Version, -OutputDirectory, -PackageIdentifier) that don't match the function's signature. The existing New-MacOsDistributionPackage function (line 1458) only accepts -FpmPackage, -HostArchitecture, and -IsPreview parameters.
The comment at line 2042 mentions "using the refactored function", which suggests that New-MacOsDistributionPackage should have been refactored as part of this PR to accept the new parameter set, but this refactoring appears to be missing.
This will cause a runtime error when attempting to create macOS packages since PowerShell will complain about unrecognized parameters.
93d230d to
c95e9c1
Compare
|
Branch updated with prerequisite PR #26326 This backport was failing due to missing prerequisite PR #26326 (log grouping functions). PR #26326 has now been merged to v7.6 via PR #26524. Conflict Resolution:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 8 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@copilot open a new pull request to apply changes based on the comments in this thread |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
SeeminglyScience
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
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
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
Regression
REQUIRED: Check exactly one box.
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.
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.