Files
Build-System/docs/roadmap/22-superiority-and-gaps.md
T
faumaray fe453bd601
VoidBuildSystem CI / 1 · Requirements (push) Successful in 3s
VoidBuildSystem CI / 2B · Windows Wine build (debug) (push) Successful in 2m11s
VoidBuildSystem CI / 2A · Linux build (debug) (push) Successful in 2m33s
VoidBuildSystem CI / 2A · Linux build (coverage) (push) Successful in 2m44s
VoidBuildSystem CI / 2A · Linux build (sanitizers) (push) Successful in 4m16s
VoidBuildSystem CI / 2A · Linux build (relwithdebinfo) (push) Successful in 4m37s
VoidBuildSystem CI / 2B · Windows Wine build (relwithdebinfo) (push) Successful in 3m29s
VoidBuildSystem CI / 3B · Windows Wine test (debug) (push) Successful in 24s
VoidBuildSystem CI / 3A · Linux test (sanitizers) (push) Successful in 1m52s
VoidBuildSystem CI / 3B · Windows Wine test (relwithdebinfo) (push) Successful in 20s
VoidBuildSystem CI / 3A · Linux test (coverage) (push) Failing after 1m57s
VoidBuildSystem CI / 3A · Linux test (relwithdebinfo) (push) Successful in 6m47s
VoidBuildSystem CI / 3A · Linux test (debug) (push) Successful in 7m4s
VoidBuildSystem CI / 4A2 · VBS installers (linux target) (push) Skipped
VoidBuildSystem CI / 4A2 · VBS installers (windows target) (push) Skipped
VoidBuildSystem CI / 5 · Release (push) Skipped
feat: migration breadth, project templates, preset export, IDE/registry polish
- vbs migrate --from meson: bounded meson.build importer (project, variable
  assignments, files()/include_directories(), executable/static_library/
  shared_library/library with link_with, include_directories, dependencies,
  install/install_dir) rendering the same build.cpp scaffold; everything
  untranslated is reported as a note.
- vbs init --template app|library|header-only|shared; every template
  scaffolds a project whose own test passes.
- vbs presets --export FILE: writes VBS profiles as CMake configure presets
  (round-trips through the CMakePresets importer).
- vbs ide generate also writes JetBrains run configurations per target.
- VBS_HOST_CXX_FLAGS/VBS_HOST_LDFLAGS instrument the compiled build
  descriptor (the CI sanitizer lane sets them).
- The registry queue counts lease attempts and abandons an action after 5
  attempts into a dead-letter list instead of leasing it forever.
- CI: coverage lane (lcov report), sanitizer descriptor flags; docs ledger
  brought up to date (STATE/TASKS/superiority roadmap).

Verified: the new FullV1Tests and RegistryTests cases pass and the full
CTest suite passes 8/8.
2026-12-06 17:23:59 +03:00

