Files
Build-System/tests/DescribeContracts.cmake
T
faumaray e333bbe84b
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
feat(platform): build on native Windows hosts
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).
2026-12-06 02:01:24 +03:00

109 lines
5.2 KiB
CMake

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}")
message(FATAL_ERROR "JSON ${ARGN}: expected [${expected}], got [${actual}]")
endif()
endfunction()
foreach(profile IN ITEMS debug release)
foreach(compiler IN ITEMS gcc clang)
execute_process(COMMAND "${DESCRIBE}" --profile "${profile}" --compiler "${compiler}"
RESULT_VARIABLE code OUTPUT_VARIABLE graph ERROR_VARIABLE err TIMEOUT 10)
if(NOT "${code}" STREQUAL "0" OR NOT "${err}" STREQUAL "")
message(FATAL_ERROR "Description ${profile}/${compiler} failed: ${code}\n${err}")
endif()
expect_json(1 schema_version)
string(JSON schema_type TYPE "${graph}" schema_version)
if(NOT schema_type STREQUAL "NUMBER")
message(FATAL_ERROR "schema_version must be an integer JSON number")
endif()
expect_json("${profile}" profile name)
expect_json("${compiler}" profile compiler)
expect_json("${EXPECTED_OS}" profile os)
expect_json("${EXPECTED_ARCH}" profile architecture)
if(profile STREQUAL "debug")
expect_json(-O0 profile compile_options 0)
expect_json(-g profile compile_options 1)
else()
expect_json(-O3 profile compile_options 0)
expect_json(-DNDEBUG profile compile_options 1)
endif()
expect_json(VoidBuildSdk targets 0 name)
expect_json(static_library targets 0 kind)
expect_json(glob targets 0 sources 0 kind)
expect_json(sdk/*.cpp targets 0 sources 0 path)
expect_json(public targets 0 include_directories 0 visibility)
expect_json(VoidBuildCore targets 1 name)
expect_json(static_library targets 1 kind)
expect_json(VoidBuildSdk targets 1 links 0 target)
expect_json(public targets 1 links 0 visibility)
expect_json(VoidLibrary targets 1 links 1 dependency)
expect_json(Void::Configuration targets 1 links 1 target)
expect_json(GenerateBootstrapConfig targets 2 name)
expect_json(custom_action targets 2 kind)
expect_json(vbs targets 3 name)
expect_json(executable targets 3 kind)
expect_json(VoidBuildCore targets 3 links 0 target)
expect_json(private targets 3 links 0 visibility)
expect_json(VoidBuildRegistry targets 4 name)
expect_json(static_library targets 4 kind)
expect_json(vbs-registry targets 5 name)
expect_json(executable targets 5 kind)
expect_json(vbs_registry_tests targets 6 name)
expect_json(test targets 6 kind)
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_core_tests targets 10 name)
expect_json(test targets 10 kind)
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)
foreach(index IN ITEMS 0 1 3 4 5 6 7 8 9 10 11 12)
if(compiler STREQUAL "gcc")
expect_json(-Wduplicated-cond targets "${index}" compile_options 2)
else()
expect_json(-Wextra-semi targets "${index}" compile_options 2)
endif()
endforeach()
expect_json(git dependencies 0 source kind)
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")
message(FATAL_ERROR "CMake bool option lost its type")
endif()
endforeach()
endforeach()
execute_process(COMMAND "${DESCRIBE}" --help
RESULT_VARIABLE help_code OUTPUT_VARIABLE help_out ERROR_VARIABLE help_err TIMEOUT 10)
if(NOT "${help_code}" STREQUAL "0" OR NOT "${help_err}" STREQUAL "" OR
NOT help_out MATCHES "Usage: vbs_describe")
message(FATAL_ERROR "vbs_describe --help failed: code=${help_code}\nstdout=[${help_out}]\nstderr=[${help_err}]")
endif()
function(expect_error expected)
execute_process(COMMAND "${DESCRIBE}" ${ARGN}
RESULT_VARIABLE code OUTPUT_VARIABLE out ERROR_VARIABLE err TIMEOUT 10)
if(NOT "${code}" STREQUAL "2" OR NOT "${out}" STREQUAL "" OR
NOT "${err}" STREQUAL "vbs_describe: ${expected}\n")
message(FATAL_ERROR "Description error ${ARGN}: ${code}\nstdout=[${out}]\nstderr=[${err}]")
endif()
endfunction()
expect_error("unknown profile 'unknown'" --profile unknown)
expect_error("unknown compiler 'msvc' (expected gcc or clang)" --compiler msvc)
expect_error("option '--profile' requires a value" --profile)
expect_error("unknown option: --invalid" --invalid)
expect_error("unexpected positional argument: invalid" invalid)
message(STATUS "Four runtime profile/compiler contexts, generated help, and five error contracts verified")