Skip to content

feat: build MLC iOS for iPhone & simulator#193

Open
artus9033 wants to merge 2 commits intomainfrom
feat/build-mlc-ios-and-sim
Open

feat: build MLC iOS for iPhone & simulator#193
artus9033 wants to merge 2 commits intomainfrom
feat/build-mlc-ios-and-sim

Conversation

@artus9033
Copy link
Copy Markdown
Contributor

This PR:

  • updates the build-runtime.sh script to build for both iPhone and iOS simulator, outputs those to lib_iphone and lib_iphonesim
  • updates Cocoapods file to link libs for the appropriate target

@artus9033 artus9033 requested a review from grabbou February 6, 2026 21:06
@artus9033 artus9033 self-assigned this Feb 6, 2026
@vercel
Copy link
Copy Markdown

vercel bot commented Feb 6, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ai Ready Ready Preview, Comment Feb 7, 2026 1:44pm

Request Review

@artus9033
Copy link
Copy Markdown
Contributor Author

artus9033 commented Feb 7, 2026

This PR is blocked by mlc-ai/relax#343 and needs #192 to be merged

@grabbou
Copy link
Copy Markdown
Contributor

grabbou commented Feb 7, 2026

This is amazing, finally will be able to run debug sessions on simulator!

@grabbou grabbou marked this pull request as ready for review February 7, 2026 11:30
@artus9033 artus9033 added enhancement New feature or request Blocked Blocked by an external PR labels Mar 24, 2026
Copy link
Copy Markdown

@JiwaniZakir JiwaniZakir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The python vs python3 inconsistency in build-runtime.sh is a subtle bug: the availability check on line ~251 was changed to use python -m mlc_llm, but both mlc_llm package invocations inside the new iOS loop still call python3. This means the guard can pass on systems where only python3 exists (with python aliased elsewhere), yet the actual build commands will fail.

The in-place sed -i '' mutation of $MLC_LLM_SOURCE_DIR/ios/prepare_libs.sh is fragile — if the build is interrupted mid-loop, the file is left in a modified state with is_simulator set to whichever value was last written, making the next run produce incorrect output silently. If MLC_LLM_SOURCE_DIR is a git submodule, this also introduces dirty state. A safer pattern would be to copy the script to a temp location, apply the substitution there, and execute the copy.

Removing the CMake cache conflict detection block without replacing it with per-platform build directories is a regression risk. The BUILD_DIR is now $SCRIPT_DIR/build (shared across both simulator and device iterations), and the loop already handles cleaning it between runs — but for the Android path, the old guard that detected cross-platform cache contamination is now gone entirely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Blocked Blocked by an external PR enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants