Commit 7a9ebb58 authored by machenbach's avatar machenbach Committed by Commit bot

[Swarming] Bundle jsfunfuzz.

This downloads a patched version of jsfunfuzz from google
storage (google internal bucket) as a hook on demand.

Similar to the gcmole approach from
https://codereview.chromium.org/1703533002/

BUG=chromium:535160
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#34106}
parent 953874e9
...@@ -68,8 +68,8 @@ shell_g ...@@ -68,8 +68,8 @@ shell_g
/tools/clang /tools/clang
/tools/gcmole/gcmole-tools /tools/gcmole/gcmole-tools
/tools/gcmole/gcmole-tools.tar.gz /tools/gcmole/gcmole-tools.tar.gz
/tools/jsfunfuzz /tools/jsfunfuzz/jsfunfuzz
/tools/jsfunfuzz.zip /tools/jsfunfuzz/jsfunfuzz.tar.gz
/tools/luci-go/linux64/isolate /tools/luci-go/linux64/isolate
/tools/luci-go/mac64/isolate /tools/luci-go/mac64/isolate
/tools/luci-go/win64/isolate.exe /tools/luci-go/win64/isolate.exe
......
...@@ -110,6 +110,14 @@ hooks = [ ...@@ -110,6 +110,14 @@ hooks = [
'v8/tools/gcmole/download_gcmole_tools.py', 'v8/tools/gcmole/download_gcmole_tools.py',
], ],
}, },
{
'name': 'jsfunfuzz',
'pattern': '.',
'action': [
'python',
'v8/tools/jsfunfuzz/download_jsfunfuzz.py',
],
},
# Pull luci-go binaries (isolate, swarming) using checked-in hashes. # Pull luci-go binaries (isolate, swarming) using checked-in hashes.
{ {
'name': 'luci-go_win', 'name': 'luci-go_win',
......
...@@ -36,6 +36,7 @@ JSFUNFUZZ_URL="https://bugzilla.mozilla.org/attachment.cgi?id=310631" ...@@ -36,6 +36,7 @@ JSFUNFUZZ_URL="https://bugzilla.mozilla.org/attachment.cgi?id=310631"
JSFUNFUZZ_MD5="d0e497201c5cd7bffbb1cdc1574f4e32" JSFUNFUZZ_MD5="d0e497201c5cd7bffbb1cdc1574f4e32"
v8_root=$(readlink -f $(dirname $BASH_SOURCE)/../) v8_root=$(readlink -f $(dirname $BASH_SOURCE)/../)
jsfunfuzz_dir="$v8_root/tools/jsfunfuzz"
if [ -n "$1" ]; then if [ -n "$1" ]; then
d8="${v8_root}/$1" d8="${v8_root}/$1"
...@@ -48,20 +49,24 @@ if [ ! -f "$d8" ]; then ...@@ -48,20 +49,24 @@ if [ ! -f "$d8" ]; then
exit 1 exit 1
fi fi
jsfunfuzz_file="$v8_root/tools/jsfunfuzz.zip" # Deprecated download method. A prepatched archive is downloaded as a hook
if [ ! -f "$jsfunfuzz_file" ]; then # if jsfunfuzz=1 is specified as a gyp flag. Requires google.com authentication
# for google storage.
if [ "$2" == "--download" ]; then
jsfunfuzz_file="$v8_root/tools/jsfunfuzz.zip"
if [ ! -f "$jsfunfuzz_file" ]; then
echo "Downloading $jsfunfuzz_file ..." echo "Downloading $jsfunfuzz_file ..."
wget -q -O "$jsfunfuzz_file" $JSFUNFUZZ_URL || exit 1 wget -q -O "$jsfunfuzz_file" $JSFUNFUZZ_URL || exit 1
fi fi
jsfunfuzz_sum=$(md5sum "$jsfunfuzz_file" | awk '{ print $1 }') jsfunfuzz_sum=$(md5sum "$jsfunfuzz_file" | awk '{ print $1 }')
if [ $jsfunfuzz_sum != $JSFUNFUZZ_MD5 ]; then if [ $jsfunfuzz_sum != $JSFUNFUZZ_MD5 ]; then
echo "Failed to verify checksum!" echo "Failed to verify checksum!"
exit 1 exit 1
fi fi
jsfunfuzz_dir="$v8_root/tools/jsfunfuzz" if [ ! -d "$jsfunfuzz_dir" ]; then
if [ ! -d "$jsfunfuzz_dir" ]; then
echo "Unpacking into $jsfunfuzz_dir ..." echo "Unpacking into $jsfunfuzz_dir ..."
unzip "$jsfunfuzz_file" -d "$jsfunfuzz_dir" || exit 1 unzip "$jsfunfuzz_file" -d "$jsfunfuzz_dir" || exit 1
echo "Patching runner ..." echo "Patching runner ..."
...@@ -78,6 +83,8 @@ if [ ! -d "$jsfunfuzz_dir" ]; then ...@@ -78,6 +83,8 @@ if [ ! -d "$jsfunfuzz_dir" ]; then
logfilename = "w%d" % iteration logfilename = "w%d" % iteration
one_timed_run(logfilename) one_timed_run(logfilename)
EOF EOF
fi
fi fi
flags='--debug-code --expose-gc --verify-gc' flags='--debug-code --expose-gc --verify-gc'
......
#!/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
FUZZ_PATH = os.path.dirname(os.path.abspath(__file__))
SHA1_PATH = os.path.join(FUZZ_PATH, 'jsfunfuzz.tar.gz.sha1')
if re.search(r'\bjsfunfuzz=1', os.environ.get('GYP_DEFINES', '')):
subprocess.check_call([
'download_from_google_storage',
'-b', 'chrome-v8-jsfunfuzz',
'-u', '--no_resume',
'-s', SHA1_PATH,
'--platform=linux*'
])
else:
print 'Skipping jsfunfuzz download as jsfunfuzz is not set in gyp flags.'
d92e66273ea2a0da89456a977edd0224a8e837e9
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment