Repository navigation
fix(build): check-toolchain rejects SDK < 27 with a clear message (#520) - #526
Arthur-Ficial wants to merge 1 commit into
Conversation
Since v1.15.0 the sources use macOS 27-only FoundationModels API (LanguageModelSession.Usage, LanguageModelCapabilities, etc.) behind runtime #available gates. The compiler needs the 27 SDK to see those type declarations, but check-toolchain still accepted SDK 26.4+, letting swift build fail with cryptic errors. Now it fails early with a message naming the cause and offering `brew install apfel` as the no-build alternative. Drafted by the apfel bug-solver routine. Needs review + local test run by @franzenzenhofer on a Mac with Apple Intelligence before merging. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019ZCGi94GGTFqn8zQaHW32p
|
The This PR makes the failure clearer (a one-line
No fix to port here - the underlying runner SDK version is an infrastructure issue outside this PR's scope. Generated by Claude Code |
Draft PR - needs @franzenzenhofer review and local test run before merging.
Fixes #520.
Root cause
Since v1.15.0 the sources
UsageAccounting.swiftandVisionSupport.swift(and since the unreleased work on main,ToolCallingSupport.swiftandTypedErrorSupport.swifttoo) use macOS 27-only FoundationModels types (LanguageModelSession.Usage,LanguageModelSession.Response,LanguageModelCapabilities, etc.) behind runtime#availablegates but without compile-time SDK guards. Thecheck-toolchainMakefile target still accepted SDK >= 26.4, somake build/make installwith a 26.x SDK fell through toswift build, which then produced cryptic compiler errors about missing types.The fix
Option 1 from the issue: raise the
check-toolchainSDK floor from 26.4 to 27. The guard is now simply[ "$major" -lt 27 ]instead of the compound 26.4 check. The error message names the cause (macOS 27 FoundationModels API used at compile time), lists the affected source files, and offersbrew install apfelas the no-build alternative.docs/install.mdtroubleshooting sections updated to match.Test coverage
Tests/integration/test_build_info.py::test_check_toolchain_requires_sdk_27to lock the SDK floor in place - it statically checks the Makefile recipe rejects SDK < 27 and does not reference the old 26.4 threshold.test_build_target_does_not_depend_on_generate_build_infoand theswift build/run --build-system nativetests still cover their respective Makefile hygiene.What I verified (static only)
check-toolchainrecipe now contains-lt 27and no26.4references.docs/install.md"Verify your toolchain" and "Troubleshooting build errors" sections updated to SDK 27.docs/install.mdline 37 (the "Build from source" intro) was already updated on main to say "macOS 27 SDK" - no change needed there.[Unreleased] ### Fixedentry added.Makefile,Tests/integration/test_build_info.py,docs/install.md,CHANGELOG.md- no touches to release infrastructure, guardrails, CI, dependencies,.version, orBuildInfo.swift.What I did NOT verify
make teston a Mac with Apple Intelligence. I cannot run FoundationModels code. If the fix does not actually resolve the reported behaviour, that is on me to refine - ping me in a review comment.Follow-up items (not in this PR)
README.mdline 41 still says "macOS 26.4 SDK" for building from source - should be updated to 27.docs/brew-install.mdline 19 says "macOS 26.4 or newer" - this is about the runtime requirement (not the build SDK) and may be a separate issue since the runtime floor is macOS 26.0.Anything that seemed suspicious
Nothing - straightforward bug filed by our own account from the v1.16.0 pre-release review.
cc @franzenzenhofer - draft stays draft until you review, test locally, and mark ready.
Generated by the apfel bug-solver routine.
🤖 Generated with Claude Code
https://claude.ai/code/session_019ZCGi94GGTFqn8zQaHW32p
Generated by Claude Code