--- /dev/null
+# 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"],
+ },
+]
# Target definitions. "all" is the default.
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.
.SECONDEXPANSION:
$(MODES): $(addsuffix .$$@,$(DEFAULT_ARCHES))
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()
},
},
}],
+ ['OS=="win" and v8_target_arch=="x64"', {
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'StackReserveSize': '2097152',
+ },
+ },
+ }],
['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \
or OS=="netbsd"', {
'conditions': [
},
'VCLinkerTool': {
'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': [
'VCLinkerTool': {
'LinkIncremental': '1',
'OptimizeReferences': '2',
- 'OptimizeForWindows98': '1',
'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"
script_dir = os.path.dirname(__file__)
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'))
import utils
result.append(path)
# 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.
supplements = glob.glob(os.path.join(v8_root, '*', 'supplement.gypi'))
# path separators even on Windows due to the use of shlex.split().
args.extend(shlex.split(gyp_file))
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)])
# Generate for the architectures supported on the given platform.
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')
+ gyp_args.append('--generator-output=out')
run_gyp(gyp_args)
-
- if utils.GuessOS() == 'linux':
- gyp_args = list(args)
- 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)
},
}], # OS=="win"
['OS=="mac"', {
+ 'xcode_settings': {
+ 'SYMROOT': '<(DEPTH)/xcodebuild',
+ },
'target_defaults': {
'xcode_settings': {
'ALWAYS_SEARCH_USER_PATHS': 'NO',
'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof
'MACOSX_DEPLOYMENT_TARGET': '10.4', # -mmacosx-version-min=10.4
'PREBINDING': 'NO', # No -Wl,-prebind
+ 'SYMROOT': '<(DEPTH)/xcodebuild',
'USE_HEADERMAP': 'NO',
'OTHER_CFLAGS': [
'-fno-strict-aliasing',
serialization_file = join('obj', 'test', self.mode, 'serdes')
else:
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 = join(self.context.buildspace, serialization_file)
serialization_file += ''.join(self.variant_flags).replace('-', '_')
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// 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.
// Also test that we can attempt to make even larger object literals without
// crashing.
from os.path import join, exists
import urllib
import hashlib
+import sys
import tarfile
os.remove(archive_name)
raise Exception("Hash mismatch of test data file")
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)
def GetBuildRequirements(self):
expected_static_init_count=3
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
- echo "Please build the project with SCons."
+ echo "d8 binary not found: $d8"
exit 1
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)
echo "Too many static initializers."
echo "$static_inits"
exit 1
+else
+ echo "Static initializer check passed ($static_init_count initializers)."
+ exit 0
fi
or (name == 'third_party')
or (name == 'gyp')
or (name == 'out')
- or (name == 'obj'))
+ or (name == 'obj')
+ or (name == 'DerivedSources'))
IGNORE_COPYRIGHTS = ['cpplint.py',
'earley-boyer.js',
#!/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
# modification, are permitted provided that the following conditions are
# met:
result.add_option("--no-presubmit",
help='Skip presubmit checks',
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:
result.add_option("-m", "--mode",
options.mode = options.mode.split(',')
options.arch = options.arch.split(',')
for mode in options.mode:
- if not mode in ['debug', 'release']:
+ if not mode.lower() in ['debug', 'release']:
print "Unknown mode %s" % mode
return False
for arch in options.arch:
if not arch in ['ia32', 'x64', 'arm', 'mips']:
print "Unknown architecture %s" % arch
return False
-
+ if options.buildbot:
+ # Buildbots run presubmit tests as a separate step.
+ options.no_presubmit = True
return True
return 1
workspace = abspath(join(dirname(sys.argv[0]), '..'))
+ returncodes = 0
if not options.no_presubmit:
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 += ['--no-build', '--build-system=gyp']
for arg in args:
args_for_children += [arg]
- returncodes = 0
env = os.environ
for mode in options.mode:
for arch in options.arch:
print ">>> running tests for %s.%s" % (arch, mode)
- shellpath = workspace + '/' + options.outdir + '/' + arch + '.' + mode
+ if options.buildbot:
+ shellpath = workspace + '/' + options.outdir + '/' + mode
+ mode = mode.lower()
+ else:
+ shellpath = workspace + '/' + options.outdir + '/' + arch + '.' + mode
env['LD_LIBRARY_PATH'] = shellpath + '/lib.target'
shell = shellpath + "/d8"
child = subprocess.Popen(' '.join(args_for_children +