Skip to content

build_llvm_mc: install llvm-mc outside AppData, where the install manager's python can see it - #1233

Merged
ItsNotRexed merged 1 commit into
ItsNotRexed:mainfrom
Nostyxx:fix/llvm-mc-dest-outside-appdata
Nov 22, 2026
Merged

ItsNotRexed merged 1 commit into
ItsNotRexed:mainfrom
Nostyxx:fix/llvm-mc-dest-outside-appdata

Conversation

@Nostyxx

@Nostyxx Nostyxx commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Item: new BUILD item, claimed in #1218 (claim); no ID yet.

scripts/build_llvm_mc.ps1 installed llvm-mc.exe to %LOCALAPPDATA%\Leonida\llvm-mc by default. python from the Python install manager (python.org's default Windows installer for 3.14; the app execution alias in WindowsApps) doesn't see folders that other programs create under %LOCALAPPDATA% or %APPDATA%. So with LLVM_MC set correctly, python -I make_game.py ... (as in the README) reports llvm-mc missing, and valu_fuzz.py / lds_fuzz.py stop with FileNotFoundError: [WinError 2] at the assembler call. Build.bat isn't affected, because it tries py first.

Measured

Windows 11 26200, Python 3.14.7, PythonManager package 26.4.240.0. A folder created today under %LOCALAPPDATA% or %APPDATA%:

Started as os.path.exists on the new folder
python (the alias in WindowsApps) False
the same pythoncore-3.14-64\python.exe by full path True
py True

Folders that already existed (Temp, Microsoft) are visible in all three; a new folder under %USERPROFILE% or on another drive is too.

Changes

  • scripts/build_llvm_mc.ps1: the default -Dest is %USERPROFILE%\.leonida\llvm-mc, with a comment on why it isn't in AppData.
  • make_game.py: when llvm-mc is missing and LLVM_MC points into %LOCALAPPDATA% or %APPDATA% (Windows only), the preflight line says why and what to do (appdata_hint). People who already built llvm-mc with the old default get this hint.
  • docs/design.md ("Disassembling shaders"): the new default and the reason.
  • tests/test_make_game_preflight.py: appdata_hint for both variables, paths with other case and quotes, paths outside AppData (including LocalLow, a WSL command and the new default), off Windows, and the preflight message.

Touches the same script as BUILD-139 (@stayjuced, the cleanup at the end of the script), but different lines.

Tested

Windows 11 Pro 26200, RTX 3080 (driver 621.14), Python 3.14.7 (install manager):

  • tests/test_make_game_preflight.py: 58 tests pass under both python and py; test_make_game_pipeline_preflight, test_mc_command, test_make_game_argparse and test_make_game_platform pass; python -m compileall -q make_game.py tools tests is clean.
  • On this machine, with LLVM_MC at the old default: tool_available is False under python and the hint is shown. With LLVM_MC at the new default: True, no hint, and valu_fuzz.py --family mem --programs 2 runs (2/2 match) under the same python.
  • The script's new default resolves to C:\Users\<user>\.leonida\llvm-mc (read from the script's param block). I didn't rerun the whole 20-40 minute LLVM build for this change; nothing else in the script changed.

No game files involved. AI-assisted (Claude Code).

…ager's python can see it

python from the Python install manager (the WindowsApps alias) doesn't see folders other programs create under %LOCALAPPDATA% or %APPDATA%, so the old default made make_game.py report llvm-mc missing and the fuzzers stop with WinError 2 although LLVM_MC named the file. The default -Dest is now %USERPROFILE%\.leonida\llvm-mc, and the preflight explains an LLVM_MC that points into AppData.
@kapitche

Copy link
Copy Markdown
Contributor

Tested 3420289 on Windows 11 (Python 3.12, not the install-manager python): pass. pytest tests/test_make_game_preflight.py: 58 passed, 23 subtests. With main's make_game.py, 9 fail.

  • The new default %USERPROFILE%\\.leonida\\llvm-mc and the appdata_hint message read well. Existing users who already have LLVM_MC pointing at the old %LOCALAPPDATA%\\Leonida\\llvm-mc get told why it looks missing and where the new default is, rather than a bare WinError 2.
  • I couldn't reproduce the WindowsApps-alias visibility problem itself, because this machine's python isn't the install-manager one. That part rests on your 3.14.7 measurement.
  • I didn't run the full build_llvm_mc.ps1 (an LLVM build). The script change is just the default -Dest path.
  • Merging make_game.py: build the runtime stage on Linux with clang-cl and xwin #1229 (which also edits make_game.py and test_make_game_preflight.py) is clean.

@whattheflop whattheflop left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

AI-assisted independent review on Windows 11 build 26200 with uv-managed CPython 3.12.13, comparing 342028959a5fae2f88c1b5daba8067152241c366 with its direct parent 0d61c357656d92334eef97facec1ae4f7b2b60b1.

PowerShell parsed the checked-in script at each commit. Evaluating only the -Dest default expression confirmed %USERPROFILE%\.leonida\llvm-mc at head and %LOCALAPPDATA%\Leonida\llvm-mc at the parent.

I passed LLVM_MC through the real command parser, file lookup and shader preflight. Only unrelated SPIR-V and work-directory checks were stubbed in-process.

  • At head, the absent old-default path under the actual %LOCALAPPDATA% got the Local hint. A quoted missing path with spaces under the actual %APPDATA% got the Roaming hint. The similarly named AppData\LocalTools sibling and the missing executable at the new default got the generic message. The parent gave the generic message in all four cases.
  • The existing uv python.exe under %APPDATA% served as an executable-availability stand-in. It passed preflight with no hint and ran --version on both revisions. The documented wsl -d Ubuntu -e /usr/lib/llvm-21/bin/llvm-mc route also passed without a hint and returned LLVM 21.1.8 with amdgcn on both.

This checks visibility from the directly launched uv interpreter and the hint's boundaries. The Python install-manager alias behavior is covered by the author's separate 3.14.7 measurement. No LLVM install, game files, or GPU needed. No actionable findings.

@ItsNotRexed
ItsNotRexed merged commit cac87b2 into ItsNotRexed:main Nov 22, 2026
@Nostyxx
Nostyxx deleted the fix/llvm-mc-dest-outside-appdata branch November 22, 2026 09:23
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