Skip to content

Commit

Permalink
Update client_build.py: fix the config check.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbushkov authored Feb 26, 2025
1 parent cae5a56 commit 7550c86
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions grr/client_builder/grr_response_client_builder/client_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,9 +423,22 @@ def main(args):

if args.subparser_name == "build":
if grr_config.CONFIG.ContextApplied("Platform:Darwin"):
if not grr_config.CONFIG.Get("ClientBuilder.install_dir"):
# We know that the client builder is run on Darwin, so we can check that
# the required config options are set. But the builder config options use
# the "Target:Darwin" context, as they care about the target system that
# the template is built for, not the system that the builder is run on.
# The fact that we build macOS templates on Darwin is technically
# an implementation detail even though it is impossible to build macOS
# templates on any other platform.
if not grr_config.CONFIG.Get(
"ClientBuilder.install_dir",
context=[contexts.TARGET_DARWIN],
):
raise RuntimeError("ClientBuilder.install_dir must be set.")
if not grr_config.CONFIG.Get("ClientBuilder.fleetspeak_plist_path"):
if not grr_config.CONFIG.Get(
"ClientBuilder.fleetspeak_plist_path",
context=[contexts.TARGET_DARWIN],
):
raise RuntimeError("ClientBuilder.fleetspeak_plist_path must be set.")
TemplateBuilder().BuildTemplate(context=context, output=args.output)
elif args.subparser_name == "repack":
Expand Down

0 comments on commit 7550c86

Please sign in to comment.