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).
169 lines
7.9 KiB
C++
169 lines
7.9 KiB
C++
#include "build-support/Defaults.hpp"
|
|
|
|
void build(Void::Build::Project &project) {
|
|
const auto &ctx = project.context();
|
|
|
|
auto library = project.dependency("VoidLibrary");
|
|
library
|
|
.git("https://git.faumaray.com/Void/VoidLibrary.git",
|
|
Void::Build::Commit{"482a3ea46b0050ec07f5063fd319e66180b4d2e4"})
|
|
.native_builder({{"VOID_ENABLED_MODULES",
|
|
"Configuration;Text;Unicode;Async;Algorithms;Crypto;Archive;Testing;Log"},
|
|
{"BUILD_SHARED_LIBS", false}});
|
|
|
|
// Source membership comes from conventions and globs, not explicit file lists:
|
|
// sdk/ is the declaration SDK, src/ + recipes/ are the native engine, registry/service/
|
|
// is the registry library.
|
|
auto sdk = project.static_library("VoidBuildSdk");
|
|
sdk.cxx_standard(Void::Build::CxxStandard::Cxx26)
|
|
.sources(project.glob("sdk/*.cpp"))
|
|
.include_directory("include", Void::Build::Visibility::Public);
|
|
BuildSupport::compiler_warnings(sdk, ctx);
|
|
if (ctx.compiler == Void::Build::CompilerFamily::Gcc) {
|
|
sdk.compile_option("-freflection", Void::Build::Visibility::Public);
|
|
}
|
|
|
|
auto core = project.static_library("VoidBuildCore");
|
|
core.cxx_standard(Void::Build::CxxStandard::Cxx26)
|
|
.sources(project.glob("src/**/*.cpp"))
|
|
.sources(project.glob("recipes/**/*.cpp"))
|
|
.include_directory("include", Void::Build::Visibility::Public)
|
|
.include_directory("recipes", Void::Build::Visibility::Public)
|
|
.include_directory("$GEN/include", Void::Build::Visibility::Private)
|
|
.define("VBS_HAS_VOID_CRYPTO=1", Void::Build::Visibility::Public)
|
|
.define("VBS_HAS_VOID_ARCHIVE=1", Void::Build::Visibility::Public)
|
|
.link(sdk, Void::Build::Visibility::Public)
|
|
.link(library.target("Void::Configuration"), Void::Build::Visibility::Public)
|
|
.link(library.target("Void::Text"), Void::Build::Visibility::Public)
|
|
.link(library.target("Void::Unicode"), Void::Build::Visibility::Public)
|
|
.link(library.target("Void::Async"), Void::Build::Visibility::Public)
|
|
.link(library.target("Void::Algorithms"), Void::Build::Visibility::Public)
|
|
.link(library.target("Void::Crypto"), Void::Build::Visibility::Public)
|
|
.link(library.target("Void::Archive"), Void::Build::Visibility::Public)
|
|
.link(library.target("Void::Log"), Void::Build::Visibility::Public);
|
|
if (ctx.os == "Windows") {
|
|
// Winsock for the registry client and the native Windows HTTP fallbacks.
|
|
core.link_option("-lws2_32");
|
|
}
|
|
BuildSupport::compiler_warnings(core, ctx);
|
|
|
|
// Generate profile-isolated BootstrapConfig.hpp inside $GEN/include/Void/Build/.
|
|
const std::string gen_script =
|
|
"mkdir -p \"$GEN/include/Void/Build\" && cat > "
|
|
"\"$GEN/include/Void/Build/BootstrapConfig.hpp\" "
|
|
"<<'EOF'\n"
|
|
"#pragma once\n"
|
|
"#include <string_view>\n"
|
|
"namespace Void::Build::Bootstrap {\n"
|
|
"inline constexpr std::string_view version = \"0.1.0\";\n"
|
|
"inline constexpr std::string_view os = \"" +
|
|
ctx.os +
|
|
"\";\n"
|
|
"inline constexpr std::string_view architecture = \"" +
|
|
ctx.architecture +
|
|
"\";\n"
|
|
"inline constexpr std::string_view source_dir = \"$PROJECT_ROOT\";\n"
|
|
"inline constexpr std::string_view binary_dir = \"\";\n"
|
|
"inline constexpr std::string_view sdk_include_dir = \"$PROJECT_ROOT/include\";\n"
|
|
"inline constexpr std::string_view sdk_source_dir = \"$PROJECT_ROOT/sdk\";\n"
|
|
"}\n"
|
|
"EOF\n";
|
|
|
|
auto bootstrap_cfg = project.custom_action("GenerateBootstrapConfig");
|
|
bootstrap_cfg.command({"/bin/sh", "-c", gen_script})
|
|
.outputs({"include/Void/Build/BootstrapConfig.hpp"});
|
|
// The generated header is a compile input of the core library.
|
|
core.depends_on(bootstrap_cfg);
|
|
|
|
auto cli = project.executable("vbs");
|
|
cli.cxx_standard(Void::Build::CxxStandard::Cxx26)
|
|
.sources({"src/Main.cpp"})
|
|
.depends_on(bootstrap_cfg)
|
|
.include_directory("$GEN/include", Void::Build::Visibility::Private)
|
|
.link(core)
|
|
.install("bin");
|
|
BuildSupport::compiler_warnings(cli, ctx);
|
|
|
|
// The registry service is POSIX-only until its Track C3 Windows port lands.
|
|
if (ctx.os != "Windows") {
|
|
auto registry_lib = project.static_library("VoidBuildRegistry");
|
|
registry_lib.cxx_standard(Void::Build::CxxStandard::Cxx26)
|
|
.sources(project.glob("registry/service/*.cpp"))
|
|
.include_directory("registry/include", Void::Build::Visibility::Public)
|
|
.link(core, Void::Build::Visibility::Public);
|
|
BuildSupport::compiler_warnings(registry_lib, ctx);
|
|
|
|
auto registry_cli = project.executable("vbs-registry");
|
|
registry_cli.cxx_standard(Void::Build::CxxStandard::Cxx26)
|
|
.sources({"registry/cli/Main.cpp"})
|
|
.depends_on(bootstrap_cfg)
|
|
.include_directory("$GEN/include", Void::Build::Visibility::Private)
|
|
.link(registry_lib)
|
|
.install("bin");
|
|
BuildSupport::compiler_warnings(registry_cli, ctx);
|
|
|
|
auto reg_tests = project.test("vbs_registry_tests");
|
|
reg_tests.cxx_standard(Void::Build::CxxStandard::Cxx26)
|
|
.sources({"tests/RegistryTests.cpp"})
|
|
.depends_on(bootstrap_cfg)
|
|
.depends_on(cli)
|
|
.include_directory("$GEN/include", Void::Build::Visibility::Private)
|
|
.link(registry_lib)
|
|
.link(library.target("Void::Testing"));
|
|
BuildSupport::compiler_warnings(reg_tests, ctx);
|
|
}
|
|
|
|
auto smoke_test = project.test("vbs_self_smoke");
|
|
smoke_test.cxx_standard(Void::Build::CxxStandard::Cxx26)
|
|
.sources({"tests/SelfBuildSmoke.cpp"})
|
|
.link(core);
|
|
BuildSupport::compiler_warnings(smoke_test, ctx);
|
|
|
|
auto benchmarks = project.executable("vbs_benchmarks");
|
|
benchmarks.cxx_standard(Void::Build::CxxStandard::Cxx26)
|
|
.sources({"benchmarks/EngineBenchmarks.cpp"})
|
|
.depends_on(bootstrap_cfg)
|
|
.include_directory("$GEN/include", Void::Build::Visibility::Private)
|
|
.link(core);
|
|
BuildSupport::compiler_warnings(benchmarks, ctx);
|
|
|
|
auto sdk_tests = project.test("vbs_sdk_tests");
|
|
sdk_tests.cxx_standard(Void::Build::CxxStandard::Cxx26)
|
|
.sources({"tests/SdkDeclarations.cpp", "tests/ExampleContexts.cpp", "build.cpp",
|
|
"build.profiles.cpp", "build-support/Defaults.cpp"})
|
|
.link(sdk)
|
|
.link(library.target("Void::Testing"))
|
|
.link(library.target("Void::Configuration"));
|
|
BuildSupport::compiler_warnings(sdk_tests, ctx);
|
|
|
|
auto core_tests = project.test("vbs_core_tests");
|
|
core_tests.cxx_standard(Void::Build::CxxStandard::Cxx26)
|
|
.sources({"tests/CoreEngineTests.cpp"})
|
|
.depends_on(bootstrap_cfg)
|
|
.include_directory("$GEN/include", Void::Build::Visibility::Private)
|
|
.link(core)
|
|
.link(library.target("Void::Testing"));
|
|
BuildSupport::compiler_warnings(core_tests, ctx);
|
|
|
|
auto v1_tests = project.test("vbs_v1_tests");
|
|
v1_tests.cxx_standard(Void::Build::CxxStandard::Cxx26)
|
|
.sources({"tests/FullV1Tests.cpp", "tests/DaemonTests.cpp", "tests/SigningTests.cpp",
|
|
"tests/SignatureEnforcementTests.cpp"})
|
|
.depends_on(bootstrap_cfg)
|
|
.depends_on(cli)
|
|
.include_directory("$GEN/include", Void::Build::Visibility::Private)
|
|
.link(core)
|
|
.link(library.target("Void::Testing"));
|
|
BuildSupport::compiler_warnings(v1_tests, ctx);
|
|
|
|
auto selfhost_tests = project.test("vbs_selfhost_tests");
|
|
selfhost_tests.cxx_standard(Void::Build::CxxStandard::Cxx26)
|
|
.sources({"tests/SelfHostTests.cpp"})
|
|
.depends_on(bootstrap_cfg)
|
|
.depends_on(cli)
|
|
.include_directory("$GEN/include", Void::Build::Visibility::Private)
|
|
.link(core)
|
|
.link(library.target("Void::Testing"));
|
|
BuildSupport::compiler_warnings(selfhost_tests, ctx);
|
|
}
|