Files
Build-System/docs/roadmap/22-superiority-and-gaps.md
T
faumaray 0c1bf7e5b2
VoidBuildSystem CI / build-and-test-gcc16 (push) Failing after 9s
VoidBuildSystem CI / sanitizers-gcc16 (push) Failing after 8s
VoidBuildSystem CI / signing-openssl-gcc16 (push) Failing after 12s
VoidBuildSystem CI / fuzz-clang (push) Failing after 5s
VoidBuildSystem CI / wine-windows-gcc16 (push) Failing after 49s
feat(lang): support assembly sources and shader bundles
2026-12-05 14:14:25 +03:00

174 lines
13 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 and UDIF. NuGet and PKG are the next
useful ones.
### 8.2 Developer experience and IDE integration
6. **Coverage reporting.** `vbs test --coverage` producing lcov XML (gcov for GCC,
llvm-cov for Clang) alongside JUnit. CMake has `CTestCoverageCollectGCOV`; Meson has the
`b_coverage` option.
7. **Test repetition controls.** CTest offers `--repeat until-fail|after-timeout|until-pass`,
`--shuffle`, `--stop-on-failure` and per-test retries; VBS has labels, resources, fixtures,
timeouts, JUnit and CDash but none of these. Flaky-test retries are valuable for CI.
8. **IDE debug integration.** `vbs ide generate` writes editor configs, but not debug
configurations: add `.vscode/launch.json`/`tasks.json` (gdb/lldb) and JetBrains run
configurations per target. Also export `CMakePresets.json` so CMake-only tools can read a
VBS project.
9. **Shell completions and man pages** for `vbs` (bash/zsh/fish), generated from the argparse
tree.
10. **Migration breadth.** `vbs migrate` handles a bounded CMake subset; add `--from meson`
and cover more CMake commands. `vbs init` could grow templates (header-only, shared
library, GUI).
### 8.3 Differentiators worth building (incumbents lack these)
11. **`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.
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** for CI dashboards and IDE timelines.
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. 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.