Fix build compatibility with Xcode 26 / modern toolchains#1371
Open
GeiserX wants to merge 2 commits intoovertake:masterfrom
Open
Fix build compatibility with Xcode 26 / modern toolchains#1371GeiserX wants to merge 2 commits intoovertake:masterfrom
GeiserX wants to merge 2 commits intoovertake:masterfrom
Conversation
Add missing brew dependencies (nasm, meson) required by dav1d and OpenH264 build scripts. Add CMAKE_POLICY_VERSION_MINIMUM=3.5 to Mozjpeg build to fix cmake 3.27+ policy deprecation error.
The ffmpeg build script references ffmpeg-7.1 but the bundled source in telegram-ios submodule is ffmpeg-7.1.1, causing build failures.
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
nasm,meson) to INSTALL.md7.1→7.1.1)Context
Building TelegramSwift from source on Xcode 26 (macOS 26 / Tahoe) with CMake 3.31 surfaces several issues, ranging from missing documented dependencies to CMake policy errors, ffmpeg version mismatches, and clang compatibility breaks. This PR addresses the issues fixable within the main repository and documents workarounds for environment-level issues.
All issues discovered during the Xcode 26 build:
meson(required by the dav1d build script) andnasm(required by the OpenH264 build script) are not listed in INSTALL.md, causingconfigure_frameworks.shto fail for first-time builders.CMP0000strictly whencmake_minimum_requiredis set to a very old version. The Mozjpeg build fails with:CMake Error at CMakeLists.txt — Policy "CMP0000" is not known to this version of CMake. Adding-DCMAKE_POLICY_VERSION_MINIMUM=3.5resolves this.core-xprojects/ffmpeg/ffmpeg/build.sh) setsFF_VERSION="7.1"but the bundled source intelegram-iossubmodule is atffmpeg-7.1.1, causing the build to fail with "FFmpeg source not found".libswiftAppKit.dylibmissing — Xcode 26's Metal Toolchain is mounted as a read-only cryptex at/var/run/com.apple.security.cryptexd/mnt/com.apple.MobileAsset.MetalToolchain-*/Metal.xctoolchain/but does NOT containusr/lib/swift-5.0/macosx/libswiftAppKit.dylib. The linker is passed this path directly and fails. See Workaround below.ABSL_ATTRIBUTE_LIFETIME_BOUNDclang error (submodule:tg_owt) — Xcode 26's clang rejects[[clang::lifetimebound]]on parameters of void-returning functions. Affectssubmodules/tg_owt/src/api/candidate.hline 108 inset_type().Changes in this PR
INSTALL.mdAdded
nasmandmesonto thebrew installcommand in step 3.core-xprojects/Mozjpeg/Mozjpeg/build.shAdded
-DCMAKE_POLICY_VERSION_MINIMUM=3.5to the CMake invocation. Required for CMake 3.27+ compatibility.core-xprojects/ffmpeg/ffmpeg/build.shUpdated
FF_VERSIONfrom"7.1"to"7.1.1"to match the actual bundled ffmpeg source directory in thetelegram-iossubmodule.Metal Toolchain Workaround
On Xcode 26, the Metal Toolchain cryptex mount doesn't include Swift compatibility libraries. The linker receives an explicit path to
libswiftAppKit.dylibinside the Metal Toolchain that doesn't exist. Since the cryptex is read-only, symlinks cannot be added.Workaround: Use an LD wrapper script that intercepts the linker invocation and remaps the Metal Toolchain path to the Xcode default toolchain:
Save as
/tmp/ld-wrapper.sh,chmod +x, then build with:Submodule issues (upstream)
These issues cannot be fixed in the main TelegramSwift repo:
tg_owt—src/api/candidate.h:108:ABSL_ATTRIBUTE_LIFETIME_BOUNDonset_type()parameter causes a clang error on Xcode 26. Fix: remove the attribute from that parameter, or update abseil.Test plan
--recurse-submoduleson macOS with Xcode 26brew install cmake ninja openssl@1.1 zlib autoconf libtool automake yasm nasm meson pkg-configconfigure_frameworks.sh— all 10 frameworks build successfully