1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31
   32
   33
   34
   35
   36
   37
   38
   39
   40
   41
   42
   43
   44
   45
   46
   47
   48
   49
   50
   51
   52
   53
   54
   55
   56
   57
   58
   59
   60
   61
   62
   63
   64

build / config / siso / mojo.star [blame]

# -*- bazel-starlark -*-
# Copyright 2023 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Siso configuration for mojo."""

load("@builtin//runtime.star", "runtime")
load("@builtin//struct.star", "module")
load("./platform.star", "platform")

def __step_config(ctx, step_config):
    # mojom_bindings_generator.py will run faster on n2-highmem-8 than
    # n2-custom-2-3840
    # e.g.
    #  n2-highmem-8: exec: 880.202978ms
    #  n2-custom-2-3840: exec: 2.42808488s
    platform_ref = "large"
    step_config["rules"].extend([
        {
            "name": "mojo/mojom_bindings_generator",
            "command_prefix": platform.python_bin + " ../../mojo/public/tools/bindings/mojom_bindings_generator.py",
            "restat": True,
            "remote": True,
            "canonicalize_dir": True,
            "timeout": "2m",
            "output_local": True,
            "platform_ref": platform_ref,
        },
        {
            "name": "mojo/mojom_parser",
            "command_prefix": platform.python_bin + " ../../mojo/public/tools/mojom/mojom_parser.py",
            # TODO: b/285078792 - Win cross compile on Linux worker doesn't work with input_root_absolute_path=true.
            "remote": runtime.os != "windows",
            "canonicalize_dir": True,
            "input_root_absolute_path": True,
            "timeout": "2m",
            "output_local": True,
            "platform_ref": platform_ref,
        },
        {
            "name": "mojo/validate_typemap_config",
            "command_prefix": platform.python_bin + " ../../mojo/public/tools/bindings/validate_typemap_config.py",
            "remote": True,
            "canonicalize_dir": True,
            "timeout": "2m",
            "output_local": True,
            "platform_ref": platform_ref,
        },
        {
            "name": "mojo/generate_type_mappings",
            "command_prefix": platform.python_bin + " ../../mojo/public/tools/bindings/generate_type_mappings.py",
            "remote": True,
            "canonicalize_dir": True,
            "timeout": "2m",
            "output_local": True,
            "platform_ref": platform_ref,
        },
    ])
    return step_config

mojo = module(
    "mojo",
    step_config = __step_config,
)