Prepare for using GYP build on buildbots

Review URL: https://chromiumcodereview.appspot.com/10383128

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11546 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 423451ae
# Note: The buildbots evaluate this file with CWD set to the parent
# directory and assume that the root of the checkout is in ./v8/, so
# all paths in here must match this assumption.
deps = {
# Remember to keep the revision in sync with the Makefile.
"v8/build/gyp":
"http://gyp.googlecode.com/svn/trunk@1282",
}
deps_os = {
"win": {
"v8/third_party/cygwin":
"http://src.chromium.org/svn/trunk/deps/third_party/cygwin@66844",
"v8/third_party/python_26":
"http://src.chromium.org/svn/trunk/tools/third_party/python_26@89111",
}
}
hooks = [
{
# A change to a .gyp, .gypi, or to GYP itself should run the generator.
"pattern": ".",
"action": ["python", "v8/build/gyp_v8"],
},
]
...@@ -137,6 +137,12 @@ ENVFILE = $(OUTDIR)/environment ...@@ -137,6 +137,12 @@ ENVFILE = $(OUTDIR)/environment
# Target definitions. "all" is the default. # Target definitions. "all" is the default.
all: $(MODES) all: $(MODES)
# Special target for the buildbots to use. Depends on $(OUTDIR)/Makefile
# having been created before.
buildbot:
$(MAKE) -C "$(OUTDIR)" BUILDTYPE=$(BUILDTYPE) \
builddir="$(abspath $(OUTDIR))/$(BUILDTYPE)"
# Compile targets. MODES and ARCHES are convenience targets. # Compile targets. MODES and ARCHES are convenience targets.
.SECONDEXPANSION: .SECONDEXPANSION:
$(MODES): $(addsuffix .$$@,$(DEFAULT_ARCHES)) $(MODES): $(addsuffix .$$@,$(DEFAULT_ARCHES))
......
...@@ -1601,4 +1601,17 @@ except: ...@@ -1601,4 +1601,17 @@ except:
pass pass
def WarnAboutDeprecation():
print """
#######################################################
# WARNING: Building V8 with SCons is deprecated and #
# will not work much longer. Please switch to using #
# the GYP-based build now. Instructions are at #
# http://code.google.com/p/v8/wiki/BuildingWithGYP. #
#######################################################
"""
WarnAboutDeprecation()
import atexit
atexit.register(WarnAboutDeprecation)
Build() Build()
...@@ -280,6 +280,13 @@ ...@@ -280,6 +280,13 @@
}, },
}, },
}], }],
['OS=="win" and v8_target_arch=="x64"', {
'msvs_settings': {
'VCLinkerTool': {
'StackReserveSize': '2097152',
},
},
}],
['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \ ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \
or OS=="netbsd"', { or OS=="netbsd"', {
'conditions': [ 'conditions': [
...@@ -322,10 +329,6 @@ ...@@ -322,10 +329,6 @@
}, },
'VCLinkerTool': { 'VCLinkerTool': {
'LinkIncremental': '2', 'LinkIncremental': '2',
# For future reference, the stack size needs to be increased
# when building for Windows 64-bit, otherwise some test cases
# can cause stack overflow.
# 'StackReserveSize': '297152',
}, },
}, },
'conditions': [ 'conditions': [
...@@ -407,12 +410,7 @@ ...@@ -407,12 +410,7 @@
'VCLinkerTool': { 'VCLinkerTool': {
'LinkIncremental': '1', 'LinkIncremental': '1',
'OptimizeReferences': '2', 'OptimizeReferences': '2',
'OptimizeForWindows98': '1',
'EnableCOMDATFolding': '2', 'EnableCOMDATFolding': '2',
# For future reference, the stack size needs to be
# increased when building for Windows 64-bit, otherwise
# some test cases can cause stack overflow.
# 'StackReserveSize': '297152',
}, },
}, },
}], # OS=="win" }], # OS=="win"
......
...@@ -38,6 +38,11 @@ import sys ...@@ -38,6 +38,11 @@ import sys
script_dir = os.path.dirname(__file__) script_dir = os.path.dirname(__file__)
v8_root = os.path.normpath(os.path.join(script_dir, os.pardir)) v8_root = os.path.normpath(os.path.join(script_dir, os.pardir))
if __name__ == '__main__':
os.chdir(v8_root)
script_dir = os.path.dirname(__file__)
v8_root = '.'
sys.path.insert(0, os.path.join(v8_root, 'tools')) sys.path.insert(0, os.path.join(v8_root, 'tools'))
import utils import utils
...@@ -93,7 +98,7 @@ def additional_include_files(args=[]): ...@@ -93,7 +98,7 @@ def additional_include_files(args=[]):
result.append(path) result.append(path)
# Always include standalone.gypi # Always include standalone.gypi
AddInclude(os.path.join(script_dir, 'standalone.gypi')) AddInclude(os.path.join(v8_root, 'build', 'standalone.gypi'))
# Optionally add supplemental .gypi files if present. # Optionally add supplemental .gypi files if present.
supplements = glob.glob(os.path.join(v8_root, '*', 'supplement.gypi')) supplements = glob.glob(os.path.join(v8_root, '*', 'supplement.gypi'))
...@@ -135,7 +140,10 @@ if __name__ == '__main__': ...@@ -135,7 +140,10 @@ if __name__ == '__main__':
# path separators even on Windows due to the use of shlex.split(). # path separators even on Windows due to the use of shlex.split().
args.extend(shlex.split(gyp_file)) args.extend(shlex.split(gyp_file))
else: else:
args.append(os.path.join(script_dir, 'all.gyp')) # Note that this must not start with "./" or things break.
# So we rely on having done os.chdir(v8_root) above and use the
# relative path.
args.append(os.path.join('build', 'all.gyp'))
args.extend(['-I' + i for i in additional_include_files(args)]) args.extend(['-I' + i for i in additional_include_files(args)])
...@@ -156,28 +164,6 @@ if __name__ == '__main__': ...@@ -156,28 +164,6 @@ if __name__ == '__main__':
# Generate for the architectures supported on the given platform. # Generate for the architectures supported on the given platform.
gyp_args = list(args) gyp_args = list(args)
target_arch = None
for p in gyp_args:
if p.find('-Dtarget_arch=') == 0:
target_arch = p
if target_arch is None:
gyp_args.append('-Dtarget_arch=ia32')
if utils.GuessOS() == 'linux':
gyp_args.append('-S.ia32')
run_gyp(gyp_args)
if utils.GuessOS() == 'linux': if utils.GuessOS() == 'linux':
gyp_args = list(args) gyp_args.append('--generator-output=out')
gyp_args.append('-Dtarget_arch=x64')
gyp_args.append('-S.x64')
run_gyp(gyp_args)
gyp_args = list(args)
gyp_args.append('-Dv8_target_arch=arm')
gyp_args.append('-S.arm')
run_gyp(gyp_args)
gyp_args = list(args)
gyp_args.append('-Dv8_target_arch=mips')
gyp_args.append('-S.mips')
run_gyp(gyp_args) run_gyp(gyp_args)
...@@ -169,6 +169,9 @@ ...@@ -169,6 +169,9 @@
}, },
}], # OS=="win" }], # OS=="win"
['OS=="mac"', { ['OS=="mac"', {
'xcode_settings': {
'SYMROOT': '<(DEPTH)/xcodebuild',
},
'target_defaults': { 'target_defaults': {
'xcode_settings': { 'xcode_settings': {
'ALWAYS_SEARCH_USER_PATHS': 'NO', 'ALWAYS_SEARCH_USER_PATHS': 'NO',
...@@ -188,6 +191,7 @@ ...@@ -188,6 +191,7 @@
'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof
'MACOSX_DEPLOYMENT_TARGET': '10.4', # -mmacosx-version-min=10.4 'MACOSX_DEPLOYMENT_TARGET': '10.4', # -mmacosx-version-min=10.4
'PREBINDING': 'NO', # No -Wl,-prebind 'PREBINDING': 'NO', # No -Wl,-prebind
'SYMROOT': '<(DEPTH)/xcodebuild',
'USE_HEADERMAP': 'NO', 'USE_HEADERMAP': 'NO',
'OTHER_CFLAGS': [ 'OTHER_CFLAGS': [
'-fno-strict-aliasing', '-fno-strict-aliasing',
......
...@@ -53,6 +53,8 @@ class CcTestCase(test.TestCase): ...@@ -53,6 +53,8 @@ class CcTestCase(test.TestCase):
serialization_file = join('obj', 'test', self.mode, 'serdes') serialization_file = join('obj', 'test', self.mode, 'serdes')
else: else:
serialization_file = join('obj', 'serdes') serialization_file = join('obj', 'serdes')
if not exists(join(self.context.buildspace, 'obj')):
os.makedirs(join(self.context.buildspace, 'obj'))
serialization_file += '_' + self.GetName() serialization_file += '_' + self.GetName()
serialization_file = join(self.context.buildspace, serialization_file) serialization_file = join(self.context.buildspace, serialization_file)
serialization_file += ''.join(self.variant_flags).replace('-', '_') serialization_file += ''.join(self.variant_flags).replace('-', '_')
......
...@@ -25,6 +25,9 @@ ...@@ -25,6 +25,9 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// On MacOS, this test needs a stack size of at least 538 kBytes.
// Flags: --stack-size=600
// Test that we can make large object literals that work. // Test that we can make large object literals that work.
// Also test that we can attempt to make even larger object literals without // Also test that we can attempt to make even larger object literals without
// crashing. // crashing.
......
...@@ -31,6 +31,7 @@ import os ...@@ -31,6 +31,7 @@ import os
from os.path import join, exists from os.path import join, exists
import urllib import urllib
import hashlib import hashlib
import sys
import tarfile import tarfile
...@@ -120,7 +121,11 @@ class Test262TestConfiguration(test.TestConfiguration): ...@@ -120,7 +121,11 @@ class Test262TestConfiguration(test.TestConfiguration):
os.remove(archive_name) os.remove(archive_name)
raise Exception("Hash mismatch of test data file") raise Exception("Hash mismatch of test data file")
archive = tarfile.open(archive_name, 'r:bz2') archive = tarfile.open(archive_name, 'r:bz2')
archive.extractall(join(self.root)) if sys.platform in ('win32', 'cygwin'):
# Magic incantation to allow longer path names on Windows.
archive.extractall(u'\\\\?\\%s' % self.root)
else:
archive.extractall(self.root)
os.rename(join(self.root, 'test262-%s' % revision), directory_name) os.rename(join(self.root, 'test262-%s' % revision), directory_name)
def GetBuildRequirements(self): def GetBuildRequirements(self):
......
...@@ -37,14 +37,19 @@ ...@@ -37,14 +37,19 @@
expected_static_init_count=3 expected_static_init_count=3
v8_root=$(readlink -f $(dirname $BASH_SOURCE)/../) v8_root=$(readlink -f $(dirname $BASH_SOURCE)/../)
d8="${v8_root}/d8"
if [ -n "$1" ] ; then
d8="${v8_root}/$1"
else
d8="${v8_root}/d8"
fi
if [ ! -f "$d8" ]; then if [ ! -f "$d8" ]; then
echo "Please build the project with SCons." echo "d8 binary not found: $d8"
exit 1 exit 1
fi fi
static_inits=$(nm "$d8" | grep _GLOBAL__I | awk '{ print $NF; }') static_inits=$(nm "$d8" | grep _GLOBAL_ | grep _I_ | awk '{ print $NF; }')
static_init_count=$(echo "$static_inits" | wc -l) static_init_count=$(echo "$static_inits" | wc -l)
...@@ -52,4 +57,7 @@ if [ $static_init_count -gt $expected_static_init_count ]; then ...@@ -52,4 +57,7 @@ if [ $static_init_count -gt $expected_static_init_count ]; then
echo "Too many static initializers." echo "Too many static initializers."
echo "$static_inits" echo "$static_inits"
exit 1 exit 1
else
echo "Static initializer check passed ($static_init_count initializers)."
exit 0
fi fi
...@@ -303,7 +303,8 @@ class SourceProcessor(SourceFileProcessor): ...@@ -303,7 +303,8 @@ class SourceProcessor(SourceFileProcessor):
or (name == 'third_party') or (name == 'third_party')
or (name == 'gyp') or (name == 'gyp')
or (name == 'out') or (name == 'out')
or (name == 'obj')) or (name == 'obj')
or (name == 'DerivedSources'))
IGNORE_COPYRIGHTS = ['cpplint.py', IGNORE_COPYRIGHTS = ['cpplint.py',
'earley-boyer.js', 'earley-boyer.js',
......
#!/usr/bin/env python #!/usr/bin/env python
# #
# Copyright 2011 the V8 project authors. All rights reserved. # Copyright 2012 the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are # modification, are permitted provided that the following conditions are
# met: # met:
...@@ -56,6 +56,9 @@ def BuildOptions(): ...@@ -56,6 +56,9 @@ def BuildOptions():
result.add_option("--no-presubmit", result.add_option("--no-presubmit",
help='Skip presubmit checks', help='Skip presubmit checks',
default=False, action="store_true") default=False, action="store_true")
result.add_option("--buildbot",
help='Adapt to path structure used on buildbots',
default=False, action="store_true")
# Flags this wrapper script handles itself: # Flags this wrapper script handles itself:
result.add_option("-m", "--mode", result.add_option("-m", "--mode",
...@@ -144,14 +147,16 @@ def ProcessOptions(options): ...@@ -144,14 +147,16 @@ def ProcessOptions(options):
options.mode = options.mode.split(',') options.mode = options.mode.split(',')
options.arch = options.arch.split(',') options.arch = options.arch.split(',')
for mode in options.mode: for mode in options.mode:
if not mode in ['debug', 'release']: if not mode.lower() in ['debug', 'release']:
print "Unknown mode %s" % mode print "Unknown mode %s" % mode
return False return False
for arch in options.arch: for arch in options.arch:
if not arch in ['ia32', 'x64', 'arm', 'mips']: if not arch in ['ia32', 'x64', 'arm', 'mips']:
print "Unknown architecture %s" % arch print "Unknown architecture %s" % arch
return False return False
if options.buildbot:
# Buildbots run presubmit tests as a separate step.
options.no_presubmit = True
return True return True
...@@ -213,21 +218,25 @@ def Main(): ...@@ -213,21 +218,25 @@ def Main():
return 1 return 1
workspace = abspath(join(dirname(sys.argv[0]), '..')) workspace = abspath(join(dirname(sys.argv[0]), '..'))
returncodes = 0
if not options.no_presubmit: if not options.no_presubmit:
print ">>> running presubmit tests" print ">>> running presubmit tests"
subprocess.call([workspace + '/tools/presubmit.py']) returncodes += subprocess.call([workspace + '/tools/presubmit.py'])
args_for_children = [workspace + '/tools/test.py'] + PassOnOptions(options) args_for_children = [workspace + '/tools/test.py'] + PassOnOptions(options)
args_for_children += ['--no-build', '--build-system=gyp'] args_for_children += ['--no-build', '--build-system=gyp']
for arg in args: for arg in args:
args_for_children += [arg] args_for_children += [arg]
returncodes = 0
env = os.environ env = os.environ
for mode in options.mode: for mode in options.mode:
for arch in options.arch: for arch in options.arch:
print ">>> running tests for %s.%s" % (arch, mode) print ">>> running tests for %s.%s" % (arch, mode)
if options.buildbot:
shellpath = workspace + '/' + options.outdir + '/' + mode
mode = mode.lower()
else:
shellpath = workspace + '/' + options.outdir + '/' + arch + '.' + mode shellpath = workspace + '/' + options.outdir + '/' + arch + '.' + mode
env['LD_LIBRARY_PATH'] = shellpath + '/lib.target' env['LD_LIBRARY_PATH'] = shellpath + '/lib.target'
shell = shellpath + "/d8" shell = shellpath + "/d8"
......
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