[cr146] Support patched grit rules in siso.

Chromium change:
https://chromium.googlesource.com/chromium/src/+/afb52035ec87bab066d067fec29ec1b00685344c

Enable remote execution for generated_resources

Bug: 452240479
Change-Id: Ifdcc4f158e7fdf6d4806cfa1285401a145aa6048
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7509051
Commit-Queue: Neri Marschik <nerima@google.com>
Reviewed-by: Takuto Ikuta <tikuta@chromium.org>
Reviewed-by: Fumitoshi Ukai <ukai@google.com>
Cr-Commit-Position: refs/heads/main@{#1575020}
This commit is contained in:
Emerick Rogul
2026-02-26 14:14:55 +00:00
committed by Claudio DeSouza
parent d9ecfa3b07
commit eeb143c0aa
+14 -5
View File
@@ -7,7 +7,6 @@
load("@builtin//runtime.star", "runtime")
load("@builtin//struct.star", "module", "struct")
load("./platform.star", "platform")
__HOST_OS_IS_LINUX = runtime.os == "linux"
__HOST_OS_IS_WINDOWS = runtime.os == "windows"
@@ -149,9 +148,6 @@ def __adjust_handlers(ctx, step_config, handlers):
# Adjust rules.
for rule in step_config["rules"]:
rule_name = rule["name"]
rule_command_prefix = rule.get("command_prefix")
is_python_rule = rule_command_prefix and rule_command_prefix.startswith(
platform.python_bin)
if rule_name.startswith("clang"):
found_clang_rule = True
@@ -159,7 +155,11 @@ def __adjust_handlers(ctx, step_config, handlers):
__wrap_with_redirect_cc_handler(ctx, rule, handlers)
continue
if is_python_rule and rule_name.startswith(("mojo", "blink")):
if __is_python_rule(rule) and rule_name.startswith((
"blink",
"grit",
"mojo",
)):
__set_rule_timeout(rule, "15m")
__wrap_python_with_chromium_src_inputs_handler(ctx, rule, handlers)
continue
@@ -390,6 +390,15 @@ def __is_remote_disabled(rule):
return rule.get("remote") == False
# Checks if a rule is a Python rule.
def __is_python_rule(rule):
rule_command_prefix = rule.get("command_prefix")
rule_remote_command = rule.get("remote_command")
return (rule_command_prefix and rule_command_prefix.startswith("python3")
) or (rule_remote_command
and rule_remote_command.startswith("python3"))
# Converts a path to the linux version of the llvm-build path.
def __to_linux_llvm_build_path(path):
return path.replace(__LLVM_BUILD_PATH, __LLVM_BUILD_PATH + "_linux", 1)