[Swarming] Bundle gcmole tools.

This enables downloading all gcmole dependencies from
google storage on demand, controlled by a gyp flag
"gcmole=1". This makes the analysis portable to any linux64
host. The archive contains a prebuilt clang in the needed
version, the gcmole plugin and a lua binary.

The tool can be run through a new wrapper that sets up the
environment. This'll ease running it on swarming.

BUG=chromium:535160
LOG=n

Review URL: https://codereview.chromium.org/1703533002

Cr-Commit-Position: refs/heads/master@{#34046}
This commit is contained in:
machenbach 2016-02-16 11:07:48 -08:00 committed by Commit bot
parent 5b2d1956eb
commit 3ec1417050
5 changed files with 54 additions and 0 deletions

2
.gitignore vendored
View File

@ -66,6 +66,8 @@ shell_g
/third_party/llvm
/third_party/llvm-build
/tools/clang
/tools/gcmole/gcmole-tools
/tools/gcmole/gcmole-tools.tar.gz
/tools/jsfunfuzz
/tools/jsfunfuzz.zip
/tools/luci-go/linux64/isolate

8
DEPS
View File

@ -102,6 +102,14 @@ hooks = [
"-s", "v8/buildtools/linux64/clang-format.sha1",
],
},
{
'name': 'gcmole',
'pattern': '.',
'action': [
'python',
'v8/tools/gcmole/download_gcmole_tools.py',
],
},
# Pull luci-go binaries (isolate, swarming) using checked-in hashes.
{
'name': 'luci-go_win',

View File

@ -0,0 +1,22 @@
#!/usr/bin/env python
# Copyright 2016 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import re
import subprocess
GCMOLE_PATH = os.path.dirname(os.path.abspath(__file__))
SHA1_PATH = os.path.join(GCMOLE_PATH, 'gcmole-tools.tar.gz.sha1')
if re.search(r'\bgcmole=1', os.environ.get('GYP_DEFINES', '')):
subprocess.check_call([
'download_from_google_storage',
'-b', 'chrome-v8-gcmole',
'-u', '--no_resume',
'-s', SHA1_PATH,
'--platform=linux*'
])
else:
print 'Skipping gcmole download as gcmole is not set in gyp flags.'

View File

@ -0,0 +1 @@
b10748117f8f53d05dda0a77424b8794e645e330

21
tools/gcmole/run-gcmole.py Executable file
View File

@ -0,0 +1,21 @@
#!/usr/bin/env python
# Copyright 2016 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import subprocess
import sys
GCMOLE_PATH = os.path.dirname(os.path.abspath(__file__))
CLANG_BIN = os.path.join(GCMOLE_PATH, 'gcmole-tools', 'bin')
CLANG_PLUGINS = os.path.join(GCMOLE_PATH, 'gcmole-tools')
LUA = os.path.join(GCMOLE_PATH, 'gcmole-tools', 'lua52')
DRIVER = os.path.join(GCMOLE_PATH, 'gcmole.lua')
assert len(sys.argv) == 2
sys.exit(subprocess.call(
[LUA, DRIVER, sys.argv[1]],
env={'CLANG_BIN': CLANG_BIN, 'CLANG_PLUGINS': CLANG_PLUGINS},
))