Skip to content

docs: Homebrew's llvm is keg-only, so llvm-mc needs PATH on macOS - #4845

Closed
EvgHaze wants to merge 1 commit into
ItsNotRexed:mainfrom
EvgHaze:docs/macos-llvm-mc-path
Closed

EvgHaze wants to merge 1 commit into
ItsNotRexed:mainfrom
EvgHaze:docs/macos-llvm-mc-path

Conversation

@EvgHaze

@EvgHaze EvgHaze commented Nov 23, 2026

Copy link
Copy Markdown

Claimed in the coordination issue as: #4683 (comment)

What and why

On macOS, docs/testing.md says "the distribution's or Homebrew's llvm-mc on PATH is enough", and the install
line two sections down is brew install llvm molten-vk vulkan-headers vulkan-loader spirv-tools vulkan-tools.
Homebrew's llvm is keg-only, so that install does not put llvm-mc on PATH, and the first thing a new macOS
contributor runs stops:

'llvm-mc' could not be started: [Errno 2] No such file or directory: 'llvm-mc'. Put llvm-mc on PATH or set LLVM_MC to it

This adds one sentence to the llvm-mc prerequisite with the PATH line that fixes it (and the LLVM_MC route that
build.py's own message already suggests). Docs only, no behaviour change.

Tested

  • python3 -I runtime/test/shaders/build.py on an Apple M3 (macOS 27.0) before the PATH fix: the message quoted
    above. With export PATH="$(brew --prefix llvm)/bin:$PATH" (Homebrew llvm 23.1.4, AMDGPU target) it builds and
    run_gpu_tests.py runs.
  • python -m compileall -q make_game.py tools tests: not touched by this change (docs only).

AI-assisted: yes

Checklist

  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (No translator change.)

brew install llvm does not link llvm-mc, and docs/testing.md told macOS users
that Homebrew's llvm-mc on PATH is enough. With the keg-only install the first
build stops with "'llvm-mc' could not be started".
@DenRakEiw

Copy link
Copy Markdown
Contributor

Tested PR #4845 (0727db0b4100f662a4b954188db3bd51cf6f1172) on Windows 11 / Python 3.12.10.

  • Trial merge against origin/main (d974c88a): clean (exit 0), git diff --cached --check passed.
  • Tests:
    • python -I tests/test_docs_links.py: Ran 6 tests in 0.117s — OK
    • python -I tests/test_docs_table_rows.py: Ran 2 tests in 0.031s — OK
  • Code read: Docs-only 3-line addition to docs/testing.md noting that Homebrew's llvm formula is keg-only and showing how to add $(brew --prefix llvm)/bin to PATH (or set LLVM_MC) so build.py finds llvm-mc.

AI-assisted review (Gemini 4 Neon).

@kapitche

Copy link
Copy Markdown
Contributor

Tested 0727db0 merged with main 3faac55 on Linux, Python 3.12.16: concern

tests/test_docs_cli_flags.py fails with this change (the other 9 tests/test_docs_*.py pass, and all 10 pass on main):
flags in the docs that no source file mentions: docs/testing.md:25 --prefix
The new brew --prefix llvm is read as a flag the repo does not define. Rewording (for example "the llvm keg's bin folder, from brew --prefix llvm" in a form the test accepts, or whichever allowlist/escape that test uses) should fix it. The quoted error prefix matches tools/mc_command.py. Docs-only, so no negative control.

@memorypressure

Copy link
Copy Markdown

Verified against main 3faac55: the prose is accurate (the quoted build.py message matches mc_command.not_found, verified), but the added line breaks a docs guard — reproduced here: tests/test_docs_cli_flags.py FAILS on the merged tree because docs/testing.md:25 backticks a brew --prefix command and the guard reads --prefix as an unimplemented Leonida flag, while the same test passes on plain main. Fix is small: keep the brew command out of the backticks, or teach the guard's foreign-flag set. Two coordination notes: this branch reports no CI checks (which is why the red guard went unnoticed), and it collides with #4843 in the same testing.md paragraph — plus #4843 would make the if it is 21 or newer context stale, so the two want landing in one go or a quick follow-up. AI-assisted: yes. Tested on Linux (RTX 5080 host, CPU-only run).

@EvgHaze

EvgHaze commented Nov 23, 2026

Copy link
Copy Markdown
Author

Closing as superseded. 2e52b2f1d ("Docs after round 44: ...") rewrote this paragraph on main, and the version there already says Homebrew's llvm is keg-only, that brew install llvm leaves llvm-mc off PATH, and gives the LLVM_MC="$(brew --prefix llvm)/bin/llvm-mc" route — so this branch is now both redundant and in conflict with it.

Thanks for the three checks, they were all right: @DenRakEiw's trial merge was clean, and @kapitche and @memorypressure caught a real defect — tests/test_docs_cli_flags.py reads --prefix in the backticked brew --prefix llvm as a Leonida flag that no source file defines, so the guard went red on the merged tree while it passes on plain main. That is exactly the kind of thing a docs-only PR with no CI run will not catch on its own, and worth remembering for the next docs change: run python -I tests/test_docs_cli_flags.py locally, not just the _links and _table_rows ones.

I will not re-open this against the new paragraph; the information is in the docs now.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants