@@ -423,9 +423,22 @@ def main(args):
423
423
424
424
if args .subparser_name == "build" :
425
425
if grr_config .CONFIG .ContextApplied ("Platform:Darwin" ):
426
- if not grr_config .CONFIG .Get ("ClientBuilder.install_dir" ):
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
+ ):
427
437
raise RuntimeError ("ClientBuilder.install_dir must be set." )
428
- if not grr_config .CONFIG .Get ("ClientBuilder.fleetspeak_plist_path" ):
438
+ if not grr_config .CONFIG .Get (
439
+ "ClientBuilder.fleetspeak_plist_path" ,
440
+ context = [contexts .TARGET_DARWIN ],
441
+ ):
429
442
raise RuntimeError ("ClientBuilder.fleetspeak_plist_path must be set." )
430
443
TemplateBuilder ().BuildTemplate (context = context , output = args .output )
431
444
elif args .subparser_name == "repack" :
0 commit comments