-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Replace fpm with native rpmbuild for RPM package generation #26233
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
Conversation
Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com>
Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com>
Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com>
|
@copilot update the linux packaging job in the github workflow to run with packaging.psm1 changes similar to the pattern in the windows packaging job in that workflow |
This ensures the RPM packaging changes (rpmbuild instead of fpm) are properly loaded in the Linux packaging GitHub Actions workflow, similar to how the Windows packaging workflow imports modules. Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com>
Updated the Linux packaging action to explicitly import both build.psm1 and packaging.psm1 modules, similar to the Windows packaging workflow pattern. This ensures the RPM packaging changes (rpmbuild instead of fpm) are properly loaded during the CI build process. Changes made in commit: Will be in the next commit |
|
@copilot the job to test this change isn't even being triggered. Look at the windows packaging job conditions here |
- Add packagingChanged output to changes job (matching Windows CI pattern) - Update linux_packaging job to only run when packagingChanged == 'true' - Remove ci_build dependency from linux_packaging job (matching Windows CI pattern) This ensures the Linux packaging job runs when packaging-related files change (tools/packaging/, build.psm1, etc.) similar to how the Windows packaging job is triggered. Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com>
Updated the Linux CI workflow to match the Windows CI pattern:
The packaging job will now run when packaging-related files change (tools/packaging/, build.psm1, etc.), including this PR's changes to packaging.psm1. Changes in commit: 21511f9 (previous) and the current commit |
The Linux packaging job requires ci_build as a dependency to ensure the build artifacts are available before packaging. Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com>
|
@copilot and linux failed with |
1. macOS issue: Fixed IsDebianFamily check by adding IsLinux condition - IsDebianFamily property only exists on Linux systems - Now checks ($environment.IsLinux -and $environment.IsDebianFamily) 2. Linux RPM issue: Fixed version formatting for RPM spec files - RPM spec files don't allow hyphens in Version field - Split version like "7.6.0-preview.6" into Version: 7.6.0 and Release: 1.preview.6 - Pre-release identifier moved from Version to Release field per RPM conventions Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com>
... Fixed both issues:
The version parsing correctly handles both stable versions (e.g., "7.6.0") and pre-release versions (e.g., "7.6.0-preview.6"). |
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 replaces the Ruby-based fpm tool with native rpmbuild for generating RPM packages, eliminating Ruby dependencies on RPM-based Linux systems while maintaining backward compatibility for DEB and macOS package builds.
Key Changes:
- Implemented native RPM spec file generation and rpmbuild integration
- Added cross-architecture build support with proper binary stripping configuration
- Created automated package validation tests using Pester
- Updated CI workflows to handle packaging changes and multi-CI environment support
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/packaging/packaging.psm1 | Added New-RpmSpec function to generate RPM spec files; updated New-UnixPackage to use rpmbuild for RPM packages; modified Test-Dependencies to skip fpm check on RPM systems |
| tools/ci.psm1 | Updated New-LinuxPackage to support both GitHub Actions and Azure DevOps artifact directories |
| test/packaging/linux/package-validation.tests.ps1 | Created Pester tests to validate RPM and tar.gz package naming conventions |
| build.psm1 | Updated Start-PSBootstrap to install fpm only on DEB/macOS systems and ensure rpmbuild is available on RPM systems |
| .github/workflows/linux-ci.yml | Added packagingChanged output to trigger packaging job on packaging-related changes |
| .github/actions/test/linux-packaging/action.yml | Added explicit module imports and package validation test step |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
daxian-dbw
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!
|
📣 Hey @@Copilot, how did we do? We would love to hear your feedback with the link below! 🗣️ 🔗 https://aka.ms/PSRepoFeedback |
…ll#26233) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com> Co-authored-by: Travis Plunk <travis.plunk@microsoft.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ll#26233) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com> Co-authored-by: Travis Plunk <travis.plunk@microsoft.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ll#26233) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com> Co-authored-by: Travis Plunk <travis.plunk@microsoft.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ll#26233) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com> Co-authored-by: Travis Plunk <travis.plunk@microsoft.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Summary
Successfully replaced the Ruby gem
fpmwith nativerpmbuildfor generating RPM packages, eliminating the need for Ruby and associated gems when building RPM packages on RHEL, CentOS, Fedora, SUSE, and Azure Linux systems.Changes Made
Modified Files
build.psm1- Updated bootstrap logic to install fpm on Debian/macOS/Mariner, added Azure Linux supporttools/packaging/packaging.psm1- Implemented native rpmbuild support with well-documented cross-architecture build fixestools/ci.psm1- Fixed package artifacts handling for GitHub Actions.github/actions/test/linux-packaging/action.yml- Updated to explicitly import packaging modules and run validation tests.github/workflows/linux-ci.yml- Updated to trigger packaging job for packaging changesCreated Files
test/packaging/linux/package-validation.tests.ps1- Added Pester tests for package name validationKey Features
1. New-RpmSpec Function
2. Updated New-UnixPackage Function
SPECS,RPMS,BUILDROOT)3. Updated Test-Dependencies Function
4. Updated Start-PSBootstrap Function
5. Updated Linux Packaging Workflow
6. Updated Linux CI Workflow
packagingChangedoutput to changes detection joblinux_packagingjob to trigger on packaging-related changesci_builddependency to ensure build artifacts are available7. Updated New-LinuxPackage Function
8. Added Package Validation Tests
Benefits
✅ Eliminates Ruby dependency - No need for Ruby or gems on RPM-based systems (except Mariner which also builds DEBs)
✅ Native tooling - Uses standard Linux packaging tools (rpmbuild)
✅ Reduced complexity - Simpler build requirements on RHEL/CentOS/Fedora/SUSE
✅ Faster builds - No Ruby environment setup needed for pure RPM systems
✅ Backward compatible - DEB and macOS packaging unchanged
✅ Well tested - Comprehensive tests validate spec generation and RPM building
✅ CI/CD ready - Workflows updated to properly detect and run packaging jobs
✅ RPM compliant - Follows RPM spec file conventions for version formatting
✅ Cross-architecture support - Supports building arm64 RPMs on x86_64 systems without strip errors
✅ Multi-CI support - Works with both GitHub Actions and Azure DevOps
✅ Package validation - Automated Pester tests ensure package names meet requirements
✅ Better debugging - Spec file logging with collapsible GitHub Actions groups
✅ Accurate release field - Distribution appears in both release field and filename
✅ Azure Linux ready - Full support for CBL-Mariner systems for both DEB and RPM builds
✅ Well documented - Clear comments with links to RPM documentation
Testing
Created and executed comprehensive tests:
rpm -qipandrpm -qlpCode Statistics
Security Summary
No security vulnerabilities introduced:
Ready for Review ✅
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.