1# -*- bazel-starlark -*- 2# Copyright 2023 The Chromium Authors. All rights reserved. 3# Use of this source code is governed by a BSD-style license that can be 4# found in the LICENSE file. 5"""Siso configuration for remote exec wrapper.""" 6 7load("@builtin//lib/gn.star", "gn") 8load("@builtin//struct.star", "module") 9 10__filegroups = {} 11__handlers = {} 12 13def __enabled(ctx): 14 if "args.gn" in ctx.metadata: 15 gn_args = gn.parse_args(ctx.metadata["args.gn"]) 16 if gn_args.get("use_goma") == "true": 17 return True 18 if gn_args.get("use_remoteexec") == "true": 19 return True 20 return False 21 22def __step_config(ctx, step_config): 23 step_config["rules"].extend([ 24 { 25 "name": "clang/cxx", 26 "action": "(.*_)?cxx", 27 "use_remote_exec_wrapper": True, 28 }, 29 { 30 "name": "clang/cc", 31 "action": "(.*_)?cc", 32 "use_remote_exec_wrapper": True, 33 }, 34 { 35 "name": "clang/objcxx", 36 "action": "(.*_)?objcxx", 37 "use_remote_exec_wrapper": True, 38 }, 39 { 40 "name": "clang/objc", 41 "action": "(.*_)?objc", 42 "use_remote_exec_wrapper": True, 43 }, 44 { 45 "name": "action_remote", 46 "command_prefix": "python3 ../../build/util/action_remote.py", 47 "use_remote_exec_wrapper": True, 48 }, 49 ]) 50 return step_config 51 52remote_exec_wrapper = module( 53 "remote_exec_wrapper", 54 enabled = __enabled, 55 step_config = __step_config, 56 filegroups = __filegroups, 57 handlers = __handlers, 58) 59