diff options
author | Ben Murdoch <benm@google.com> | 2011-11-30 16:04:58 +0000 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2011-12-02 17:28:30 +0000 |
commit | 589d6979ff2ef66fca2d8fa51404c369ca5e9250 (patch) | |
tree | 1d9032fcae9d18a05430a4ba9c14e5c635c4096e /tools | |
parent | 69a99ed0b2b2ef69d393c371b03db3a98aaf880e (diff) | |
download | v8-589d6979ff2ef66fca2d8fa51404c369ca5e9250.tar.gz |
Upgrade to V8 3.6
Merge V8 at 3.6.6.11
Simple merge required updates to makefiles only.
Bug: 5688872
Change-Id: Ib38b7ffbcd409585f6cb6fccc59c767029cecc77
Diffstat (limited to 'tools')
-rw-r--r-- | tools/codemap.js | 19 | ||||
-rw-r--r-- | tools/gdb-v8-support.py | 2 | ||||
-rw-r--r-- | tools/gyp/v8.gyp | 63 | ||||
-rwxr-xr-x | tools/presubmit.py | 50 | ||||
-rwxr-xr-x | tools/process-heap-prof.py | 6 | ||||
-rwxr-xr-x | tools/push-to-trunk.sh | 431 | ||||
-rwxr-xr-x | tools/test-wrapper-gypbuild.py | 16 | ||||
-rwxr-xr-x | tools/test.py | 9 |
8 files changed, 578 insertions, 18 deletions
diff --git a/tools/codemap.js b/tools/codemap.js index dec494a3..129179e8 100644 --- a/tools/codemap.js +++ b/tools/codemap.js @@ -79,6 +79,7 @@ CodeMap.PAGE_SIZE = * @param {CodeMap.CodeEntry} codeEntry Code entry object. */ CodeMap.prototype.addCode = function(start, codeEntry) { + this.deleteAllCoveredNodes_(this.dynamics_, start, start + codeEntry.size); this.dynamics_.insert(start, codeEntry); }; @@ -92,6 +93,7 @@ CodeMap.prototype.addCode = function(start, codeEntry) { */ CodeMap.prototype.moveCode = function(from, to) { var removedNode = this.dynamics_.remove(from); + this.deleteAllCoveredNodes_(this.dynamics_, to, to + removedNode.value.size); this.dynamics_.insert(to, removedNode.value); }; @@ -146,6 +148,23 @@ CodeMap.prototype.markPages_ = function(start, end) { /** * @private */ +CodeMap.prototype.deleteAllCoveredNodes_ = function(tree, start, end) { + var to_delete = []; + var addr = end - 1; + while (addr >= start) { + var node = tree.findGreatestLessThan(addr); + if (!node) break; + var start2 = node.key, end2 = start2 + node.value.size; + if (start2 < end && start < end2) to_delete.push(start2); + addr = start2 - 1; + } + for (var i = 0, l = to_delete.length; i < l; ++i) tree.remove(to_delete[i]); +}; + + +/** + * @private + */ CodeMap.prototype.isAddressBelongsTo_ = function(addr, node) { return addr >= node.key && addr < (node.key + node.value.size); }; diff --git a/tools/gdb-v8-support.py b/tools/gdb-v8-support.py index 0aa1d494..9cc046c7 100644 --- a/tools/gdb-v8-support.py +++ b/tools/gdb-v8-support.py @@ -138,7 +138,7 @@ def v8_to_int(v): else: return '?' - + def v8_get_value(vstring): v = gdb.parse_and_eval(vstring) return v8_to_int(v) diff --git a/tools/gyp/v8.gyp b/tools/gyp/v8.gyp index 2da82139..50144172 100644 --- a/tools/gyp/v8.gyp +++ b/tools/gyp/v8.gyp @@ -71,6 +71,13 @@ ], }, }], + ['soname_version!=""', { + # Ideally, we'd like to specify the full filename for the + # library and set it to "libv8.so.<(soname_version)", + # but currently the best we can do is use 'product_name' and + # get "libv8-<(soname_version).so". + 'product_name': 'v8-<(soname_version)', + }], ], }, { @@ -288,11 +295,11 @@ '../../src/disasm.h', '../../src/disassembler.cc', '../../src/disassembler.h', - '../../src/dtoa.cc', - '../../src/dtoa.h', '../../src/diy-fp.cc', '../../src/diy-fp.h', '../../src/double.h', + '../../src/dtoa.cc', + '../../src/dtoa.h', '../../src/elements.cc', '../../src/elements.h', '../../src/execution.cc', @@ -407,10 +414,10 @@ '../../src/runtime-profiler.h', '../../src/safepoint-table.cc', '../../src/safepoint-table.h', - '../../src/scanner-base.cc', - '../../src/scanner-base.h', '../../src/scanner.cc', '../../src/scanner.h', + '../../src/scanner-character-streams.cc', + '../../src/scanner-character-streams.h', '../../src/scopeinfo.cc', '../../src/scopeinfo.h', '../../src/scopes.cc', @@ -418,7 +425,7 @@ '../../src/serialize.cc', '../../src/serialize.h', '../../src/small-pointer-list.h', - '../../src/smart-pointer.h', + '../../src/smart-array-pointer.h', '../../src/snapshot-common.cc', '../../src/snapshot.h', '../../src/spaces-inl.h', @@ -643,6 +650,8 @@ ['OS=="win"', { 'sources': [ '../../src/platform-win32.cc', + '../../src/win32-math.cc', + '../../src/win32-math.h', ], 'msvs_disabled_warnings': [4351, 4355, 4800], 'link_settings': { @@ -787,19 +796,61 @@ '../../src', ], 'sources': [ + '../../include/v8-preparser.h', + '../../include/v8stdint.h', '../../src/allocation.cc', + '../../src/allocation.h', '../../src/bignum.cc', + '../../src/bignum.h', + '../../src/bignum-dtoa.cc', + '../../src/bignum-dtoa.h', '../../src/cached-powers.cc', + '../../src/cached-powers.h', + '../../src/char-predicates-inl.h', + '../../src/char-predicates.h', + '../../src/checks.h', + '../../src/conversions-inl.h', '../../src/conversions.cc', + '../../src/conversions.h', + '../../src/diy-fp.cc', + '../../src/diy-fp.h', + '../../src/double.h', + '../../src/dtoa.cc', + '../../src/dtoa.h', + '../../src/fast-dtoa.cc', + '../../src/fast-dtoa.h', + '../../src/fixed-dtoa.cc', + '../../src/fixed-dtoa.h', + '../../src/globals.h', '../../src/hashmap.cc', + '../../src/hashmap.h', + '../../src/list-inl.h', + '../../src/list.h', + '../../src/preparse-data-format.h', '../../src/preparse-data.cc', + '../../src/preparse-data.h', '../../src/preparser.cc', + '../../src/preparser.h', '../../src/preparser-api.cc', - '../../src/scanner-base.cc', + '../../src/scanner.cc', + '../../src/scanner.h', '../../src/strtod.cc', + '../../src/strtod.h', '../../src/token.cc', + '../../src/token.h', + '../../src/unicode-inl.h', '../../src/unicode.cc', + '../../src/unicode.h', + '../../src/utils-inl.h', '../../src/utils.cc', + '../../src/utils.h', + ], + 'conditions': [ + ['OS=="win"', { + 'sources': [ + '../../src/win32-math.cc', + '../../src/win32-math.h', + ]}], ], }, ], diff --git a/tools/presubmit.py b/tools/presubmit.py index c191fc74..fda7ba96 100755 --- a/tools/presubmit.py +++ b/tools/presubmit.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2008 the V8 project authors. All rights reserved. +# Copyright 2011 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: @@ -42,6 +42,7 @@ import pickle import re import sys import subprocess +from subprocess import PIPE # Disabled LINT rules and reason. # build/include_what_you_use: Started giving false positives for variables @@ -88,7 +89,6 @@ whitespace/blank_line whitespace/braces whitespace/comma whitespace/comments -whitespace/end_of_line whitespace/ending_newline whitespace/indent whitespace/labels @@ -231,11 +231,29 @@ COPYRIGHT_HEADER_PATTERN = re.compile( class SourceProcessor(SourceFileProcessor): """ - Check that all files include a copyright notice. + Check that all files include a copyright notice and no trailing whitespaces. """ RELEVANT_EXTENSIONS = ['.js', '.cc', '.h', '.py', '.c', 'SConscript', - 'SConstruct', '.status'] + 'SConstruct', '.status', '.gyp', '.gypi'] + + # Overwriting the one in the parent class. + def FindFilesIn(self, path): + if os.path.exists(path+'/.git'): + output = subprocess.Popen('git ls-files --full-name', + stdout=PIPE, cwd=path, shell=True) + result = [] + for file in output.stdout.read().split(): + for dir_part in os.path.dirname(file).split(os.sep): + if self.IgnoreDir(dir_part): + break + else: + if self.IsRelevant(file) and not self.IgnoreFile(file): + result.append(join(path, file)) + if output.wait() == 0: + return result + return super(SourceProcessor, self).FindFilesIn(path) + def IsRelevant(self, name): for ext in SourceProcessor.RELEVANT_EXTENSIONS: if name.endswith(ext): @@ -273,17 +291,37 @@ class SourceProcessor(SourceFileProcessor): if not COPYRIGHT_HEADER_PATTERN.search(contents): print "%s is missing a correct copyright header." % name result = False + ext = base.split('.').pop() + if ' \n' in contents or contents.endswith(' '): + line = 0 + lines = [] + parts = contents.split(' \n') + if not contents.endswith(' '): + parts.pop() + for part in parts: + line += part.count('\n') + 1 + lines.append(str(line)) + linenumbers = ', '.join(lines) + if len(lines) > 1: + print "%s has trailing whitespaces in lines %s." % (name, linenumbers) + else: + print "%s has trailing whitespaces in line %s." % (name, linenumbers) + result = False return result def ProcessFiles(self, files, path): success = True + violations = 0 for file in files: try: handle = open(file) contents = handle.read() - success = self.ProcessContents(file, contents) and success + if not self.ProcessContents(file, contents): + success = False + violations += 1 finally: handle.close() + print "Total violating files: %s" % violations return success @@ -299,8 +337,10 @@ def Main(): parser = GetOptions() (options, args) = parser.parse_args() success = True + print "Running C++ lint check..." if not options.no_lint: success = CppLintProcessor().Run(workspace) and success + print "Running copyright header and trailing whitespaces check..." success = SourceProcessor().Run(workspace) and success if success: return 0 diff --git a/tools/process-heap-prof.py b/tools/process-heap-prof.py index 6a2c3978..a26cbf15 100755 --- a/tools/process-heap-prof.py +++ b/tools/process-heap-prof.py @@ -47,7 +47,7 @@ def ProcessLogFile(filename, options): itemname = 'heap-js-cons-item' else: itemname = 'heap-sample-item' - + first_call_time = None sample_time = 0.0 sampling = False @@ -108,11 +108,11 @@ def Main(): if not ProcessOptions(options): parser.print_help() sys.exit(); - + if not args: print "Missing logfile" sys.exit(); - + ProcessLogFile(args[0], options) diff --git a/tools/push-to-trunk.sh b/tools/push-to-trunk.sh new file mode 100755 index 00000000..761b7336 --- /dev/null +++ b/tools/push-to-trunk.sh @@ -0,0 +1,431 @@ +#!/bin/bash +# Copyright 2011 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: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +########## Global variable definitions + +BRANCHNAME=prepare-push +TRUNKBRANCH=trunk-push +TEMP_BRANCH=v8-push-to-trunk-script-temporary-branch +VERSION_FILE="src/version.cc" +PERSISTFILE_BASENAME=/tmp/v8-push-to-trunk-tempfile +CHANGELOG_ENTRY_FILE="$PERSISTFILE_BASENAME-changelog-entry" +PATCH_FILE="$PERSISTFILE_BASENAME-patch" +COMMITMSG_FILE="$PERSISTFILE_BASENAME-commitmsg" +TOUCHED_FILES_FILE="$PERSISTFILE_BASENAME-touched-files" +STEP=0 + + +########## Function definitions + +usage() { +cat << EOF +usage: $0 OPTIONS + +Performs the necessary steps for a V8 push to trunk. Only works for \ +git checkouts. + +OPTIONS: + -h Show this message + -s Specify the step where to start work. Default: 0. + -l Manually specify the git commit ID of the last push to trunk. +EOF +} + +die() { + [[ -n "$1" ]] && echo "Error: $1" + echo "Exiting." + exit 1 +} + +confirm() { + echo -n "$1 [Y/n] " + read ANSWER + if [[ -z "$ANSWER" || "$ANSWER" == "Y" || "$ANSWER" == "y" ]] ; then + return 0 + else + return 1 + fi +} + +delete_branch() { + local MATCH=$(git branch | grep $1 | awk '{print $NF}' ) + if [ "$MATCH" == "$1" ] ; then + confirm "Branch $1 exists, do you want to delete it?" + if [ $? -eq 0 ] ; then + git branch -D $1 || die "Deleting branch '$1' failed." + echo "Branch $1 deleted." + else + die "Can't continue. Please delete branch $1 and try again." + fi + fi +} + +# Persist and restore variables to support canceling/resuming execution +# of this script. +persist() { + local VARNAME=$1 + local FILE="$PERSISTFILE_BASENAME-$VARNAME" + echo "${!VARNAME}" > $FILE +} + +restore() { + local VARNAME=$1 + local FILE="$PERSISTFILE_BASENAME-$VARNAME" + local VALUE="$(cat $FILE)" + eval "$VARNAME=\"$VALUE\"" +} + +restore_if_unset() { + local VARNAME=$1 + [[ -z "${!VARNAME}" ]] && restore "$VARNAME" + [[ -z "${!VARNAME}" ]] && die "Variable '$VARNAME' could not be restored." +} + + +########## Option parsing + +while getopts ":hs:l:" OPTION ; do + case $OPTION in + h) usage + exit 0 + ;; + s) STEP=$OPTARG + ;; + l) LASTPUSH=$OPTARG + ;; + ?) echo "Illegal option: -$OPTARG" + usage + exit 1 + ;; + esac +done + + +########## Regular workflow + +# Cancel if this is not a git checkout. +[[ -d .git ]] \ + || die "This is not a git checkout, this script won't work for you." + +# Cancel if EDITOR is unset or not executable. +[[ -n "$EDITOR" && -x "$(which $EDITOR)" ]] \ + || die "Please set your EDITOR environment variable, you'll need it." + +if [ $STEP -le 0 ] ; then + echo ">>> Step 0: Preparation" + # Check for a clean workdir. + [[ -z "$(git status -s -uno)" ]] \ + || die "Workspace is not clean. Please commit or undo your changes." + + # Persist current branch. + CURRENT_BRANCH=$(git status -s -b -uno | grep "^##" | awk '{print $2}') + persist "CURRENT_BRANCH" + # Get ahold of a safe temporary branch and check it out. + if [ "$CURRENT_BRANCH" != "$TEMP_BRANCH" ] ; then + delete_branch $TEMP_BRANCH + git checkout -b $TEMP_BRANCH + fi + # Delete branches if they exist. + delete_branch $BRANCHNAME + delete_branch $TRUNKBRANCH +fi + +if [ $STEP -le 1 ] ; then + echo ">>> Step 1: Fetch unfetched revisions." + git svn fetch || die "'git svn fetch' failed." +fi + +if [ $STEP -le 2 ] ; then + echo ">>> Step 2: Create a fresh branch." + git checkout -b $BRANCHNAME svn/bleeding_edge \ + || die "Creating branch $BRANCHNAME failed." +fi + +if [ $STEP -le 3 ] ; then + echo ">>> Step 3: Detect commit ID of last push to trunk." + [[ -n "$LASTPUSH" ]] || LASTPUSH=$(git log -1 --format=%H ChangeLog) + LOOP=1 + while [ $LOOP -eq 1 ] ; do + # Print assumed commit, circumventing git's pager. + git log -1 $LASTPUSH | cat + confirm "Is the commit printed above the last push to trunk?" + if [ $? -eq 0 ] ; then + LOOP=0 + else + LASTPUSH=$(git log -1 --format=%H $LASTPUSH^ ChangeLog) + fi + done + persist "LASTPUSH" +fi + +if [ $STEP -le 4 ] ; then + echo ">>> Step 4: Prepare raw ChangeLog entry." +# These version numbers are used again later for the trunk commit. + MAJOR=$(grep "#define MAJOR_VERSION" "$VERSION_FILE" | awk '{print $NF}') + persist "MAJOR" + MINOR=$(grep "#define MINOR_VERSION" "$VERSION_FILE" | awk '{print $NF}') + persist "MINOR" + BUILD=$(grep "#define BUILD_NUMBER" "$VERSION_FILE" | awk '{print $NF}') + persist "BUILD" + + DATE=$(date +%Y-%m-%d) + persist "DATE" + echo "$DATE: Version $MAJOR.$MINOR.$BUILD" > "$CHANGELOG_ENTRY_FILE" + echo "" >> "$CHANGELOG_ENTRY_FILE" + COMMITS=$(git log $LASTPUSH..HEAD --format=%H) + for commit in $COMMITS ; do + # Get the commit's title line. + git log -1 $commit --format="%w(80,8,8)%s" >> "$CHANGELOG_ENTRY_FILE" + # Grep for "BUG=xxxx" lines in the commit message. + git log -1 $commit --format="%b" | grep BUG= | grep -v "BUG=$" \ + | sed -e 's/^/ /' \ + >> "$CHANGELOG_ENTRY_FILE" + # Append the commit's author for reference. + git log -1 $commit --format="%w(80,8,8)(%an)" >> "$CHANGELOG_ENTRY_FILE" + echo "" >> "$CHANGELOG_ENTRY_FILE" + done +fi + +if [ $STEP -le 5 ] ; then + echo ">>> Step 5: Edit ChangeLog entry." + echo -n "Please press <Return> to have your EDITOR open the ChangeLog entry, \ +then edit its contents to your liking. When you're done, save the file and \ +exit your EDITOR. " + read ANSWER + $EDITOR "$CHANGELOG_ENTRY_FILE" + NEWCHANGELOG=$(mktemp) + # Eliminate any trailing newlines by going through a shell variable. + CHANGELOGENTRY=$(cat "$CHANGELOG_ENTRY_FILE") + [[ -n "$CHANGELOGENTRY" ]] || die "Empty ChangeLog entry." + echo "$CHANGELOGENTRY" > "$NEWCHANGELOG" + echo "" >> "$NEWCHANGELOG" # Explicitly insert two empty lines. + echo "" >> "$NEWCHANGELOG" + cat ChangeLog >> "$NEWCHANGELOG" + mv "$NEWCHANGELOG" ChangeLog +fi + +if [ $STEP -le 6 ] ; then + echo ">>> Step 6: Increment version number." + restore_if_unset "BUILD" + NEWBUILD=$(($BUILD + 1)) + confirm "Automatically increment BUILD_NUMBER? (Saying 'n' will fire up \ +your EDITOR on $VERSION_FILE so you can make arbitrary changes. When \ +you're done, save the file and exit your EDITOR.)" + if [ $? -eq 0 ] ; then + sed -e "/#define BUILD_NUMBER/s/[0-9]*$/$NEWBUILD/" \ + -i "$VERSION_FILE" + else + $EDITOR "$VERSION_FILE" + fi + NEWMAJOR=$(grep "#define MAJOR_VERSION" "$VERSION_FILE" | awk '{print $NF}') + persist "NEWMAJOR" + NEWMINOR=$(grep "#define MINOR_VERSION" "$VERSION_FILE" | awk '{print $NF}') + persist "NEWMINOR" + NEWBUILD=$(grep "#define BUILD_NUMBER" "$VERSION_FILE" | awk '{print $NF}') + persist "NEWBUILD" +fi + +if [ $STEP -le 7 ] ; then + echo ">>> Step 7: Commit to local branch." + restore_if_unset "NEWMAJOR" + restore_if_unset "NEWMINOR" + restore_if_unset "NEWBUILD" + git commit -a -m "Prepare push to trunk. \ +Now working on version $NEWMAJOR.$NEWMINOR.$NEWBUILD." \ + || die "'git commit -a' failed." +fi + +if [ $STEP -le 8 ] ; then + echo ">>> Step 8: Upload for code review." + echo -n "Please enter the email address of a V8 reviewer for your patch: " + read REVIEWER + git cl upload -r $REVIEWER --send-mail \ + || die "'git cl upload' failed, please try again." +fi + +if [ $STEP -le 9 ] ; then + echo ">>> Step 9: Commit to the repository." + echo "Please wait for an LGTM, then type \"LGTM<Return>\" to commit your \ +change. (If you need to iterate on the patch, do so in another shell.)" + unset ANSWER + while [ "$ANSWER" != "LGTM" ] ; do + [[ -n "$ANSWER" ]] && echo "That was not 'LGTM'." + echo -n "> " + read ANSWER + done + # Re-read the ChangeLog entry (to pick up possible changes). + cat ChangeLog | awk --posix '{ + if ($0 ~ /^[0-9]{4}-[0-9]{2}-[0-9]{2}:/) { + if (in_firstblock == 1) { + exit 0; + } else { + in_firstblock = 1; + } + }; + print $0; + }' > "$CHANGELOG_ENTRY_FILE" + git cl dcommit || die "'git cl dcommit' failed, please try again." +fi + +if [ $STEP -le 10 ] ; then + echo ">>> Step 10: NOP" + # Present in the manual guide, not necessary (even harmful!) for this script. +fi + +if [ $STEP -le 11 ] ; then + echo ">>> Step 11: Squash commits into one." + # Instead of relying on "git rebase -i", we'll just create a diff, because + # that's easier to automate. + git diff svn/trunk > "$PATCH_FILE" + # Convert the ChangeLog entry to commit message format: + # - remove date + # - remove indentation + # - merge paragraphs into single long lines, keeping empty lines between them. + restore_if_unset "DATE" + CHANGELOGENTRY=$(cat "$CHANGELOG_ENTRY_FILE") + echo "$CHANGELOGENTRY" \ + | sed -e "s/^$DATE: //" \ + | sed -e 's/^ *//' \ + | awk '{ + if (need_space == 1) { + printf(" "); + }; + printf("%s", $0); + if ($0 ~ /^$/) { + printf("\n\n"); + need_space = 0; + } else { + need_space = 1; + } + }' > "$COMMITMSG_FILE" || die "Commit message editing failed." + LOOP=1 + while [ $LOOP -eq 1 ] ; do + echo "This is the trunk commit message:" + echo "--------------------" + cat "$COMMITMSG_FILE" + echo -e "\n--------------------" + confirm "Does this look good to you? (Saying 'n' will fire up your \ +EDITOR so you can change the commit message. When you're done, save the \ +file and exit your EDITOR.)" + if [ $? -eq 0 ] ; then + LOOP=0 + else + $EDITOR "$COMMITMSG_FILE" + fi + done + rm -f "$CHANGELOG_ENTRY_FILE" +fi + +if [ $STEP -le 12 ] ; then + echo ">>> Step 12: Create a new branch from trunk." + git checkout -b $TRUNKBRANCH svn/trunk \ + || die "Checking out a new branch '$TRUNKBRANCH' failed." +fi + +if [ $STEP -le 13 ] ; then + echo ">>> Step 13: Apply squashed changes." + patch -p1 < "$PATCH_FILE" | tee >(awk '{print $NF}' >> "$TOUCHED_FILES_FILE") + [[ $? -eq 0 ]] || die "Applying the patch to trunk failed." + # Stage added and modified files. + TOUCHED_FILES=$(cat "$TOUCHED_FILES_FILE") + for FILE in $TOUCHED_FILES ; do + git add "$FILE" + done + # Stage deleted files. + DELETED_FILES=$(git status -s -uno --porcelain | grep "^ D" \ + | awk '{print $NF}') + for FILE in $DELETED_FILES ; do + git rm "$FILE" + done + rm -f "$PATCH_FILE" + rm -f "$TOUCHED_FILES_FILE" +fi + +if [ $STEP -le 14 ] ; then + echo ">>> Step 14: Set correct version for trunk." + restore_if_unset "MAJOR" + restore_if_unset "MINOR" + restore_if_unset "BUILD" + sed -e "/#define MAJOR_VERSION/s/[0-9]*$/$MAJOR/" \ + -e "/#define MINOR_VERSION/s/[0-9]*$/$MINOR/" \ + -e "/#define BUILD_NUMBER/s/[0-9]*$/$BUILD/" \ + -e "/#define PATCH_LEVEL/s/[0-9]*$/0/" \ + -e "/#define IS_CANDIDATE_VERSION/s/[0-9]*$/0/" \ + -i "$VERSION_FILE" || die "Patching $VERSION_FILE failed." +fi + +if [ $STEP -le 15 ] ; then + echo ">>> Step 15: Commit to local trunk branch." + git add "$VERSION_FILE" + git commit -F "$COMMITMSG_FILE" || die "'git commit' failed." + rm -f "$COMMITMSG_FILE" +fi + +if [ $STEP -le 16 ] ; then + echo ">>> Step 16: Sanity check." + confirm "Please check if your local checkout is sane: Inspect $VERSION_FILE, \ +compile, run tests. Do you want to commit this new trunk revision to the \ +repository?" + [[ $? -eq 0 ]] || die "Execution canceled." +fi + +if [ $STEP -le 17 ] ; then + echo ">>> Step 17. Commit to SVN." + git svn dcommit || die "'git svn dcommit' failed." +fi + +if [ $STEP -le 18 ] ; then + echo ">>> Step 18: Tag the new revision." + restore_if_unset "MAJOR" + restore_if_unset "MINOR" + restore_if_unset "BUILD" + git svn tag $MAJOR.$MINOR.$BUILD -m "Tagging version $MAJOR.$MINOR.$BUILD" \ + || die "'git svn tag' failed." +fi + +if [ $STEP -le 19 ] ; then + echo ">>> Step 19: Cleanup." + restore_if_unset "CURRENT_BRANCH" + git checkout -f $CURRENT_BRANCH + [[ "$TEMP_BRANCH" != "$CURRENT_BRANCH" ]] && git branch -D $TEMP_BRANCH + [[ "$BRANCHNAME" != "$CURRENT_BRANCH" ]] && git branch -D $BRANCHNAME + [[ "$TRUNKBRANCH" != "$CURRENT_BRANCH" ]] && git branch -D $TRUNKBRANCH +fi + +if [ $STEP -le 20 ] ; then + echo ">>> Step 20: Done!" + restore_if_unset "MAJOR" + restore_if_unset "MINOR" + restore_if_unset "BUILD" + echo "Congratulations, you have successfully created the trunk revision \ +$MAJOR.$MINOR.$BUILD. Please don't forget to update the v8rel spreadsheet, \ +and to roll this new version into Chromium." + # Clean up all temporary files. + rm -f "$PERSISTFILE_BASENAME"* +fi diff --git a/tools/test-wrapper-gypbuild.py b/tools/test-wrapper-gypbuild.py index 9bc6bf6a..ad5449a4 100755 --- a/tools/test-wrapper-gypbuild.py +++ b/tools/test-wrapper-gypbuild.py @@ -53,6 +53,9 @@ def BuildOptions(): result.add_option("--outdir", help='Base output directory', default='out') + result.add_option("--no-presubmit", + help='Skip presubmit checks', + default=False, action="store_true") # Flags this wrapper script handles itself: result.add_option("-m", "--mode", @@ -202,22 +205,31 @@ def Main(): return 1 workspace = abspath(join(dirname(sys.argv[0]), '..')) + + if not options.no_presubmit: + print ">>> running presubmit tests" + 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) - shell = workspace + '/' + options.outdir + '/' + arch + '.' + mode + "/d8" + shellpath = workspace + '/' + options.outdir + '/' + arch + '.' + mode + env['LD_LIBRARY_PATH'] = shellpath + '/lib.target' + shell = shellpath + "/d8" child = subprocess.Popen(' '.join(args_for_children + ['--arch=' + arch] + ['--mode=' + mode] + ['--shell=' + shell]), shell=True, - cwd=workspace) + cwd=workspace, + env=env) returncodes += child.wait() return returncodes diff --git a/tools/test.py b/tools/test.py index d40159c6..ecc0062d 100755 --- a/tools/test.py +++ b/tools/test.py @@ -1164,6 +1164,7 @@ def ReadConfigurationInto(path, sections, defs): ARCH_GUESS = utils.GuessArchitecture() +TIMEOUT_DEFAULT = 60; def BuildOptions(): @@ -1188,7 +1189,7 @@ def BuildOptions(): result.add_option("-s", "--suite", help="A test suite", default=[], action="append") result.add_option("-t", "--timeout", help="Timeout in seconds", - default=60, type="int") + default=-1, type="int") result.add_option("--arch", help='The architecture to run tests for', default='none') result.add_option("--snapshot", help="Run the tests with snapshot turned on", @@ -1262,6 +1263,12 @@ def ProcessOptions(options): if options.arch == 'none': options.arch = ARCH_GUESS options.scons_flags.append("arch=" + options.arch) + # Simulators are slow, therefore allow a longer default timeout. + if options.timeout == -1: + if options.arch == 'arm' or options.arch == 'mips': + options.timeout = 2 * TIMEOUT_DEFAULT; + else: + options.timeout = TIMEOUT_DEFAULT; if options.snapshot: options.scons_flags.append("snapshot=on") global VARIANT_FLAGS |