Revision: 11546
Author:   [email protected]
Date:     Fri May 11 05:18:09 2012
Log:      Prepare for using GYP build on buildbots

Review URL: https://chromiumcodereview.appspot.com/10383128
http://code.google.com/p/v8/source/detail?r=11546

Added:
 /branches/bleeding_edge/DEPS
Modified:
 /branches/bleeding_edge/Makefile
 /branches/bleeding_edge/SConstruct
 /branches/bleeding_edge/build/common.gypi
 /branches/bleeding_edge/build/gyp_v8
 /branches/bleeding_edge/build/standalone.gypi
 /branches/bleeding_edge/test/cctest/testcfg.py
 /branches/bleeding_edge/test/mjsunit/big-array-literal.js
 /branches/bleeding_edge/test/test262/testcfg.py
 /branches/bleeding_edge/tools/check-static-initializers.sh
 /branches/bleeding_edge/tools/presubmit.py
 /branches/bleeding_edge/tools/test-wrapper-gypbuild.py

=======================================
--- /dev/null
+++ /branches/bleeding_edge/DEPS        Fri May 11 05:18:09 2012
@@ -0,0 +1,27 @@
+# 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"],
+  },
+]
=======================================
--- /branches/bleeding_edge/Makefile    Thu May  3 01:11:38 2012
+++ /branches/bleeding_edge/Makefile    Fri May 11 05:18:09 2012
@@ -137,6 +137,12 @@
 # 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))
=======================================
--- /branches/bleeding_edge/SConstruct  Wed Mar 21 07:29:14 2012
+++ /branches/bleeding_edge/SConstruct  Fri May 11 05:18:09 2012
@@ -1601,4 +1601,17 @@
   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()
=======================================
--- /branches/bleeding_edge/build/common.gypi   Thu May  3 01:11:38 2012
+++ /branches/bleeding_edge/build/common.gypi   Fri May 11 05:18:09 2012
@@ -279,6 +279,13 @@
             'GenerateMapFile': 'true',
           },
         },
+      }],
+      ['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"', {
@@ -322,10 +329,6 @@
           },
           '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': [
@@ -407,12 +410,7 @@
               '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"
=======================================
--- /branches/bleeding_edge/build/gyp_v8        Thu May  3 01:11:38 2012
+++ /branches/bleeding_edge/build/gyp_v8        Fri May 11 05:18:09 2012
@@ -38,6 +38,11 @@
 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

@@ -93,7 +98,7 @@
       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'))
@@ -135,7 +140,10 @@
       # 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)])

@@ -156,28 +164,6 @@

   # 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)
=======================================
--- /branches/bleeding_edge/build/standalone.gypi       Thu May  3 01:11:38 2012
+++ /branches/bleeding_edge/build/standalone.gypi       Fri May 11 05:18:09 2012
@@ -169,6 +169,9 @@
       },
     }],  # OS=="win"
     ['OS=="mac"', {
+      'xcode_settings': {
+        'SYMROOT': '<(DEPTH)/xcodebuild',
+      },
       'target_defaults': {
         'xcode_settings': {
           'ALWAYS_SEARCH_USER_PATHS': 'NO',
@@ -188,6 +191,7 @@
           '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',
=======================================
--- /branches/bleeding_edge/test/cctest/testcfg.py      Fri Aug  5 02:44:30 2011
+++ /branches/bleeding_edge/test/cctest/testcfg.py      Fri May 11 05:18:09 2012
@@ -53,6 +53,8 @@
       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('-', '_')
=======================================
--- /branches/bleeding_edge/test/mjsunit/big-array-literal.js Tue Dec 7 03:01:02 2010 +++ /branches/bleeding_edge/test/mjsunit/big-array-literal.js Fri May 11 05:18:09 2012
@@ -25,6 +25,9 @@
 // (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.
=======================================
--- /branches/bleeding_edge/test/test262/testcfg.py     Mon Apr 16 02:05:32 2012
+++ /branches/bleeding_edge/test/test262/testcfg.py     Fri May 11 05:18:09 2012
@@ -31,6 +31,7 @@
 from os.path import join, exists
 import urllib
 import hashlib
+import sys
 import tarfile


@@ -120,7 +121,11 @@
         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):
=======================================
--- /branches/bleeding_edge/tools/check-static-initializers.sh Fri Mar 30 07:30:46 2012 +++ /branches/bleeding_edge/tools/check-static-initializers.sh Fri May 11 05:18:09 2012
@@ -37,14 +37,19 @@
 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)

@@ -52,4 +57,7 @@
   echo "Too many static initializers."
   echo "$static_inits"
   exit 1
+else
+  echo "Static initializer check passed ($static_init_count initializers)."
+  exit 0
 fi
=======================================
--- /branches/bleeding_edge/tools/presubmit.py  Thu Apr 19 03:28:26 2012
+++ /branches/bleeding_edge/tools/presubmit.py  Fri May 11 05:18:09 2012
@@ -303,7 +303,8 @@
               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',
=======================================
--- /branches/bleeding_edge/tools/test-wrapper-gypbuild.py Wed Mar 14 07:52:52 2012 +++ /branches/bleeding_edge/tools/test-wrapper-gypbuild.py Fri May 11 05:18:09 2012
@@ -1,6 +1,6 @@
 #!/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:
@@ -56,6 +56,9 @@
   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",
@@ -144,14 +147,16 @@
     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


@@ -213,22 +218,26 @@
     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 +

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to