From 7fa57f8522ed7741c00ed3cd64cf956716aebd2c Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Mon, 11 Mar 2024 21:23:21 +0300 Subject: Add support for build auxiliary machines/configurations --- libbrep/build.hxx | 45 +++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 41 insertions(+), 4 deletions(-) (limited to 'libbrep/build.hxx') diff --git a/libbrep/build.hxx b/libbrep/build.hxx index 1e9a9fc..be7cdf5 100644 --- a/libbrep/build.hxx +++ b/libbrep/build.hxx @@ -28,7 +28,7 @@ // #define LIBBREP_BUILD_SCHEMA_VERSION_BASE 20 -#pragma db model version(LIBBREP_BUILD_SCHEMA_VERSION_BASE, 24, closed) +#pragma db model version(LIBBREP_BUILD_SCHEMA_VERSION_BASE, 25, closed) // We have to keep these mappings at the global scope instead of inside the // brep namespace because they need to be also effective in the bbot namespace @@ -230,6 +230,13 @@ namespace brep using bbot::operation_results; + #pragma db value + struct build_machine + { + string name; + string summary; + }; + #pragma db object pointer(shared_ptr) session class build { @@ -249,7 +256,8 @@ namespace brep optional interactive, optional agent_fingerprint, optional agent_challenge, - string machine, string machine_summary, + build_machine, + vector auxiliary_machines, string controller_checksum, string machine_checksum); @@ -262,6 +270,21 @@ namespace brep string package_config_name, string toolchain_name, version toolchain_version); + // Create the build object with the built state, the specified status and + // operation results, all the timestamps set to now, and the force state + // set to unforced. + // + build (string tenant, + package_name_type, version, + target_triplet, + string target_config_name, + string package_config_name, + string toolchain_name, version toolchain_version, + result_status, + operation_results, + build_machine, + vector auxiliary_machines = {}); + // Move-only type. // build (build&&); @@ -325,8 +348,9 @@ namespace brep optional agent_fingerprint; optional agent_challenge; - string machine; - string machine_summary; + build_machine machine; + vector auxiliary_machines; + odb::section auxiliary_machines_section; // Note that the logs are stored as std::string/TEXT which is Ok since // they are UTF-8 and our database is UTF-8. @@ -368,6 +392,19 @@ namespace brep // #pragma db member(timestamp) index + #pragma db member(machine) transient + + #pragma db member(machine_name) virtual(std::string) \ + access(machine.name) column("machine") + + #pragma db member(machine_summary) virtual(std::string) \ + access(machine.summary) + + #pragma db member(auxiliary_machines) id_column("") value_column("") \ + section(auxiliary_machines_section) + + #pragma db member(auxiliary_machines_section) load(lazy) update(always) + #pragma db member(results) id_column("") value_column("") \ section(results_section) -- cgit v1.1