• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 mojo."""
6
7load("@builtin//struct.star", "module")
8
9__filegroups = {}
10
11__handlers = {}
12
13def __step_config(ctx, step_config):
14    # mojom_bindings_generator.py will run faster on n2-highmem-8 than
15    # n2-custom-2-3840
16    # e.g.
17    #  n2-highmem-8: exec: 880.202978ms
18    #  n2-custom-2-3840: exec: 2.42808488s
19    platform_ref = "large"
20    step_config["rules"].extend([
21        {
22            "name": "mojo/mojom_bindings_generator",
23            "command_prefix": "python3 ../../mojo/public/tools/bindings/mojom_bindings_generator.py",
24            "inputs": [
25                "mojo/public/tools/bindings/mojom_bindings_generator.py",
26            ],
27            "indirect_inputs": {
28                "includes": [
29                    "*.js",
30                    "*.mojom",
31                    "*.mojom-module",
32                    "*.test-mojom",
33                    "*.test-mojom-module",
34                    "*.zip",
35                ],
36            },
37            "exclude_input_patterns": [
38                "*.stamp",
39            ],
40            # TODO(crbug.com/1437820): unspecified outputs of mojom_bindings_generator.py
41            "outputs_map": {
42                "./gen/components/aggregation_service/aggregation_service.mojom.js": {
43                    "outputs": [
44                        "./gen/mojom-webui/components/aggregation_service/aggregation_service.mojom-webui.js",
45                    ],
46                },
47                "./gen/components/attribution_reporting/eligibility_error.mojom.js": {
48                    "outputs": [
49                        "./gen/mojom-webui/components/attribution_reporting/eligibility_error.mojom-webui.js",
50                        "./gen/mojom-webui/components/attribution_reporting/registration_eligibility.mojom-webui.js",
51                        "./gen/mojom-webui/components/attribution_reporting/source_registration_error.mojom-webui.js",
52                        "./gen/mojom-webui/components/attribution_reporting/trigger_registration_error.mojom-webui.js",
53                    ],
54                },
55                "./gen/components/attribution_reporting/registration.mojom.js": {
56                    "outputs": [
57                        "./gen/mojom-webui/components/attribution_reporting/registration.mojom-webui.js",
58                    ],
59                },
60                "./gen/media/capture/mojom/image_capture.mojom.js": {
61                    "outputs": [
62                        "./gen/mojom-webui/media/capture/mojom/image_capture.mojom-webui.js",
63                    ],
64                },
65                "./gen/services/device/public/mojom/usb_device.mojom.js": {
66                    "outputs": [
67                        "./gen/mojom-webui/services/device/public/mojom/usb_device.mojom-webui.js",
68                        "./gen/mojom-webui/services/device/public/mojom/usb_enumeration_options.mojom-webui.js",
69                        "./gen/mojom-webui/services/device/public/mojom/usb_manager.mojom-webui.js",
70                        "./gen/mojom-webui/services/device/public/mojom/usb_manager_client.mojom-webui.js",
71                    ],
72                },
73                "./gen/services/media_session/public/mojom/audio_focus.mojom.js": {
74                    "outputs": [
75                        "./gen/mojom-webui/services/media_session/public/mojom/audio_focus.mojom-webui.js",
76                        "./gen/mojom-webui/services/media_session/public/mojom/constants.mojom-webui.js",
77                        "./gen/mojom-webui/services/media_session/public/mojom/media_controller.mojom-webui.js",
78                        "./gen/mojom-webui/services/media_session/public/mojom/media_session.mojom-webui.js",
79                    ],
80                },
81                "./gen/services/network/public/mojom/attribution.mojom.js": {
82                    "outputs": [
83                        "./gen/mojom-webui/services/network/public/mojom/attribution.mojom-webui.js",
84                    ],
85                },
86                "./gen/services/network/public/mojom/schemeful_site.mojom.js": {
87                    "outputs": [
88                        "./gen/mojom-webui/services/network/public/mojom/schemeful_site.mojom-webui.js",
89                    ],
90                },
91                "./gen/third_party/blink/public/mojom/quota/quota_manager_host.mojom.js": {
92                    "outputs": [
93                        "./gen/mojom-webui/third_party/blink/public/mojom/quota/quota_manager_host.mojom-webui.js",
94                        "./gen/mojom-webui/third_party/blink/public/mojom/quota/quota_types.mojom-webui.js",
95                    ],
96                },
97                "./gen/third_party/blink/public/mojom/storage_key/ancestor_chain_bit.mojom.js": {
98                    "outputs": [
99                        "./gen/mojom-webui/third_party/blink/public/mojom/storage_key/ancestor_chain_bit.mojom-webui.js",
100                        "./gen/mojom-webui/third_party/blink/public/mojom/storage_key/storage_key.mojom-webui.js",
101                    ],
102                },
103                "./gen/ui/base/mojom/ui_base_types.mojom.js": {
104                    "outputs": [
105                        "./gen/mojom-webui/ui/base/mojom/ui_base_types.mojom-webui.js",
106                        "./gen/mojom-webui/ui/base/mojom/window_open_disposition.mojom-webui.js",
107                    ],
108                },
109                "./gen/ui/gfx/image/mojom/image.mojom.js": {
110                    "outputs": [
111                        "./gen/mojom-webui/ui/gfx/image/mojom/image.mojom-webui.js",
112                    ],
113                },
114            },
115            "restat": True,
116            "remote": True,
117            "timeout": "2m",
118            "output_local": True,
119            "platform_ref": platform_ref,
120        },
121        {
122            "name": "mojo/mojom_parser",
123            "command_prefix": "python3 ../../mojo/public/tools/mojom/mojom_parser.py",
124            "indirect_inputs": {
125                "includes": [
126                    "*.build_metadata",
127                    "*.mojom",
128                    "*.mojom-module",
129                    "*.test-mojom",
130                    "*.test-mojom-module",
131                ],
132            },
133            "exclude_input_patterns": [
134                "*.stamp",
135            ],
136            # TODO(b/288523418): missing inputs for mojom_parser?
137            "outputs_map": {
138                "./gen/mojo/public/interfaces/bindings/tests/sample_import2.mojom-module": {
139                    "inputs": [
140                        "./gen/mojo/public/interfaces/bindings/tests/test_mojom_import_wrapper.build_metadata",
141                        "./gen/mojo/public/interfaces/bindings/tests/test_mojom_import_wrapper_wrapper.build_metadata",
142                    ],
143                },
144                "./gen/mojo/public/interfaces/bindings/tests/math_calculator.mojom-module": {
145                    "inputs": [
146                        "./gen/mojo/public/interfaces/bindings/tests/test_mojom_import_wrapper.build_metadata",
147                        "./gen/mojo/public/interfaces/bindings/tests/test_mojom_import_wrapper_wrapper.build_metadata",
148                    ],
149                },
150                "./gen/mojo/public/interfaces/bindings/tests/test_associated_interfaces.mojom-module": {
151                    "inputs": [
152                        "./gen/mojo/public/interfaces/bindings/tests/test_mojom_import_wrapper.build_metadata",
153                        "./gen/mojo/public/interfaces/bindings/tests/test_mojom_import_wrapper_wrapper.build_metadata",
154                    ],
155                },
156            },
157            "remote": True,
158            "input_root_absolute_path": True,
159            "output_local": True,
160            "platform_ref": platform_ref,
161        },
162    ])
163    return step_config
164
165mojo = module(
166    "mojo",
167    step_config = __step_config,
168    filegroups = __filegroups,
169    handlers = __handlers,
170)
171