From 7fd8fe9f6d3f870746bbc790c7f07f5b7be3ac3c Mon Sep 17 00:00:00 2001 From: "Aleksei (Faumaray) Selikhov" Date: Fri, 4 Dec 2026 01:14:11 +0300 Subject: [PATCH] test(provider): verify the Conan2 provider against a live conan install --- docs/agent-workflow/STATE.md | 2 +- docs/agent-workflow/TASKS.md | 3 +- docs/agent-workflow/VERIFICATION.md | 17 ++++++ tests/FullV1Tests.cpp | 90 +++++++++++++++++++++++++++++ 4 files changed, 110 insertions(+), 2 deletions(-) diff --git a/docs/agent-workflow/STATE.md b/docs/agent-workflow/STATE.md index 9cb37c5..a53b932 100644 --- a/docs/agent-workflow/STATE.md +++ b/docs/agent-workflow/STATE.md @@ -173,7 +173,7 @@ Stage: VERIFIED — Plans 01–19 + Plan 20 Slices 1–2C + Track A + Track B (B - Added the `compdb_entries` daemon request (`vbs daemon compdb entries [--file SUFFIX] [--limit N]`): reads the active published compilation database (selection state or root alias), returns bounded projected entries (`file`, `directory`, `output`, `command`, bounded `arguments`), reports `total`/`returned`, and errors explicitly when nothing is published. - Added `Daemon.compdb_entries_queries_published_database` (unpublished → error, then all entries, a `main.cpp` filter with `limit:1`, and an invalid limit) and a CLI help contract; Daemon suite is now 18 cases. -- **Wave 40 (Authenticated Binary-Variant Downloads)**:\n - `download_binary_artifact` now accepts `RegistryAuth` and sends the bearer token, so private registry binary artifacts can be fetched; `BinaryFetchOptions` gained `bearer_token` and `materialize_binary_variant` forwards it; `vbs binaries fetch` passes the configured token.\n - Added `RegistryTests.private_binary_variant_download_requires_auth`: anonymous download of a private binary → 401, authenticated client download and signed materialization succeed.\n\n- **Wave 41 (Yanked Binary Variants in Listing)**:\n - `fetch_binary_variants` gained `include_yanked` (default false, so selection/materialization still never sees yanked variants); `vbs binaries list` opts in and marks yanked entries while `binaries fetch` keeps the filtered view.\n - Extended the registry binary-variant test to assert the yanked variant is returned with `yanked=true` only when requested.\n\n- **Wave 42 (Registry Binary-Variant Listing Endpoint)**:\n - Added `GET /api/v1/packages///binaries` returning the release's binary variants (`variant_id`, `sha256`, `size_bytes`, `yanked`, optional signature/public key) under normal read permissions; `RegistryClient::fetch_binary_variants` now queries this endpoint directly instead of parsing package detail JSON.\n - The registry binary-variant test asserts the listing endpoint returns the published variant with `yanked:false`.\n\n- **Wave 43 (Workspace Members Request)**:\n - Added the `workspace_members` daemon request (`vbs daemon workspace members`): lists declared workspace members (`name`, canonical `path`) without evaluating member build descriptions; non-workspace roots return `workspace:false` with an empty list.\n - Added `Daemon.workspace_members_lists_declared_members` and a CLI help contract; Daemon suite is now 19 cases.\n\n- **Wave 44 (IDE Configs Request)**:\n - Added the `ide_configs` daemon request (`vbs daemon ide configs`): reports presence of `.clangd`, `.vscode/tasks.json`, `.zed/tasks.json`, and `.idea/customTargets.xml` so editor extensions can see what is configured.\n - Added `Daemon.ide_configs_reports_generated_files` (absent before generation, present after `ide_generate`) and a CLI help contract; Daemon suite is now 20 cases.\n\n- **Wave 45 (Compdb Generations Request)**:\n - Added the `compdb_generations` daemon request (`vbs daemon compdb generations --profile`): lists immutable editor generations (bounded 128) with active flag, per-generation entry counts, and the per-profile status/diagnostic record; profile names are validated against `[A-Za-z0-9._-]` to prevent traversal.\n - Added `Daemon.compdb_generations_lists_history_and_active_generation` (empty before export, then a valid generation with entries and an active selection; invalid profile rejected) and a CLI help contract; Daemon suite is now 21 cases.\n\n- **Wave 46 (Registry Package Search Pagination)**:\n - `GET /api/v1/packages` now supports bounded `limit` (0-500, default 100) and `offset` (0-1,000,000) pagination with a `total`/`limit`/`offset` envelope; malformed values return 400.\n - The registry RBAC test asserts a `limit=1` page contains exactly one package and that `limit=501` is rejected.\n\n- **Wave 47 (Registry Release Detail Endpoint)**:\n - Added `GET /api/v1/packages//` returning release metadata (digest, size, yank state, publisher/epoch, optional signature/public key, binary variant summaries) under normal read permissions; unknown packages/releases return 404.\n - The registry binary-variant test asserts the release detail includes the version and published binary variant, and that an unknown version returns 404.\n\n- **Wave 48 (Daemon Deps Request)**:\n - Added the `deps` daemon request (`vbs daemon deps [--profile] [--member]`): evaluates the project, merges TOML/declared dependencies, resolves and materializes them with the pinned lock, registry environment, and trusted keys, then returns the lock context key and per-entry metadata (`alias`, `source_kind`, `package_name`, `version`, `sha256`, `signed`). Shared dependency-merge and resolve-option helpers were extracted for reuse by the build path.\n - Extended `Daemon.build_materializes_path_dependency` to assert a `deps` response with the `helper` path entry before building, plus a CLI help contract.\n\n- **Wave 49 (Daemon Info Request)**:\n - Added the `info` daemon request (`vbs daemon info`): reports the daemon version, host OS/architecture, project/build/lock roots, and socket path so editor extensions can discover the environment without guessing.\n - Added `Daemon.info_reports_daemon_paths_and_host` and a CLI help contract; Daemon suite is now 22 cases.\n\n- **Wave 50 (Registry Audit Query Filters)**:\n - `GET /api/v1/audit` now supports `actor`, `action` (substring), `outcome`, `limit` (0–2000, default 100) and `offset` filters with a `total`/`limit`/`offset` envelope; malformed limits return 400.\n - The registry RBAC test asserts the audit envelope and an action-filtered `limit=1` page contains a single entry.\n\n- **Wave 51 (Track E4 `Void::Sqlite` Alignment for the StateStore)**:\n - When built with SQLite3 (`VBS_HAS_VOID_SQLITE`, now available via `dev cpp-gcc -p sqlite`), `StateStore` keeps its transactional action cache in `state/state.v2.sqlite` using `Void::Sqlite` (`meta`, `actions`, `generations` tables, one transaction per publication) and imports an existing `state.v1.json` once. Without SQLite the journaled atomic JSON store remains unchanged.\n - `Void::Net` alignment is still pending: it requires OpenSSL, while only Boost is provided by `-p boost`.\n\n## Remaining future scope"}, {"oldString": "Track E4 (`Void::Net`/`Void::Sqlite` alignment) remain planned scope.", "newString": "Track E4 (`Void::Net` alignment; `Void::Sqlite` is now used by the StateStore when SQLite3 is available) remain planned scope."} +- **Wave 40 (Authenticated Binary-Variant Downloads)**:\n - `download_binary_artifact` now accepts `RegistryAuth` and sends the bearer token, so private registry binary artifacts can be fetched; `BinaryFetchOptions` gained `bearer_token` and `materialize_binary_variant` forwards it; `vbs binaries fetch` passes the configured token.\n - Added `RegistryTests.private_binary_variant_download_requires_auth`: anonymous download of a private binary → 401, authenticated client download and signed materialization succeed.\n\n- **Wave 41 (Yanked Binary Variants in Listing)**:\n - `fetch_binary_variants` gained `include_yanked` (default false, so selection/materialization still never sees yanked variants); `vbs binaries list` opts in and marks yanked entries while `binaries fetch` keeps the filtered view.\n - Extended the registry binary-variant test to assert the yanked variant is returned with `yanked=true` only when requested.\n\n- **Wave 42 (Registry Binary-Variant Listing Endpoint)**:\n - Added `GET /api/v1/packages///binaries` returning the release's binary variants (`variant_id`, `sha256`, `size_bytes`, `yanked`, optional signature/public key) under normal read permissions; `RegistryClient::fetch_binary_variants` now queries this endpoint directly instead of parsing package detail JSON.\n - The registry binary-variant test asserts the listing endpoint returns the published variant with `yanked:false`.\n\n- **Wave 43 (Workspace Members Request)**:\n - Added the `workspace_members` daemon request (`vbs daemon workspace members`): lists declared workspace members (`name`, canonical `path`) without evaluating member build descriptions; non-workspace roots return `workspace:false` with an empty list.\n - Added `Daemon.workspace_members_lists_declared_members` and a CLI help contract; Daemon suite is now 19 cases.\n\n- **Wave 44 (IDE Configs Request)**:\n - Added the `ide_configs` daemon request (`vbs daemon ide configs`): reports presence of `.clangd`, `.vscode/tasks.json`, `.zed/tasks.json`, and `.idea/customTargets.xml` so editor extensions can see what is configured.\n - Added `Daemon.ide_configs_reports_generated_files` (absent before generation, present after `ide_generate`) and a CLI help contract; Daemon suite is now 20 cases.\n\n- **Wave 45 (Compdb Generations Request)**:\n - Added the `compdb_generations` daemon request (`vbs daemon compdb generations --profile`): lists immutable editor generations (bounded 128) with active flag, per-generation entry counts, and the per-profile status/diagnostic record; profile names are validated against `[A-Za-z0-9._-]` to prevent traversal.\n - Added `Daemon.compdb_generations_lists_history_and_active_generation` (empty before export, then a valid generation with entries and an active selection; invalid profile rejected) and a CLI help contract; Daemon suite is now 21 cases.\n\n- **Wave 46 (Registry Package Search Pagination)**:\n - `GET /api/v1/packages` now supports bounded `limit` (0-500, default 100) and `offset` (0-1,000,000) pagination with a `total`/`limit`/`offset` envelope; malformed values return 400.\n - The registry RBAC test asserts a `limit=1` page contains exactly one package and that `limit=501` is rejected.\n\n- **Wave 47 (Registry Release Detail Endpoint)**:\n - Added `GET /api/v1/packages//` returning release metadata (digest, size, yank state, publisher/epoch, optional signature/public key, binary variant summaries) under normal read permissions; unknown packages/releases return 404.\n - The registry binary-variant test asserts the release detail includes the version and published binary variant, and that an unknown version returns 404.\n\n- **Wave 48 (Daemon Deps Request)**:\n - Added the `deps` daemon request (`vbs daemon deps [--profile] [--member]`): evaluates the project, merges TOML/declared dependencies, resolves and materializes them with the pinned lock, registry environment, and trusted keys, then returns the lock context key and per-entry metadata (`alias`, `source_kind`, `package_name`, `version`, `sha256`, `signed`). Shared dependency-merge and resolve-option helpers were extracted for reuse by the build path.\n - Extended `Daemon.build_materializes_path_dependency` to assert a `deps` response with the `helper` path entry before building, plus a CLI help contract.\n\n- **Wave 49 (Daemon Info Request)**:\n - Added the `info` daemon request (`vbs daemon info`): reports the daemon version, host OS/architecture, project/build/lock roots, and socket path so editor extensions can discover the environment without guessing.\n - Added `Daemon.info_reports_daemon_paths_and_host` and a CLI help contract; Daemon suite is now 22 cases.\n\n- **Wave 50 (Registry Audit Query Filters)**:\n - `GET /api/v1/audit` now supports `actor`, `action` (substring), `outcome`, `limit` (0–2000, default 100) and `offset` filters with a `total`/`limit`/`offset` envelope; malformed limits return 400.\n - The registry RBAC test asserts the audit envelope and an action-filtered `limit=1` page contains a single entry.\n\n- **Wave 51 (Track E4 `Void::Sqlite` Alignment for the StateStore)**:\n - When built with SQLite3 (`VBS_HAS_VOID_SQLITE`, now available via `dev cpp-gcc -p sqlite`), `StateStore` keeps its transactional action cache in `state/state.v2.sqlite` using `Void::Sqlite` (`meta`, `actions`, `generations` tables, one transaction per publication) and imports an existing `state.v1.json` once. Without SQLite the journaled atomic JSON store remains unchanged.\n - `Void::Net` alignment is still pending: it requires OpenSSL, while only Boost is provided by `-p boost`.\n\n- **Wave 52 (Live Conan2 Verification)**:\n - `conan` 2.32.0 is available via `dev cpp-gcc -p conan`. Added `FullV1Tests.track_b3_live_conan_provider_install`: it builds a real local header-only package with `conan create` in an isolated `CONAN_HOME` (restored afterwards), then runs the Conan2 provider so a real `conan install` executes (verified by the generated `conanbuild.sh`). Skips when `conan` is absent.\n\n## Remaining future scope"}, {"oldString": "Live `conan` CLI verification (Track B3), Track C", "newString": "Track C"}"}, {"oldString": "Track E4 (`Void::Net`/`Void::Sqlite` alignment) remain planned scope.", "newString": "Track E4 (`Void::Net` alignment; `Void::Sqlite` is now used by the StateStore when SQLite3 is available) remain planned 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, daemon-backed IDE metadata, compdb export, IDE config generation, editor watch poll and bounded long-poll done; dedicated external editor plugins remain), and Track E4 (`Void::Net`/`Void::Sqlite` alignment) remain planned scope. diff --git a/docs/agent-workflow/TASKS.md b/docs/agent-workflow/TASKS.md index 3d15bc5..7c54503 100644 --- a/docs/agent-workflow/TASKS.md +++ b/docs/agent-workflow/TASKS.md @@ -57,4 +57,5 @@ Base HEAD: `fe0d1a6` | Wave 48 (Daemon deps request) | `deps` daemon request + `vbs daemon deps --profile --member`: resolve/materialize and return the lock context entries; shared merge/resolve helpers | COMPLETE & VERIFIED (GCC 16.2, pin `0002e74`; Daemon 21/21, full CTest 8/8) | `src/Daemon/Daemon.cpp`, `src/Main.cpp`, `tests/DaemonTests.cpp`, `tests/CliContracts.cmake`, docs | | Wave 49 (Daemon info request) | `info` daemon request + `vbs daemon info`: version, host, project/build/lock roots, socket | COMPLETE & VERIFIED (GCC 16.2, pin `0002e74`; Daemon 22/22, full CTest 8/8) | `src/Daemon/Daemon.cpp`, `src/Main.cpp`, `tests/DaemonTests.cpp`, `tests/CliContracts.cmake`, docs | | Wave 50 (Audit query filters) | `/api/v1/audit` actor/action/outcome/limit/offset filters with envelope and 400 validation | COMPLETE & VERIFIED (GCC 16.2, pin `0002e74`; Registry 7/7, full CTest 8/8) | `registry/service/RegistryService.cpp`, `tests/RegistryTests.cpp`, docs | -| Wave 51 (Track E4 Sqlite alignment) | SQLite-backed `StateStore` (`state.v2.sqlite`) with one-time JSON import when `VBS_HAS_VOID_SQLITE`; JSON fallback unchanged; `Void::Net` still needs OpenSSL | COMPLETE & VERIFIED (GCC 16.2, pin `0002e74`, `-p sqlite -p boost`: core 6/6 and full CTest 8/8; default JSON backend core 6/6) | `include/Void/Build/State/StateStore.hpp`, `src/State/StateStore.cpp`, docs |\n| Future (Plan 20 Slice 3 / Tracks C, E3 editor extensions, E4 Net alignment, 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) | +| Wave 51 (Track E4 Sqlite alignment) | SQLite-backed `StateStore` (`state.v2.sqlite`) with one-time JSON import when `VBS_HAS_VOID_SQLITE`; JSON fallback unchanged; `Void::Net` still needs OpenSSL | COMPLETE & VERIFIED (GCC 16.2, pin `0002e74`, `-p sqlite -p boost`: core 6/6 and full CTest 8/8; default JSON backend core 6/6) | `include/Void/Build/State/StateStore.hpp`, `src/State/StateStore.cpp`, docs |\n| Wave 52 (Live conan verification) | `FullV1Tests.track_b3_live_conan_provider_install`: isolated `CONAN_HOME`, real `conan create`, real `conan install` through the Conan2 provider | COMPLETE & VERIFIED (GCC 16.2, pin `0002e74`, `-p conan`, conan 2.32.0; full CTest 8/8) | `tests/FullV1Tests.cpp`, docs | +| Future (Plan 20 Slice 3 / Tracks C, E3 editor extensions, E4 Net alignment) |"}] 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/agent-workflow/VERIFICATION.md b/docs/agent-workflow/VERIFICATION.md index 2e6bac9..07b6b04 100644 --- a/docs/agent-workflow/VERIFICATION.md +++ b/docs/agent-workflow/VERIFICATION.md @@ -848,6 +848,23 @@ dev cpp-gcc -c build/pinned/bin/vbs_core_tests --no-color extracted `parse_database_snapshot` needed its final `return snap;` (a missing return trapped as SIGILL under the SQLite path). +## Live Conan2 Provider Verification (GCC 16.2, pin `0002e74`, conan 2.32.0) + +`conan` 2.32.0 was provided with `dev cpp-gcc -p conan`. + +```sh +dev cpp-gcc -p conan -c cmake --build build/pinned --parallel 8 +dev cpp-gcc -p conan -c build/pinned/bin/vbs_v1_tests --filter track_b3_live_conan_provider_install --no-color +dev cpp-gcc -p conan -c ctest --test-dir build/pinned --output-on-failure +``` + +- `track_b3_live_conan_provider_install`: **passed** (1.23 s). It creates a real header-only + package with `conan create` in an isolated `CONAN_HOME`, runs the Conan2 provider (which runs a + real `conan install` using the adapter-generated host/build profiles), asserts the provider + export has `builder == "conan"`, and finds the generated `conanbuild.sh` as proof the install + executed. `CONAN_HOME` is restored afterwards; the test skips when `conan` is absent. +- Full CTest with conan available: **8 / 8 passed** in 241.62 s. + ## 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). diff --git a/tests/FullV1Tests.cpp b/tests/FullV1Tests.cpp index 1bb4a79..1b17a24 100644 --- a/tests/FullV1Tests.cpp +++ b/tests/FullV1Tests.cpp @@ -20,12 +20,14 @@ #include #include #include +#include #include #include #include #include #include +#include #include #include #include @@ -2310,3 +2312,91 @@ VOID_TEST(FullV1Tests, ide_integration_compdb_build_cpp_and_editor_configs_end_t std::string::npos); } } + +// Live Conan2 verification (Track B3): a real local package is built into an isolated +// CONAN_HOME and the provider performs a real `conan install`. +VOID_TEST(FullV1Tests, track_b3_live_conan_provider_install) { + if (!Platform::resolve_executable("conan").has_value()) { + return; + } + + Void::FileSystem::TempDir tmp{"vbs_conan_live_"}; + const auto conan_home = tmp / "conan_home"; + const auto profile = tmp / "conan.profile"; + write_file(profile, "[settings]\nos=Linux\narch=x86_64\ncompiler=gcc\nbuild_type=Debug\n"); + + // Isolate the global conan cache and restore the environment afterwards. + const char *previous_home = std::getenv("CONAN_HOME"); + const std::string saved_home = previous_home == nullptr ? std::string{} : previous_home; + const bool had_home = previous_home != nullptr; + (void)::setenv("CONAN_HOME", conan_home.c_str(), 1); + const auto restore_home = Void::Scope::on_exit([&] { + if (had_home) { + (void)::setenv("CONAN_HOME", saved_home.c_str(), 1); + } else { + (void)::unsetenv("CONAN_HOME"); + } + }); + + write_file(tmp / "pkg" / "conanfile.py", R"py(from conan import ConanFile +from conan.tools.files import copy + +class DemoPkg(ConanFile): + name = "vbs-demo" + version = "1.0.0" + package_type = "header-library" + def package(self): + copy(self, "*.hpp", self.source_folder, self.package_folder + "/include") +)py"); + write_file(tmp / "pkg" / "demo.hpp", + "#pragma once\ninline int vbs_demo_value() { return 5; }\n"); + + Platform::ProcessRequest create; + auto conan = Platform::resolve_executable("conan"); + Void::Testing::require(conan.has_value()); + create.executable = *conan; + create.arguments = { + "create", (tmp / "pkg").string(), "--name", "vbs-demo", "--version", + "1.0.0", "--profile:host", profile.string(), "--profile:build", profile.string()}; + create.timeout = std::chrono::seconds{240}; + auto created = Platform::run_supervised(create); + Void::Testing::expect(created.has_value() && created->succeeded()); + if (!created || !created->succeeded()) { + return; + } + + auto ctx = default_profiles().resolve("debug", CompilerFamily::Gcc, Toolchain::host_os_name(), + Toolchain::host_architecture_name()); + auto tc = Toolchain::discover_and_probe(ctx, tmp / "probes"); + Void::Testing::expect(tc.has_value()); + if (!tc) { + return; + } + + DependencyRecord conan_dep; + conan_dep.name = "demo"; + conan_dep.source_kind = DependencySourceKind::Conan; + conan_dep.package = "vbs-demo/1.0.0"; + conan_dep.builder = "conan"; + Package::MaterializedSource dummy{"demo", tmp / "src", "dummy", true}; + auto exported = Provider::resolve_foreign_provider( + {conan_dep, dummy, ctx, *tc, tmp / "prov", Provider::ProviderMode::FullBuild, {}}); + Void::Testing::expect(exported.has_value()); + if (exported) { + Void::Testing::expect_eq(exported->builder, std::string{"conan"}); + std::error_code ec; + bool found_profile = false; + bool found_install_output = false; + for (const auto &entry : std::filesystem::recursive_directory_iterator(tmp / "prov", ec)) { + if (entry.path().filename() == "conan_host.profile") { + found_profile = true; + } + if (entry.path().filename() == "conanbuild.sh") { + found_install_output = true; + } + } + Void::Testing::expect(found_profile); + // Generated env scripts prove `conan install` really executed. + Void::Testing::expect(found_install_output); + } +}