From 6613fbc2a3fc96b491b6691145c72c5a9550dc84 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 25 Aug 2022 20:54:40 +0300 Subject: Add target to build configuration id --- mod/mod-build-force.cxx | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'mod/mod-build-force.cxx') diff --git a/mod/mod-build-force.cxx b/mod/mod-build-force.cxx index bd172e3..281c76c 100644 --- a/mod/mod-build-force.cxx +++ b/mod/mod-build-force.cxx @@ -120,6 +120,17 @@ handle (request& rq, response& rs) if (config.empty ()) throw invalid_argument ("no configuration name"); + target_triplet target; + + try + { + target = target_triplet (params.target ()); + } + catch (const invalid_argument& e) + { + throw invalid_argument (string ("invalid target: ") + e.what ()); + } + string& toolchain_name (params.toolchain_name ()); if (toolchain_name.empty ()) @@ -130,6 +141,7 @@ handle (request& rq, response& rs) id = build_id (package_id (move (tenant), move (p), package_version), move (config), + move (target), move (toolchain_name), toolchain_version); } @@ -149,7 +161,7 @@ handle (request& rq, response& rs) // Make sure the build configuration still exists. // - if (build_conf_map_->find (id.configuration.c_str ()) == + if (build_conf_map_->find (build_config_id {id.configuration, id.target}) == build_conf_map_->end ()) config_expired ("no configuration"); @@ -177,7 +189,7 @@ handle (request& rq, response& rs) l1 ([&]{trace << "force rebuild for " << b->tenant << ' ' << b->package_name << '/' << b->package_version << ' ' - << b->configuration << ' ' + << b->configuration << '/' << b->target << ' ' << b->toolchain_name << '-' << b->toolchain_version << ": " << reason;}); } -- cgit v1.1