refactor(watch): move the Linux inotify watcher under src/Watch/Linux
This commit is contained in:
1 parent
9b405ce772
commit
8001d98bb7
10 files changed
+30
-8
No files matched your search
@@ -8,7 +8,7 @@ Pinned VoidLibrary revision: `0002e74a7da94a756f55a4a5574d20b77736c185` (upstrea
|
||||
| --- | --- | --- | --- |
|
||||
| `VL-001` | Process group supervision (`Void::Process::spawn`, `communicate_blocking`, `enable_subreaper`) | Implemented | **Adopted** (`src/Platform/Linux/ProcessSupervisor.cpp`) |
|
||||
| `VL-002` | TOML 1.0 parser & serializer (`Void::Data::Toml`) | Implemented | **Adopted** (`src/Package/Toml.cpp`) |
|
||||
| `VL-003` | Kernel `inotify` recursive directory watcher (`Void::FileSystem::DirectoryWatcher`) | Implemented | **Adopted** (`src/Watch/Watcher.cpp`, `include/Void/Build/Watch/Watcher.hpp`) |
|
||||
| `VL-003` | Kernel `inotify` recursive directory watcher (`Void::FileSystem::DirectoryWatcher`) | Implemented | **Adopted** (`src/Watch/Linux/Watcher.cpp`, `include/Void/Build/Watch/Watcher.hpp`) |
|
||||
| `VL-004` | Concrete HTTP/1.1 server (`Void::Net::HttpServer`) | Implemented (requires Boost + OpenSSL) | Local loopback POSIX adapter retained for minimal `dev cpp-gcc` (no Boost/OpenSSL) |
|
||||
| `VL-005` | Streaming HTTP client & TLS default (`Void::Net::HttpClient`) | Implemented (requires Boost + OpenSSL) | Local loopback POSIX + `curl` adapter retained for minimal `dev cpp-gcc` (no Boost/OpenSSL) |
|
||||
| `VL-006` | Deterministic archive creation & safe staged extraction (`Void::Archive::create`, `extract_staged`) | Implemented (zero external deps for `.tar`) | **Adopted** (`src/Package/Archive.cpp`, always linked via `Void::Archive`) |
|
||||
@@ -30,7 +30,7 @@ Pinned VoidLibrary revision: `0002e74a7da94a756f55a4a5574d20b77736c185` (upstrea
|
||||
|
||||
- **`VL-001` (`Void::Process`)**: `src/Platform/Linux/ProcessSupervisor.cpp` delegates process spawning, pipe multiplexing, timeouts, cancellation, `PR_SET_CHILD_SUBREAPER`, and `-pgid` `SIGTERM -> SIGKILL` termination to `Void::Process::spawn`, `Void::Process::communicate_blocking`, and `Void::Process::enable_subreaper`, adding post-leader process-group drain supervision for detached grandchildren with redirected stdio.
|
||||
- **`VL-002` (`Void::Data::Toml`)**: `src/Package/Toml.cpp` delegates all TOML 1.0 parsing and canonical table serialization to `Void::Data::Toml::parse` and `Void::Data::Toml::serialize_table`.
|
||||
- **`VL-003` (`Void::FileSystem::DirectoryWatcher`)**: `src/Watch/Watcher.cpp` wraps `Void::FileSystem::DirectoryWatcher` for recursive Linux `inotify` observation, ignore predicates, and `RescanRequired` overflow handling.
|
||||
- **`VL-003` (`Void::FileSystem::DirectoryWatcher`)**: `src/Watch/Linux/Watcher.cpp` wraps `Void::FileSystem::DirectoryWatcher` for recursive Linux `inotify` observation, ignore predicates, and `RescanRequired` overflow handling.
|
||||
- **`VL-006` (`Void::Archive`)**: `CMakeLists.txt`, `cmake/VoidDependency.cmake`, `recipes/VoidLibrary/VoidLibraryRecipe.cpp`, and `recipes/SelfHost/VbsSelfHostRecipe.cpp` unconditionally enable `Void::Archive` (`VOID_ARCHIVE_HAS_LIBARCHIVE=0` built-in USTAR/PAX tar), and `src/Package/Archive.cpp` delegates archive creation and staged security-checked extraction to `Void::Archive::create` and `Void::Archive::extract_staged` + `StagedTree::publish`.
|
||||
- **`VL-007` (`Void::Crypto`)**: `Void::Crypto` (`VOID_CRYPTO_HAS_OPENSSL=0` built-in FIPS 180-4 SHA-256) is unconditionally linked, and `src/Util/Sha256.cpp` delegates directly to `Void::Crypto::Hasher`, `Void::Crypto::sha256`, and `Void::Crypto::sha256_file`.
|
||||
- **`VL-008` (`Void::Json::Strict` / `Void::Unicode`)**: Strict UTF-8 validation is active across `Void::Json::Strict` and `src/Util/Json.cpp`.
|
||||
|
||||
@@ -14,7 +14,7 @@ Stage: VERIFIED — Plans 01–19 + Plan 20 Slices 1–2C + Track A + Track B (B
|
||||
- Built out-of-process host configuration frontend (`src/Config/Frontend.cpp`), dependency-propagating graph lowering (`src/Graph/Graph.cpp`), GCC/Clang toolchain discovery & capability probing (`src/Toolchain/Driver.cpp`), content-verified immutable snapshots (`src/Snapshot/Snapshot.cpp`), process group supervisor (`src/Platform/Linux/ProcessSupervisor.cpp`), isolated file ops (`src/Platform/Linux/FileOps.cpp`), CAS durable state store (`src/State/StateStore.cpp`), and parallel DAG scheduler (`src/Execution/Scheduler.cpp`).
|
||||
- **Wave 2 (Plans 09–10 — Editor CompDB & Watchers)**:
|
||||
- Implemented per-profile `compile_commands.json` projection with monotonic selection tickets, crash recovery, and unrelated root file preservation (`src/Editor/CompDb.cpp`).
|
||||
- Implemented recursive Linux `inotify` watcher (`src/Watch/Watcher.cpp`) with overflow rescan and strict `MetadataOnly` boundary vs `FullBuild`.
|
||||
- Implemented recursive Linux `inotify` watcher (`src/Watch/Linux/Watcher.cpp`) with overflow rescan and strict `MetadataOnly` boundary vs `FullBuild`.
|
||||
- **Wave 3 (Plans 11–15, 18 — Packages, Foreign Providers, Bridge, Install & Self-Hosting)**:
|
||||
- Implemented TOML 1.0 parser/merger (`src/Package/Toml.cpp`), PubGrub-style SemVer solver (`src/Package/Solver.cpp`), context-aware atomic CAS `vbs.lock` (`src/Package/Lockfile.cpp`), deterministic PAX/USTAR `.tar` builder & safe extractor (`src/Package/Archive.cpp`), source/binary materialization (`src/Package/Fetch.cpp`).
|
||||
- Implemented CMake File API & Meson introspection providers + explicit missing-tool Conan2 adapter (`src/Provider/Provider.cpp`), `cmake/bridge/VbsDeps.cmake` + `vbs bridge` (`src/Bridge/CMakeBridge.cpp`), staged relocatable install/export/uninstall (`src/Install/Installer.cpp`), native `VoidLibrary` recipe (`recipes/VoidLibrary/VoidLibraryRecipe.cpp`), and non-CMake `Void::Testing` generator (`src/SelfHost/TestRegistryGen.cpp`).
|
||||
@@ -109,6 +109,9 @@ Stage: VERIFIED — Plans 01–19 + Plan 20 Slices 1–2C + Track A + Track B (B
|
||||
- Added `download_binary_artifact` (`RegistryClient`): fetches an absolute http(s) binary artifact URL and verifies its SHA-256 before the atomic write. Added `materialize_binary_variant` (`BinaryFetchOptions`): selects a compatible variant (trusted-signature checked), reuses `<cache>/binaries/<sha256>` only when the cached digest still matches, and downloads otherwise.
|
||||
- `RegistryTests.binary_variant_distribution_downloads_and_verifies`: a signed variant is downloaded from the live registry package endpoint, byte-for-byte verified, reused from cache after the server stops, and rejected on digest mismatch.
|
||||
|
||||
- **Wave 23 (Track C1 Watcher Backend Split)**:
|
||||
- Moved the Linux `inotify` watcher implementation to `src/Watch/Linux/Watcher.cpp` with an explicit non-Linux compile-time boundary, completing the `src/Watch/Linux/` layout alongside `src/Platform/Linux/`; source lists (CMake, `build.cpp`, self-host recipe) and path references updated.
|
||||
|
||||
## 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))**: Live `conan` CLI verification (Track B3), Track C (macOS/Windows ports + dual-profile cross-compilation), Track D3 signing (SBOM, Ed25519 primitives, trusted-key enforcement and distribution, binary-variant signing and distribution materialization, the #52 built-in-backend capability probe, and the VoidLibrary pin bump to `0002e74` done), Track E3 (daemon core, bounded `describe`, build-serving, dependency materialization, and daemon-backed IDE metadata done; dedicated external editor extensions remain), and Track E4 (`Void::Net`/`Void::Sqlite` alignment) remain planned scope.
|
||||
|
||||
@@ -29,4 +29,5 @@ Base HEAD: `fe0d1a6`
|
||||
| Wave 20 (Track D3 binary-variant signing) | `sign_message`/`verify_message`, `BinaryVariantMeta` signature fields, canonical `vbs-binary-v1` message + trusted-key policy, `select_compatible_signed_binary` fail-closed selection | COMPLETE & VERIFIED (GCC 16.2, pin `0002e74`; SignatureEnforcement 7/7, full CTest 8/8) | `include/Void/Build/Provenance/{Signing,Verification}.hpp`, `src/Provenance/{Signing,Verification}.cpp`, `include/Void/Build/Package/{Solver,Fetch}.hpp`, `src/Package/Fetch.cpp`, `tests/SignatureEnforcementTests.cpp`, docs |
|
||||
| Wave 21 (Track E3 daemon-backed editor metadata) | `ide_query` daemon request + `vbs daemon ide query` CLI: lowers the graph, publishes/selects the profile compdb, returns IDE query JSON (workspace/targets/compdb) over the socket | COMPLETE & VERIFIED (GCC 16.2, pin `0002e74`; Daemon 9/9, full CTest 8/8) | `src/Daemon/Daemon.cpp`, `src/Main.cpp`, `tests/DaemonTests.cpp`, `tests/CliContracts.cmake`, docs |
|
||||
| Wave 22 (Track D3 binary-variant distribution) | `download_binary_artifact` with SHA-256 verification; `materialize_binary_variant` (signed selection, digest-validated cache reuse, download) | COMPLETE & VERIFIED (GCC 16.2, pin `0002e74`; registry distribution test, full CTest 8/8) | `include/Void/Build/Package/{RegistryClient,Fetch}.hpp`, `src/Package/{RegistryClient,Fetch}.cpp`, `tests/RegistryTests.cpp`, docs |
|
||||
| Wave 23 (Track C1 watcher split) | Move the Linux inotify watcher to `src/Watch/Linux/Watcher.cpp` with an explicit non-Linux boundary; update source lists/docs | COMPLETE & VERIFIED (GCC 16.2, pin `0002e74`; full CTest 8/8) | `src/Watch/Linux/Watcher.cpp`, `CMakeLists.txt`, `build.cpp`, `recipes/SelfHost/VbsSelfHostRecipe.cpp`, docs |
|
||||
| Future (Plan 20 Slice 3 / Tracks C, E3 editor extensions, E4, live `conan`) | 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) |
|
||||
@@ -434,6 +434,19 @@ dev cpp-gcc -c ctest --test-dir build/pinned --output-on-failure
|
||||
- Full CTest: **8 / 8 passed** in 200.71 s (`vbs_registry_tests` 11.39 s).
|
||||
- `clang-format --dry-run --Werror` passes on the changed C++ files.
|
||||
|
||||
## Track C1 Watcher Backend Split (GCC 16.2, pin `0002e74`)
|
||||
|
||||
```sh
|
||||
dev cpp-gcc -c cmake --build build/pinned --parallel 8
|
||||
dev cpp-gcc -c ctest --test-dir build/pinned --output-on-failure
|
||||
```
|
||||
|
||||
- Moved `src/Watch/Watcher.cpp` to `src/Watch/Linux/Watcher.cpp` with an explicit non-Linux
|
||||
compile-time boundary; CMake, `build.cpp`, and the self-host recipe source lists were updated.
|
||||
- Build: exit 0. Full CTest: **8 / 8 passed** in 213.42 s.
|
||||
- After the formatting pass, `vbs_v1_tests --filter watcher_inotify` still **passed** (4.43 s),
|
||||
and `clang-format --dry-run --Werror` is clean on the moved file.
|
||||
|
||||
## Limits and Unrun Checks
|
||||
|
||||
1. **HTTPS git fetch**: the host shell is proxy-restricted, but the Docker container could clone `https://git.faumaray.com/Void/VoidLibrary.git`; the pinned commit `3e254055e081a104f08df68dde39711bc7813518` was fetched directly for the verification above. A separate configure against the local `/home/faumaray/Projects/Library` checkout via `VBS_VOID_SOURCE_DIR` also succeeded (development-only override, checkout unmodified).
|
||||
|
||||
@@ -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/` with an explicit `HostOs`/`host_supported()` boundary in `include/Void/Build/Platform/Host.hpp`; macOS/Windows backends await real hosts. | 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. | 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. |
|
||||
|
||||
@@ -21,7 +21,7 @@ Authority: [requirements](REQUIREMENTS.md), [architecture](ARCHITECTURE.md),
|
||||
| [07 — Transactional state and local artifact cache](07-state-local-cache.md) | Implemented & Verified | [StateStore.cpp](../../src/State/StateStore.cpp) |
|
||||
| [08 — Modules, header units and compiler features](08-modern-cpp.md) | Implemented & Verified | [ModuleScanner.cpp](../../src/Modules/ModuleScanner.cpp) |
|
||||
| [09 — Compilation databases and editor selection](09-compilation-database.md) | Implemented & Verified | [CompDb.cpp](../../src/Editor/CompDb.cpp) |
|
||||
| [10 — Reconciliation, build watching and metadata watching](10-watchers-cli.md) | Implemented & Verified | [Watcher.cpp](../../src/Watch/Watcher.cpp), [Main.cpp](../../src/Main.cpp) |
|
||||
| [10 — Reconciliation, build watching and metadata watching](10-watchers-cli.md) | Implemented & Verified | [Watcher.cpp](../../src/Watch/Linux/Watcher.cpp), [Main.cpp](../../src/Main.cpp) |
|
||||
| [11 — Dependency declarations, native solver and lockfile](11-dependencies-solver-lock.md) | Implemented & Verified | [Toml.cpp](../../src/Package/Toml.cpp), [Solver.cpp](../../src/Package/Solver.cpp), [Lockfile.cpp](../../src/Package/Lockfile.cpp) |
|
||||
| [12 — Acquisition, source packages and binary packages](12-fetching-packages.md) | Implemented & Verified | [Archive.cpp](../../src/Package/Archive.cpp), [Fetch.cpp](../../src/Package/Fetch.cpp) |
|
||||
| [13 — CMake, Meson and Conan providers](13-foreign-providers.md) | Implemented & Verified | [Provider.cpp](../../src/Provider/Provider.cpp) (Conan fails explicitly if `conan` absent) |
|
||||
|
||||
Reference in new issue
Block a user