Repository navigation
fetch-metallib: use the metal-cpp archive the Darkbloom sandbox image carries - #1814
Merged
Merged
Conversation
… carries MLX's configure downloads metal-cpp_26.zip from developer.apple.com with FetchContent, which does not try again; through Darkbloom's sandbox egress the download ended early in macOS jobs (Layr-Labs/darkbloom-sandbox#299). The macOS sandbox payload disk now carries the archive, pinned by SHA-256 (Layr-Labs/darkbloom-sandbox#301). When it is the archive the nested MLX core names and its digest matches, the script unzips it into the build directory and passes -DFETCHCONTENT_SOURCE_DIR_METAL_CPP; anywhere else, FetchContent downloads it as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…build still fetches MLX's GitHub dependencies Review: a local copy named by MLX_METAL_CPP_ARCHIVE was used only when its file name was metal-cpp_26.zip, because the check grepped MLX's CMakeLists for the copy's basename. It now looks for the fixed name, so any copy with the pinned digest works. build.md said the build makes no download; MLX's configure still fetches json, fmt and gguflib from GitHub: it makes no download from developer.apple.com. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch had an error being deployed
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
MLX's CMake configure downloads
metal-cpp_26.zipfrom developer.apple.com with FetchContent, and FetchContent does not try again. On Darkbloom macOS sandbox runners, that download ended early through the egress gateway. It failed shards on 2026-10-30, 2026-11-03 and 2026-11-05 (runs 41957288305 and 41971787801), always withtransfer closed with … bytes remaining. See Layr-Labs/darkbloom-sandbox#299.Layr-Labs/darkbloom-sandbox#301 puts that archive on the macOS sandbox payload disk, pinned by SHA-256
4df3c078…a3a4. This PR makesscripts/fetch-metallib.shuse the archive when it fits:libs/mlx-swift/Source/Cmlx/mlx,72dffa2d) names that exact archive;metal-cpp/Metal/Metal.hpp.When all four hold, the script passes
-DFETCHCONTENT_SOURCE_DIR_METAL_CPP=<build dir>/metal-cpp-archive/metal-cpp. Otherwise FetchContent downloads the archive as before.MLX_METAL_CPP_ARCHIVEnames another local copy, which must have the same digest.Before
After
flowchart LR A[fetch-metallib.sh: cache miss] --> P{payload archive present, named by this MLX, pinned digest?} P -->|yes| U[unzip into build dir] --> B1[cmake -DFETCHCONTENT_SOURCE_DIR_METAL_CPP] --> E[build mlx.metallib] P -->|no: GitHub-hosted, Blacksmith, older image, newer MLX| B2[cmake as before: FetchContent downloads] --> EChecks
bash -n scripts/fetch-metallib.shpasses. Themetal_cpp_argsarray expands with${arr[@]+"${arr[@]}"}, so it is safe underset -uon macOS/bin/bash3.2.images/macos/tests/ci-compat.sh(provider: fix "stale state file" status when daemon is stopped — or actually running #301) configures MLX's exactFetchContent_Declare(metal_cpp URL …metal-cpp_26.zip)from the unzipped archive withFETCHCONTENT_FULLY_DISCONNECTED=ON.cmakecommand line as before. This PR's CI runs that path.docs/developer/build.md(stamp 2026-11-05). Changelog:changelog.d/metal-cpp-from-the-sandbox-image.md.Known limitations
helper=infetch-metallib.sh,HELPER_SHAinprovider-release-build). After this merges, every lane rebuilds the metallib once. On Darkbloom runners, each of those rebuilds downloads metal-cpp until the payload disk from provider: fix "stale state file" status when daemon is stopped — or actually running #301 is rolled out. Merge after that rollout, or accept one cold round._27) falls back to the download until the image and the pin here move together.scripts/install-release-cmake.sh. It also downloads through the egress (curl: (18)on 2026-10-30 and 2026-11-03), even though the image already has the same CMake onPATH.Refactor pass
The change is the narrowest one possible: one guarded branch before the existing
cmakecall, and no change to the cache logic, the lock or verification. I removed nothing.🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.