Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(424)

Unified Diff: tools/foozzie/v8_foozzie.py

Issue 2649133010: [foozzie] Support multi-architecture builds (Closed)
Patch Set: Review Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « infra/mb/mb_config.pyl ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/foozzie/v8_foozzie.py
diff --git a/tools/foozzie/v8_foozzie.py b/tools/foozzie/v8_foozzie.py
index 51e9c38d1285b6e4f90e891b8b758c4c75a87833..993fa0b177c068eae3a9235e87a74ea99ec75a61 100755
--- a/tools/foozzie/v8_foozzie.py
+++ b/tools/foozzie/v8_foozzie.py
@@ -92,16 +92,22 @@ ORIGINAL_SOURCE_HASH_LENGTH = 3
# Placeholder string if no original source file could be determined.
ORIGINAL_SOURCE_DEFAULT = 'none'
+
+def infer_arch(d8):
+ """Infer the V8 architecture from the build configuration next to the
+ executable.
+ """
+ with open(os.path.join(os.path.dirname(d8), 'v8_build_config.json')) as f:
+ arch = json.load(f)['v8_current_cpu']
+ return 'ia32' if arch == 'x86' else arch
+
+
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument(
'--random-seed', type=int, required=True,
help='random seed passed to both runs')
parser.add_argument(
- '--first-arch', help='first architecture', default='x64')
- parser.add_argument(
- '--second-arch', help='second architecture', default='x64')
- parser.add_argument(
'--first-config', help='first configuration', default='fullcode')
parser.add_argument(
'--second-config', help='second configuration', default='fullcode')
@@ -115,15 +121,6 @@ def parse_args():
parser.add_argument('testcase', help='path to test case')
options = parser.parse_args()
- # Ensure we make a sane comparison.
- assert (options.first_arch != options.second_arch or
- options.first_config != options.second_config) , (
- 'Need either arch or config difference.')
- assert options.first_arch in SUPPORTED_ARCHS
- assert options.second_arch in SUPPORTED_ARCHS
- assert options.first_config in CONFIGS
- assert options.second_config in CONFIGS
-
# Ensure we have a test case.
assert (os.path.exists(options.testcase) and
os.path.isfile(options.testcase)), (
@@ -142,11 +139,18 @@ def parse_args():
assert os.path.exists(options.first_d8)
assert os.path.exists(options.second_d8)
- # Ensure we use different executables when we claim we compare
- # different architectures.
- # TODO(machenbach): Infer arch from gn's build output.
- if options.first_arch != options.second_arch:
- assert options.first_d8 != options.second_d8
+ # Infer architecture from build artifacts.
+ options.first_arch = infer_arch(options.first_d8)
+ options.second_arch = infer_arch(options.second_d8)
+
+ # Ensure we make a sane comparison.
+ assert (options.first_arch != options.second_arch or
+ options.first_config != options.second_config), (
+ 'Need either arch or config difference.')
+ assert options.first_arch in SUPPORTED_ARCHS
+ assert options.second_arch in SUPPORTED_ARCHS
+ assert options.first_config in CONFIGS
+ assert options.second_config in CONFIGS
return options
« no previous file with comments | « infra/mb/mb_config.pyl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698