fix(build): a clang that can't read the play profile says which clang it is and where the one that reads it is #1267

Merged
HumanBean merged 1 commit from HumanBean/Longshot:fix/pgo-unread-message into main 2026-11-17 00:03:53 +00:00
Owner

Type: fix · Risk: low · Tested on: Linux (parsed only, no checks run) · Needs: Linux with a clang older than 23, any GPU

Why

A Linux build from a checkout with the distro's clang (Ubuntu 24.04's is 18) prints "this compiler cannot read the play profile (<clang's error>): building without it". People read that as an error and ask about it, and it says neither which compiler the build found nor how to get one that reads the profile. Building with an older clang is supported (README: "LLVM 23 or newer reads the play profile; an older one builds without it"): the build goes on, a little slower in play. The line should say that, and where the LLVM that reads the profile is.

How to reproduce

Seen on: Linux, a checkout with no EMSDK and clang 18 on PATH
Settings and switches: defaults
Steps: build with python -I nx2/make_game.py ...
Expected: a line naming the clang, the profile, that the build goes on, and how to get a clang that reads it
Actual: "this compiler cannot read the play profile (error: ...): building without it"

What changed

The line now names the clang and its version, the profile's file name, clang's reason, and that the build goes on a little slower in play. On Linux, when that clang is older than the build tools' LLVM, it adds that python -I scripts/dev_build.py env installs the build tools (tools.lock's LLVM) and prints the variables that point the build at them, or to install clang 23 or newer. For example:

clang 18.1.3 cannot read the play profile longshot_vk.shipped.profdata (error: …): building without it, a little slower in play. The build tools' LLVM 23.1.5 reads it: python -I scripts/dev_build.py env installs them and prints the variables that point the build at them (EMSDK), or install clang 23 or newer

  • builder: profile_unread_message() builds the line and build_tools_llvm() reads the build tools' version (LLVM_VER in scripts/linux/deps.sh), both in nx2/make_game.py. profile_readable() calls them only after its test compile has failed. Nothing else in the path changes: the same profiles are checked, and a failure still builds without the profile.
  • tests: check_unread_message() in tests/test_vk_pgo.py, game-free. It covers clang 18 against 23.1.5 (the advice shows), a clang as new as the build tools' (no advice), Windows (no advice), a clang that names no version, an empty reason, no deps.sh, and that the version comes from deps.sh.

Measurements

Nothing to measure: a message printed only after the profile's test compile has failed.

Flags and settings

None

Testing

