Skip to content

fix(cpn): restore macOS deployment target for Companion and simulator plugins - #7737

Merged
pfeerick merged 2 commits into
pfeerick/backport-2.12.4from
fix/cpn-macos-deployment-target
Sep 1, 2026
Merged

pfeerick merged 2 commits into
pfeerick/backport-2.12.4from
fix/cpn-macos-deployment-target

Conversation

@pfeerick

@pfeerick pfeerick commented Aug 31, 2026 •

Copy link
Copy Markdown
Member

Fixes #7732 — Companion 2.12.3 will not start on macOS below 15 ("The application requires macOS 15.0 or later").

What actually broke

Reading LC_BUILD_VERSION out of the shipped DMGs:

binary 2.12.2 2.12.3
companion executable minos 10.15 minos 15.0
51 / 55 libedgetx-*-simulator.dylib minos 10.15 minos 15.0
bundled libSDL2-2.0.0.dylib / libSDL3.dylib 14.0 (brew, x86_64 only) 11.0, universal ✅
Qt frameworks 12.0 12.0

This is not the SDL3 packaging work (#7549, #7653) — the bundled SDL copies are correct. Everything EdgeTX itself compiles lost its deployment target and got the Xcode 16 SDK default of 15.0. MacOSXBundleInfo.plist.in has no LSMinimumSystemVersion, so LaunchServices falls back to the executable's minos, which is where the error text comes from verbatim.

Root cause

build-companion.sh passes -DCMAKE_OSX_DEPLOYMENT_TARGET only to the top-level superbuild. Companion and the plugins are compiled in the native ExternalProject, which only receives variables the forwarding loop collects by matching the helpstring "No help, variable specified on the command line.". CMake's Platform/Darwin-Initialize.cmake re-declares that variable as a documented cache entry, replacing the helpstring — so the loop skips it and the flag never reaches the compiler. Confirmed against CMake 3.31.6 and 4.3.3.

main is unaffected: it configures the native build directly (cmake -B native -S ... -DEdgeTX_SUPERBUILD:BOOL=0), and its artifact is minos 11.0.

Changes

  • tools/build-companion.sh — export MACOSX_DEPLOYMENT_TARGET, which Darwin-Initialize.cmake reads on every configure including nested ones.
  • CMakeLists.txt — forward CMAKE_OSX_DEPLOYMENT_TARGET explicitly through CMAKE_CACHE_ARGS (native only; irrelevant to the ARM cross build).
  • Target 12.0 rather than 11.0 — Qt 6.9's frameworks are minos 12.0, so the bundle already cannot start below macOS 12, which is what the 2.12.3 release note tells users. One number instead of three. Nobody loses access. SDL stays at 11.0 (lower is safe, and it keeps the CI cache key intact).
  • MacOSXBundleInfo.plist.in — declare LSMinimumSystemVersion, so macOS 11 gets a clear dialog instead of an opaque dyld failure.
  • CMakeLists.txt, separate defect — LIST_SEPARATOR + ; escaping when building CMAKE_ARGS. -DCMAKE_PREFIX_PATH='<qt>;<sdl>' was splitting into a truncated -DCMAKE_PREFIX_PATH=<qt> plus a stray positional argument, so the sub-build never saw the SDL prefix that -D was added to provide. Latent (SDL is still found via the environment copy), but the forwarding did not do what its comment claimed.
  • bundle_verify.cmake.in — fail packaging if any Mach-O in the bundle is stamped above the deployment target, and report the bundle's real floor. This class of bug shipped precisely because nothing checked it; setup-sdl.sh already does the equivalent for the SDL libs, which is why those were correct.

Verification

  • Top-level superbuild configure now emits CMAKE_ARGS: -DCMAKE_PREFIX_PATH=/opt/qt|/opt/sdl as a single entry, and the generated nested configure command carries the full prefix path with no stray argument.
  • bundle_verify.cmake.in parses under cmake -P; the minos matcher was exercised against real otool -l fragments — 15.0 flagged, 12.0/11.0 pass, and LC_ID_DYLIB's current version 2.32.10 correctly does not false-positive.
  • Real check is CI: the new gate fails the packaging step if the fix did not take, so a green macOS build is the proof. Worth confirming the artifact's EXECUTE row and all 55 plugin dylibs read 12.0.0, and asking the reporter (macOS 12.7.6, Intel) to try it.

Follow-ups (not in this PR)

A follow-up PR against main should carry the 11.0 → 12.0 bump, the bundle_verify gate, LSMinimumSystemVersion and the LIST_SEPARATOR fix — everything here except the deployment-target propagation itself, which main does not need. Done via #7740, as this cannot be cherry-picked into main.

Final check

Now reports in CI

-- Bundle verification: 87 Mach-O files, no external references, minimum macOS 12.0

… plugins

Companion 2.12.3 refuses to start below macOS 15 ("The application requires
macOS 15.0 or later"). Its executable and all 55 simulator plugins are stamped
minos 15.0 - the Xcode 16 SDK default - where 2.12.2 shipped 10.15. The bundled
SDL2/SDL3 copies are fine, so this is not the SDL3 packaging work.

build-companion.sh passes -DCMAKE_OSX_DEPLOYMENT_TARGET only to the top level
superbuild. The 'native' ExternalProject that actually compiles Companion only
receives variables the forwarding loop collects by matching the "specified on
the command line" helpstring, and CMake's Platform/Darwin-Initialize.cmake
re-declares CMAKE_OSX_DEPLOYMENT_TARGET as a documented cache entry, replacing
that helpstring. The flag never reaches the compiler.

Export MACOSX_DEPLOYMENT_TARGET as well, which Darwin-Initialize.cmake reads on
every configure, and forward the variable explicitly via CMAKE_CACHE_ARGS.

Target 12.0 rather than 11.0: Qt 6.9's frameworks are minos 12.0, so the bundle
already cannot start below macOS 12. Declare it in LSMinimumSystemVersion too,
so older systems get a clear message instead of a dyld failure.

Also give the ExternalProjects a LIST_SEPARATOR and escape ';' when building
CMAKE_ARGS. Without it -DCMAKE_PREFIX_PATH='<qt>;<sdl>' split into a truncated
-DCMAKE_PREFIX_PATH=<qt> plus a stray positional argument, so the sub-build
never saw the SDL prefix the -D was added to provide.

Finally, extend bundle_verify to fail packaging when any Mach-O in the bundle
is stamped above the deployment target, so this cannot regress unnoticed again.

Fixes #7732

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@pfeerick pfeerick added companion (cpn) Related to the companion software compilation Related to compiling the firmware and firmware options labels Aug 31, 2026
@pfeerick pfeerick added this to the 2.12.4 milestone Aug 31, 2026
@pfeerick
pfeerick marked this pull request as draft August 31, 2026 13:01
… log

CPack discards message(STATUS) output from install scripts, so the
verification summary never reached the CI log - the run that validated
#7732 showed no sign the check had run at all. Echo it through a
subprocess instead, the same way the neighbouring "Re-signing:" line
does, so the bundle's real macOS floor is recorded in every build.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@pfeerick
pfeerick marked this pull request as ready for review September 1, 2026 02:34
@pfeerick pfeerick linked an issue Sep 1, 2026 that may be closed by this pull request
1 task done
@pfeerick
pfeerick merged commit 5f3cef9 into pfeerick/backport-2.12.4 Sep 1, 2026
3 checks passed
@pfeerick
pfeerick deleted the fix/cpn-macos-deployment-target branch September 1, 2026 09:41
pfeerick added a commit that referenced this pull request Sep 2, 2026
… plugins (#7737)

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

companion (cpn) Related to the companion software compilation Related to compiling the firmware and firmware options

Projects

None yet

Development

Successfully merging this pull request may close these issues.

EdgeTx Companion 2.12.3 not working on macOS 12 (Intel macOS 12.7.6)

1 participant