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

Rebased 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 #

Zed Example

clip-zed-demo.mp4
task-refresh-compile-db.mp4

@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.

@sunmachine
sunmachine force-pushed the generic-ide-setup branch 2 times, most recently from ea27cba to 6ce4137 Compare August 7, 2026 02:57
@sunmachine
sunmachine requested a review from Masterkatze August 7, 2026 03:16
@sunmachine

sunmachine commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

#2052 is merged in, will rebase in the morning rebase complete.

@sunmachine
sunmachine force-pushed the generic-ide-setup branch 2 times, most recently from b049fbb to 6ce849e Compare August 8, 2026 19:02
@sunmachine sunmachine added the Tooling Tooling related works (EX: OS fixes, libraries) label Aug 8, 2026
@sunmachine sunmachine added New Changes for Reviewers New changes has been made. This label is mostly to notify reviewers. Updated Description Hopefully more actionable descriptions, for issues previously labeled "Poor Description" and removed Updated Description Hopefully more actionable descriptions, for issues previously labeled "Poor Description" labels Aug 8, 2026
@sunmachine

sunmachine commented Aug 8, 2026

Copy link
Copy Markdown
Contributor Author

Just verified Zed fully. It worked about as well as they described from their new (Jan 2026) devcontainer support.

@Agiel Hopes this helps to stop from switching IDEs so much. 🤞 Check out the videos above.

sunmachine and others added 3 commits August 9, 2026 09:50
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

New Changes for Reviewers New changes has been made. This label is mostly to notify reviewers. Tooling Tooling related works (EX: OS fixes, libraries)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants