Files
Build-System/docs/VOIDLIBRARY_UPSTREAM_REQUESTS.md
T
faumaray ab64147f9d
VoidBuildSystem CI / build-and-test-gcc16 (push) Failing after 3s
Implement VoidBuildSystem v1 (Plans 01-19) with VoidLibrary integration
2026-11-26 20:45:54 +03:00

260 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.
# VoidLibrary Upstream Feature Requests
Pinned baseline inspected: `9931c5ffc4844a5e09e1b1db35b3d29c5097c3a5`.
This ledger tracks reusable, non-build-system-specific capabilities needed by
VoidBuildSystem that are absent, incomplete, or tightly bound to external
system libraries in the pinned VoidLibrary revision. Until a dedicated
VoidLibrary worker implements these items and the pin is updated, VBS keeps
swappable local adapters behind clean internal interfaces.
---
## VL-001: Robust Process Descendant Lifecycle Supervision (`Void::Process`)
- **Target module**: `System` (`include/Void/System/Process.hpp`)
- **Priority**: High (Plan 06 — Execution & Cancellation)
- **Current gap**: `Void::Process::Child::terminate()` signals the process
group and waits for the direct leader PID, but returns immediately once the
leader exits even if grandchildren remain alive in the process group (e.g.
ignoring `SIGTERM`).
- **Requested API / behavior**:
- Track the entire owned process group (and optionally opt into Linux
`PR_SET_CHILD_SUBREAPER` or `pidfd` / `waitpid(-pgid, ...)` draining).
- `Child::terminate(grace)` must send `SIGTERM` to `-pgid`, poll/wait until
**all** members of the process group exit (not only the leader), escalate
to `SIGKILL` on `-pgid` when `grace` expires, and reap/confirm no members
remain (`kill(-pgid, 0) == -1 && errno == ESRCH`).
- **Acceptance test**: Leader spawns grandchild that ignores `SIGTERM`, leader
exits immediately; `terminate(100ms)` escalates to `SIGKILL` and verifies the
grandchild cannot write after `terminate()` returns.
- **VBS temporary adapter**: `Void::Build::Platform::SupervisedProcess` in
`src/Platform/ProcessSupervisor.cpp`.
## VL-002: TOML 1.0 Parser and Serializer (`Void::Data::Toml`)
- **Target module**: `Data` (`include/Void/Data/Toml.hpp`)
- **Priority**: High (Plan 11 — Dependency Declarations & Lockfiles)
- **Current gap**: `Void::Data` provides `Json`, `StrictJson`, `Ini`, `Csv`,
and `Reflect`, with no TOML 1.0 parser/serializer.
- **Requested API / behavior**:
- Full TOML 1.0 parser returning `Void::Result::Result<Document, ParseError>`
with line/column source locations (`Origin{line, column}`) on every node
and error.
- Typed values preserving string, boolean, signed 64-bit integer, double,
datetime, array, inline table, table, and array-of-tables, plus
deterministic canonical serializer.
- **Acceptance test**: Round-trip TOML 1.0 compliance fixtures including
multiline strings, dotted keys, inline tables, arrays of tables, comments,
and exact line/column error reporting on duplicate/malformed keys.
- **VBS temporary adapter**: `Void::Build::Package::Toml` in
`src/Package/Toml.cpp`.
## VL-003: Kernel-Event Recursive Directory Watcher (`Void::System` / `Void::SystemAsync`)
- **Target module**: `System` / `SystemAsync`
(`include/Void/System/DirectoryWatcher.hpp` or extension to `AsyncWatcher.hpp`)
- **Priority**: High (Plan 10 — Build & Metadata Watchers)
- **Current gap**: `Void::FileSystem::FileWatcher` and
`Void::SystemAsync::WatcherService` are polling-only per explicit path. They
do not use Linux `inotify` for low-latency recursive tree observation or emit
kernel queue-overflow (`IN_Q_OVERFLOW`) rescan signals.
- **Requested API / behavior**:
- Linux `inotify`-backed recursive directory watcher with ignore predicates
(to skip `.git`, `build/`, etc.), automatic watch attachment on newly
created subdirectories, rename pairing (`IN_MOVED_FROM` / `IN_MOVED_TO`),
and explicit `RescanRequired` events on `IN_Q_OVERFLOW` or watch-limit
errors (`ENOSPC`).
- **Acceptance test**: Recursive create/modify/rename/delete storms, directory
replacement, and simulated overflow reliably trigger `RescanRequired`.
- **VBS temporary adapter**: `Void::Build::Watch::InotifyWatcher` in
`src/Watch/Watcher.cpp`.
## VL-004: Concrete HTTP/1.1 Server Transport (`Void::Net::HttpServer`)
- **Target module**: `Net` (`include/Void/Net/HttpServer.hpp`)
- **Priority**: High (Plan 16 & 17 — Hosted Registry Service & Web UI)
- **Current gap**: `Void::Net::Server.hpp` provides transport-neutral `Router`,
`StaticFileResolver`, and `WebSocketSessions`, while `Void::Net::Socket.hpp`
only provides `UdpSocket`. There is no concrete TCP/HTTP server listener.
- **Requested API / behavior**:
- Concrete loopback/configurable TCP HTTP/1.1 server dispatching through
`Void::Net::Router`, supporting ephemeral port binding (`port == 0` with
`bound_port()` query), configurable header/body size limits, graceful
shutdown, and streaming request/response bodies to/from files.
- **Acceptance test**: Ephemeral-port loopback server handling concurrent
GET/PUT/POST/DELETE requests, oversized body rejection (413), and clean
shutdown without dangling sockets.
- **VBS temporary adapter**: `Void::Build::Registry::HttpServer` in
`registry/service/HttpServer.cpp`.
## VL-005: Streaming HTTP Client & Secure TLS Default (`Void::Net::HttpClient`)
- **Target module**: `Net` (`include/Void/Net/Http.hpp`)
- **Priority**: Medium (Plan 12 — Package Fetching)
- **Current gap**: `HttpClient::send()` buffers the entire response body in
`std::string` and defaults `m_verify_tls = false`.
- **Requested API / behavior**:
- Add streaming download-to-file (`download_to_file`) and streaming
upload-from-file (`upload_file`) with byte quotas, cancellation
(`std::stop_token`), and incremental digest/progress callbacks.
- Provide a secure constructor/preset with TLS certificate verification
enabled by default and explicit redaction of `Authorization` headers in
diagnostics.
- **Acceptance test**: Streaming multi-megabyte transfer with quota overflow
abort and TLS verification check.
- **VBS temporary adapter**: `Void::Build::Package::HttpTransfer` in
`src/Package/Fetch.cpp`.
## VL-006: Archive Creation and Multi-Format Support (`Void::Archive`)
- **Target module**: `Archive` (`include/Void/Archive/Archive.hpp`)
- **Priority**: Medium (Plan 12 & 15 — Source/Binary Packaging)
- **Current gap**: `Void::Archive` currently exposes only `extract()` for
`tar`/`tar.zst` and requires external `LibArchive::LibArchive`. There is no
archive creation API (`create()`), nor pure-C++ USTAR/PAX tar fallback.
- **Requested API / behavior**:
- Add deterministic `Void::Archive::create()` accepting sorted entries,
canonical mtime/uid/gid/mode metadata (for reproducible archives), and
safe extraction for `.tar`, `.tar.gz`, `.tar.zst`.
- **Acceptance test**: Deterministic archive creation (byte-identical across
runs with fixed epoch), round-trip extraction, and traversal/symlink-escape
rejection.
- **VBS temporary adapter**: `Void::Build::Package::TarArchive` (pure-C++
deterministic PAX/USTAR tar reader/writer + optional gzip/zstd piping) in
`src/Package/Archive.cpp`.
## VL-007: Zero-Dependency Built-In SHA-256 / BLAKE2b Fallback (`Void::Crypto`)
- **Target module**: `Crypto` (`include/Void/Crypto/Crypto.hpp`)
- **Priority**: Medium (Plan 05, 07, 11, 12, 16)
- **Current gap**: `Void::Crypto` requires external `OpenSSL::Crypto`, which is
not installed in minimal C++ toolchain environments such as `dev cpp-gcc`.
- **Requested API / behavior**:
- Support a built-in pure-C++ FIPS 180-4 SHA-256 (and SHA-512) implementation
in `Void::Crypto` when OpenSSL is absent (or as a lightweight
`Void::CryptoHash` module without external dependencies), keeping the exact
`Void::Crypto::Hasher` API.
- **Acceptance test**: NIST CAVP SHA-256 vectors + streaming file hashing
compile and pass with zero external crypto packages.
- **VBS temporary adapter**: `Void::Build::Util::Sha256Hasher` in
`src/Util/Sha256.cpp` (with compile-time switch to `Void::Crypto::Hasher`
when `VBS_HAS_VOID_CRYPTO` is enabled).
## VL-008: Strict UTF-8 Validation in `Void::Json::Strict` (`Void::Data`)
- **Target module**: `Data` (`include/Void/Data/StrictJson.hpp`)
- **Priority**: Medium (Observed in V-002 review)
- **Current gap**: `Void::Json::Strict::parse()` accepts raw invalid UTF-8
bytes (e.g. `0xff`, overlong sequences, UTF-8 encoded surrogates) inside JSON
strings instead of rejecting them per RFC 8259.
- **Requested API / behavior**:
- Validate every UTF-8 byte sequence in JSON strings and object keys during
both `parse()` and serialization (reusing `Void::Unicode::is_scalar_value`
/ UTF-8 validation).
- **Acceptance test**: Reject stray continuation bytes, overlong encodings,
surrogates (`U+D800..U+DFFF`), and code points `> U+10FFFF` while preserving
all valid 1..4-byte Unicode scalars.
- **VBS temporary adapter**: `src/Util/Json.cpp` now delegates to
`Void::Unicode::validate_utf8` whenever `VBS_HAS_VOID_UNICODE` is enabled
(preserving a pure-C++ fallback for standalone SDK compilation), and
`src/Build.cpp` enforces `require_utf8()`.
## VL-009: Native Non-CMake Test Registration API (`Void::Testing`)
- **Target module**: `Testing` (`include/Void/Testing/Test.hpp`,
`cmake/VoidTestScanner.cmake`)
- **Priority**: High (Plan 18 — Strict Native Self-Hosting)
- **Current gap**: Test discovery currently relies on CMake running
`VoidTestScanner.cmake` at configure time to scan `.cpp` files and emit a
generated registration translation unit. Strict native self-hosting stages
cannot depend on CMake.
- **Requested API / behavior**:
- Provide either a first-class self-registering C++ macro/helper API in
`Void::Testing` (e.g. `VOID_TEST(suite, name)` with path-disambiguated
unique symbols avoiding basename collisions) or an officially supported
standalone C++ registration generator library/header contract.
- **Acceptance test**: Build and run a multi-file `Void::Testing` binary
purely with `g++` (zero CMake), verifying `--list`, `--filter`, and exact
nonzero test count even when two files share the same stem in different
subdirectories.
- **VBS temporary adapter**: Native C++ test registration generator in
`src/SelfHost/TestRegistryGen.cpp` (Plan 18).
## VL-010: Advisory File Locks, Atomic Symlink Swap, Reflink Copy & Canonical Timestamps (`Void::FileSystem`)
- **Target module**: `System` (`include/Void/System/Path.hpp`)
- **Priority**: Medium (Plan 05, 07, 09, 11)
- **Current gap**: `Void::FileSystem::replace_file()` covers atomic durable
regular-file replacement, but lacks:
- RAII advisory file locks (`flock` / `fcntl` shared & exclusive, blocking
and try-lock).
- Atomic symlink swap (`symlink` to temp name + `rename` + parent dir
`fsync`).
- Copy-on-write reflink copy (`ioctl(FICLONE)` with private-copy fallback,
explicitly never hardlinking).
- Canonical timestamp setter (`utimensat(..., AT_SYMLINK_NOFOLLOW)`).
- **Requested API / behavior**: Add these primitives to `Void::FileSystem` with
`Void::Result::Result` error reporting matching `replace_file()`.
- **VBS temporary adapter**: `Void::Build::Platform::FileOps` in
`src/Platform/FileOps.cpp`.
## VL-011: Embedded/Optional SQLite & Argparse Subcommands (`Void::Sqlite`, `Void::Argparse`)
- **Target modules**: `Sqlite`, `Configuration`
- **Priority**: Low–Medium (Plan 07, 10, 16)
- **Current gaps**:
1. `Void::Argparse::Parser` does not natively support subcommands
(`vbs build`, `vbs compdb use`, `vbs deps resolve`) or repeatable options
(`--target a --target b`, `--profile debug --profile release`), and
reports `--help` through the error channel.
2. `Void::Sqlite` requires system `SQLite3::SQLite3` (`find_package`) with no
optional FetchContent/amalgamation fallback when building in minimal tool
environments (`dev cpp-gcc`).
- **Requested API / behavior**:
- Add subcommand dispatch, repeatable `option_many()`, and distinct
`ParseOutcome::Help` vs `ParseOutcome::Error` in `Void::Argparse::Parser`.
- Allow optional FetchContent/amalgamation SQLite3 in
`cmake/Dependencies.cmake` (parallel to Boost) so `Void::Sqlite` works in
minimal shells.
- **VBS temporary adapter**: `src/Main.cpp`, `registry/service/Main.cpp`,
`src/Describe.cpp`, and `benchmarks/EngineBenchmarks.cpp` all delegate option
parsing and `--help` generation to `Void::Argparse::Parser` (with only thin
subcommand-dispatch and repeatable-flag extraction wrappers in `src/Main.cpp`).
`src/State/StateStore.cpp` provides a crash-safe journaled atomic-replace
backend using `Void::FileSystem::replace_file` while preserving a compile-time
`Void::Sqlite` switch when `SQLite3` is present.
## VL-012: VoidLibrary Naming Consistency Note
- **Observation**: Most VoidLibrary modules use `PascalCase` enums
(`Void::Crypto::HashAlgorithm::Sha256`, `Void::Sqlite::OpenMode::ReadOnly`,
`Void::Net::Method::Get`, `Void::Security::PasswordHashStrength::Moderate`)
and `snake_case` functions/methods. A few headers mix styles
(`Void::Crypto::sha256File` camelCase vs `Void::Security::hash_password`
snake_case; `Void::Process::EnvMode::inherit` snake_case vs
`Void::Sqlite::OpenMode::ReadOnly` PascalCase). VoidBuildSystem standardizes
strictly on `Void::Build` (`PascalCase` types/enums/filenames, `snake_case`
functions/methods) to align with the primary VoidLibrary style.
## VL-013: Shorthand SemVer Range Comparators (`Void::Semver::VersionRange`)
- **Target module**: `Text` (`include/Void/Text/Semver.hpp`)
- **Priority**: Medium (Plan 11 — Native Dependency Solver)
- **Current gap**: `Void::Semver::VersionRange::parse()` calls
`parse_strict()` on comparator/caret/tilde operands and rejects omitted minor
or patch components such as `^1`, `^1.0`, `^11.0`, `~1.2`, `>=1.2 <2`, or
`<2`. While wildcard tokens (`1.*`, `1.2.x`) are accepted, standard
Cargo/npm-style shorthand comparators fail to parse.
- **Requested API / behavior**:
- Support partial version bounds in `Void::Semver::VersionRange::parse()`:
- `^M` -> `>=M.0.0 <(M+1).0.0` (including `^0` -> `<1.0.0`)
- `^M.m` -> `^M.m.0`
- `~M` -> `>=M.0.0 <(M+1).0.0`, `~M.m` -> `~M.m.0`
- `>=M`, `>=M.m`, `<M`, `<M.m`, etc. padded to `.0` / `.0.0`.
- **Acceptance test**: `parse_range("^1.0")`, `parse_range("^11.0")`,
`parse_range("~1.2")`, `parse_range(">=1.2 <2")`, and `parse_range("<1.2.0")`
all parse cleanly and match the expected versions.
- **VBS temporary adapter**: `parse_semver_range_compat()` in
`src/Package/Solver.cpp`.