Skip to content

clangd checks the game's code and trusts the framework's; Windows clang builds with Visual Studio's clang - #61

Merged
omardev29 merged 1 commit into
mainfrom
ccr-0e58095e-jh8d23
Nov 21, 2026
Merged

omardev29 merged 1 commit into
mainfrom
ccr-0e58095e-jh8d23

Conversation

@omardev29

@omardev29 omardev29 commented Nov 21, 2026 •

Copy link
Copy Markdown
Owner

What changed, and why

clangd (Omar, 2026-11-21). Omar asked that clangd stop reporting errors in rmp/ while completion still works, and that the root scripts for the Android database go. This PR does that with one .clangd, copied into every game as before.

What .clangd does now:

  • Database: it reads the desktop debug build's database (build/debug) on every machine, as before.
  • Flags that are no error in the editor:
    • it adds -D_ALLOW_COMPILER_AND_STL_VERSION_MISMATCH, so a Visual Studio STL newer than the clangd reading it does not make every file that includes it fail with STL1000;
    • it adds -Wno-unknown-warning-option;
    • it leaves out -Werror and -Werror=*, so a warning in the game is a warning, not an error;
    • it removes gcc-only flags and suppresses the driver's "unknown argument" diagnostics.
  • A second fragment for the framework and what it vendors (include/rmp/, src/rmp/, thirdparty/, raymob/, ios/, tests/smoke_test.h): Diagnostics: Suppress: "*", no clang-tidy, no include cleaner, Index: Background: Skip. Completion, hover and go-to-declaration into them still work, because they come from the headers the game includes.
  • The game's own files (src/main.cpp, src/scenes/, src/objects/, include/<game>, tests/game/, and the framework's examples and tests) are diagnosed as the compiler would.

generate_android_commands.{sh,ps1} and update_clangd.{sh,ps1} are deleted, together with their lines in INCLUDE (tools/rmp.py) and in TECHNICAL.md. TECHNICAL.md's "Editor / clangd" section says what is above, and CLAUDE.md records the decision under Omar's standing rules.

CI: windows / x64-clang was red on main (19 and 20 Nov). GitHub's windows-2025-vs2026 image of 2026-11-16 brought MSVC 14.52, whose yvals_core.h stops at error STL1000: Unexpected compiler version, expected Clang 22 or newer under the runner's LLVM 20.1.8 in C:\Program Files\LLVM. The PR runs of 20 Nov went green only because they still got the 2026-11-03 image. The job now puts Visual Studio's own clang first on PATH: it finds VS with vswhere, requiring Microsoft.VisualStudio.Component.VC.Llvm.Clang, and uses VC\Tools\Llvm\x64\bin, the clang that STL ships with. It prints both versions, and fails with a sentence if the component or clang++.exe is missing.

The ladder

Stage Where Result
clangd 22.1.1 --check on a planted error in src/rmp/scene/collision.cpp laptop old .clangd: [undeclared_var_use] Line 1368; new: 0 diagnostics
clangd on a planted error in src/scenes/ laptop still reported with the new .clangd
clangd on an unused variable in src/scenes/ laptop old: an error (-Werror); new: not an error
clangd on src/scenes, src/main.cpp, src/rmp/..., include/rmp/ui.h, rcore.c, an example laptop, with build/debug 0 diagnostics
python3 -m unittest tests.rmp_test.ClangdConfigTest laptop 6 OK
rmp test workflows, rmp, repo, portable, naming laptop PASS
windows / x64-clang with Visual Studio's clang this PR's CI, on the image that broke main (windows-2025-vs2026 20261116.315.1) PASS: the runner's LLVM is 20.1.8, Visual Studio's clang 22.1.3, and the debug and release builds pass
linux / riscv64-native (dispatch 44929388390, -f targets=linux-riscv64-glibc, same tree) RISE, rise-riscv-runner-tyi58um3h, kernel 5.10.113-scw1 PASS in 7 min 37 s; the QEMU fallback skipped. The first board RISE has given this repository

Seen red first

  • ClangdConfigTest:
    • with the quiet pattern widened to src/.*, it fails on src/main.cpp, src/scenes/... and src/objects/...;
    • with a pattern that names nothing (iosx/.*), it fails with iosx/.* matches nothing the repository tracks.
  • The quiet fragment: the planted error in src/rmp/ showed with the old .clangd, as in the first row of the ladder.

Not verified

  • clangd on Windows itself (LazyVim's or VS Code's clangd against MSVC's STL): no Windows here. The STL1000 define is the macro Microsoft documents for this exact message.
  • Without a database: before the first rmp build, clangd has no flags at all, and rmp/... is not found in any file. That is unchanged, and .clangd and TECHNICAL.md say to build once.

Checklist

  • rmp fmt check is clean (no C++ changed).
  • rmp lint is clean (no C++ changed).
  • rmp test passes: the stages it touches pass locally (above); the rest are in the PR's CI.
  • rmp test examples, sanitize, fuzz, coverage: not applicable.
  • The docs say what the code now does: TECHNICAL.md.
  • An API change: none. This changes CLAUDE.md with Omar's own decision of 2026-11-21.
  • No gate was weakened.
  • No secret anywhere.
  • Commits are plain, in Omar's name.

Generated by Claude Code

…11-21): one .clangd, the desktop debug build's database on every machine; include/rmp, src/rmp, thirdparty, raymob and ios give completion and declarations and report nothing, run no clang-tidy and index no source; -Werror left out, gcc's flags and an STL newer than clangd (STL1000) no error in the editor. The Android database scripts (generate_android_commands, update_clangd) are gone. ClangdConfigTest holds the line, seen red on a pattern too wide and one that names nothing. And the windows x64-clang job builds with Visual Studio's own clang: the image of 2026-11-16 brought MSVC 14.52, whose STL refuses the runner's LLVM 20
@omardev29
omardev29 merged commit a81898b into main Nov 21, 2026
31 checks passed
@omardev29
omardev29 deleted the ccr-0e58095e-jh8d23 branch November 21, 2026 18:24
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.

1 participant