Skip to content

Modernization Phase 1.4: iOS refresh — SDK libc++, deployment target 26 [iosbuild] - #25

Merged
ptesavol merged 4 commits into
mainfrom
modernize/1.4-ios
Jul 3, 2026
Merged

ptesavol merged 4 commits into
mainfrom
modernize/1.4-ios

Conversation

@ptesavol

@ptesavol ptesavol commented Jul 3, 2026 •

Copy link
Copy Markdown
Collaborator

Phase 1.4: the iOS arrangement is now correct by construction rather than held together by availability hacks.

Changes

  1. Deployment target 13.0 → 26.0 (product decision: iPhones keep themselves up to date). Set in the triplet + presets; verified in the artifact: minos 26.0. Xcode 26+ requirement guarded in install-prerequisities.sh.
  2. SDK libc++ headers + SDK runtime: iOS builds compile with -nostdinc++ -isystem <iphoneos-sdk>/usr/include/c++/v1 (path via xcrun). Headers and device runtime are now availability-consistent by construction — the Homebrew-libc++ header injection, the _LIBCPP_AVAILABILITY_HAS_INIT_PRIMARY_EXCEPTION=0 define, and -lc++abi are deleted. Confirmed flowing everywhere: 341 folly compile lines and the package compile database all show the SDK header flags + -miphoneos-version-min=26.0.
  3. ios.toolchain.cmake → pristine leetal 4.5.0 — with a discovery: the previously vendored copy had undocumented local modifications (glue at its top reading ENV{VCPKG_*_FLAGS}, paired with env exports in the triplet). That glue was the only thing applying triplet flags under the chainload arrangement, so replacing the file silently disabled all triplet flags (first symptom: usrsctp losing its RFC 2292 define). The glue now lives in a documented 25-line wrapper, toolchains/streamr-ios.toolchain.cmake, consuming the VCPKG_* flag variables directly — works for port builds (cache vars) and package builds (two-stage chainload), and upstream's file stays genuinely pristine/updatable.
  4. folly defines re-validated by experiment: dropped all five legacy globals, re-added only what failed —
    • FOLLY_HAVE_MALLOC_USABLE_SIZE=0: no such function on iOS; folly's link check false-positives against SDK stubs → small_vector.h compile error.
    • IS_AARCH64_ARCH=0: the iOS toolchain reports aarch64 (macOS host says arm64), enabling folly's Arm-Optimized-Routines assembly memcpy whose ELF-only directives the Mach-O assembler rejects.
    • FOLLY_HAVE_CLOCK_GETTIME, FOLLY_MOBILE, __APPLE__: gone — never needed.
      Both survivors are now scoped to the folly port block with their failure modes documented, instead of applied globally.
  5. usrsctp's -D__APPLE_USE_RFC_2292 kept — the iOS 26 SDK still gates IPV6_PKTINFO behind an RFC-API selection.
  6. iostest.sh fixes surfaced by the device run: IOS_DEVELOPMENT_TEAM env override signs with a different team via command-line build settings (used with a Personal Team while the org team's PLA acceptance is pending; bundle IDs get a team-ID suffix since the originals are App IDs registered to the org team), and xcresulttool get object --legacy (Xcode 16+ requires the flag — result processing previously failed even after a green run).

Verification

Gate Result
Full arm64-ios dependency set at baseline 2026.06.24, new arrangement ✅
Packages + XCFramework ✅
Artifact: platform=iOS, minos=26.0, SDK 26.5 ✅
Flag flow (port logs + package compile database) ✅
iOS CI ([iosbuild] title) ✅
Device run: ./iostest.sh --device — GoogleTest suite passed on iPhone 12 mini, iOS 26.4.2 (Personal Team signing) ✅

macOS/Linux legs are unaffected by these files (iOS-only triplet/toolchain/preset changes + a warning in the prerequisites script), but run anyway as always.

Remaining in Part 1 after this

Phase 1.5 (lint remainder: clangd-tidy submodule bump + .clang-tidy suppression triage) and 1.6 (CI/docs closeout) — both small. Then Part 2: the modules migration.

🤖 Generated with Claude Code

- Deployment target 13.0 -> 26.0 (product decision: iPhones keep
  themselves up to date). Set in the triplet and presets; Xcode 26+
  guarded in install-prerequisities.sh.
- iOS builds now use the iPhoneOS SDK's libc++ headers (-nostdinc++ +
  xcrun-resolved SDK path) with the SDK runtime — availability-
  consistent by construction. The Homebrew-libc++ header injection,
  the _LIBCPP_AVAILABILITY_HAS_INIT_PRIMARY_EXCEPTION=0 hack and
  -lc++abi are gone.
- toolchains/ios.toolchain.cmake updated to pristine leetal 4.5.0. The
  old vendored copy had local modifications (reading
  ENV{VCPKG_*_FLAGS}) that were the ONLY thing applying triplet flags
  under the chainload arrangement; that glue now lives in a documented
  wrapper, toolchains/streamr-ios.toolchain.cmake, consuming the
  VCPKG_* flag variables directly (works for port builds via cache
  vars and package builds via the two-stage chainload).
- folly defines re-validated by experiment: of the five legacy globals
  only FOLLY_HAVE_MALLOC_USABLE_SIZE=0 (no such function on iOS; link
  check false-positives against SDK stubs) and IS_AARCH64_ARCH=0 (iOS
  toolchain reports aarch64, enabling folly's ELF-only assembly memcpy
  that Mach-O rejects) proved necessary — now scoped to the folly port
  block with documented reasons. The RFC 2292 define stays (the iOS 26
  SDK still gates IPV6_PKTINFO behind an RFC-API choice).

Verified: full arm64-ios dependency set + packages + XCFramework
green; artifact platform=iOS minos=26.0; flag flow confirmed in port
logs and the package compile database.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions github-actions Bot added the docs label Jul 3, 2026
ptesavol and others added 3 commits July 3, 2026 07:29
Allows running the on-device tests signed with a different team (e.g. a
Personal Team) when organization provisioning is blocked, without
modifying the Xcode project.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…y (iosbuild)

- When IOS_DEVELOPMENT_TEAM is set, suffix PRODUCT_BUNDLE_IDENTIFIER with
  the team ID via $(inherited): the project's App IDs are registered to
  the organization team and cannot be claimed by another team.
- xcresulttool on Xcode 16+ requires 'get object --legacy' for the old
  JSON format; without it result processing failed after a green test run.

Verified end-to-end on an iPhone 12 mini (iOS 26.4.2): Personal Team
signing, install, and the GoogleTest suite pass on device with the
deployment-target-26 / SDK-libc++ build.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ptesavol
ptesavol merged commit e451e96 into main Jul 3, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant