-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Replace fpm with native macOS packaging tools (pkgbuild/productbuild) #26268
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>
|
@copilot Add a test to actually package and test the contents of the package in the packaging job in .github/workflows/macos-ci.yml |
Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com>
Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com>
Added comprehensive package creation and validation to the
The validation ensures the new native macOS packaging implementation creates packages with the correct structure and contents. |
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>
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 gem fpm (Effing Package Management) with native macOS packaging tools (pkgbuild and productbuild) from Xcode Command Line Tools for creating macOS PowerShell packages. This eliminates the Ruby dependency on macOS and uses Apple-supported tools for better integration with macOS standards.
Key Changes:
- Created
New-MacOSPackagefunction using nativepkgbuildandproductbuildtools - Refactored
New-MacOsDistributionPackageto be reusable by both legacy and new packaging approaches - Updated all native command invocations to use
Start-NativeExecutionwith proper error handling - Enhanced macOS CI workflow to build, package, and validate packages using Pester tests
- Added comprehensive Copilot instructions for
Start-NativeExecutionusage and NuGet feed configuration
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
tools/packaging/packaging.psm1 |
Added New-MacOSPackage function, refactored New-MacOsDistributionPackage, updated native command execution to use Start-NativeExecution, removed fpm workarounds |
tools/packaging/releaseTests/macOSPackage.tests.ps1 |
New comprehensive Pester test for validating macOS package structure and contents |
.github/workflows/macos-ci.yml |
Enhanced to build PowerShell, create packages, and validate with Pester tests; added public NuGet feed configuration |
docs/maintainers/releasing.md |
Updated documentation to reflect different packaging tools for different platforms |
.github/instructions/start-native-execution.instructions.md |
New comprehensive guide on using Start-NativeExecution for native command execution |
.github/instructions/build-configuration-guide.instructions.md |
Added documentation about Switch-PSNugetConfig usage for CI/CD environments |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com>
|
📣 Hey @@Copilot, how did we do? We would love to hear your feedback with the link below! 🗣️ 🔗 https://aka.ms/PSRepoFeedback |
…PowerShell#26268) 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>
…PowerShell#26268) 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>
…PowerShell#26268) 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>
…PowerShell#26268) 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>
Update macOS packaging to use Xcode command line tools instead of fpm
Summary
This PR replaces the Ruby gem
fpm(Effing Package Management) with native macOS packaging tools (pkgbuildandproductbuild) from Xcode Command Line Tools for creating macOS PowerShell packages.Plan
Changes Made
New Function:
New-MacOSPackage(tools/packaging/packaging.psm1)Created a comprehensive function that uses native macOS packaging tools:
pkgbuildviaStart-NativeExecutionto create a component package from the staged filesNew-MacOsDistributionPackageto create the final distribution package with proper metadataStart-NativeExecutionfor all native commands (chmod, pkgbuild)Refactored
New-MacOsDistributionPackageFunctionModernized and generalized this function to work with component packages from the native tools:
productbuildviaStart-NativeExecutionwith proper distribution XMLNew-MacOSPackageto avoid code duplicationUpdated Packaging Module Initialization
startNativeExecution.ps1to makeStart-NativeExecutionavailableStart-NativeExecutionwith proper error handlingStart-NativeExecutionfor chmod, pkgbuild, productbuild, and pkgutil commandsUpdated
New-UnixPackageFunctionNew-MacOSPackagefor osxpkg type packagesNew-MacOsDistributionPackagesince the new implementation creates distribution packages directlyUpdated
Test-DependenciesFunctionpkgbuildandproductbuildon macOSUpdated Documentation
docs/maintainers/releasing.md: Clarified that different packaging tools are used for different platforms.github/instructions/start-native-execution.instructions.md: Comprehensive guide on usingStart-NativeExecutionfor native command execution in packaging scripts.github/instructions/build-configuration-guide.instructions.md: Added comprehensive documentation aboutSwitch-PSNugetConfigusage, including when and why to use public feeds in CI/CD environmentsEnhanced macOS CI Workflow (.github/workflows/macos-ci.yml)
Switch-PSNugetConfig -Source Publicto use public NuGet feeds (required for CI environments)-SkipReleaseChecksflag toStart-PSPackageto bypass repo path validation in CI.github/actions/test/process-pester-resultsaction for proper test result publishing and aggregationNew Pester Test (tools/packaging/releaseTests/macOSPackage.tests.ps1)
Created comprehensive Pester-based validation test:
Start-NativeExecutionfor pkgutil command to ensure proper error handlingKey Benefits
process-pester-resultsaction for consistent test result publishing across the repositoryNew-MacOsDistributionPackageto be reusable by both legacy and new packaging approachesStart-NativeExecutionfor all native command execution with proper error handling and diagnosticsTesting
The macOS CI workflow now includes comprehensive testing that:
Switch-PSNugetConfig -Source Public)-SkipReleaseChecksto bypass repo path validation (CI repos are not at /PowerShell)tools/packaging/releaseTests/macOSPackage.tests.ps1) using TestDrive for temporary directories${{ runner.workspace }}/testResults.github/actions/test/process-pester-resultsaction to aggregate, summarize, and upload test resultsOriginal prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.