CI(macos): silence example-build ld deployment-target warnings in test-distribution#6159
Merged
Merged
Conversation
Match the deployment target baked into the framework dylibs (CMAKE_OSX_DEPLOYMENT_TARGET=12.7 from top-level CMakeLists.txt) so the C/C++ example builds in the macos-test distribution job don't link with the macos-12 SDK's default min-macOS of 12.0, which produces "dylib (libMR*.dylib) was built for newer macOS version (12.7) than being linked (12.0)" ld warnings on the macos-12-intel cell. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Empty commit to re-run CI now that the upload-binaries label is applied, so test-distribution / macos-test (x64, macos-12-intel) actually executes and we can confirm the "dylib was built for newer macOS version (12.7) than being linked (12.0)" warnings are gone. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The first cut of this fix exported MACOSX_DEPLOYMENT_TARGET=12.7
unconditionally on every macos-test cell. That silenced the original
warnings on the macos-12-intel cell (where the macOS-12 SDK defaults
the link target to 12.0, lower than the framework dylibs' 12.7), but
introduced symmetric warnings on macos-13/26 cells:
ld: warning: dylib (.../libfmt.12.1.0.dylib) was built for newer
macOS version (13.0) than being linked (12.7)
The brew bottles on those hosts are built at the host's macOS version
(13.0, 14.0, 26.0), so forcing the link target down to 12.7 makes the
brew dependencies "newer than being linked" instead.
Gate the export on the host's macOS major version: apply 12.7 only on
hosts older than 13, where the SDK default would otherwise fall below
MeshLib's 12.7. On macOS-13+ hosts the SDK's default min-macOS is
already >= 12.7 and >= every brew bottle on that host, so both classes
of warning stay silent.
Net effect across the matrix vs. the original master run:
- x64, macos-12-intel: 65 warnings -> 0 (original symptom, fixed)
- arm64, macos-13: 0 warnings -> 0 (regression from the
previous commit reverted)
- arm64, macos-26: 0 warnings -> 0 (ditto)
- x64, macos-26-intel: 0 warnings -> 0 (ditto)
- all other cells: 0 -> 0 (unchanged)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Condense the 9-line explanation above the example-build steps to 3 lines. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
What
Bump the deployment target of the C/C++ example builds in
macos-test(.github/workflows/test-distribution.yml) to12.7only on macOS-12 hosts, leaving the SDK default in place everywhere else:Why
The
test-distribution / macos-test (x64, macos-12-intel, *x64.pkg)job was producing a wall of linker warnings against every dylib in the installed framework, e.g.:(See run https://github.com/MeshInspector/MeshLib/actions/runs/26396912525/job/77711295815.)
The mismatch has two ends:
CMakeLists.txt(lines 26-28) defaultsCMAKE_OSX_DEPLOYMENT_TARGETto12.7on macOS, and that value is baked into everylibMR*.dylib/libMeshLibC2.dylibshipped in the.pkg.cmake ..invocations forexamples/cpp-examplesandexamples/c-examplesdon't set a deployment target, so AppleClang on the self-hostedmacos-12-intelrunner falls back to the macOS-12 SDK's default min-macOS of12.0.ldthen sees a 12.0-target binary linking against 12.7-target dylibs and warns for every example. Only themacos-12-intelcell showed this — on macOS-13+ cells the SDK default min-macOS is already >= 12.7.Why the fix is conditional
The obvious fix — exporting
MACOSX_DEPLOYMENT_TARGET=12.7unconditionally — fixesmacos-12-intelbut introduces the symmetric warning on newer cells, because the brew bottles there are built at the host's macOS version:The warning fires whenever any linked dylib's min-macOS exceeds the binary's link target. Forcing 12.7 everywhere drops the target below the brew bottles on every macOS-13+ host. So the target is bumped to 12.7 only when the host SDK would otherwise default below it (macOS-12); on macOS-13+ the SDK default already covers both MeshLib's 12.7 and the brew bottles.
Scope
CI workflow only. No source, no CMake files, no example logic touched. The
12.7literal matches the constant in the top-levelCMakeLists.txt; if that moves, both should move together.Test plan / results
Verified on run https://github.com/MeshInspector/MeshLib/actions/runs/26468388117 — all 7
macos-testcells pass with zeroldwarnings:x64, macos-12-intelx64, macos-15-intelx64, macos-26-intelarm64, macos-13arm64, macos-14arm64, macos-15arm64, macos-26macos-12-intelcell: original 65 warnings gone.MeshModificationexample still runs at the end of "Build C++ examples".Note:
test-distribution.ymlis invoked viaworkflow_callfrom the release pipeline; on this PR it was exercised by applying theupload-binarieslabel.