feat(platform): build on native Windows hosts
VoidBuildSystem CI / 1 · Requirements (push) Successful in 6s
VoidBuildSystem CI / 2C · Windows native build (debug) (push) Failing after 1m32s
VoidBuildSystem CI / 2C · Windows native build (sanitizers) (push) Failing after 18s
VoidBuildSystem CI / 2C · Windows native build (relwithdebinfo) (push) Failing after 3m4s
VoidBuildSystem CI / 2B · Windows Wine build (debug) (push) Successful in 6m20s
VoidBuildSystem CI / 2A · Linux build (debug) (push) Successful in 6m32s
VoidBuildSystem CI / 3C · Windows native test (debug) (push) Failing after 1m45s
VoidBuildSystem CI / 2B · Windows Wine build (sanitizers) (push) Successful in 6m55s
VoidBuildSystem CI / 2A · Linux build (sanitizers) (push) Successful in 6m59s
VoidBuildSystem CI / 2A · Linux build (relwithdebinfo) (push) Successful in 6m59s
VoidBuildSystem CI / 3C · Windows native test (sanitizers) (push) Failing after 15s
VoidBuildSystem CI / 3C · Windows native test (relwithdebinfo) (push) Failing after 1m47s
VoidBuildSystem CI / 3A · Linux test (sanitizers) (push) Successful in 2m4s
VoidBuildSystem CI / 4B · Windows package (debug) (push) Successful in 1m6s
VoidBuildSystem CI / 4B · Windows package (sanitizers) (push) Successful in 12s
VoidBuildSystem CI / 2B · Windows Wine build (relwithdebinfo) (push) Successful in 4m2s
VoidBuildSystem CI / 4B · Windows package (relwithdebinfo) (push) Successful in 1m44s
VoidBuildSystem CI / 3B · Windows Wine test (sanitizers) (push) Successful in 3m16s
VoidBuildSystem CI / 3B · Windows Wine test (debug) (push) Successful in 3m21s
VoidBuildSystem CI / 3A · Linux test (relwithdebinfo) (push) Failing after 6m45s
VoidBuildSystem CI / 3A · Linux test (debug) (push) Failing after 6m54s
VoidBuildSystem CI / 4A · Linux package (debug) (push) Skipped
VoidBuildSystem CI / 4A · Linux package (relwithdebinfo) (push) Skipped
VoidBuildSystem CI / 4A · Linux package (sanitizers) (push) Skipped
VoidBuildSystem CI / 5 · Release (push) Skipped
VoidBuildSystem CI / 3B · Windows Wine test (relwithdebinfo) (push) Successful in 3m42s

Bump VoidLibrary to 482a3ea (Windows target support: qualified
Configuration/Crypto/System/Archive, Windows DirectoryWatcher,
TempDir/TempFile, process pipes) and port VBS's own host backends:

