From 997fef310ebf496205e101be0d95db5d0452e5ac Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Mon, 25 Mar 2024 17:31:59 +0300 Subject: Don't parse nor serialize toolchain and bootstrap manifests in bootstrapped machine manifest for auxiliary machine --- bbot/machine-manifest.cxx | 48 +++++++++++++++++++++++++++++++---------------- 1 file changed, 32 insertions(+), 16 deletions(-) (limited to 'bbot/machine-manifest.cxx') diff --git a/bbot/machine-manifest.cxx b/bbot/machine-manifest.cxx index 606baf0..bddf4d5 100644 --- a/bbot/machine-manifest.cxx +++ b/bbot/machine-manifest.cxx @@ -326,24 +326,36 @@ namespace bbot if (!machine.mac) bad_name ("mac address must be present in machine manifest"); - nv = p.next (); - if (nv.empty ()) - bad_value ("toolchain manifest expected"); + if (machine.effective_role () == machine_role::build) + { + nv = p.next (); + if (nv.empty ()) + bad_value ("toolchain manifest expected"); - toolchain = toolchain_manifest (p, nv, iu); + toolchain = toolchain_manifest (p, nv, iu); - nv = p.next (); - if (nv.empty ()) - bad_value ("bootstrap manifest expected"); + nv = p.next (); + if (nv.empty ()) + bad_value ("bootstrap manifest expected"); - bootstrap = bootstrap_manifest (p, nv, iu); + bootstrap = bootstrap_manifest (p, nv, iu); - // Make sure this is the end. - // - nv = p.next (); - if (!nv.empty ()) - throw parsing (p.name (), nv.name_line, nv.name_column, - "single bootstrapped machine manifest expected"); + // Make sure this is the end. + // + nv = p.next (); + if (!nv.empty ()) + throw parsing (p.name (), nv.name_line, nv.name_column, + "single bootstrapped machine manifest expected"); + } + else + { + // Make sure this is the end. + // + nv = p.next (); + if (!nv.empty ()) + throw parsing (p.name (), nv.name_line, nv.name_column, + "single machine manifest expected"); + } } void bootstrapped_machine_manifest:: @@ -359,8 +371,12 @@ namespace bbot "mac address must be present in machine manifest"); machine.serialize (s); - toolchain.serialize (s); - bootstrap.serialize (s); + + if (machine.effective_role () == machine_role::build) + { + toolchain.serialize (s); + bootstrap.serialize (s); + } s.next ("", ""); // End of stream. } -- cgit v1.1