Skip to content

Commit 37d6a37

Browse files
authored
Fix the macOS app not finding librtcheck.dylib, and smoke test the release zips (#197)
* Fix the macOS app not finding librtcheck.dylib outside the build tree, and smoke test the release zips * Smoke test: hide the build's rtcheck directory so the bundled dylib must be found
1 parent 72fe1cd commit 37d6a37

3 files changed

Lines changed: 24 additions & 0 deletions

File tree

‎.github/workflows/build.yaml‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,24 @@ jobs:
166166
working-directory: ${{ env.APP_DIR }}
167167
run: 7z a -aoa -tzip ${{ env.ZIP_FILE_NAME }} ${{ matrix.app }}
168168

169+
# Run the packaged app away from the build tree, as a user would, so anything
170+
# that only resolves on the build machine (e.g. a dylib rpath) fails here
171+
# rather than in a published release.
172+
- name: Smoke test the zip
173+
shell: bash
174+
run: |
175+
# The macOS binary also has the build tree's rtcheck directory as an rpath,
176+
# which exists on this runner but not on a user's machine, so hide it to
177+
# make sure the dylib bundled in the app is the one that's found.
178+
rtcheck_build="$PWD/${{ env.BUILD_DIR }}/_deps/rtcheck-build"
179+
if [ -d "$rtcheck_build" ]; then mv "$rtcheck_build" "$rtcheck_build.hidden"; fi
180+
181+
mkdir -p "$RUNNER_TEMP/smoke"
182+
7z x -y -o"$RUNNER_TEMP/smoke" "${{ env.APP_DIR }}/${{ env.ZIP_FILE_NAME }}" > /dev/null
183+
cd "$RUNNER_TEMP/smoke"
184+
chmod +x ${{ matrix.test-binary }}
185+
${{ matrix.test-binary }} --version
186+
169187
- name: Upload zip files
170188
uses: actions/upload-artifact@v4
171189
with:

‎CHANGELIST.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
- Fixed false failures in the "Plugin state restoration" test where the first parameter was compared against the last value sent by a previous test rather than the plugin's own value
2222
- Below strictness level 8, two-step (on/off) parameters are now only sent 0 or 1 when tests randomise parameter values. Arbitrary values are still sent to them at level 8 and above, and to all other parameters at every level
2323
- Fixed the "Plugin state restoration" test's exact binary state comparison never running. It was documented as running at strictness level 8 and above but checked the test's own level instead of the run's
24+
- Fixed the macOS app failing to start on any machine other than the one that built it ("Library not loaded: @rpath/librtcheck.dylib"); this affected the `v2.0.0-beta1` and `v2.0.0-beta2` releases
2425
- Enabled the editor stress and extreme (real-time allocation / oversized block) tests that were present in the source tree but had not been compiled into the build
2526

2627
### 1.0.5

‎CMakeLists.txt‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,11 @@ if (PLUGINVAL_ENABLE_RTCHECK)
238238
rtcheck)
239239

240240
if (APPLE)
241+
# The dylib is copied into the app bundle (below), so also look for it there.
242+
# Otherwise the only rpath is the build tree's, and the app only starts on the
243+
# machine that built it.
244+
set_target_properties(pluginval PROPERTIES BUILD_RPATH "@executable_path/../Libraries")
245+
241246
add_custom_command(TARGET pluginval POST_BUILD
242247
COMMAND ${CMAKE_COMMAND} -E echo "Executable path: $<TARGET_FILE_DIR:pluginval>")
243248
add_custom_command(TARGET pluginval POST_BUILD

0 commit comments

Comments
 (0)