Skip to content

Expand building claude skill#18045

Merged
psiddh merged 15 commits intopytorch:mainfrom
psiddh:expand-building-claude-skill
Mar 11, 2026
Merged

Expand building claude skill#18045
psiddh merged 15 commits intopytorch:mainfrom
psiddh:expand-building-claude-skill

Conversation

@psiddh
Copy link
Contributor

@psiddh psiddh commented Mar 10, 2026

The skill now has an explicit routing table at the top of Step 2:

┌──────────────────────────────────────┬────────────────────────────┐
│ User says │ Claude goes to │
├──────────────────────────────────────┼────────────────────────────┤
│ "build from sources" │ Python package (default) │
├──────────────────────────────────────┼────────────────────────────┤
│ "build for Android" │ Cross-compilation: Android │
├──────────────────────────────────────┼────────────────────────────┤
│ "build for iOS" / "build frameworks" │ Cross-compilation: iOS │
├──────────────────────────────────────┼────────────────────────────┤
│ "build llama" / "build whisper" │ LLM/ASR model runner │
├──────────────────────────────────────┼────────────────────────────┤
│ "build C++ runtime" / "cmake" │ C++ runtime standalone │
└──────────────────────────────────────┴────────────────────────────┘

psiddh and others added 2 commits March 9, 2026 16:41
The existing building skill only covered runners (Makefile targets) and
CMake workflow presets. This expands it to be a comprehensive guide for
building ExecuTorch from source, including:

- Prerequisites and toolchain requirements
- Building the Python package (install_executorch.sh with all flags)
- Building the C++ runtime standalone (presets, workflows, manual CMake)
- Building model runners (Makefile)
- Cross-compilation (Android, iOS, macOS, Windows)
- Complete build options reference with dependency chains
- Common build patterns (minimal, XNNPACK, profiling, tests, subdirectory)
- Troubleshooting section covering 12 common build issues:
  - Submodule issues
  - Stale build artifacts
  - CMake version conflicts
  - Python version mismatch
  - Dependency version conflicts
  - Missing python-dev headers
  - Linking errors with --whole-archive
  - XNNPACK build failures
  - Windows symlink errors
  - MSVC kernel compilation failures
  - Intel macOS limitations
  - Duplicate kernel registration
- Build output reference table
- Tips for faster and more reliable builds
Reorganize the building skill to be concise and action-driven rather
than encyclopedic. Key changes:
- Add "do not ask questions" directive — detect and fix env issues automatically
- Make conda the mandatory path (no venvs, no system Python)
- Auto-fix for cmake >= 4.0 and PEP 668 errors
- Default action is `./install_executorch.sh --editable`
- Complete runner table from actual Makefile (adds voxtral, voxtral_realtime,
  sortformer, silero-vad, llava, debug variants)
- Fix macOS commands: $(sysctl -n hw.ncpu) instead of $(nproc)
- Note that --preset macos uses Xcode generator
- Condense troubleshooting into scannable table
- Trim cmake options to most-used flags (full list in CMakeLists.txt)

Co-authored-by: Claude <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings March 10, 2026 16:24
@pytorch-bot
Copy link

pytorch-bot bot commented Mar 10, 2026

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/18045

Note: Links to docs will display an error until the docs builds have been completed.

❌ 1 New Failure

As of commit da50e3f with merge base 518daa8 (image):

NEW FAILURE - The following job has failed:

  • pull / test-lora-linux / linux-job (gh)
    An error occurred trying to start process '/usr/bin/bash' with working directory '/home/ec2-user/actions-runner/_work/executorch/executorch/pytorch/executorch'. No such file or directory

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 10, 2026
@github-actions
Copy link

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the internal “building” skill documentation to cover end-to-end ExecuTorch builds (conda env setup, Python package install, Makefile runners, CMake presets/workflows, cross-compilation, and troubleshooting).

Changes:

  • Expanded build guidance to include conda environment setup and a recommended default install path (install_executorch.sh).
  • Added consolidated instructions for model runners, C++ runtime builds (presets + workflows + manual), and cross-compilation (Apple frameworks / Android AAR).
  • Added a flags reference table plus troubleshooting and build-output sections.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 10, 2026 16:32
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 10, 2026 16:42
psiddh and others added 2 commits March 10, 2026 09:42
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Github Executorch and others added 2 commits March 10, 2026 13:22
- Add venv fallback when conda is not installed
- Handle conda PermissionError by checking env directory on disk
- Auto-fix cmake: missing or < 3.24 gets pip-installed, >= 4.0 works fine
- Add troubleshooting entries for conda not found and PEP 668 errors
- Remove heavy-handed directive banner; let skill structure guide behavior

Co-authored-by: Claude <noreply@anthropic.com>
Explicit decision tree at the top of Step 2 so Claude routes to the
right section based on keywords (Android, iOS, model names, cmake)
instead of always defaulting to the Python package build.

Co-authored-by: Claude <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings March 10, 2026 20:25
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- Add ANDROID_NDK requirement and verification to Android section
- Fix CMAKE_BUILD_TYPE description: not all presets set it
- Separate build output table by flow (pip vs cmake vs cross-compilation)

Co-authored-by: Claude <noreply@anthropic.com>
@psiddh psiddh requested a review from GregoryComer March 10, 2026 20:37
Three issues that would break a fresh Mac checkout:
- Add Xcode Command Line Tools prerequisite check
- Add conda shell.bash hook for non-interactive shells (Claude Code / CI)
- Add brew install python@3.12 guidance for venv path when only 3.14+ exists

Co-authored-by: Claude <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings March 10, 2026 20:41
Co-authored-by: Claude <noreply@anthropic.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +157 to +161

## Key build options

Most commonly needed flags (full list: `CMakeLists.txt`):

Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

Android cross-compilation prerequisites are incorrect/incomplete. scripts/build_android_library.sh expects ANDROID_NDK and also uses ANDROID_SDK (mapped to ANDROID_HOME when running Gradle); it does not require the NDK to be “on PATH”. Please update this section to instruct users to export ANDROID_NDK and ANDROID_SDK/ANDROID_HOME (per docs), otherwise the script may fall back to /opt/ndk and /opt/android/sdk and fail on most dev machines.

Copilot uses AI. Check for mistakes.
Copy link
Member

@GregoryComer GregoryComer left a comment

Choose a reason for hiding this comment

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

Looks good to me.


| Platform | Command |
|----------|---------|
| macOS | `cmake -B cmake-out --preset macos` (uses Xcode generator — requires Xcode) |
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Linux specifies Release. Should we specify release mode for all of them?

@GregoryComer
Copy link
Member

CC @cbilgin - recently mentioned Claude having trouble building ET.

@psiddh psiddh merged commit 3eb1726 into pytorch:main Mar 11, 2026
156 of 157 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants