xref: /aosp_15_r20/external/angle/build/config/siso/linux.star (revision 8975f5c5ed3d1c378011245431ada316dfb6f244)
1*8975f5c5SAndroid Build Coastguard Worker# -*- bazel-starlark -*-
2*8975f5c5SAndroid Build Coastguard Worker# Copyright 2023 The Chromium Authors
3*8975f5c5SAndroid Build Coastguard Worker# Use of this source code is governed by a BSD-style license that can be
4*8975f5c5SAndroid Build Coastguard Worker# found in the LICENSE file.
5*8975f5c5SAndroid Build Coastguard Worker"""Siso configuration for linux."""
6*8975f5c5SAndroid Build Coastguard Worker
7*8975f5c5SAndroid Build Coastguard Workerload("@builtin//struct.star", "module")
8*8975f5c5SAndroid Build Coastguard Workerload("./android.star", "android")
9*8975f5c5SAndroid Build Coastguard Workerload("./clang_linux.star", "clang")
10*8975f5c5SAndroid Build Coastguard Workerload("./config.star", "config")
11*8975f5c5SAndroid Build Coastguard Workerload("./cros.star", "cros")
12*8975f5c5SAndroid Build Coastguard Workerload("./devtools_frontend.star", "devtools_frontend")
13*8975f5c5SAndroid Build Coastguard Workerload("./nacl_linux.star", "nacl")
14*8975f5c5SAndroid Build Coastguard Workerload("./nasm_linux.star", "nasm")
15*8975f5c5SAndroid Build Coastguard Workerload("./proto_linux.star", "proto")
16*8975f5c5SAndroid Build Coastguard Workerload("./reproxy.star", "reproxy")
17*8975f5c5SAndroid Build Coastguard Workerload("./rust_linux.star", "rust")
18*8975f5c5SAndroid Build Coastguard Workerload("./typescript_unix.star", "typescript")
19*8975f5c5SAndroid Build Coastguard Workerload("./v8.star", "v8")
20*8975f5c5SAndroid Build Coastguard Worker
21*8975f5c5SAndroid Build Coastguard Workerdef __filegroups(ctx):
22*8975f5c5SAndroid Build Coastguard Worker    fg = {}
23*8975f5c5SAndroid Build Coastguard Worker    fg.update(android.filegroups(ctx))
24*8975f5c5SAndroid Build Coastguard Worker    fg.update(clang.filegroups(ctx))
25*8975f5c5SAndroid Build Coastguard Worker    fg.update(cros.filegroups(ctx))
26*8975f5c5SAndroid Build Coastguard Worker    fg.update(devtools_frontend.filegroups(ctx))
27*8975f5c5SAndroid Build Coastguard Worker    fg.update(nacl.filegroups(ctx))
28*8975f5c5SAndroid Build Coastguard Worker    fg.update(nasm.filegroups(ctx))
29*8975f5c5SAndroid Build Coastguard Worker    fg.update(proto.filegroups(ctx))
30*8975f5c5SAndroid Build Coastguard Worker    fg.update(rust.filegroups(ctx))
31*8975f5c5SAndroid Build Coastguard Worker    fg.update(typescript.filegroups(ctx))
32*8975f5c5SAndroid Build Coastguard Worker    fg["third_party/perfetto/python:python"] = {
33*8975f5c5SAndroid Build Coastguard Worker        "type": "glob",
34*8975f5c5SAndroid Build Coastguard Worker        "includes": ["*.py"],
35*8975f5c5SAndroid Build Coastguard Worker    }
36*8975f5c5SAndroid Build Coastguard Worker    fg["third_party/perfetto/src/trace_processor:trace_processor"] = {
37*8975f5c5SAndroid Build Coastguard Worker        "type": "glob",
38*8975f5c5SAndroid Build Coastguard Worker        "includes": ["*.py"],
39*8975f5c5SAndroid Build Coastguard Worker    }
40*8975f5c5SAndroid Build Coastguard Worker    return fg
41*8975f5c5SAndroid Build Coastguard Worker
42*8975f5c5SAndroid Build Coastguard Worker__handlers = {}
43*8975f5c5SAndroid Build Coastguard Worker__handlers.update(android.handlers)
44*8975f5c5SAndroid Build Coastguard Worker__handlers.update(clang.handlers)
45*8975f5c5SAndroid Build Coastguard Worker__handlers.update(cros.handlers)
46*8975f5c5SAndroid Build Coastguard Worker__handlers.update(devtools_frontend.handlers)
47*8975f5c5SAndroid Build Coastguard Worker__handlers.update(nacl.handlers)
48*8975f5c5SAndroid Build Coastguard Worker__handlers.update(nasm.handlers)
49*8975f5c5SAndroid Build Coastguard Worker__handlers.update(proto.handlers)
50*8975f5c5SAndroid Build Coastguard Worker__handlers.update(rust.handlers)
51*8975f5c5SAndroid Build Coastguard Worker__handlers.update(typescript.handlers)
52*8975f5c5SAndroid Build Coastguard Worker
53*8975f5c5SAndroid Build Coastguard Workerdef __step_config(ctx, step_config):
54*8975f5c5SAndroid Build Coastguard Worker    config.check(ctx)
55*8975f5c5SAndroid Build Coastguard Worker
56*8975f5c5SAndroid Build Coastguard Worker    if android.enabled(ctx):
57*8975f5c5SAndroid Build Coastguard Worker        step_config = android.step_config(ctx, step_config)
58*8975f5c5SAndroid Build Coastguard Worker
59*8975f5c5SAndroid Build Coastguard Worker    # nacl and cros rules should be added before clang rules for link action.
60*8975f5c5SAndroid Build Coastguard Worker    step_config = nacl.step_config(ctx, step_config)
61*8975f5c5SAndroid Build Coastguard Worker
62*8975f5c5SAndroid Build Coastguard Worker    # cros rules are necessary only for the Siso's builtin RBE client mode.
63*8975f5c5SAndroid Build Coastguard Worker    if not reproxy.enabled(ctx):
64*8975f5c5SAndroid Build Coastguard Worker        step_config = cros.step_config(ctx, step_config)
65*8975f5c5SAndroid Build Coastguard Worker
66*8975f5c5SAndroid Build Coastguard Worker    step_config = clang.step_config(ctx, step_config)
67*8975f5c5SAndroid Build Coastguard Worker    step_config = devtools_frontend.step_config(ctx, step_config)
68*8975f5c5SAndroid Build Coastguard Worker    step_config = nasm.step_config(ctx, step_config)
69*8975f5c5SAndroid Build Coastguard Worker    step_config = proto.step_config(ctx, step_config)
70*8975f5c5SAndroid Build Coastguard Worker    step_config = rust.step_config(ctx, step_config)
71*8975f5c5SAndroid Build Coastguard Worker    step_config = typescript.step_config(ctx, step_config)
72*8975f5c5SAndroid Build Coastguard Worker    step_config = v8.step_config(ctx, step_config)
73*8975f5c5SAndroid Build Coastguard Worker
74*8975f5c5SAndroid Build Coastguard Worker    step_config["rules"].extend([
75*8975f5c5SAndroid Build Coastguard Worker        {
76*8975f5c5SAndroid Build Coastguard Worker            "name": "write_buildflag_header",
77*8975f5c5SAndroid Build Coastguard Worker            "command_prefix": "python3 ../../build/write_buildflag_header.py",
78*8975f5c5SAndroid Build Coastguard Worker            "remote": config.get(ctx, "cog"),
79*8975f5c5SAndroid Build Coastguard Worker            "canonicalize_dir": True,
80*8975f5c5SAndroid Build Coastguard Worker            "timeout": "2m",
81*8975f5c5SAndroid Build Coastguard Worker        },
82*8975f5c5SAndroid Build Coastguard Worker        {
83*8975f5c5SAndroid Build Coastguard Worker            "name": "write_build_date_header",
84*8975f5c5SAndroid Build Coastguard Worker            "command_prefix": "python3 ../../base/write_build_date_header.py",
85*8975f5c5SAndroid Build Coastguard Worker            "remote": config.get(ctx, "cog"),
86*8975f5c5SAndroid Build Coastguard Worker            "canonicalize_dir": True,
87*8975f5c5SAndroid Build Coastguard Worker            "timeout": "2m",
88*8975f5c5SAndroid Build Coastguard Worker        },
89*8975f5c5SAndroid Build Coastguard Worker        {
90*8975f5c5SAndroid Build Coastguard Worker            "name": "version_py",
91*8975f5c5SAndroid Build Coastguard Worker            "command_prefix": "python3 ../../build/util/version.py",
92*8975f5c5SAndroid Build Coastguard Worker            "remote": config.get(ctx, "cog"),
93*8975f5c5SAndroid Build Coastguard Worker            "canonicalize_dir": True,
94*8975f5c5SAndroid Build Coastguard Worker            "timeout": "2m",
95*8975f5c5SAndroid Build Coastguard Worker        },
96*8975f5c5SAndroid Build Coastguard Worker        {
97*8975f5c5SAndroid Build Coastguard Worker            "name": "perfetto/touch_file",
98*8975f5c5SAndroid Build Coastguard Worker            "command_prefix": "python3 ../../third_party/perfetto/tools/touch_file.py",
99*8975f5c5SAndroid Build Coastguard Worker            "remote": config.get(ctx, "cog"),
100*8975f5c5SAndroid Build Coastguard Worker            "replace": True,
101*8975f5c5SAndroid Build Coastguard Worker            "canonicalize_dir": True,
102*8975f5c5SAndroid Build Coastguard Worker            "timeout": "2m",
103*8975f5c5SAndroid Build Coastguard Worker        },
104*8975f5c5SAndroid Build Coastguard Worker        {
105*8975f5c5SAndroid Build Coastguard Worker            "name": "perfetto/write_buildflag_header",
106*8975f5c5SAndroid Build Coastguard Worker            "command_prefix": "python3 ../../third_party/perfetto/gn/write_buildflag_header.py",
107*8975f5c5SAndroid Build Coastguard Worker            "remote": config.get(ctx, "cog"),
108*8975f5c5SAndroid Build Coastguard Worker            "canonicalize_dir": True,
109*8975f5c5SAndroid Build Coastguard Worker            "timeout": "2m",
110*8975f5c5SAndroid Build Coastguard Worker        },
111*8975f5c5SAndroid Build Coastguard Worker        {
112*8975f5c5SAndroid Build Coastguard Worker            "name": "perfetto/gen_tp_table_headers",
113*8975f5c5SAndroid Build Coastguard Worker            "command_prefix": "python3 ../../third_party/perfetto/tools/gen_tp_table_headers.py",
114*8975f5c5SAndroid Build Coastguard Worker            "inputs": [
115*8975f5c5SAndroid Build Coastguard Worker                "third_party/perfetto/python:python",
116*8975f5c5SAndroid Build Coastguard Worker                "third_party/perfetto/src/trace_processor:trace_processor",
117*8975f5c5SAndroid Build Coastguard Worker            ],
118*8975f5c5SAndroid Build Coastguard Worker            "remote": config.get(ctx, "cog"),
119*8975f5c5SAndroid Build Coastguard Worker            "canonicalize_dir": True,
120*8975f5c5SAndroid Build Coastguard Worker            "timeout": "2m",
121*8975f5c5SAndroid Build Coastguard Worker        },
122*8975f5c5SAndroid Build Coastguard Worker        {
123*8975f5c5SAndroid Build Coastguard Worker            "name": "perfetto/gen_cc_proto_descriptor",
124*8975f5c5SAndroid Build Coastguard Worker            "command_prefix": "python3 ../../third_party/perfetto/tools/gen_cc_proto_descriptor.py",
125*8975f5c5SAndroid Build Coastguard Worker            "remote": config.get(ctx, "cog"),
126*8975f5c5SAndroid Build Coastguard Worker            "canonicalize_dir": True,
127*8975f5c5SAndroid Build Coastguard Worker            "timeout": "2m",
128*8975f5c5SAndroid Build Coastguard Worker        },
129*8975f5c5SAndroid Build Coastguard Worker        {
130*8975f5c5SAndroid Build Coastguard Worker            # b/331716896: local fails due to link(2) error.
131*8975f5c5SAndroid Build Coastguard Worker            "name": "generate_fontconfig_cache",
132*8975f5c5SAndroid Build Coastguard Worker            "command_prefix": "python3 ../../build/gn_run_binary.py generate_fontconfig_caches",
133*8975f5c5SAndroid Build Coastguard Worker            "remote": config.get(ctx, "cog"),
134*8975f5c5SAndroid Build Coastguard Worker            "canonicalize_dir": True,
135*8975f5c5SAndroid Build Coastguard Worker            "timeout": "2m",
136*8975f5c5SAndroid Build Coastguard Worker        },
137*8975f5c5SAndroid Build Coastguard Worker    ])
138*8975f5c5SAndroid Build Coastguard Worker
139*8975f5c5SAndroid Build Coastguard Worker    return step_config
140*8975f5c5SAndroid Build Coastguard Worker
141*8975f5c5SAndroid Build Coastguard Workerchromium = module(
142*8975f5c5SAndroid Build Coastguard Worker    "chromium",
143*8975f5c5SAndroid Build Coastguard Worker    step_config = __step_config,
144*8975f5c5SAndroid Build Coastguard Worker    filegroups = __filegroups,
145*8975f5c5SAndroid Build Coastguard Worker    handlers = __handlers,
146*8975f5c5SAndroid Build Coastguard Worker)
147