Repository navigation
scripts: skip test metallib copy on Swift 6.4 layout, add Metal Toolchain check - #222
Merged
Merged
Conversation
…lchain instead SwiftPM compiles the Cmlx kernels itself and embeds default.metallib in mlx-swift_Cmlx.bundle inside every .xctest. Hiding that file makes the MLX tests abort with 'Failed to load the default metallib'; with it present the suites pass without any copied metallib. Copying a metallib into <bundle>.xctest/Contents/MacOS invalidates the bundle signature and the next incremental 'swift build --build-tests' fails at CodeSign. install-test-metallib.sh, bootstrap_local_tests.sh and the build_and_unit_test CI step all did that. - add scripts/check-metal-toolchain.sh (fails early with the fix) - drop scripts/install-test-metallib.sh (its search path no longer matched the Swift 6.4 layout and it fell back to pip-installing the mlx wheel) - bootstrap_local_tests.sh: toolchain check + build, optional --with-server - coverage-report.sh: use the toolchain check - ci.yml: remove only the Contents/MacOS copy; the copy next to the release binary stays Refs #128 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…6.4 build layout The previous commit removed the metallib copy from ci.yml, but CI runs Xcode 26.3 (Swift 6.2, .build/arm64-apple-macosx/ layout) where default.metallib is not embedded in the test bundles, so the SwiftBuddy tests aborted with 'Failed to load the default metallib'. The embedding only exists on Swift 6.4 (.build/out layout), so the scripts now detect that layout and skip the copy there; ci.yml is back to its original state. Co-Authored-By: Claude Sonnet 5.5 <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.
Follow-up on #128 (Tier 3: make the local test suite runnable).
What this PR does now
scripts/check-metal-toolchain.sh: fails early with thexcodebuild -downloadComponent MetalToolchainhint when the Metal Toolchain is missing.scripts/install-test-metallib.shandscripts/bootstrap_local_tests.sh: on the Swift 6.4 / Xcode 27 build layout (.build/out/) they only run the toolchain check and skip the metallib copy; on older toolchains they behave as before.Why the copy is skipped only on Swift 6.4
Verified on Swift 6.4 / Xcode 27: SwiftPM compiles the Cmlx kernels and embeds
default.metallibinmlx-swift_Cmlx.bundleinside every.xctest. Copying a metallib into<bundle>.xctest/Contents/MacOSinvalidates the bundle signature, and the next incrementalswift build --build-teststhen fails at CodeSign (reproduced).Not verified / correction
An earlier revision of this PR also removed the copy from
ci.yml. That broke CI: the runner uses Xcode 26.3 (Swift 6.2,.build/arm64-apple-macosx/layout), which does not embed the metallib (Failed to load the default metallib).ci.ymlis restored to its original state. I could not reproduce the "unsigned library" abort reported with bareswift test, and I have no Swift 6.2 toolchain locally, so the old-layout path is covered by CI only.🤖 Generated with Claude Code