Revision: 11747
Author:   [email protected]
Date:     Fri Jun  8 07:44:14 2012
Log:      Merged r11546 into 3.9 branch.

Prepare for using GYP build on buildbots.

Bonus: includes merge-to-branch.sh (and required common-includes.sh)

[email protected]

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

Modified:
 /branches/3.9/Makefile
 /branches/3.9/SConstruct
 /branches/3.9/build/common.gypi
 /branches/3.9/build/gyp_v8
 /branches/3.9/build/standalone.gypi
 /branches/3.9/src/version.cc
 /branches/3.9/test/cctest/testcfg.py
 /branches/3.9/test/mjsunit/big-array-literal.js
 /branches/3.9/test/test262/testcfg.py
 /branches/3.9/tools/check-static-initializers.sh
 /branches/3.9/tools/common-includes.sh
 /branches/3.9/tools/merge-to-branch.sh
 /branches/3.9/tools/presubmit.py
 /branches/3.9/tools/test-wrapper-gypbuild.py

=======================================
--- /branches/3.9/Makefile      Fri Mar  9 02:52:05 2012
+++ /branches/3.9/Makefile      Fri Jun  8 07:44:14 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/3.9/SConstruct    Fri Mar 23 08:11:57 2012
+++ /branches/3.9/SConstruct    Fri Jun  8 07:44:14 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/3.9/build/common.gypi     Wed Mar 14 04:16:03 2012
+++ /branches/3.9/build/common.gypi     Fri Jun  8 07:44:14 2012
@@ -261,6 +261,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"', {
@@ -300,10 +307,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': [
@@ -385,12 +388,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/3.9/build/gyp_v8  Thu Nov 10 03:38:15 2011
+++ /branches/3.9/build/gyp_v8  Fri Jun  8 07:44:14 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,23 +164,6 @@

   # Generate for the architectures supported on the given platform.
   gyp_args = list(args)
-  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('-I' + v8_root + '/build/armu.gypi')
-    gyp_args.append('-S-armu')
-    run_gyp(gyp_args)
-
-    gyp_args = list(args)
-    gyp_args.append('-I' + v8_root + '/build/mipsu.gypi')
-    gyp_args.append('-S-mipsu')
-    run_gyp(gyp_args)
=======================================
--- /branches/3.9/build/standalone.gypi Thu Jan 19 07:36:35 2012
+++ /branches/3.9/build/standalone.gypi Fri Jun  8 07:44:14 2012
@@ -165,6 +165,9 @@
       },
     }],  # OS=="win"
     ['OS=="mac"', {
+      'xcode_settings': {
+        'SYMROOT': '<(DEPTH)/xcodebuild',
+      },
       'target_defaults': {
         'xcode_settings': {
           'ALWAYS_SEARCH_USER_PATHS': 'NO',
@@ -184,6 +187,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/3.9/src/version.cc        Fri Jun  8 06:36:14 2012
+++ /branches/3.9/src/version.cc        Fri Jun  8 07:44:14 2012
@@ -35,7 +35,7 @@
 #define MAJOR_VERSION     3
 #define MINOR_VERSION     9
 #define BUILD_NUMBER      24
-#define PATCH_LEVEL       30
+#define PATCH_LEVEL       31
 // Use 1 for candidates and 0 otherwise.
 // (Boolean macro values are not supported by all preprocessors.)
 #define IS_CANDIDATE_VERSION 0
=======================================
--- /branches/3.9/test/cctest/testcfg.py        Wed Aug 10 04:27:35 2011
+++ /branches/3.9/test/cctest/testcfg.py        Fri Jun  8 07:44:14 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/3.9/test/mjsunit/big-array-literal.js     Mon Jul 13 07:04:26 2009
+++ /branches/3.9/test/mjsunit/big-array-literal.js     Fri Jun  8 07:44:14 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/3.9/test/test262/testcfg.py       Fri Mar  9 02:52:05 2012
+++ /branches/3.9/test/test262/testcfg.py       Fri Jun  8 07:44:14 2012
@@ -31,6 +31,7 @@
 from os.path import join, exists
 import urllib
 import hashlib
+import sys
 import tarfile


@@ -117,7 +118,11 @@
         if md5.hexdigest() != TEST_262_ARCHIVE_MD5:
           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)
       if not exists(join(self.root, 'data')):
         os.symlink(directory_name, join(self.root, 'data'))

=======================================
--- /branches/3.9/tools/check-static-initializers.sh Wed Apr 11 06:59:42 2012 +++ /branches/3.9/tools/check-static-initializers.sh Fri Jun 8 07:44:14 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/3.9/tools/common-includes.sh      Mon Mar 19 04:01:52 2012
+++ /branches/3.9/tools/common-includes.sh      Fri Jun  8 07:44:14 2012
@@ -77,20 +77,27 @@
 persist() {
   local VARNAME=$1
   local FILE="$PERSISTFILE_BASENAME-$VARNAME"
-  echo "${!VARNAME}" > $FILE
+  local VALUE="${!VARNAME}"
+  if [ -z "$VALUE" ] ; then
+    VALUE="__EMPTY__"
+  fi
+  echo "$VALUE" > $FILE
 }

 restore() {
   local VARNAME=$1
   local FILE="$PERSISTFILE_BASENAME-$VARNAME"
   local VALUE="$(cat $FILE)"
+  [[ -z "$VALUE" ]] && die "Variable '$VARNAME' could not be restored."
+  if [ "$VALUE" == "__EMPTY__" ] ; then
+    VALUE=""
+  fi
   eval "$VARNAME=\"$VALUE\""
 }

 restore_if_unset() {
   local VARNAME=$1
   [[ -z "${!VARNAME}" ]] && restore "$VARNAME"
- [[ -z "${!VARNAME}" ]] && die "Variable '$VARNAME' could not be restored."
 }

 initial_environment_checks() {
@@ -175,9 +182,10 @@

 # Takes a file containing the patch to apply as first argument.
 apply_patch() {
-  patch -p1 < "$1" > "$PATCH_OUTPUT_FILE" || \
+  patch $REVERSE_PATCH -p1 < "$1" > "$PATCH_OUTPUT_FILE" || \
     { cat "$PATCH_OUTPUT_FILE" && die "Applying the patch failed."; }
-  tee < "$PATCH_OUTPUT_FILE" >(awk '{print $NF}' >> "$TOUCHED_FILES_FILE")
+  tee < "$PATCH_OUTPUT_FILE" >(grep "patching file" \
+ | awk '{print $NF}'
"$TOUCHED_FILES_FILE")
   rm "$PATCH_OUTPUT_FILE"
 }

=======================================
--- /branches/3.9/tools/merge-to-branch.sh      Fri Mar 23 08:11:57 2012
+++ /branches/3.9/tools/merge-to-branch.sh      Fri Jun  8 07:44:14 2012
@@ -49,6 +49,8 @@
   -h    Show this message
   -s    Specify the step where to start work. Default: 0.
   -p    Specify a patch file to apply as part of the merge
+  -m    Specify a commit message for the patch
+  -r    Reverse specified patches
 EOF
 }

@@ -68,7 +70,7 @@

 ########## Option parsing

-while getopts ":hs:fp:" OPTION ; do
+while getopts ":hs:fp:rm:" OPTION ; do
   case $OPTION in
     h)  usage
         exit 0
@@ -77,6 +79,10 @@
         ;;
     f)  rm -f "$ALREADY_MERGING_SENTINEL_FILE"
         ;;
+    r)  REVERSE_PATCH="--reverse"
+        ;;
+    m)  NEW_COMMIT_MSG=$OPTARG
+        ;;
     s)  START_STEP=$OPTARG
         ;;
     ?)  echo "Illegal option: -$OPTARG"
@@ -98,8 +104,13 @@
 initial_environment_checks

 if [ $START_STEP -le $CURRENT_STEP ] ; then
-  if [ ${#@} -lt 2 ] && [ -z "$EXTRA_PATCH" ] ; then
-    die "Either a patch file or revision numbers must be specified"
+  if [ ${#@} -lt 2 ] ; then
+    if [ -z "$EXTRA_PATCH" ] ; then
+      die "Either a patch file or revision numbers must be specified"
+    fi
+    if [ -z "$NEW_COMMIT_MSG" ] ; then
+      die "You must specify a merge comment if no patches are specified"
+    fi
   fi
   echo ">>> Step $CURRENT_STEP: Preparation"
   MERGE_TO_BRANCH=$1
@@ -131,10 +142,12 @@
     REVISION_LIST="$REVISION_LIST r$REVISION"
     let current+=1
   done
-  if [ -z "$REVISION_LIST" ] ; then
-    NEW_COMMIT_MSG="Applied patch to $MERGE_TO_BRANCH branch."
-  else
-    NEW_COMMIT_MSG="Merged$REVISION_LIST into $MERGE_TO_BRANCH branch."
+  if [ -n "$REVISION_LIST" ] ; then
+    if [ -n "$REVERSE_PATCH" ] ; then
+ NEW_COMMIT_MSG="Rollback of$REVISION_LIST in $MERGE_TO_BRANCH branch."
+    else
+      NEW_COMMIT_MSG="Merged$REVISION_LIST into $MERGE_TO_BRANCH branch."
+    fi;
   fi;

   echo "$NEW_COMMIT_MSG" > $COMMITMSG_FILE
=======================================
--- /branches/3.9/tools/presubmit.py    Mon Jan 23 06:42:48 2012
+++ /branches/3.9/tools/presubmit.py    Fri Jun  8 07:44:14 2012
@@ -300,7 +300,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/3.9/tools/test-wrapper-gypbuild.py        Mon Mar 19 04:01:52 2012
+++ /branches/3.9/tools/test-wrapper-gypbuild.py        Fri Jun  8 07:44:14 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