@@ -213,6 +213,17 @@ def BuildTemplate(self, context=None, output=None):
213213 # The repacker uses this context to chose the .msi extension for the
214214 # repacked installer.
215215 context .append ("Target:WindowsMsi" )
216+ if "Target:Darwin" in context :
217+ if not grr_config .CONFIG .Get (
218+ "ClientBuilder.install_dir" , context = context
219+ ):
220+ raise ValueError ("ClientBuilder.install_dir must be set on Darwin." )
221+ if not grr_config .CONFIG .Get (
222+ "ClientBuilder.fleetspeak_plist_path" , context = context
223+ ):
224+ raise ValueError (
225+ "ClientBuilder.fleetspeak_plist_path must be set on Darwin."
226+ )
216227
217228 template_path = None
218229 # If output is specified, place the built template file there, otherwise
@@ -422,24 +433,6 @@ def main(args):
422433 logger .handlers = [handler ]
423434
424435 if args .subparser_name == "build" :
425- if grr_config .CONFIG .ContextApplied ("Platform:Darwin" ):
426- # We know that the client builder is run on Darwin, so we can check that
427- # the required config options are set. But the builder config options use
428- # the "Target:Darwin" context, as they care about the target system that
429- # the template is built for, not the system that the builder is run on.
430- # The fact that we build macOS templates on Darwin is technically
431- # an implementation detail even though it is impossible to build macOS
432- # templates on any other platform.
433- if not grr_config .CONFIG .Get (
434- "ClientBuilder.install_dir" ,
435- context = [contexts .TARGET_DARWIN ],
436- ):
437- raise RuntimeError ("ClientBuilder.install_dir must be set." )
438- if not grr_config .CONFIG .Get (
439- "ClientBuilder.fleetspeak_plist_path" ,
440- context = [contexts .TARGET_DARWIN ],
441- ):
442- raise RuntimeError ("ClientBuilder.fleetspeak_plist_path must be set." )
443436 TemplateBuilder ().BuildTemplate (context = context , output = args .output )
444437 elif args .subparser_name == "repack" :
445438 if args .debug_build :
0 commit comments