Skip to content

Commit 1ee2c02

Browse files
rzhwcopybara-github
authored andcommitted
siso: read reproxy labels from rewrapper_linux.cfg not hardcoded values
we are still hardcoding the path to rewrapper_linux.cfg right now, a followup CL will resolve this. Bug: b/273407069 Change-Id: I65bb3d660c5e25617ec28f964a8da0d451f92e75 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4573171 Reviewed-by: Fumitoshi Ukai <[email protected]> Commit-Queue: Richard Wang <[email protected]> Cr-Commit-Position: refs/heads/main@{#1151065} NOKEYCHECK=True GitOrigin-RevId: f2ed66aba136788cedd4bf178c95887f2d85db8e
1 parent d0c2b4c commit 1ee2c02

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

config/siso/rewrapper_to_reproxy.star

+18-5
Original file line numberDiff line numberDiff line change
@@ -38,31 +38,44 @@ def __enabled(ctx):
3838
return False
3939

4040
def __step_config(ctx, step_config):
41-
# TODO(b/273407069): Read reproxy config from config files.
41+
labels = dict()
42+
43+
# TODO(b/273407069): Choose the right cfg rather than hardcoding buildtools/reclient_cfgs/chromium-browser-clang/rewrapper_linux.cfg.
44+
# TODO(b/273407069): Read cfg values other than labels.
45+
if not ctx.fs.exists("buildtools/reclient_cfgs/chromium-browser-clang/rewrapper_linux.cfg"):
46+
fail("rewrapper_to_reproxy enabled but buildtools/reclient_cfgs/chromium-browser-clang/rewrapper_linux.cfg not found, is download_remoteexec_cfg set in gclient custom_vars?")
47+
for line in str(ctx.fs.read("buildtools/reclient_cfgs/chromium-browser-clang/rewrapper_linux.cfg")).splitlines():
48+
if line.startswith("labels="):
49+
for label in line.removeprefix("labels=").split(","):
50+
label_parts = label.split("=")
51+
if len(label_parts) != 2:
52+
fail("invalid label %s" % label)
53+
labels[label_parts[0]] = label_parts[1]
54+
4255
step_config["rules"].extend([
4356
{
4457
"name": "clang/cxx",
4558
"action": "(.*_)?cxx",
4659
"handler": "remove_rewrapper",
47-
"reproxy_config": {"labels": {"type": "compile", "compiler": "clang", "lang": "cpp"}},
60+
"reproxy_config": {"labels": labels},
4861
},
4962
{
5063
"name": "clang/cc",
5164
"action": "(.*_)?cc",
5265
"handler": "remove_rewrapper",
53-
"reproxy_config": {"labels": {"type": "compile", "compiler": "clang", "lang": "cpp"}},
66+
"reproxy_config": {"labels": labels},
5467
},
5568
{
5669
"name": "clang/objcxx",
5770
"action": "(.*_)?objcxx",
5871
"handler": "remove_rewrapper",
59-
"reproxy_config": {"labels": {"type": "compile", "compiler": "clang", "lang": "cpp"}},
72+
"reproxy_config": {"labels": labels},
6073
},
6174
{
6275
"name": "clang/objc",
6376
"action": "(.*_)?objc",
6477
"handler": "remove_rewrapper",
65-
"reproxy_config": {"labels": {"type": "compile", "compiler": "clang", "lang": "cpp"}},
78+
"reproxy_config": {"labels": labels},
6679
},
6780
])
6881
return step_config

0 commit comments

Comments
 (0)