Implement the VLS roadmap on the native VBS build
Native VBS and CMake builds of the server and every registered suite: protocol and document sync, VBS/compdb providers, stock GCC diagnostics (including in-process default profile preparation), the stock occurrence observer and hover/definition, the bounded Scheduler, C++ module graph, scan and artifact cache with real CMI production, the context-aware symbol index with schema-2 snapshot migration, navigation and guarded rename, reflection provenance with splice-origin extraction, index-backed completion and signature help, live GCC worker control with a registered DAP suite, and the Neovim and VS Code clients. VoidLibrary follows main. The private GCC 16.2.0 frontend is reproduced from the versioned patches and verified stepping reflection/template code with projected values 17/34 and 41/82.
This commit is contained in:
1 parent
ca04975d54
commit
da8003f6d4
310 files changed
+47552
-480
No files matched your search
@@ -5,71 +5,143 @@ combines native Void Build System integration, compilation-database compatibilit
|
||||
core IDE features, modules/reflection, and a live/replay metaprogram debugger for
|
||||
Neovim and VS Code.
|
||||
|
||||
**Current state:** milestone0 shell implementation. The CLI and stdio LSP lifecycle
|
||||
are implemented and the ordinary unit/process suites pass. Full JSON conformance
|
||||
and final shell acceptance are **blocked on VoidLibrary's decimal-support update**.
|
||||
The capability suite intentionally reports the missing behavior as failures.
|
||||
This is not yet a usable clangd replacement.
|
||||
The native server supports stdio lifecycle, UTF-8/UTF-16 negotiation and
|
||||
incremental document synchronization. It reads native VBS build metadata and
|
||||
`compile_commands.json` without launching the project compiler. The JSON
|
||||
capability suite passes on VoidLibrary main, including exact numeric request IDs
|
||||
and valid numbers outside the parser's machine range. See the
|
||||
[verification record](docs/agent-workflow/VERIFICATION.md).
|
||||
|
||||
Compiler semantics, document synchronization, build providers, indexing, debugging
|
||||
and editor plugins are planned, not implemented. The shell advertises no semantic
|
||||
capabilities. See the [27-part roadmap](docs/roadmap/README.md),
|
||||
The provider and compiler work is in progress. Semantic IDE features, debugging
|
||||
and editors have separate acceptance gates in the [27-part roadmap](docs/roadmap/README.md),
|
||||
[requirements](docs/roadmap/REQUIREMENTS.md) and [architecture](docs/roadmap/ARCHITECTURE.md).
|
||||
|
||||
## Compiler requirements
|
||||
|
||||
Void projects can keep their existing compiler. Building VLS itself has been
|
||||
verified with stock GCC 16.2. Its C++26 reference tests include VoidLibrary
|
||||
reflection and module imports.
|
||||
|
||||
The Linux/Nix development profile enables editor diagnostics with unmodified
|
||||
GCC 16.2. VLS runs the selected translation unit's checked command and sends
|
||||
`textDocument/publishDiagnostics` as the user edits. It also tracks unsaved
|
||||
headers and optional headers that appear on disk. Separate module tests feed
|
||||
GCC dependency scans to the C++ planner. Completion, navigation and editor
|
||||
scheduling for modules remain in development.
|
||||
|
||||
An experimental GDB adapter observed nested `consteval` return values live on
|
||||
an unmodified x86-64 Linux GCC 16.2 package. It uses the matching GCC headers
|
||||
and an internal evaluator symbol. A separate experiment uses a patched frontend
|
||||
for richer events. Saved GCC recordings can be opened in a DAP client without
|
||||
a compiler on PATH. Live DAP control remains in development.
|
||||
See the [stock compiler experiment](tests/corpus/frontend/README.md).
|
||||
|
||||
## Build and test
|
||||
|
||||
Requires GCC16+ with C++26 reflection, CMake4+, Ninja and Git. The observed local
|
||||
environment provides GCC16.2 via `dev cpp-gcc`. On another system, run the underlying
|
||||
CMake commands in an equivalent toolchain environment; `dev` is a local wrapper.
|
||||
Use a VoidBuildSystem CLI with its matching SDK, GCC 16.2 with C++26 reflection,
|
||||
Git and Python 3. The commands below use the local `dev cpp-gcc` environment.
|
||||
Set `VBS` to the absolute path of your CLI when it is outside that environment's
|
||||
`PATH`.
|
||||
|
||||
```sh
|
||||
dev cpp-gcc -c cmake -S . -B build/bootstrap -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
|
||||
VBS=${VBS:-vbs}
|
||||
tools/prepare-voidlibrary
|
||||
dev cpp-gcc -c "$VBS" build --project "$PWD" --build-dir "$PWD/build/native" --profile debug
|
||||
dev cpp-gcc -c "$VBS" test --project "$PWD" --build-dir "$PWD/build/native" --profile debug
|
||||
python3 tests/native/Preparation.py
|
||||
```
|
||||
|
||||
Preparation fetches VoidLibrary `main` and selects an immutable generation
|
||||
under `build/voidlibrary`. Run it again to pick up an update. For an explicit
|
||||
development checkout, use `tools/prepare-voidlibrary --source /path/to/VoidLibrary`.
|
||||
The selected generation's `provenance.json` records the tested revision and
|
||||
local input changes. A prepared generation also supports an offline build.
|
||||
|
||||
## Run and install
|
||||
|
||||
```sh
|
||||
build/native/profiles/debug/out/bin/vls --help
|
||||
build/native/profiles/debug/out/bin/vls --stdio
|
||||
dev cpp-gcc -c "$VBS" install --project "$PWD" --build-dir "$PWD/build/native" \
|
||||
--profile debug --prefix "$PWD/build/stage" --no-cmake-export
|
||||
build/stage/bin/vls --version
|
||||
```
|
||||
|
||||
The VBS development checkout's dependency-aware install path passed the
|
||||
staged-executable test. VBS commit `6c225c2` builds and tests VLS, but that
|
||||
revision's install command fails while resolving `Void::Data`. The native
|
||||
build executable above is available with either CLI. See the
|
||||
[verification record](docs/agent-workflow/VERIFICATION.md).
|
||||
|
||||
## Replay a recorded constant evaluation
|
||||
|
||||
Configure a DAP executable with the installed `vls-dap` and the arguments
|
||||
`--replay /absolute/path/to/recording.vls`. Send a DAP `launch` request.
|
||||
The included `tests/debug/fixtures/integral-17.vls` opens at the inner
|
||||
`reflected_value` return of 17. Continue moves to the enclosing `twice`
|
||||
return of 34 and then to the later recorded values 22 and 44.
|
||||
|
||||
Use Stack Trace and Variables to inspect a return. Loaded Sources exposes
|
||||
the captured primary text even after its file changes. The recorded function
|
||||
locations are logical declarations, so clients display the frame name without
|
||||
jumping to a physical source line. The versioned timeline preserves which
|
||||
values the compiler actually paused on. The stdio process tests and headless
|
||||
Neovim session use the same installed executable interface.
|
||||
|
||||
```sh
|
||||
python3 -B tests/native/DapReplay.py --adapter "$PWD/build/stage/bin/vls-dap"
|
||||
```
|
||||
|
||||
## Enable stock GCC editor diagnostics
|
||||
|
||||
Prepare the profile in the same development shell used to build the project.
|
||||
Pass the project root and the profile's absolute path in the editor's VLS command.
|
||||
|
||||
```sh
|
||||
dev cpp-gcc -c tools/prepare-gcc-profile --output "$PWD/build/gcc-profile.json"
|
||||
build/native/profiles/debug/out/bin/vls --stdio \
|
||||
--workspace-root "$PWD" --gcc-profile "$PWD/build/gcc-profile.json"
|
||||
```
|
||||
|
||||
With the prepared stock occurrence observer, the same profile also enables
|
||||
hover and definition for verified direct calls:
|
||||
|
||||
```sh
|
||||
dev cpp-gcc -c tools/prepare-gcc-observer --output "$PWD/build/stock-observer-014/occurrences.so"
|
||||
dev cpp-gcc -c tools/prepare-gcc-profile --observer "$PWD/build/stock-observer-014/occurrences.so" \
|
||||
--output "$PWD/build/gcc-profile.json"
|
||||
```
|
||||
|
||||
The launcher sets the workspace's CLI tool-approval list to the profile's single
|
||||
compiler. This takes precedence over the tool list in a user settings file.
|
||||
The selected VBS metadata or compilation database
|
||||
must name the same compiler. The editor supplies the workspace folder and opens
|
||||
the source document as usual. With no profile the server provides passive build
|
||||
information and document synchronization.
|
||||
|
||||
The development worker supports one GCC 16.2 Linux/Nix toolchain profile and
|
||||
analyzes one open translation unit at a time. It captures source bytes under the
|
||||
launcher root and uses the toolchain's immutable system headers. A client can
|
||||
request `voidLanguageServer/analysisStatus` with `{"textDocument":{"uri":"…"}}`
|
||||
to inspect the active context or a compiler message whose editor range could
|
||||
not be verified. Each checked document has its own result. Project-wide
|
||||
diagnostics, cross-file navigation and module artifact production remain open.
|
||||
|
||||
With no arguments or with `--stdio`, the server reads Content-Length-framed
|
||||
UTF-8 JSON on stdin, writes protocol responses on stdout and diagnostics on
|
||||
stderr. Help and version are standalone options.
|
||||
|
||||
### Comparison build
|
||||
|
||||
The CMake 4/Ninja bootstrap is retained for comparison. A fresh configure
|
||||
refreshes the fetched revision of VoidLibrary.
|
||||
|
||||
```sh
|
||||
dev cpp-gcc -c cmake --fresh -S . -B build/bootstrap -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
|
||||
dev cpp-gcc -c cmake --build build/bootstrap
|
||||
dev cpp-gcc -c ctest --test-dir build/bootstrap --output-on-failure
|
||||
```
|
||||
|
||||
Default configuration follows VoidLibrary's main branch, as requested. Re-run
|
||||
configuration to check for upstream updates. The currently observed main revision
|
||||
still lacks decimal/exponent support; passing configure
|
||||
and compilation does not mean the full test suite passes.
|
||||
See [dependency provenance](docs/DEPENDENCIES.md) and
|
||||
[observed verification](docs/agent-workflow/VERIFICATION.md).
|
||||
|
||||
For explicit development against a local checkout, use a separate output tree:
|
||||
|
||||
```sh
|
||||
dev cpp-gcc -c cmake -S . -B build/local -G Ninja -DCMAKE_BUILD_TYPE=Debug -DVLS_VOID_SOURCE_DIR=/home/faumaray/Projects/VoidLibrary
|
||||
dev cpp-gcc -c cmake --build build/local
|
||||
dev cpp-gcc -c ctest --test-dir build/local --output-on-failure
|
||||
```
|
||||
|
||||
The override bypasses upstream main and is reported during configuration. The dependency
|
||||
checkout is never an output directory and must remain unchanged.
|
||||
|
||||
## Run
|
||||
|
||||
```sh
|
||||
./build/bootstrap/vls --help
|
||||
./build/bootstrap/vls --version
|
||||
./build/bootstrap/vls --stdio
|
||||
```
|
||||
|
||||
No arguments also starts stdio mode. Send Content-Length-framed UTF-8 JSON through
|
||||
stdin; stdout contains only protocol messages. Logs/errors go to stderr.
|
||||
The shell handles initialize/initialized/shutdown/exit, protocol errors and unknown
|
||||
methods. It returns empty capabilities and no fabricated semantic results.
|
||||
Header/body/depth limits are8KiB/16MiB/64. Help and version are standalone CLI modes.
|
||||
|
||||
Install the executable into an explicit local prefix after building:
|
||||
|
||||
```sh
|
||||
dev cpp-gcc -c cmake --install build/bootstrap --prefix /tmp/vls-install
|
||||
/tmp/vls-install/bin/vls --version
|
||||
```
|
||||
|
||||
The development dependency is linked statically; standard compiler/runtime libraries
|
||||
remain system requirements. Packaging/distribution and licensing are later gates.
|
||||
|
||||
## Development
|
||||
|
||||
[Current state](docs/agent-workflow/STATE.md) and
|
||||
@@ -80,7 +152,7 @@ Run meaningful tests and obtain independent review of integrated changes.
|
||||
The first usable release includes both live and recorded replay debugging of
|
||||
templates, constraints, constexpr/consteval and reflection, through DAP and custom
|
||||
views in both editors. Frontend/debugger feasibility and native VBS producer work
|
||||
are explicit gates. CMake bootstraps the repository; native VBS self-build follows.
|
||||
are explicit gates.
|
||||
|
||||
Project licensing is intentionally deferred until the backend decision. Local
|
||||
initialization does not authorize commits, pushes, publication or sibling edits.
|
||||
Reference in new issue
Block a user