feat: add Plan 20 Slice 1 CMake native translation, self-test smoke target, VL-009 VOID_TEST check, and warm-cache hardening
VoidBuildSystem CI / build-and-test-gcc16 (push) Failing after 5s
VoidBuildSystem CI / build-and-test-gcc16 (push) Failing after 5s
This commit is contained in:
1 parent
363fb8200e
commit
d3d2666965
19 files changed
+1466
-65
No files matched your search
@@ -0,0 +1,93 @@
|
||||
#pragma once
|
||||
|
||||
#include <Void/Build/Execution/Scheduler.hpp>
|
||||
#include <Void/Build/Graph/Graph.hpp>
|
||||
#include <Void/Build/Provider/Provider.hpp>
|
||||
#include <Void/Build/Snapshot/Snapshot.hpp>
|
||||
#include <Void/Build/State/StateStore.hpp>
|
||||
#include <Void/Functional/Error.hpp>
|
||||
#include <Void/Functional/Result.hpp>
|
||||
|
||||
#include <filesystem>
|
||||
#include <map>
|
||||
#include <optional>
|
||||
#include <stop_token>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace Void::Build::Provider {
|
||||
|
||||
enum class TranslationPolicy {
|
||||
RequireNative,
|
||||
FallbackToForeignBuild,
|
||||
};
|
||||
|
||||
enum class TranslationStatus {
|
||||
Supported,
|
||||
Unsupported,
|
||||
};
|
||||
|
||||
struct UnsupportedConstruct {
|
||||
std::string target_name;
|
||||
std::string construct_kind;
|
||||
std::string detail;
|
||||
};
|
||||
|
||||
struct TranslationAuditReport {
|
||||
TranslationStatus status{TranslationStatus::Supported};
|
||||
std::vector<std::string> supported_targets;
|
||||
std::vector<UnsupportedConstruct> unsupported;
|
||||
std::string summary;
|
||||
|
||||
[[nodiscard]] bool is_supported() const noexcept {
|
||||
return status == TranslationStatus::Supported && unsupported.empty();
|
||||
}
|
||||
};
|
||||
|
||||
struct TranslatedCMakeGraph {
|
||||
TranslationAuditReport audit;
|
||||
Graph::BuildGraph graph;
|
||||
std::map<std::string, Graph::ImportedTargetInterface, std::less<>> exported_targets;
|
||||
};
|
||||
|
||||
struct TranslationResolution {
|
||||
bool executed_natively{false};
|
||||
TranslationAuditReport audit;
|
||||
ProviderExport exported;
|
||||
std::optional<Execution::ExecutionReport> native_execution;
|
||||
};
|
||||
|
||||
// Configures CMake ONLY (writing File API codemodel-v2 query; never invokes `cmake --build`)
|
||||
// and returns the configured File API reply directory.
|
||||
[[nodiscard]] Void::Result::Result<std::filesystem::path, Void::Result::Error>
|
||||
configure_cmake_for_translation(const ProviderRequest &request,
|
||||
const std::filesystem::path &configure_dir,
|
||||
std::stop_token stop = {});
|
||||
|
||||
// Audits a configured CMake File API codemodel against Plan 20's bounded native subset:
|
||||
// C++ STATIC_LIBRARY / SHARED_LIBRARY / OBJECT_LIBRARY / EXECUTABLE targets without
|
||||
// generated sources, custom UTILITY rules, foreign C++20 module fileSets, precompiled
|
||||
// headers, non-C++ languages, or untracked link fragments. Any unsupported construct is
|
||||
// reported explicitly and never silently dropped.
|
||||
[[nodiscard]] Void::Result::Result<TranslationAuditReport, Void::Result::Error>
|
||||
audit_cmake_codemodel(const std::filesystem::path &configure_dir);
|
||||
|
||||
// Translates an audited CMake codemodel into a native VBS BuildGraph whose actions execute
|
||||
// through VBS's Toolchain driver, CAS StateStore, depfile tracking, and ProcessSupervisor.
|
||||
[[nodiscard]] Void::Result::Result<TranslatedCMakeGraph, Void::Result::Error>
|
||||
translate_cmake_to_native_graph(const ProviderRequest &request,
|
||||
const std::filesystem::path &configure_dir,
|
||||
const std::filesystem::path &native_build_root,
|
||||
const Snapshot::InputSnapshot *snapshot = nullptr);
|
||||
|
||||
// End-to-end Plan 20 Slice 1 resolver: configures CMake, audits completeness, and either
|
||||
// executes the translated native BuildGraph via VBS Execution::execute_graph (without
|
||||
// running `cmake --build`), fails with explicit unsupported-construct diagnostics
|
||||
// (RequireNative), or delegates cleanly to the v1 foreign CMake provider
|
||||
// (FallbackToForeignBuild).
|
||||
[[nodiscard]] Void::Result::Result<TranslationResolution, Void::Result::Error>
|
||||
resolve_cmake_with_translation(const ProviderRequest &request, State::StateStore &state,
|
||||
TranslationPolicy policy = TranslationPolicy::FallbackToForeignBuild,
|
||||
std::stop_token stop = {});
|
||||
|
||||
} // namespace Void::Build::Provider
|
||||
@@ -8,6 +8,7 @@
|
||||
#include <cstdint>
|
||||
#include <filesystem>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <set>
|
||||
#include <string>
|
||||
@@ -120,6 +121,8 @@ class StateStore {
|
||||
std::vector<GraphGenerationRecord> generations;
|
||||
};
|
||||
|
||||
struct CacheState;
|
||||
|
||||
explicit StateStore(std::filesystem::path root);
|
||||
|
||||
[[nodiscard]] Void::Result::Result<DatabaseSnapshot, Void::Result::Error>
|
||||
@@ -133,6 +136,7 @@ class StateStore {
|
||||
std::filesystem::path leases_dir_;
|
||||
std::filesystem::path db_file_;
|
||||
std::filesystem::path lock_file_;
|
||||
std::shared_ptr<CacheState> cache_;
|
||||
};
|
||||
|
||||
} // namespace Void::Build::State
|
||||
Reference in new issue
Block a user