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 "restat": True, 23 "remote": True, 24 "canonicalize_dir": True, 25 "timeout": "2m", 26 "output_local": True, 27 "platform_ref": platform_ref, 28 }, 29 { 30 "name": "mojo/mojom_parser", 31 "command_prefix": platform.python_bin + " ../../mojo/public/tools/mojom/mojom_parser.py", 32 # TODO: b/285078792 - Win cross compile on Linux worker doesn't work with input_root_absolute_path=true. 33 "remote": runtime.os != "windows", 34 "canonicalize_dir": True, 35 "input_root_absolute_path": True, 36 "timeout": "2m", 37 "output_local": True, 38 "platform_ref": platform_ref, 39 }, 40 { 41 "name": "mojo/validate_typemap_config", 42 "command_prefix": platform.python_bin + " ../../mojo/public/tools/bindings/validate_typemap_config.py", 43 "remote": True, 44 "canonicalize_dir": True, 45 "timeout": "2m", 46 "output_local": True, 47 "platform_ref": platform_ref, 48 }, 49 { 50 "name": "mojo/generate_type_mappings", 51 "command_prefix": platform.python_bin + " ../../mojo/public/tools/bindings/generate_type_mappings.py", 52 "remote": True, 53 "canonicalize_dir": True, 54 "timeout": "2m", 55 "output_local": True, 56 "platform_ref": platform_ref, 57 }, 58 ]) 59 return step_config 60 61mojo = module( 62 "mojo", 63 step_config = __step_config, 64) 65