- Toolchain: Windows/macOS host names and architectures without uname.
- Platform FileOps: Win32 stat metadata, CreateFileW+LockFileEx file
  locks (Void FileLock is POSIX-only, Void/Library#66), no-op
  directory fsync, GetModuleFileNameW executable path, mtime via
  std::filesystem, and a file-copy fallback for the compdb alias.
- ProcessSupervisor: Windows PATH/PATHEXT resolution and no POSIX
  waitpid reaping (job objects own descendants).
- Snapshot: directory listing through std::filesystem on Windows.
- Remote cache/registry client/CDash: curl or Winsock-based HTTP on
  Windows (Void::Net is not qualified there yet).
- Daemon: explicit unsupported errors on Windows (named-pipe
  transport is Track C3); the registry service stays POSIX-only and
  is excluded from the Windows build.
- StateStore/Sbom/Main/Graph: portable stat, time and path handling.

Verified: MinGW-w64 GCC 16.2 builds vbs, vbs_describe, vbs_benchmarks
and the sdk/core/v1/selfhost test executables; vbs runs under Wine
and the SDK suite passes 17/17. The Linux suite stays green (8/8).
This commit is contained in:
faumaray committed 2026-12-06 02:01:24 +03:00
1 parent 8768720e54
commit e333bbe84b
23 files changed
+715 -127

No files matched your search

+22 -9
View File
@@ -12,19 +12,27 @@ set_target_properties(vbs_core_tests PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin")
add_test(NAME vbs_core_tests COMMAND "$<TARGET_FILE:vbs_core_tests>" --no-color)
add_executable(vbs_v1_tests FullV1Tests.cpp DaemonTests.cpp SigningTests.cpp SignatureEnforcementTests.cpp)
set(VBS_V1_TEST_SOURCES FullV1Tests.cpp SigningTests.cpp SignatureEnforcementTests.cpp)
if(NOT WIN32)
# The daemon transport is POSIX-only until its Track C3 Windows port lands.
list(APPEND VBS_V1_TEST_SOURCES DaemonTests.cpp)
endif()
add_executable(vbs_v1_tests ${VBS_V1_TEST_SOURCES})
target_include_directories(vbs_v1_tests PRIVATE "${PROJECT_BINARY_DIR}/generated")
target_link_libraries(vbs_v1_tests PRIVATE Void::BuildCore Void::Testing)
set_target_properties(vbs_v1_tests PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin")
add_test(NAME vbs_v1_tests COMMAND "$<TARGET_FILE:vbs_v1_tests>" --no-color)
add_executable(vbs_registry_tests RegistryTests.cpp)
target_include_directories(vbs_registry_tests PRIVATE "${PROJECT_BINARY_DIR}/generated")
target_link_libraries(vbs_registry_tests PRIVATE Void::BuildRegistry Void::Testing)
set_target_properties(vbs_registry_tests PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin")
add_test(NAME vbs_registry_tests COMMAND "$<TARGET_FILE:vbs_registry_tests>" --no-color)
if(NOT WIN32)
# The registry service is POSIX-only until its Track C3 Windows port lands.
add_executable(vbs_registry_tests RegistryTests.cpp)
target_include_directories(vbs_registry_tests PRIVATE "${PROJECT_BINARY_DIR}/generated")
target_link_libraries(vbs_registry_tests PRIVATE Void::BuildRegistry Void::Testing)
set_target_properties(vbs_registry_tests PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin")
add_test(NAME vbs_registry_tests COMMAND "$<TARGET_FILE:vbs_registry_tests>" --no-color)
endif()
add_executable(vbs_selfhost_tests SelfHostTests.cpp)
target_include_directories(vbs_selfhost_tests PRIVATE "${PROJECT_BINARY_DIR}/generated")
@@ -37,9 +45,14 @@ add_test(NAME vbs_selfhost_tests COMMAND "$<TARGET_FILE:vbs_selfhost_tests>" --n
add_test(NAME vbs_sdk_registration COMMAND "${CMAKE_COMMAND}"
"-DSDK_TESTS=$<TARGET_FILE:vbs_sdk_tests>" -P "${CMAKE_CURRENT_SOURCE_DIR}/SdkRegistration.cmake")
if(TARGET vbs-registry)
set(VBS_REGISTRY_ARG "-DVBS_REGISTRY=$<TARGET_FILE:vbs-registry>")
else()
set(VBS_REGISTRY_ARG "")
endif()
add_test(NAME vbs_cli_contract COMMAND "${CMAKE_COMMAND}"
"-DVBS=$<TARGET_FILE:vbs>" "-DVBS_REGISTRY=$<TARGET_FILE:vbs-registry>"
"-DVBS_VERSION=${PROJECT_VERSION}"
"-DVBS=$<TARGET_FILE:vbs>" "${VBS_REGISTRY_ARG}"
"-DVBS_VERSION=${PROJECT_VERSION}" "-DVBS_WINDOWS=${WIN32}"
-P "${CMAKE_CURRENT_SOURCE_DIR}/CliContracts.cmake")
add_test(NAME vbs_description_contract COMMAND "${CMAKE_COMMAND}"
"-DDESCRIBE=$<TARGET_FILE:vbs_describe>"
+21 -7
View File
@@ -1,5 +1,8 @@
cmake_minimum_required(VERSION 4.0)
# Captured output must be plain text: the CLI colorizes help when colors are allowed.
set(ENV{NO_COLOR} "1")
function(check_process expected_code expected_out_regex expected_err_regex)
execute_process(COMMAND "${VBS}" ${ARGN}
RESULT_VARIABLE code OUTPUT_VARIABLE out ERROR_VARIABLE err TIMEOUT 15)
@@ -91,7 +94,10 @@ check_process(0 "Usage: vbs daemon ide query .*--profile" "" daemon ide query --
check_process(0 "Usage: vbs daemon compdb export .*--profile" "" daemon compdb export --help)
check_process(0 "Usage: vbs daemon compdb use .*--profile" "" daemon compdb use --help)
check_process(0 "Usage: vbs daemon compdb entries .*--file.*--limit" "" daemon compdb entries --help)
check_process(0 "Usage: vbs daemon ide generate .*--profile.*--editor.*--force" "" daemon ide generate --help)
check_process(0 "Usage: vbs daemon ide generate " "" daemon ide generate --help)
check_process(0 "--force" "" daemon ide generate --help)
check_process(0 "--profile" "" daemon ide generate --help)
check_process(0 "--editor" "" daemon ide generate --help)
check_process(0 "Usage: vbs daemon ide poll " "" daemon ide poll --help)
check_process(0 "Usage: vbs daemon ide status " "" daemon ide status --help)
check_process(0 "Usage: vbs daemon graph .*--format" "" daemon graph --help)
@@ -106,15 +112,20 @@ check_process(0 "Usage: vbs daemon target info .*--name" "" daemon target info -
check_process(0 "Usage: vbs daemon target flags .*--name.*--file" "" daemon target flags --help)
check_process(0 "Usage: vbs daemon pack .*--output" "" daemon pack --help)
check_process(0 "Usage: vbs daemon actions .*--limit" "" daemon actions --help)
check_process(0 "Usage: vbs daemon install .*--prefix.*--component.*--no-cmake-export.*--no-native-export" "" daemon install --help)
check_process(0 "Usage: vbs daemon install " "" daemon install --help)
check_process(0 "--prefix" "" daemon install --help)
check_process(0 "--component" "" daemon install --help)
check_process(0 "--no-cmake-export" "" daemon install --help)
check_process(0 "--no-native-export" "" daemon install --help)
check_process(0 "Usage: vbs daemon uninstall .*--prefix" "" daemon uninstall --help)
check_process(0 "Usage: vbs daemon gen-tests .*--input.*--output-dir" "" daemon gen-tests --help)
check_process(0 "Usage: vbs daemon init .*--dir" "" daemon init --help)
check_process(0 "Usage: vbs daemon ide wait .*--timeout-ms" "" daemon ide wait --help)
check_process(2 "" "missing subcommand for 'vbs daemon'" daemon)
if(NOT VBS_WINDOWS)
# Daemon-backed describe contract: start `vbs daemon run`, query the bounded graph summary over
# the Unix socket, then stop it. The daemon is Unix-only, matching the rest of this suite.
# the Unix socket, then stop it (Unix-only; the Windows transport is Track C3).
set(daemon_contract_root "${CMAKE_CURRENT_BINARY_DIR}/daemon_contract")
file(REMOVE_RECURSE "${daemon_contract_root}")
file(MAKE_DIRECTORY "${daemon_contract_root}/project")
@@ -193,6 +204,7 @@ if(NOT daemon_describe_out MATCHES "\"ok\":true" OR
message(FATAL_ERROR "vbs daemon describe: unexpected response [${daemon_describe_out}]")
endif()
message(STATUS "daemon describe response: ${daemon_describe_out}")
endif()
check_process(0 "Usage: vbs ide <command>.*Commands:.*generate.*query" "" ide --help)
check_process(0 "Usage: vbs ide generate " "" ide generate --help)
check_process(0 "Usage: vbs ide query " "" ide query --help)
@@ -201,9 +213,11 @@ check_process(2 "" "--output is required" ide plugin)
check_process(2 "" "missing subcommand for 'vbs ide'" ide)
check_process(2 "" "unknown IDE kind" ide generate --editor invalid_ide)
execute_process(COMMAND "${VBS_REGISTRY}" --help
RESULT_VARIABLE reg_code OUTPUT_VARIABLE reg_out ERROR_VARIABLE reg_err TIMEOUT 15)
if(NOT "${reg_code}" STREQUAL "0" OR NOT reg_out MATCHES "Usage: vbs-registry")
message(FATAL_ERROR "vbs-registry --help failed: code=${reg_code}\nstdout=[${reg_out}]\nstderr=[${reg_err}]")
if(VBS_REGISTRY)
execute_process(COMMAND "${VBS_REGISTRY}" --help
RESULT_VARIABLE reg_code OUTPUT_VARIABLE reg_out ERROR_VARIABLE reg_err TIMEOUT 15)
if(NOT "${reg_code}" STREQUAL "0" OR NOT reg_out MATCHES "Usage: vbs-registry")
message(FATAL_ERROR "vbs-registry --help failed: code=${reg_code}\nstdout=[${reg_out}]\nstderr=[${reg_err}]")
endif()
endif()
message(STATUS "CLI and auto-generated Argparse help contracts verified (including daemon describe round-trip)")
+3 -1
View File
@@ -292,7 +292,9 @@ VOID_TEST(CoreEngineTests, state_store_cas_corruption_recovery_and_gc) {
// Corrupt blob1 on disk and verify lookup detects corruption!
const auto blob_path = store->cas_blob_path(blob1->sha256);
(void)::chmod(blob_path.c_str(), 0644);
std::error_code perm_ec;
std::filesystem::permissions(blob_path, std::filesystem::perms::owner_write,
std::filesystem::perm_options::add, perm_ec);
write_text_file(blob_path, "CORRUPTED_BYTES!!");
Void::Testing::expect(!store->verify_blob(blob1->sha256).value_or(true));
auto lookup = store->lookup_action("good_key");
+12 -9
View File
@@ -1,5 +1,8 @@
cmake_minimum_required(VERSION 4.0)
# Captured output must be plain text: the CLI colorizes help when colors are allowed.
set(ENV{NO_COLOR} "1")
function(expect_json expected)
string(JSON actual GET "${graph}" ${ARGN})
if(NOT "${actual}" STREQUAL "${expected}")
@@ -51,17 +54,17 @@ foreach(profile IN ITEMS debug release)
expect_json(static_library targets 4 kind)
expect_json(vbs-registry targets 5 name)
expect_json(executable targets 5 kind)
expect_json(vbs_self_smoke targets 6 name)
expect_json(vbs_registry_tests targets 6 name)
expect_json(test targets 6 kind)
expect_json(vbs_benchmarks targets 7 name)
expect_json(executable targets 7 kind)
expect_json(vbs_sdk_tests targets 8 name)
expect_json(test targets 8 kind)
expect_json(vbs_core_tests targets 9 name)
expect_json(vbs_self_smoke targets 7 name)
expect_json(test targets 7 kind)
expect_json(vbs_benchmarks targets 8 name)
expect_json(executable targets 8 kind)
expect_json(vbs_sdk_tests targets 9 name)
expect_json(test targets 9 kind)
expect_json(vbs_v1_tests targets 10 name)
expect_json(vbs_core_tests targets 10 name)
expect_json(test targets 10 kind)
expect_json(vbs_registry_tests targets 11 name)
expect_json(vbs_v1_tests targets 11 name)
expect_json(test targets 11 kind)
expect_json(vbs_selfhost_tests targets 12 name)
expect_json(test targets 12 kind)
@@ -73,7 +76,7 @@ foreach(profile IN ITEMS debug release)
endif()
endforeach()
expect_json(git dependencies 0 source kind)
expect_json(0002e74a7da94a756f55a4a5574d20b77736c185 dependencies 0 source revision)
expect_json(482a3ea46b0050ec07f5063fd319e66180b4d2e4 dependencies 0 source revision)
expect_json(native dependencies 0 builder)
string(JSON option_type TYPE "${graph}" dependencies 0 options BUILD_SHARED_LIBS)
if(NOT option_type STREQUAL "BOOLEAN")
+9 -8
View File
@@ -66,16 +66,17 @@ VOID_TEST(ExampleContexts, example_records_sources_links_and_pin) {
std::string{"VoidBuildCore"});
Void::Testing::expect_eq(project.targets().at(4).name, std::string{"VoidBuildRegistry"});
Void::Testing::expect_eq(project.targets().at(5).name, std::string{"vbs-registry"});
Void::Testing::expect_eq(project.targets().at(6).name, std::string{"vbs_self_smoke"});
Void::Testing::expect_eq(project.targets().at(6).name, std::string{"vbs_registry_tests"});
Void::Testing::expect_eq(project.targets().at(6).kind, Void::Build::TargetKind::Test);
Void::Testing::expect_eq(project.targets().at(7).name, std::string{"vbs_benchmarks"});
Void::Testing::expect_eq(project.targets().at(8).name, std::string{"vbs_sdk_tests"});
Void::Testing::expect_eq(project.targets().at(8).kind, Void::Build::TargetKind::Test);
Void::Testing::expect_eq(project.targets().at(9).name, std::string{"vbs_core_tests"});
Void::Testing::expect_eq(project.targets().at(10).name, std::string{"vbs_v1_tests"});
Void::Testing::expect_eq(project.targets().at(11).name, std::string{"vbs_registry_tests"});
Void::Testing::expect_eq(project.targets().at(7).name, std::string{"vbs_self_smoke"});
Void::Testing::expect_eq(project.targets().at(7).kind, Void::Build::TargetKind::Test);
Void::Testing::expect_eq(project.targets().at(8).name, std::string{"vbs_benchmarks"});
Void::Testing::expect_eq(project.targets().at(9).name, std::string{"vbs_sdk_tests"});
Void::Testing::expect_eq(project.targets().at(9).kind, Void::Build::TargetKind::Test);
Void::Testing::expect_eq(project.targets().at(10).name, std::string{"vbs_core_tests"});
Void::Testing::expect_eq(project.targets().at(11).name, std::string{"vbs_v1_tests"});
Void::Testing::expect_eq(project.targets().at(12).name, std::string{"vbs_selfhost_tests"});
Void::Testing::expect_eq(project.dependencies().at(0).revision,
std::string{"0002e74a7da94a756f55a4a5574d20b77736c185"});
std::string{"482a3ea46b0050ec07f5063fd319e66180b4d2e4"});
Void::Testing::expect_eq(project.dependencies().at(0).builder, std::string{"native"});
}
+13 -2
View File
@@ -3688,12 +3688,23 @@ VOID_TEST(FullV1Tests, track_b3_live_conan_provider_install) {
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 set_env = [](const char *name, const char *value) {
#if defined(_WIN32)
(void)_putenv_s(name, value);
#else
(void)::setenv(name, value, 1);
#endif
};
set_env("CONAN_HOME", conan_home.string().c_str());
const auto restore_home = Void::Scope::on_exit([&] {
if (had_home) {
(void)::setenv("CONAN_HOME", saved_home.c_str(), 1);
set_env("CONAN_HOME", saved_home.c_str());
} else {
#if defined(_WIN32)
(void)_putenv_s("CONAN_HOME", "");
#else
(void)::unsetenv("CONAN_HOME");
#endif
}
});
+12
View File
@@ -91,7 +91,11 @@ VOID_TEST(SelfHostTests, strict_native_selfhost_voidlibrary_and_sdk_without_cmak
write_file(
trap_bin / "cmake",
"#!/bin/sh\necho 'FORBIDDEN CMAKE INVOCATION IN STRICT NATIVE STAGE' >&2\nexit 99\n");
#if defined(_WIN32)
return; // The cmake trap is a POSIX shell script.
#else
(void)::chmod((trap_bin / "cmake").c_str(), 0755);
#endif
auto ctx = default_profiles().resolve("debug", CompilerFamily::Gcc, Toolchain::host_os_name(),
Toolchain::host_architecture_name());
@@ -267,7 +271,11 @@ VOID_TEST(SelfHostTests, strict_native_full_vbs_stage1_to_stage2_without_cmake)
write_file(
trap_bin / "cmake",
"#!/bin/sh\necho 'FORBIDDEN CMAKE INVOCATION IN STRICT SELF-HOST STAGE' >&2\nexit 99\n");
#if defined(_WIN32)
return; // The cmake trap is a POSIX shell script.
#else
(void)::chmod((trap_bin / "cmake").c_str(), 0755);
#endif
auto ctx = default_profiles().resolve("debug", CompilerFamily::Gcc, Toolchain::host_os_name(),
Toolchain::host_architecture_name());
@@ -472,7 +480,11 @@ VOID_TEST(SelfHostTests, reproducible_stage2_equals_stage3_artifacts_across_buil
const auto trap_bin = tmp / "trap_bin";
write_file(trap_bin / "cmake",
"#!/bin/sh\necho 'FORBIDDEN CMAKE INVOCATION IN REPRO STAGE' >&2\nexit 99\n");
#if defined(_WIN32)
return; // The cmake trap is a POSIX shell script.
#else
(void)::chmod((trap_bin / "cmake").c_str(), 0755);
#endif
std::string trapped_path = trap_bin.string();
if (const char *old_path = std::getenv("PATH")) {