1# -*- bazel-starlark -*- 2# Copyright 2023 The Chromium Authors 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 mojo.""" 6 7load("@builtin//runtime.star", "runtime") 8load("@builtin//struct.star", "module") 9load("./platform.star", "platform") 10 11def __step_config(ctx, step_config): 12 # mojom_bindings_generator.py will run faster on n2-highmem-8 than 13 # n2-custom-2-3840 14 # e.g. 15 # n2-highmem-8: exec: 880.202978ms 16 # n2-custom-2-3840: exec: 2.42808488s 17 platform_ref = "large" 18 step_config["rules"].extend([ 19 { 20 "name": "mojo/mojom_bindings_generator", 21 "command_prefix": platform.python_bin + " ../../mojo/public/tools/bindings/mojom_bindings_generator.py", 22 "exclude_input_patterns": [ 23 "*.stamp", 24 ], 25 "restat": True, 26 "remote": True, 27 "canonicalize_dir": True, 28 "timeout": "2m", 29 "output_local": True, 30 "platform_ref": platform_ref, 31 }, 32 { 33 "name": "mojo/mojom_parser", 34 "command_prefix": platform.python_bin + " ../../mojo/public/tools/mojom/mojom_parser.py", 35 "exclude_input_patterns": [ 36 "*.stamp", 37 ], 38 # TODO: b/285078792 - Win cross compile on Linux worker doesn't work with input_root_absolute_path=true. 39 "remote": runtime.os != "windows", 40 "canonicalize_dir": True, 41 "input_root_absolute_path": True, 42 "timeout": "2m", 43 "output_local": True, 44 "platform_ref": platform_ref, 45 }, 46 { 47 "name": "mojo/validate_typemap_config", 48 "command_prefix": platform.python_bin + " ../../mojo/public/tools/bindings/validate_typemap_config.py", 49 "remote": True, 50 "canonicalize_dir": True, 51 "timeout": "2m", 52 "output_local": True, 53 "platform_ref": platform_ref, 54 }, 55 { 56 "name": "mojo/generate_type_mappings", 57 "command_prefix": platform.python_bin + " ../../mojo/public/tools/bindings/generate_type_mappings.py", 58 "remote": True, 59 "canonicalize_dir": True, 60 "timeout": "2m", 61 "output_local": True, 62 "platform_ref": platform_ref, 63 }, 64 ]) 65 return step_config 66 67mojo = module( 68 "mojo", 69 step_config = __step_config, 70) 71