179 lines
14 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 22 — Superiority roadmap: gaps toward replacing CMake, Meson and build2
Status: **analysis plan (2026-12-05)**. This plan records what is still missing after Plans 01–21 and the post-v1 expansion, and the path to a *superior* replacement of CMake, Meson and build2.
Sources: [REQUIREMENTS](REQUIREMENTS.md), [ARCHITECTURE](ARCHITECTURE.md), [01–21 plans](README.md), [STATE](../agent-workflow/STATE.md), [VERIFICATION](../agent-workflow/VERIFICATION.md), live CMake/Meson documentation via Context7, and this session's observed results.
build2 documentation was **not** available through Context7; build2 statements below are general knowledge and are marked *(unverified)*.
## 1. Current gap inventory
| Area | Status | Evidence / note |
| --- | --- | --- |
| Track C2 macOS / Apple Clang / `ld64` | **Deferred (dropped for now)** | no macOS host; decided 2026-12-05 |
| Track C3 Windows / MSVC | **Redesigned: Wine-first** | see §2; native MSVC host is Track C3-native, deferred |
| Track C4 host-vs-target cross-compilation | **Required by the Wine strategy** | host profile for generators, target profile for products |
| Dedicated editor plugins (VS Code, Zed, CLion…) | Open | daemon editor protocol is implemented; plugins live in external repos |
| Remote / distributed execution workers | Deferred | `20`, R-015 |
| VoidLibrary's own `build.cpp` | Open | `recipes/VoidLibrary/` builds it inside VBS, but VoidLibrary is not yet migrated |
| Installer generators | Partial | deterministic tar + self-extracting `sh` + SBOM + Ed25519; DEB/RPM/MSI/DMG-style generators missing |
| Test-runner parity | Done | `VOID_TEST` runner; fixtures/labels/resource locks/timeouts/JUnit/CDash |
| IDE ecosystem | Partial | `vbs ide` + CompDB + daemon protocol; no File API shim, presets import, or plugins |
| CI on real runners, sanitizers, fuzzing | Unverified | the GitHub Actions workflow is a template that has never run |
## 2. Platform strategy (revised 2026-12-05)
- **macOS: dropped for now.** No macOS host is available; Track C2 stays documented but unscheduled.
- **Windows: Wine-first.**
- Cross-compile to `x86_64-w64-mingw32` with MinGW-w64 GCC 16.2 from
`dev cpp-gcc -p pkgsCross.mingwW64.stdenv.cc`.
- Run produced PE binaries and Windows-only tools under Wine 11 from
`dev cpp-gcc -p wine64`.
- This exercises the host/target split (Track C4): a Linux **host** profile builds code
generators, a Windows **target** profile builds products, and tests execute under Wine.
- **Native MSVC / clang-cl host support is deferred** (Track C3-native) until a real Windows
host exists.
Status 2026-12-05: items 1-3 below are **implemented** (`--target-os windows --target-arch x86_64`, MinGW-w64 discovery, `.exe`/`.dll` naming, Wine test runner) and verified by `FullV1Tests.track_c_windows_target_cross_build_and_wine_test`; item 4 (path/case-sensitivity validation under Wine) is also implemented: Windows-target lowering rejects case-only output collisions and reserved device names, and the Wine regression test proves case-insensitive file semantics.
Concrete work this implies:
1. Toolchain driver discovers `x86_64-w64-mingw32-{gcc,g++,ar,windres}` and records
`target_triple`, PE artifact naming (`.exe`, `.dll`, `.a`/`.lib`, import libraries).
2. Profile/target context carries the Windows target (`os=Windows`, `architecture=x86_64`) while
the host stays Linux.
3. Test execution uses a configurable runner prefix (`wine`, or `wine64`) when the target is
Windows and the host is not.
4. Path and case-sensitivity tests run against Wine to validate Windows semantics without a
Windows host.
## 3. Parity roadmap against the incumbents
| Capability | CMake | Meson | build2 *(unverified)* | VBS now | Planned work |
| --- | --- | --- | --- | --- | --- |
| Platforms | Windows, macOS, Linux, BSD, cross | same | same | Linux | Wine-first Windows (§2); macOS deferred |
| Languages | C, C++, CUDA, Fortran, ObjC, ASM, HIP… | C, C++, Rust, D, Fortran, Java… | C/C++ focused | C, C++ | ASM and shader languages (GLSL/HLSL/Slang) |
| Toolchains | MSVC, clang-cl, GCC, Clang, Apple, many | GCC, Clang, MSVC, many | GCC, Clang, MSVC | GCC, Clang (Linux) | MinGW target; MSVC deferred |
| Package/registry | External (vcpkg, Conan, FetchContent) | wrapdb, subprojects | cppget.org / brep | **Built-in registry + solver + lock + binary variants + signatures + SBOM** | federation, mirrors, key distribution |
| Install/package | `install()`, `install(EXPORT)`, CPack (TGZ/ZIP/DEB/RPM/WIX/DMG/NuGet/APK…) | `install_data`, `install_headers`, dist scripts | install module | prefix staging, components, relocatable CMake + native exports, tar, self-extracting `sh`, **stored ZIP**, **DEB (dpkg-validated)**, SBOM, **Ed25519-signed archives with checksums** | **RPM (rpm 6.1-validated)**, **WiX source for MSI** (candle/light on Windows), **UDIF/DMG container** (koly trailer, CRC-32; HFS+ payload is macOS-only) |
| IDE integration | File API, presets, every IDE | `meson-info` introspection | limited | `vbs ide generate/query`, CompDB, daemon protocol | File API shim, `CMakePresets.json` import, plugins |
| Test runner | CTest: fixtures, labels, resource locks, timeouts, JUnit/CDash | `meson test`: suites, timeouts, JUnit | test module | `VOID_TEST` runner; `vbs test --junit --test-timeout --label`; parallel tests with resource locks and fixtures; CDash submission | - |
| Incremental / cache | compiler depfiles, ccache external | depfiles, ccache | internal caching model | **content-addressed state, immutable snapshots, remote action cache** | scale benchmarks |
| Modules / PCH / unity / LTO / sanitizers | yes (with generator quirks) | yes | yes | **native with capability probing** | more compilers |
| Reproducibility | opt-in | opt-in | partial | **default deterministic** (epoch, prefix maps, canonical mtimes) | cross-platform determinism |
| Generators/backends | Ninja, Makefiles, VS, Xcode… | Ninja (+ others historically) | own scheduler | **direct executor (no generator)** | n/a |
| Remote execution | rare (via add-ons) | rare | rare | planned | workers after local engine |
## 4. Differentiators to preserve
1. Ordinary compiled C++ descriptions instead of a DSL (CMake language, Meson DSL, build2 `bsl`).
2. Hermetic immutable snapshots and content-addressed inputs.
3. Built-in CAS with remote action cache and profile isolation.
4. Deterministic-by-default outputs (proven bit-identical Stage 2 == Stage 3).
5. Native foreign-graph translation (CMake/Meson → native actions), not just delegation.
6. Integrated package manager, registry (RBAC, signatures, SBOM, binary variants).
7. First-class modules/header units/PCH/unity/LTO/sanitizers with real capability probes.
8. Daemon + editor protocol built in.
9. One tool covers build, deps, registry, install, packaging, provenance.
## 5. Prioritized execution order
1. Documentation drift: status tables must match verified reality (this plan updates them).
2. Wine-first Windows target support (§2).
3. Packaging parity: ZIP (stored), DEB, RPM, metadata, signing (`--archive-format` extensions).
4. IDE ecosystem: File API shim (**done**: `vbs ide generate` emits codemodel-v2), presets import (**done**: `vbs presets`), external plugins (**VS Code and Zed extensions published** at `Void/VbsVsCode` and `Void/VbsZed` via `vbs ide plugin`; a CLion plugin remains).
5. Migration tooling (**done**: `vbs migrate` renders a `build.cpp` scaffold from a bounded CMakeLists subset) and migrating VoidLibrary onto VBS (**trial extended**: 25+ pure modules build with VBS in a separate clone; upstream #61 tracks the in-repo build description and the remaining externally dependent modules).
6. Test-runner parity.
7. Benchmarks against CMake/Meson/build2 on documented fixtures (including 10k-target scaling).
8. CI on real runners, sanitizer jobs (**sanitizer build run done**), parser fuzzing (**deterministic mutation harness and a Clang/libFuzzer target done**).
9. Remote execution workers (**registry worker/lease/result protocol, queue, remote action execution and parallel workers done**; cross-machine orchestration remains).
10. pkg-config discovery (the top adoption blocker, §8.1) and ASM/shader language support.
## 6. Observed baseline (2026-12-05, x86_64, GCC 16.2, Debug, `benchmarks/compare.sh 20`)
20 generated sources, 32 cores, wall-clock milliseconds:
| Tool | cold | warm/no-op |
| --- | --- | --- |
| VBS (`vbs build`) | 2578 | 209 |
| CMake + Ninja (configure / build) | 234 (configure) | 98 cold build, 9 warm |
| Meson (`setup` / `compile`) | 438 (setup) | 232 cold, 166 warm |
Interpretation: for a tiny project VBS pays for descriptor compilation, snapshot capture and
toolchain probing on every CI invocation, so its cold and warm times are higher than Ninja's
no-op. This is the clear performance target: cache the compiled descriptor and toolchain probe
across invocations, and keep snapshot work proportional to changed files. Larger fixtures are
needed before drawing scaling conclusions.
## 8. Research findings: what to add next (2026-12-05)
Checked against current CMake and Meson documentation via Context7 (build2 has no
Context7 docs; its items stay general knowledge). Ordered by what actually blocks adoption
first, then what makes VBS *better* rather than merely equal.
### 8.1 Adoption blockers
1. **pkg-config discovery - done (Wave 140).** `Dependency::pkgconfig(spec)` resolves `.pc` modules into imported targets. Originally: CMake (`FindPkgConfig`/`find_package`) and Meson
(`dependency()`, auto method order `pkg-config` → `cmake` → framework) both find
system-installed libraries. VBS has registry/git/path/CMake/Meson/Conan providers but no
pkg-config lookup, so most existing Linux projects cannot be built as-is. Add
`.pkgconfig("libfoo >= 1.2")` plus a `.pc` search path in profiles, resolved into an
imported target.
2. **Language breadth: ASM and shader languages - done (Wave 141).** VBS is C/C++ only. Add assembly (`.s`,
`.S` with the C preprocessor) and the shader languages used by Void projects (GLSL, HLSL,
Slang) through pluggable shader-compiler toolchains with capability probes.
3. **Platform breadth - deferred.** Native MSVC and Apple Clang/macOS stay deferred by
decision; MinGW cross + Wine is the current Windows story.
4. **Package-generator parity.** CPack also ships NuGet, PKG/productbuild, APK and IFW
installers; VBS has tar, `sh`, ZIP, DEB, RPM, WiX, MSI (compiled with wixl/candle), UDIF and
NuGet (Wave 144). PKG is the next useful one.
### 8.2 Developer experience and IDE integration
6. **Coverage reporting - done (Wave 145).** `vbs test --coverage` produces lcov (gcov for GCC,
llvm-cov for Clang) alongside JUnit. CMake has `CTestCoverageCollectGCOV`; Meson has the
`b_coverage` option.
7. **Test repetition controls - done (Wave 146).** `vbs test` now has `--repeat
until-fail|until-pass|after-timeout[:N]`, `--retry N`, `--shuffle [--shuffle-seed N]`
and `--stop-on-failure`, alongside labels, resources, fixtures, timeouts, JUnit and CDash.
8. **IDE debug integration.** `vbs ide generate` writes `.vscode/launch.json` and
`.zed/debug.json` debug configurations; JetBrains run configurations per target remain
open. `vbs presets --export FILE` (**done**) writes VBS profiles as CMake presets so
CMake-only tools can read a VBS project.
9. **Shell completions and man pages - done (Wave 146).** `vbs completions --shell
bash|zsh|fish` and `vbs man [--output DIR]` are generated from the argparse tree.
10. **Migration breadth.** `vbs migrate` handles a bounded CMake subset and now also
`--from meson` (`meson.build`: project, variables, targets, link_with,
include_directories, install). `vbs init --template app|library|header-only|shared`
provides project templates.
### 8.3 Differentiators worth building (incumbents lack these)
11. **`vbs explain` - done (Wave 146).** Why did an action re-run? `vbs explain` compares
every selected action against the CAS record and reports the changed inputs/outputs,
missing records, restorable outputs and remote-cache hits, as text or JSON. Ninja/CMake/Meson
do not offer this.
12. **Enforced hermetic sandboxing.** Snapshots already define exact inputs; enforcing that
actions see *only* them (mount/user namespaces) would make incrementality and
reproducibility a guarantee rather than a convention (Bazel-style).
13. **Build Event Protocol / Chrome trace output - Chrome trace done (Wave 146).**
`vbs build|test --trace FILE` writes a Chrome trace with phase and action spans for CI
dashboards and IDE timelines; a full BEP stream remains open.
14. **Multi-machine orchestration.** The registry, queue, leases, remote execution and
parallel workers exist; coordinating several machines (capacity, retries, affinity) is the
remaining step.
15. **Registry ecosystem.** Federation/mirrors, trusted-key distribution, and vcpkg
interop (Conan is already supported).
### 8.4 Performance note
The 92 ms warm no-op was measured with a **Debug** `vbs` binary. The shared per-user caches
(Wave 146) removed most of the cold-start cost in a fresh build directory (3897 -> 755 ms on
the 20-source fixture); warm no-ops stay around 150 ms. Next: re-run `benchmarks/compare.sh`
against a Release build and keep snapshot work proportional to changed files.
## 7. Acceptance gates
- Every platform claim has an observed run on that platform (or under Wine, clearly labelled).
- A package generator is accepted only when its output installs and runs from a clean machine image.
- Parity rows move to "done" only with tests in the repo suite, not from planning alone.
- Superiority claims require measured comparisons against the incumbent on the same fixture and
toolchain; until then they stay listed as design advantages.