From b8c362917ffc6fe0349bbef5ecebc7c5fc3523cd Mon Sep 17 00:00:00 2001 From: "Aleksei (Faumaray) Selikhov" Date: Fri, 4 Dec 2026 08:36:16 +0300 Subject: [PATCH] refactor(platform): make remaining POSIX assumptions explicit --- docs/agent-workflow/STATE.md | 2 ++ docs/agent-workflow/TASKS.md | 1 + docs/roadmap/21-expansion-roadmap.md | 2 +- registry/service/HttpServer.cpp | 8 ++++++++ src/Daemon/Daemon.cpp | 10 ++++++++++ src/Main.cpp | 4 ++++ 6 files changed, 26 insertions(+), 1 deletion(-) diff --git a/docs/agent-workflow/STATE.md b/docs/agent-workflow/STATE.md index ff5e5df..6970916 100644 --- a/docs/agent-workflow/STATE.md +++ b/docs/agent-workflow/STATE.md @@ -267,6 +267,8 @@ Stage: VERIFIED — Plans 01–19 + Plan 20 Slices 1–2C + Track A + Track B (B - **Wave 87 (`vbs releases yank` & Daemon `info` Workspace/Lockfile)**: added `Package::set_release_yanked` and `vbs releases yank --registry --name --version [--unyank]`, exercised live in the registry E2E. A swarm worker extended the daemon `info` response with `workspace` and `lockfile` ({path, exists}) fields and their test (4/4 substantive tasks; build task stopped and re-run). +- **Wave 88 (Track C1 Platform Boundaries)**: added explicit compile-time boundaries for the daemon Unix-socket transport (Windows `#error` pointing at Track C3) and the registry POSIX HTTP server/loopback client (swarm worker), and Windows-safe `_putenv_s` branches for the workspace member environment in `Main.cpp`/`Daemon.cpp`. Linux behavior is unchanged (full CTest 8/8). + ## Remaining future scope - **Post-v1 Expansion Roadmap ([21-expansion-roadmap.md](../roadmap/21-expansion-roadmap.md) & [20-future-translation-platforms.md](../roadmap/20-future-translation-platforms.md))**: Track C (macOS/Windows ports + dual-profile cross-compilation) and dedicated external editor plugins remain planned; Track D3 signing (SBOM, Ed25519 primitives, trusted-key enforcement/distribution, binary-variant signing/distribution) and Track E3 daemon capabilities are implemented, and Track E4 now uses `Void::Net` for the registry client/server and remote cache plus `Void::Sqlite` for the StateStore when available. diff --git a/docs/agent-workflow/TASKS.md b/docs/agent-workflow/TASKS.md index 91fbb3f..aa8e962 100644 --- a/docs/agent-workflow/TASKS.md +++ b/docs/agent-workflow/TASKS.md @@ -91,4 +91,5 @@ Base HEAD: `fe0d1a6` | Wave 85 (Lock show + mermaid graph) | `vbs lock show`; swarm added daemon `graph --format mermaid` | COMPLETE & VERIFIED (GCC 16.2, pin `0002e74`; CLI contract passes, Daemon suite passes, full CTest 8/8) | `src/Main.cpp`, `src/Daemon/Daemon.cpp`, `tests/{DaemonTests,CliContracts}.cpp/cmake`, docs | | Wave 86 (Shared compdb query + CLI) | `Editor::query_compdb_entries` reused by the daemon and the new `vbs compdb-entries` | COMPLETE & VERIFIED (GCC 16.2, pin `0002e74`; Daemon test and CLI contract pass, full CTest 8/8) | `include/Void/Build/Editor/CompDb.hpp`, `src/Editor/CompDb.cpp`, `src/Daemon/Daemon.cpp`, `src/Main.cpp`, `tests/CliContracts.cmake`, docs | | Wave 87 (Releases yank + info workspace) | `set_release_yanked`/`vbs releases yank --unyank`; swarm added daemon `info` workspace/lockfile fields | COMPLETE & VERIFIED (GCC 16.2, pin `0002e74`; Registry 9/9, Daemon suite passes, full CTest 8/8) | `include/Void/Build/Package/RegistryClient.hpp`, `src/Package/RegistryClient.cpp`, `src/Daemon/Daemon.cpp`, `src/Main.cpp`, `tests/{RegistryTests,DaemonTests}.cpp`, `tests/CliContracts.cmake`, docs | +| Wave 88 (Track C1 boundaries) | Windows compile-time boundaries for the daemon socket and registry POSIX HTTP; `_putenv_s` branches for workspace env vars | COMPLETE & VERIFIED (GCC 16.2, pin `0002e74`; full CTest 8/8) | `src/Daemon/Daemon.cpp`, `src/Main.cpp`, `registry/service/HttpServer.cpp`, docs | | Future (Plan 20 Slice 3 / Tracks C, E3 editor extensions) |"}] Live `conan` CLI verification; macOS/Windows/cross-compile; binary-variant signing and key distribution; daemon-side dependency materialization and editor plugins; `Void::Net`/`Void::Sqlite` alignment | PLANNED (unimplemented) | [21-expansion-roadmap.md](../roadmap/21-expansion-roadmap.md), [20-future-translation-platforms.md](../roadmap/20-future-translation-platforms.md) | diff --git a/docs/roadmap/21-expansion-roadmap.md b/docs/roadmap/21-expansion-roadmap.md index 82ac1e6..a7223d9 100644 --- a/docs/roadmap/21-expansion-roadmap.md +++ b/docs/roadmap/21-expansion-roadmap.md @@ -46,7 +46,7 @@ flowchart LR | Phase | Concrete Scope | Acceptance Gate | | --- | --- | --- | -| **C1 — Platform Backend Split** *(Linux backend split implemented; macOS/Windows pending)* | Split `src/Platform/` into `Linux/`, `MacOS/`, and `Windows/` behind clean interfaces (`FileOps`, `ProcessSupervisor`, `DirectoryWatcher`), delegating to `Void::System` as upstream adds OS backends. Linux implementations now live under `src/Platform/Linux/` and `src/Watch/Linux/` (inotify watcher) with an explicit `HostOs`/`host_supported()` boundary in `include/Void/Build/Platform/Host.hpp`; macOS/Windows backends await real hosts (`vbs doctor` and the daemon `info` request report the detected host and enabled backends, `Platform::current_executable_path()` isolates the executable-path lookup across sources and tests, the daemon `describe` request can be scoped to one workspace member, `vbs daemon target flags` serves per-unit compile arguments, `vbs releases show` prints one release's detail, source archives never embed themselves, registry downloads answer HEAD with full headers, support single-range requests, and both metadata reads and downloads are ETag-validated). | Zero Linux regressions; clean platform abstraction boundary. | +| **C1 — Platform Backend Split** *(Linux backend split implemented; macOS/Windows pending)* | Split `src/Platform/` into `Linux/`, `MacOS/`, and `Windows/` behind clean interfaces (`FileOps`, `ProcessSupervisor`, `DirectoryWatcher`), delegating to `Void::System` as upstream adds OS backends. Linux implementations now live under `src/Platform/Linux/` and `src/Watch/Linux/` (inotify watcher) with an explicit `HostOs`/`host_supported()` boundary in `include/Void/Build/Platform/Host.hpp`; macOS/Windows backends await real hosts (the daemon socket and registry POSIX server carry explicit Windows compile-time boundaries, `vbs doctor` and the daemon `info` request report the detected host and enabled backends, `Platform::current_executable_path()` isolates the executable-path lookup across sources and tests, the daemon `describe` request can be scoped to one workspace member, `vbs daemon target flags` serves per-unit compile arguments, `vbs releases show` prints one release's detail, source archives never embed themselves, registry downloads answer HEAD with full headers, support single-range requests, and both metadata reads and downloads are ETag-validated). | Zero Linux regressions; clean platform abstraction boundary. | | **C2 — macOS / Apple Clang & `ld64`** | Apple Clang toolchain probes, `.dylib` + `@rpath`/`@loader_path` install-name lowering, `FSEvents` watcher, Mach-O deterministic timestamps. | Real macOS CI runner passing all SDK, core, module, and install tests. | | **C3 — Windows / MSVC & `clang-cl`** | MSVC (`cl.exe`, `lib.exe`, `link.exe`, `/showIncludes`, `.pdb`, `/FS`, `.dll`/`.lib` import libraries), Job Object process-tree kill, `ReadDirectoryChangesW` watcher, case-insensitive path conflict detection. | Real Windows CI runner passing process-tree kill, header-shadowing, and install relocation tests. | | **C4 — True Host-vs-Target Cross-Compilation** | Dual-context evaluation (`host` profile for code generators and `build_dependency` tools vs `target` profile for cross-compiled products), sysroot & `--target=` triple propagation. | `linux-x86_64` host cross-compiling `linux-aarch64` fixture while executing host-compiled generator natively. | diff --git a/registry/service/HttpServer.cpp b/registry/service/HttpServer.cpp index 39b8168..c329128 100644 --- a/registry/service/HttpServer.cpp +++ b/registry/service/HttpServer.cpp @@ -6,6 +6,14 @@ #include #include + +// Track C1 platform boundary: the fallback HTTP server (sockets, poll) and the loopback test +// client in this translation unit require a POSIX host (Linux/macOS/BSD). Void::Net covers +// only the server transport, so Windows stays unsupported until both sides are portable. +#if defined(_WIN32) +#error "registry/service/HttpServer.cpp requires a POSIX host" +#endif + #include #include #include diff --git a/src/Daemon/Daemon.cpp b/src/Daemon/Daemon.cpp index 6eaa0c7..e5f1094 100644 --- a/src/Daemon/Daemon.cpp +++ b/src/Daemon/Daemon.cpp @@ -50,6 +50,12 @@ #include #include #include + +// The daemon control socket is a POSIX Unix-domain socket (Linux/macOS). Windows support is +// planned (Track C3) and would need a named-pipe transport instead. +#if defined(_WIN32) +#error "The vbs daemon Unix-socket transport requires a POSIX host (Track C3 Windows port is planned)." +#endif #include namespace Void::Build::Daemon { @@ -446,7 +452,11 @@ evaluate_workspace_members(const DaemonOptions &options) { member.name, dir.string())}; } const std::string env_name = "VBS_WORKSPACE_MEMBER_" + member.name; +#if defined(_WIN32) + (void)_putenv_s(env_name.c_str(), canonical.c_str()); +#else (void)::setenv(env_name.c_str(), canonical.c_str(), 1); +#endif members.push_back(WorkspaceMemberDir{member.name, canonical}); } return members; diff --git a/src/Main.cpp b/src/Main.cpp index 7c6ea92..a7b39fd 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -838,7 +838,11 @@ int execute_workspace(BuildCmdOptions opts, bool run_tests) { } member_dirs[member.name] = canonical; const std::string env_name = "VBS_WORKSPACE_MEMBER_" + member.name; +#if defined(_WIN32) + (void)_putenv_s(env_name.c_str(), canonical.c_str()); +#else (void)::setenv(env_name.c_str(), canonical.c_str(), 1); +#endif } std::set selected;