Fix postPackage hook to remove non-native SITL binaries from macOS builds #2508
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