Skip to content

Add generic Linux dev setup & bootstrap - #2035

Open
sunmachine wants to merge 3 commits into
NeotokyoRebuild:masterfrom
sunmachine:generic-ide-setup
Open

Add generic Linux dev setup & bootstrap#2035
sunmachine wants to merge 3 commits into
NeotokyoRebuild:masterfrom
sunmachine:generic-ide-setup

Conversation

@sunmachine

@sunmachine sunmachine commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Description

Optional developer tooling for Linux + Clang. It does not change how NT;RE builds.

  • tools/ntre-dev-setup.sh — sets up working C++ IntelliSense: a pinned clangd, a compile_commands.json symlinked at the repo root, and a .clangd carrying the flags the SteamRT toolchain needs.
  • .devcontainer/ — a dev container on the same sniper SDK image the CI runners use, which runs that script on first open.

Why the script is needed: a unity build's compile_commands.json lists only the generated unity_*.cxx blobs, so roughly 1300 translation units get no compile flags and indexing is dead across most of src/game. The script works around that with a separate, build free CMake directory configured with the unity options off, written to the git-ignored src/CMakeUserPresets.json. Your real build directory keeps whatever settings you gave it, and nothing is ever compiled from the IntelliSense one.

Editor config for VS Code and Zed is written on request. Everything generated is git-ignored, and the existing Qt Creator and CLI build workflows are untouched.

Also removes two Source SDK leftovers: the buildallprojects gitattributes entry and src/.vscode/tasks.json, which both refer to a build script this repo no longer has.

Note

Based on #2052

Rebased onto @nullsystem's 6d33c0e, which adds the NEO_UNITY_BUILD_CLIENT_SERVER and NEO_UNITY_BUILD_OTHERS options. The IntelliSense preset sets both to OFF for itself alone. Following @Masterkatze's review, this branch no longer touches shared build defaults or injects CMake code into the project. That commit appears in the diff below until #2052 merges. This also gives me another day to hammer on Zed a bit.

Trying it out

  1. git clone this repo and check out this branch.
  2. Open the folder in VS Code with the Dev Containers extension installed.
  3. Accept the "Reopen in Container" prompt, or run Dev Containers: Reopen in Container from the command palette.
  4. Wait for the first build; it pulls the sniper SDK image and runs the setup script, so expect a few minutes. Later opens are seconds.
  5. Open any .cpp file under src/ and confirm go-to-definition and completion work.

Requires Docker or Podman on the host. The README.md covers running the script outside a container.

Toolchain

  • Linux GCC 10 Sniper 3.0

Linked Issues

  • fixes #
  • related #

TODO

  • Hit against Zed a bit more to make sure it works.

@sunmachine sunmachine changed the title Add generic Linux dev setup dev & bootstrap Add generic Linux dev setup & bootstrap Jul 26, 2026
Comment thread tools/ntre-dev-setup.sh Outdated
@sunmachine

Copy link
Copy Markdown
Contributor Author

Note to self: I still need to toy around with Zed more to make sure this is solid.

Note to self 2: Get more details on @Agiel 's specific Zed workflows to make sure I covered his concerns adequately.

nullsystem and others added 2 commits August 5, 2026 18:30
One for client/server and one for vgui2/tier1/mathlib as may want to
turn it off only for working on just client/server library side. Also
fixup compile/linker errors since the changes and add NEO_UNITY
defines to fixup for those ifdef changes. Add info in README.
src/.vscode/tasks.json ran ./buildallprojects, and .gitattributes pinned line
endings for the same file. Neither exists: the script came from the
source-sdk-2013 import and never survived the move to CMake presets, so the task
could only ever fail on invocation.
Run tools/ntre-dev-setup.sh, reload your editor, and go-to-definition works
across src/game. It changes nothing about how NT;RE is built.

A unity build's compile_commands.json lists only the generated unity_*.cxx
blobs, so roughly 1300 translation units carry no compile flags an indexer
can use. Navigation and completion are dead across most of src/game.

What the script does:

1. Adds a "Linux Debug (IntelliSense index only)" preset to the git-ignored
   src/CMakeUserPresets.json, with NEO_UNITY_BUILD_CLIENT_SERVER and
   NEO_UNITY_BUILD_OTHERS set to OFF.
2. Configures that directory for its compile database alone. Nothing is
   built from it, and your real build directory keeps whatever unity
   settings you gave it.
3. Symlinks compile_commands.json at the repo root, where nearly every C++
   tool probes for it.
4. Writes a .clangd that drops the GCC-only flags clang rejects.
5. Installs a pinned, checksummed clangd under .ide/. The sniper image
   ships clangd 13, which is too early for the repo's C++20.

The script runs from the dev container (the CI image plus a non-root account
matched to the local UID, so bind-mount files stay user-owned under rootful
docker), from the tracked VS Code tasks, or directly from a shell. The output
is a plain compile database, so any editor that speaks clangd works, not only
VS Code.

Everything generated is git-ignored. *.sh gains eol=lf so a Windows checkout
cannot produce a script that fails to run.
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.

3 participants