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

+57
View File
@@ -1,5 +1,6 @@
#include <Void/Build/Report/Cdash.hpp>
#include <Void/Build/Platform/ProcessSupervisor.hpp>
#include <Void/Core/Scope.hpp>
#include <Void/System/Types.hpp>
#include <Void/Text/Str.hpp>
@@ -11,9 +12,13 @@
#include <cstdio>
#include <ctime>
#include <format>
#if defined(_WIN32)
#include <windows.h>
#else
#include <netdb.h>
#include <sys/socket.h>
#include <unistd.h>
#endif
#if defined(VBS_HAS_VOID_NET)
#include <Void/Net/Http.hpp>
@@ -61,17 +66,30 @@ std::string utc_timestamp() {
const auto now = std::chrono::system_clock::now();
const std::time_t seconds = std::chrono::system_clock::to_time_t(now);
std::tm tm{};
#if defined(_WIN32)
::gmtime_s(&tm, &seconds);
#else
::gmtime_r(&seconds, &tm);
#endif
return std::format("{:04d}-{:02d}-{:02d}T{:02d}:{:02d}:{:02d}", tm.tm_year + 1900,
tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec);
}
std::string host_name() {
#if defined(_WIN32)
char buffer[256]{};
DWORD size = static_cast<DWORD>(sizeof(buffer) - 1);
if (::GetComputerNameA(buffer, &size) != 0) {
return buffer;
}
return "localhost";
#else
char buffer[256]{};
if (::gethostname(buffer, sizeof(buffer) - 1) == 0) {
return buffer;
}
return "localhost";
#endif
}
} // namespace
@@ -186,6 +204,44 @@ submit_cdash_report(std::string_view cdash_url, std::string_view project,
response->body.substr(0, 200)))};
}
return {};
#else
#if defined(_WIN32)
// Windows: curl performs the submission for http and https (Void::Net not linked).
auto curl = Platform::resolve_executable("curl");
if (!curl) {
return std::unexpected{make_error(
"CDash submission on Windows requires curl (Void::Net not linked)")};
}
Platform::ProcessRequest req;
req.executable = *curl;
req.arguments = {"--silent",
"--show-error",
"-X",
"POST",
"-H",
"Content-Type: " + submission.content_type,
"--data-binary",
"@-",
"-w",
"\n%{http_code}",
std::format("{}://{}:{}{}", scheme, host, port, path)};
req.stdin_data = submission.body;
req.timeout = std::chrono::seconds{60};
auto proc = Platform::run_supervised(req);
if (!proc || !proc->succeeded()) {
return std::unexpected{make_error(std::format(
"CDash submission failed: {}",
proc ? proc->stderr_data : proc.error().message()))};
}
int status = 0;
if (const auto nl = proc->stdout_data.rfind('\n'); nl != std::string::npos) {
(void)Void::Str::to_int(Void::Str::trim_ascii(proc->stdout_data.substr(nl + 1)), status);
}
if (status < 200 || status >= 300) {
return std::unexpected{
make_error(std::format("CDash submission rejected with HTTP {}", status))};
}
return {};
#else
// Plain TCP HTTP/1.1 POST for http:// (Void::Net server transport not linked).
if (scheme != "http") {
@@ -252,6 +308,7 @@ submit_cdash_report(std::string_view cdash_url, std::string_view project,
}
return {};
#endif
#endif
}
} // namespace Void::Build::Report