Skip to content

Commit 1cd6fd9

Browse files
mi-acCommit Bot
authored andcommitted
[build] Drop Chromium-specific features from V8's MB fork
V8 passes the command explicitly to each swarming task, hence it's not necessary to store the command in the isolate. This drops the Chromium-specific code in MB that creates the swarming command based on Chromium test features. This also makes the swarming targets option a no-op to allow activating it on the infra side without disruption. Bug: chromium:669910 Change-Id: I6cb03f05d034092a25d879d52b4d64952493f55b Reviewed-on: https://chromium-review.googlesource.com/779148 Reviewed-by: Sergiy Byelozyorov <[email protected]> Commit-Queue: Michael Achenbach <[email protected]> Cr-Commit-Position: refs/heads/master@{#49520}
1 parent 4cc5520 commit 1cd6fd9

2 files changed

Lines changed: 14 additions & 106 deletions

File tree

tools/mb/mb.py

Lines changed: 11 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,10 @@ def AddCommonOptions(subp):
253253

254254
self.args = parser.parse_args(argv)
255255

256+
# TODO(machenbach): This prepares passing swarming targets to isolate on the
257+
# infra side.
258+
self.args.swarming_targets_file = None
259+
256260
def DumpInputFiles(self):
257261

258262
def DumpContentsOfFilePassedTo(arg_name, path):
@@ -326,7 +330,7 @@ def CmdIsolate(self):
326330
return 1
327331

328332
if vals['type'] == 'gn':
329-
return self.RunGNIsolate(vals)
333+
return self.RunGNIsolate()
330334
else:
331335
return self.Build('%s_run' % self.args.target[0])
332336

@@ -356,7 +360,7 @@ def CmdRun(self):
356360
ret = self.Build(target)
357361
if ret:
358362
return ret
359-
ret = self.RunGNIsolate(vals)
363+
ret = self.RunGNIsolate()
360364
if ret:
361365
return ret
362366
else:
@@ -892,16 +896,13 @@ def RunGNGen(self, vals, compute_grit_inputs_for_analyze=False):
892896
raise MBErr('did not generate any of %s' %
893897
', '.join(runtime_deps_targets))
894898

895-
command, extra_files = self.GetIsolateCommand(target, vals)
896-
897899
runtime_deps = self.ReadFile(runtime_deps_path).splitlines()
898900

899-
self.WriteIsolateFiles(build_dir, command, target, runtime_deps,
900-
extra_files)
901+
self.WriteIsolateFiles(build_dir, target, runtime_deps)
901902

902903
return 0
903904

904-
def RunGNIsolate(self, vals):
905+
def RunGNIsolate(self):
905906
target = self.args.target[0]
906907
isolate_map = self.ReadIsolateMap()
907908
err, labels = self.MapTargetsToLabels(isolate_map, [target])
@@ -910,7 +911,6 @@ def RunGNIsolate(self, vals):
910911
label = labels[0]
911912

912913
build_dir = self.args.path[0]
913-
command, extra_files = self.GetIsolateCommand(target, vals)
914914

915915
cmd = self.GNCmd('desc', build_dir, label, 'runtime_deps')
916916
ret, out, _ = self.Call(cmd)
@@ -921,8 +921,7 @@ def RunGNIsolate(self, vals):
921921

922922
runtime_deps = out.splitlines()
923923

924-
self.WriteIsolateFiles(build_dir, command, target, runtime_deps,
925-
extra_files)
924+
self.WriteIsolateFiles(build_dir, target, runtime_deps)
926925

