aboutsummaryrefslogtreecommitdiff
path: root/bbot/machine-manifest.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2024-03-25 17:31:59 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2024-03-25 17:31:59 +0300
commit997fef310ebf496205e101be0d95db5d0452e5ac (patch)
tree2b3aa4eb9eb142f285ba8ad99011fcb278667ae8 /bbot/machine-manifest.cxx
parentb476cc01c98885bb40c6b118dfda57dea08d5a4b (diff)
Don't parse nor serialize toolchain and bootstrap manifests in bootstrapped machine manifest for auxiliary machine
Diffstat (limited to 'bbot/machine-manifest.cxx')
-rw-r--r--bbot/machine-manifest.cxx48
1 files changed, 32 insertions, 16 deletions
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.
}