[build] Fix RBE fallback on pkg, ddc and dyn bots.

Also fix --check-clean. `ninja target -t commands` reports the commands for the default target, fix to use `ninja -t commands target` instead.

Change-Id: Ice179290e75b083a96abadb7540ca960eafcc982
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/510440
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
This commit is contained in:
Ryan Macnak
2026-06-09 12:27:23 -07:00
committed by dart-scoped@luci-project-accounts.iam.gserviceaccount.com
parent a7c437e4d8
commit b5eb9af663
4 changed files with 29 additions and 21 deletions
+8 -4
View File
@@ -198,8 +198,8 @@ def RunOneBuildCommand(build_config, args, env):
return 0
def CheckCleanBuild(build_config, args, rbe, env):
explain_args = args + ['-n', '-d', 'explain']
def CheckCleanBuild(build_config, args, rbe, targets, env):
explain_args = args[0:3] + ['-n', '-d', 'explain'] + targets
print(' '.join(explain_args))
process = subprocess.Popen(explain_args,
env=env,
@@ -218,7 +218,7 @@ def CheckCleanBuild(build_config, args, rbe, env):
return 1
if rbe:
list_args = args + ['-t', 'commands']
list_args = args[0:3] + ['-t', 'commands'] + targets
print(' '.join(list_args))
process = subprocess.Popen(list_args,
env=env,
@@ -298,7 +298,11 @@ def Build(configs, env, options):
if options.check_clean:
for (build_config, args, rbe) in configs:
if CheckCleanBuild(build_config, args, rbe, env=env) != 0:
if CheckCleanBuild(build_config,
args,
rbe,
options.build_targets,
env=env) != 0:
return 1
return 0