Skip to content

Add generic Linux dev setup & bootstrap - #2035

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

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

Conversation

@sunmachine

@sunmachine sunmachine commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Description

Genericized IDE setup for Linux w/ Clang.

Optional developer tooling for working on the code, not a change to how NT;RE builds. Adds a dev container based on the same sniper SDK image the CI runners use, and tools/ntre-dev-setup.sh, which sets up working C++ IntelliSense: a pinned clangd, a compile_commands.json symlinked at the repo root, and a .clangd with the flags the SteamRT toolchain needs. 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 tree no longer has.

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 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
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.
Five targets build with UNITY_BUILD ON, so the build's compile_commands.json
lists only generated unity_*.cxx blobs and roughly 1300 translation units
carry no compile flags an indexer can use - navigation and completion are
dead across most of src/game.

The script configures a second, build-free CMake directory with unity off,
purely for its compile database. The property is cleared through a deferred
CMAKE_PROJECT_neo_INCLUDE hook, so no tracked CMakeLists.txt changes and the
build keeps its unity speedup. What it produces is editor-agnostic:
compile_commands.json symlinked at the repo root, a .clangd removing the
GCC-only flags clang rejects, and a pinned, checksummed clangd under .ide/
(the sniper image ships 13, too old for this tree's C++20).

Entry points: 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),
the tracked VS Code tasks, or running the script directly. Everything
generated is git-ignored; *.sh gains eol=lf so a Windows checkout cannot
produce a script that fails to run.
Comment thread tools/ntre-dev-setup.sh
# UNITY_BUILD so the database gets one entry per translation unit (see the
# header of tools/ntre-dev-setup.sh). The real build keeps its unity speedup.

function(_neo_ide_disable_unity dir)

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.

This thing is kinda clever, but I think it would be better to create a CMake option NEO_USE_UNITY_BUILD instead and use its value to initialize the UNITY_BUILD property of all unity build targets. Set it to ON only for the CI build and OFF otherwise (which is what we need for Linux Debug (IntelliSense index only) preset and also the developers since the build is incremental). Apart from this - LGTM.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Happy to make the change, thank you for the review!

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

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.

2 participants