Tested: both changed files parse (Python's ast). On the PC this was written on, no checks are run, so tests/test_vk_pgo.py and tests/run_all.py have not run yet.

Not tested: a build that hits the line. This PC's clang is 23.1.4, which reads the profile, so its builds never print it. Opened with --force at the request of the person I work for.

Must be tested:

  • Any OS: python -I -B tests/test_vk_pgo.py, expecting "OK" (by hand or CI)
  • Linux with a clang older than 23 first on PATH and EMSDK unset: build, expecting the line above in the build log and the build finishing (by hand: the build log)

Risks

What could break: the line itself. profile_readable() runs clang --version once more, only when the profile check has already failed.

Turning it off: revert the commit

Compatibility: Nothing changes: the same profiles are used and the build keys are the same.

Checklist

Everyone

  • One topic.
  • The title is a Conventional Commit (type(scope): description) of the status line's type.
  • Why gives the reason plainly and links the issues that fit (the tracker searched).
  • Measurements has a verdict, or one line saying why there is nothing to measure.
  • Testing names what was tested, what wasn't, and what must still be tested, where and how.
  • Rebased on current main.
  • python -I -B tests/run_all.py passes (any failure that also fails on main is named): not run on this PC; CI or a reviewer
  • No game files, dumps, build output or generated files.
  • third_party/ untouched (a new folder with a PROVENANCE.md instead).
  • The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled.

When it applies

  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.
  • A check under tests/ that reads changed source updated in this PR, not weakened.

🤖 Generated with Claude Code

**Type:** fix · **Risk:** low · **Tested on:** Linux (parsed only, no checks run) · **Needs:** Linux with a clang older than 23, any GPU ## Why A Linux build from a checkout with the distro's clang (Ubuntu 24.04's is 18) prints "this compiler cannot read the play profile (<clang's error>): building without it". People read that as an error and ask about it, and it says neither which compiler the build found nor how to get one that reads the profile. Building with an older clang is supported (README: "LLVM 23 or newer reads the play profile; an older one builds without it"): the build goes on, a little slower in play. The line should say that, and where the LLVM that reads the profile is. ## How to reproduce **Seen on:** Linux, a checkout with no `EMSDK` and clang 18 on `PATH` **Settings and switches:** defaults **Steps:** build with `python -I nx2/make_game.py ...` **Expected:** a line naming the clang, the profile, that the build goes on, and how to get a clang that reads it **Actual:** "this compiler cannot read the play profile (error: ...): building without it" ## What changed The line now names the clang and its version, the profile's file name, clang's reason, and that the build goes on a little slower in play. On Linux, when that clang is older than the build tools' LLVM, it adds that `python -I scripts/dev_build.py env` installs the build tools (tools.lock's LLVM) and prints the variables that point the build at them, or to install clang 23 or newer. For example: > clang 18.1.3 cannot read the play profile longshot_vk.shipped.profdata (error: …): building without it, a little slower in play. The build tools' LLVM 23.1.5 reads it: `python -I scripts/dev_build.py env` installs them and prints the variables that point the build at them (EMSDK), or install clang 23 or newer - builder: `profile_unread_message()` builds the line and `build_tools_llvm()` reads the build tools' version (`LLVM_VER` in `scripts/linux/deps.sh`), both in `nx2/make_game.py`. `profile_readable()` calls them only after its test compile has failed. Nothing else in the path changes: the same profiles are checked, and a failure still builds without the profile. - tests: `check_unread_message()` in `tests/test_vk_pgo.py`, game-free. It covers clang 18 against 23.1.5 (the advice shows), a clang as new as the build tools' (no advice), Windows (no advice), a clang that names no version, an empty reason, no deps.sh, and that the version comes from deps.sh. ## Measurements Nothing to measure: a message printed only after the profile's test compile has failed. ### Flags and settings None ## Testing **Tested:** both changed files parse (Python's `ast`). On the PC this was written on, no checks are run, so `tests/test_vk_pgo.py` and `tests/run_all.py` have not run yet. **Not tested:** a build that hits the line. This PC's clang is 23.1.4, which reads the profile, so its builds never print it. Opened with `--force` at the request of the person I work for. **Must be tested:** - Any OS: `python -I -B tests/test_vk_pgo.py`, expecting "OK" (by hand or CI) - Linux with a clang older than 23 first on `PATH` and `EMSDK` unset: build, expecting the line above in the build log and the build finishing (by hand: the build log) ## Risks **What could break:** the line itself. `profile_readable()` runs `clang --version` once more, only when the profile check has already failed. **Turning it off:** revert the commit **Compatibility:** Nothing changes: the same profiles are used and the build keys are the same. ## Checklist ### Everyone - [x] One topic. - [x] The title is a Conventional Commit (`type(scope): description`) of the status line's type. - [x] Why gives the reason plainly and links the issues that fit (the tracker searched). - [x] Measurements has a verdict, or one line saying why there is nothing to measure. - [x] Testing names what was tested, what wasn't, and what must still be tested, where and how. - [x] Rebased on current `main`. - [ ] `python -I -B tests/run_all.py` passes (any failure that also fails on `main` is named): not run on this PC; CI or a reviewer - [x] No game files, dumps, build output or generated files. - [x] `third_party/` untouched (a new folder with a `PROVENANCE.md` instead). - [x] The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled. ### When it applies - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. - [x] A check under `tests/` that reads changed source updated in this PR, not weakened. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix(build): a clang that can't read the play profile says which clang it is and where the one that reads it is
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 8s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 12s
CI / Workflow lint (actionlint) (pull_request) Successful in 13s
Website / Website on Cloudflare (pull_request_target) Has been skipped
Third-party parts / As their notes say (pull_request) Successful in 19s
PR description / Description follows the template (pull_request_target) Failing after 4s
c064584a46
The line was "this compiler cannot read the play profile (<clang's error>): building without it". On a Linux checkout
building with a distro's clang (Ubuntu 24.04's 18) that reads as an error, and says neither which compiler the build
found nor that the build tools' LLVM 23 reads the committed profile. It now names the clang and its version, the
profile, that the build goes on a little slower in play, and on Linux, when that clang is older than the build tools'
LLVM (scripts/linux/deps.sh's LLVM_VER), that `python -I scripts/dev_build.py env` installs it, or clang 23 or newer.

tests/test_vk_pgo.py checks the line (profile_unread_message) and where the version comes from (build_tools_llvm).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Collaborator

Possibly related, for context:

  • PR #592 test(build): isolate shipped-profile lookups in game-free fixtures — Touches tests around shipped-profile readability and compiler probes
Possibly related, for context: - PR #592 test(build): isolate shipped-profile lookups in game-free fixtures — Touches tests around shipped-profile readability and compiler probes
HumanBean changed title from WIP: fix(build): a clang that can't read the play profile says which clang it is and where the one that reads it is to fix(build): a clang that can't read the play profile says which clang it is and where the one that reads it is 2026-11-17 00:03:47 +00:00
HumanBean deleted branch fix/pgo-unread-message 2026-11-17 00:03:53 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!1267
No description provided.