13 KiB
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, ARCHITECTURE, 01–21 plans, STATE, VERIFICATION, 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-mingw32with MinGW-w64 GCC 16.2 fromdev 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.
- Cross-compile to
- 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:
- Toolchain driver discovers
x86_64-w64-mingw32-{gcc,g++,ar,windres}and recordstarget_triple, PE artifact naming (.exe,.dll,.a/.lib, import libraries). - Profile/target context carries the Windows target (
os=Windows,architecture=x86_64) while the host stays Linux. - Test execution uses a configurable runner prefix (
wine, orwine64) when the target is Windows and the host is not. - 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
- Ordinary compiled C++ descriptions instead of a DSL (CMake language, Meson DSL, build2
bsl). - Hermetic immutable snapshots and content-addressed inputs.
- Built-in CAS with remote action cache and profile isolation.
- Deterministic-by-default outputs (proven bit-identical Stage 2 == Stage 3).
- Native foreign-graph translation (CMake/Meson → native actions), not just delegation.
- Integrated package manager, registry (RBAC, signatures, SBOM, binary variants).
- First-class modules/header units/PCH/unity/LTO/sanitizers with real capability probes.
- Daemon + editor protocol built in.
- One tool covers build, deps, registry, install, packaging, provenance.
5. Prioritized execution order
- Documentation drift: status tables must match verified reality (this plan updates them).
- Wine-first Windows target support (§2).
- Packaging parity: ZIP (stored), DEB, RPM, metadata, signing (
--archive-formatextensions). - IDE ecosystem: File API shim (done:
vbs ide generateemits codemodel-v2), presets import (done:vbs presets), external plugins (VS Code and Zed extensions published atVoid/VbsVsCodeandVoid/VbsZedviavbs ide plugin; a CLion plugin remains). - Migration tooling (done:
vbs migraterenders abuild.cppscaffold 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). - Test-runner parity.
- Benchmarks against CMake/Meson/build2 on documented fixtures (including 10k-target scaling).
- CI on real runners, sanitizer jobs (sanitizer build run done), parser fuzzing (deterministic mutation harness and a Clang/libFuzzer target done).
- Remote execution workers (registry worker/lease/result protocol, queue, remote action execution and parallel workers done; cross-machine orchestration remains).
- 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
- pkg-config discovery - done (Wave 140).
Dependency::pkgconfig(spec)resolves.pcmodules into imported targets. Originally: CMake (FindPkgConfig/find_package) and Meson (dependency(), auto method orderpkg-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.pcsearch path in profiles, resolved into an imported target. - Language breadth: ASM and shader languages - done (Wave 141). VBS is C/C++ only. Add assembly (
.s,.Swith the C preprocessor) and the shader languages used by Void projects (GLSL, HLSL, Slang) through pluggable shader-compiler toolchains with capability probes. - Platform breadth - deferred. Native MSVC and Apple Clang/macOS stay deferred by decision; MinGW cross + Wine is the current Windows story.
- Package-generator parity. CPack also ships NuGet, PKG/productbuild, APK and IFW
installers; VBS has tar,
sh, ZIP, DEB, RPM, WiX, UDIF and NuGet (Wave 144). PKG is the next useful one.
8.2 Developer experience and IDE integration
- Coverage reporting.
vbs test --coverageproducing lcov XML (gcov for GCC, llvm-cov for Clang) alongside JUnit. CMake hasCTestCoverageCollectGCOV; Meson has theb_coverageoption. - Test repetition controls. CTest offers
--repeat until-fail|after-timeout|until-pass,--shuffle,--stop-on-failureand per-test retries; VBS has labels, resources, fixtures, timeouts, JUnit and CDash but none of these. Flaky-test retries are valuable for CI. - IDE debug integration.
vbs ide generatewrites editor configs, but not debug configurations: add.vscode/launch.json/tasks.json(gdb/lldb) and JetBrains run configurations per target. Also exportCMakePresets.jsonso CMake-only tools can read a VBS project. - Shell completions and man pages for
vbs(bash/zsh/fish), generated from the argparse tree. - Migration breadth.
vbs migratehandles a bounded CMake subset; add--from mesonand cover more CMake commands.vbs initcould grow templates (header-only, shared library, GUI).
8.3 Differentiators worth building (incumbents lack these)
vbs explain. Why did an action re-run? VBS already stores cached action digests and inputs; the explain report (changed input, command, environment, cache miss) is a cheap, high-value debugging feature that Ninja/CMake/Meson do not offer.- 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).
- Build Event Protocol / Chrome trace output for CI dashboards and IDE timelines.
- Multi-machine orchestration. The registry, queue, leases, remote execution and parallel workers exist; coordinating several machines (capacity, retries, affinity) is the remaining step.
- 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. Before optimizing further,
re-run benchmarks/compare.sh against a Release build, then attack the cold-start cost
(descriptor compilation dominates: 2.6 s cold vs CMake's 97 ms on 20 sources).
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.