927926
ret, _, _ = self.Run([
928927
self.executable,
@@ -936,14 +935,12 @@ def RunGNIsolate(self, vals):
936935

937936
return ret
938937

939-
def WriteIsolateFiles(self, build_dir, command, target, runtime_deps,
940-
extra_files):
938+
def WriteIsolateFiles(self, build_dir, target, runtime_deps):
941939
isolate_path = self.ToAbsPath(build_dir, target + '.isolate')
942940
self.WriteFile(isolate_path,
943941
pprint.pformat({
944942
'variables': {
945-
'command': command,
946-
'files': sorted(runtime_deps + extra_files),
943+
'files': sorted(runtime_deps),
947944
}
948945
}) + '\n')
949946

@@ -1058,97 +1055,6 @@ def RunGYPAnalyze(self, vals):
10581055

10591056
return ret
10601057

1061-
def GetIsolateCommand(self, target, vals):
1062-
isolate_map = self.ReadIsolateMap()
1063-
1064-
is_android = 'target_os="android"' in vals['gn_args']
1065-
is_fuchsia = 'target_os="fuchsia"' in vals['gn_args']
1066-
1067-
# This should be true if tests with type='windowed_test_launcher' are
1068-
# expected to run using xvfb. For example, Linux Desktop, X11 CrOS and
1069-
# Ozone CrOS builds. Note that one Ozone build can be used to run differen
1070-
# backends. Currently, tests are executed for the headless and X11 backends
1071-
# and both can run under Xvfb.
1072-
# TODO(tonikitoo,msisov,fwang): Find a way to run tests for the Wayland
1073-
# backend.
1074-
use_xvfb = self.platform == 'linux2' and not is_android and not is_fuchsia
1075-
1076-
asan = 'is_asan=true' in vals['gn_args']
1077-
msan = 'is_msan=true' in vals['gn_args']
1078-
tsan = 'is_tsan=true' in vals['gn_args']
1079-
cfi_diag = 'use_cfi_diag=true' in vals['gn_args']
1080-
1081-
test_type = isolate_map[target]['type']
1082-
1083-
executable = isolate_map[target].get('executable', target)
1084-
executable_suffix = '.exe' if self.platform == 'win32' else ''
1085-
1086-
cmdline = []
1087-
extra_files = []
1088-
1089-
if test_type == 'nontest':
1090-
self.WriteFailureAndRaise('We should not be isolating %s.' % target,
1091-
output_path=None)
1092-
1093-
if is_android and test_type != "script":
1094-
cmdline = [
1095-
'../../build/android/test_wrapper/logdog_wrapper.py',
1096-
'--target', target,
1097-
'--logdog-bin-cmd', '../../bin/logdog_butler',
1098-
'--store-tombstones']
1099-
elif is_fuchsia and test_type != 'script':
1100-
cmdline = [os.path.join('bin', 'run_%s' % target)]
1101-
elif use_xvfb and test_type == 'windowed_test_launcher':
1102-
extra_files = [
1103-
'../../testing/test_env.py',
1104-
'../../testing/xvfb.py',
1105-
]
1106-
cmdline = [
1107-
'../../testing/xvfb.py',
1108-
'./' + str(executable) + executable_suffix,
1109-
'--brave-new-test-launcher',
1110-
'--test-launcher-bot-mode',
1111-
'--asan=%d' % asan,
1112-
'--msan=%d' % msan,
1113-
'--tsan=%d' % tsan,
1114-
'--cfi-diag=%d' % cfi_diag,
1115-
]
1116-
elif test_type in ('windowed_test_launcher', 'console_test_launcher'):
1117-
extra_files = [
1118-
'../../testing/test_env.py'
1119-
]
1120-
cmdline = [
1121-
'../../testing/test_env.py',
1122-
'./' + str(executable) + executable_suffix,
1123-
'--brave-new-test-launcher',
1124-
'--test-launcher-bot-mode',
1125-
'--asan=%d' % asan,
1126-
'--msan=%d' % msan,
1127-
'--tsan=%d' % tsan,
1128-
'--cfi-diag=%d' % cfi_diag,
1129-
]
1130-
elif test_type == 'script':
1131-
extra_files = [
1132-
'../../testing/test_env.py'
1133-
]
1134-
cmdline = [
1135-
'../../testing/test_env.py',
1136-
'../../' + self.ToSrcRelPath(isolate_map[target]['script'])
1137-
]
1138-
elif test_type in ('raw'):
1139-
extra_files = []
1140-
cmdline = [
1141-
'./' + str(target) + executable_suffix,
1142-
]
1143-
1144-
else:
1145-
self.WriteFailureAndRaise('No command line for %s found (test type %s).'
1146-
% (target, test_type), output_path=None)
1147-
1148-
cmdline += isolate_map[target].get('args', [])
1149-
1150-
return cmdline, extra_files
1151-
11521058
def ToAbsPath(self, build_path, *comps):
11531059
return self.PathJoin(self.chromium_src_dir,
11541060
self.ToSrcRelPath(build_path),

tools/mb/mb_unittest.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,8 @@ def test_gn_gen_fails(self):
430430
mbw.Call = lambda cmd, env=None, buffer_output=True: (1, '', '')
431431
self.check(['gen', '-c', 'gn_debug_goma', '//out/Default'], mbw=mbw, ret=1)
432432

433+
# TODO(machenbach): Comment back in after swarming file parameter is used.
434+
"""
433435
def test_gn_gen_swarming(self):
434436
files = {
435437
'/tmp/swarming_targets': 'base_unittests\n',
@@ -480,7 +482,7 @@ def test_gn_gen_swarming_script(self):
480482
mbw.files)
481483
self.assertIn('c:\\fake_src\\out\\Default\\cc_perftests.isolated.gen.json',
482484
mbw.files)
483-
485+
""" # pylint: disable=pointless-string-statement
484486

485487
def test_gn_isolate(self):
486488
files = {

0 commit comments

Comments
 (0)