Skip to content

Commit 7550c86

Browse files
authored
Update client_build.py: fix the config check.
1 parent cae5a56 commit 7550c86

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

grr/client_builder/grr_response_client_builder/client_build.py

+15-2
Original file line numberDiff line numberDiff line change
@@ -423,9 +423,22 @@ def main(args):
423423

424424
if args.subparser_name == "build":
425425
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+
):
427437
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+
):
429442
raise RuntimeError("ClientBuilder.fleetspeak_plist_path must be set.")
430443
TemplateBuilder().BuildTemplate(context=context, output=args.output)
431444
elif args.subparser_name == "repack":

0 commit comments

Comments
 (0)