Fix postPackage hook to remove non-native SITL binaries from macOS builds#2508
Merged
sensei-hacker merged 2 commits intoiNavFlight:maintenance-9.xfrom Jan 13, 2026
Conversation
…ilds The postPackage hook was using the wrong path for macOS app bundles, causing it to fail to find and remove non-native SITL binaries. Problem: - macOS DMG packages included Windows SITL binaries (cygwin1.dll, inav_SITL.exe) - These should have been removed by the postPackage hook - Hook was looking at outputPath/resources/sitl (incorrect for macOS) - Actual macOS location: <app>/Contents/Resources/sitl Root Cause: - macOS app bundles have structure: INAV Configurator.app/Contents/Resources/ - Windows/Linux packages: <outputPath>/resources/ - Hook used same path for all platforms (outputPath/resources/sitl) Fix: - Use different path construction based on platform: - macOS (darwin): <outputPath>/Contents/Resources/sitl - Windows/Linux: <outputPath>/resources/sitl - Added console.log statements for debugging build process Impact: - macOS DMG will now correctly contain only darwin SITL binaries - Reduces package size (no unnecessary Windows/Linux binaries) - Consistent with Windows/Linux builds which already work correctly Testing: - Requires macOS build to verify DMG no longer contains windows/ directory - Logic verified for all three platforms (darwin, win32, linux) - Console logging added to aid verification 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
The previous fix used the wrong path for macOS app bundles. It was missing the .app directory name in the path construction. Problem: - Was looking for: <outputPath>/Contents/Resources/sitl - Actual location: <outputPath>/<AppName>.app/Contents/Resources/sitl Fix: - Dynamically find the .app bundle in outputPath - Construct correct path with .app directory included This should now properly remove non-native SITL binaries from macOS builds.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix the
postPackagehook inforge.config.jsto properly remove non-native SITL binaries from macOS DMG packages.Problem
macOS DMG packages were including Windows SITL binaries that should have been removed:
INAV Configurator.app/Contents/Resources/sitl/windows/cygwin1.dllINAV Configurator.app/Contents/Resources/sitl/windows/inav_SITL.exeThis unnecessarily increased DMG file size and was inconsistent with the intended behavior.
Root Cause
The
postPackagehook was using the same path structure for all platforms:<outputPath>/resources/sitl<app>/Contents/Resources/sitl<outputPath>/resources/sitl✓macOS app bundles have a different structure (
App.app/Contents/Resources/) compared to Windows/Linux packages, so the hook couldn't find the SITL directory and failed silently.Changes
<outputPath>/Contents/Resources/sitl<outputPath>/resources/sitlTesting
Since this requires a macOS build environment to fully test:
linux/andwindows/directories from macOS buildsExpected result after build:
sitl/darwin/directorysitl/windows/directorysitl/linux/directory (with correct architecture)Impact