diff options
author | dank@chromium.org <dank@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-12 23:42:17 +0000 |
---|---|---|
committer | dank@chromium.org <dank@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-12 23:42:17 +0000 |
commit | 81cf559637d4f158f3449bb2d620c6a828bcbbf9 (patch) | |
tree | 5470d01f15b03e268caeec35584f68caabd0300a /tools | |
parent | 78a162f7f9a50666fd246457467383dd54ede5c2 (diff) | |
download | chromium_src-81cf559637d4f158f3449bb2d620c6a828bcbbf9.zip chromium_src-81cf559637d4f158f3449bb2d620c6a828bcbbf9.tar.gz chromium_src-81cf559637d4f158f3449bb2d620c6a828bcbbf9.tar.bz2 |
Move blocks of build-valgrind-for-chromium.sh around to let it build and use source tarballs, needed for deploying on jailed bots
Also change usage message to match last commit
Review URL: http://codereview.chromium.org/164434
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23251 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/valgrind/build-valgrind-for-chromium.sh | 147 |
1 files changed, 89 insertions, 58 deletions
diff --git a/tools/valgrind/build-valgrind-for-chromium.sh b/tools/valgrind/build-valgrind-for-chromium.sh index 1c94a68..d36bac8 100755 --- a/tools/valgrind/build-valgrind-for-chromium.sh +++ b/tools/valgrind/build-valgrind-for-chromium.sh @@ -1,5 +1,10 @@ #!/bin/sh # Script to build valgrind for use with chromium +# +# Can also be used to just prepare patched source tarball with MAKE_TARBALL=yes +# or to just build from a patched source tarball with USE_TARBALL=yes. +# These are useful when configuring jailed buildbots which are not allowed to +# fetch valgrind source via svn. Most users won't need those options. # Checkout by date doesn't work unless you specify the friggin' timezone VALGRIND_SVN_REV=10771 @@ -17,8 +22,8 @@ x|x/*) ;; echo "Usage: sh build-valgrind-for-chromium.sh [prefix]" echo "Prefix is optional, but if present, must be the absolute path to where" echo "you want to install valgrind's bin, include, and lib directories." - echo "Prefix defaults to /usr/local/valgrind-$SHORTSVNDATE, where" - echo "$SHORTSVNDATE is the date used when retrieving valgrind from svn." + echo "Prefix defaults to /usr/local/valgrind-$VALGRIND_SVN_REV, where" + echo "$VALGRIND_SVN_REV is the revision used when retrieving valgrind from svn." echo "Will use sudo to do the install if you don't own the parent of prefix." exit 1 ;; @@ -27,77 +32,103 @@ esac set -x set -e -if ld --version | grep gold +if test x"$USE_TARBALL" = xyes && test x"$MAKE_TARBALL" = yes then - # build/install-build-deps leaves original ld around, try using that - if test -x /usr/bin/ld.orig - then - echo "Using /usr/bin/ld.orig instead of gold to link valgrind" - test -d $THISDIR/override_ld && rm -rf $THISDIR/override_ld - mkdir $THISDIR/override_ld - ln -s /usr/bin/ld.orig $THISDIR/override_ld/ld - PATH="$THISDIR/override_ld:$PATH" - else - echo "Cannot build valgrind with gold. Please switch to normal /usr/bin/ld, rerun this script, then switch back to gold." - exit 1 - fi + echo Set only one of MAKE_TARBALL or USE_TARBALL to yes + exit 1 fi -# Desired parent directory for valgrind's bin, include, etc. -PREFIX="${1:-/usr/local/valgrind-$VALGRIND_SVN_REV}" -parent_of_prefix="`dirname $PREFIX`" -if test ! -d "$parent_of_prefix" +if test x"$USE_TARBALL" != xyes then - echo "Directory $parent_of_prefix does not exist" - exit 1 -fi + # Check out latest version that following patches known to apply against + rm -rf valgrind-$VALGRIND_SVN_REV + svn co -r $VALGRIND_SVN_REV svn://svn.valgrind.org/valgrind/trunk valgrind-$VALGRIND_SVN_REV + + cd valgrind-$VALGRIND_SVN_REV -# Check out latest version that following patches known to apply against -rm -rf valgrind-$VALGRIND_SVN_REV -svn co -r $VALGRIND_SVN_REV svn://svn.valgrind.org/valgrind/trunk valgrind-$VALGRIND_SVN_REV + # Make sure svn gets the right version of the external VEX repo, too + svn update -r $VEX_SVN_REV VEX/ -cd valgrind-$VALGRIND_SVN_REV + # Work around bug https://bugs.kde.org/show_bug.cgi?id=162848 + # "fork() not handled properly" + patch -p0 < "$THISDIR"/fork.patch -# Make sure svn gets the right version of the external VEX repo, too -svn update -r $VEX_SVN_REV VEX/ + # Add feature bug https://bugs.kde.org/show_bug.cgi?id=201170 + # "Want --show-possible option so I can ignore the bazillion possible leaks..." + patch -p0 < "$THISDIR"/possible.patch -# Work around bug https://bugs.kde.org/show_bug.cgi?id=162848 -# "fork() not handled properly" -patch -p0 < "$THISDIR"/fork.patch + if [ "$INSTALL_TSAN" = "yes" ] + then + # Add ThreadSanitier to the installation. + # ThreadSanitizer is an experimental dynamic data race detector. + # See http://code.google.com/p/data-race-test/wiki/ThreadSanitizer + svn checkout -r $TSAN_SVN_REV http://data-race-test.googlecode.com/svn/trunk/tsan tsan + mkdir tsan/{docs,tests} + touch tsan/{docs,tests}/Makefile.am + patch -p 0 < tsan/valgrind.patch + fi -# Add feature bug https://bugs.kde.org/show_bug.cgi?id=201170 -# "Want --show-possible option so I can ignore the bazillion possible leaks..." -patch -p0 < "$THISDIR"/possible.patch + sh autogen.sh + cd .. +fi -if [ "$INSTALL_TSAN" = "yes" ] +if test x"$MAKE_TARBALL" = xyes then - # Add ThreadSanitier to the installation. - # ThreadSanitizer is an experimental dynamic data race detector. - # See http://code.google.com/p/data-race-test/wiki/ThreadSanitizer - svn checkout -r $TSAN_SVN_REV http://data-race-test.googlecode.com/svn/trunk/tsan tsan - mkdir tsan/{docs,tests} - touch tsan/{docs,tests}/Makefile.am - patch -p 0 < tsan/valgrind.patch + tar -czvf valgrind-$VALGRIND_SVN_REV.tgz valgrind-$VALGRIND_SVN_REV fi -sh autogen.sh -./configure --prefix="$PREFIX" -make -j4 - -if ./vg-in-place true +if test x"$USE_TARBALL" = xyes then - echo built valgrind passes smoke test, good -else - echo built valgrind fails smoke test - exit 1 + tar -xzvf valgrind-$VALGRIND_SVN_REV.tgz fi -test -d $THISDIR/override_ld && rm -rf $THISDIR/override_ld - -# Don't use sudo if we own the destination -if test -w "$parent_of_prefix" +if test x"$MAKE_TARBALL" != xyes then - make install -else - sudo make install + cd valgrind-$VALGRIND_SVN_REV + + if ld --version | grep gold + then + # build/install-build-deps leaves original ld around, try using that + if test -x /usr/bin/ld.orig + then + echo "Using /usr/bin/ld.orig instead of gold to link valgrind" + test -d $THISDIR/override_ld && rm -rf $THISDIR/override_ld + mkdir $THISDIR/override_ld + ln -s /usr/bin/ld.orig $THISDIR/override_ld/ld + PATH="$THISDIR/override_ld:$PATH" + else + echo "Cannot build valgrind with gold. Please switch to normal /usr/bin/ld, rerun this script, then switch back to gold." + exit 1 + fi + fi + + # Desired parent directory for valgrind's bin, include, etc. + PREFIX="${1:-/usr/local/valgrind-$VALGRIND_SVN_REV}" + parent_of_prefix="`dirname $PREFIX`" + if test ! -d "$parent_of_prefix" + then + echo "Directory $parent_of_prefix does not exist" + exit 1 + fi + + ./configure --prefix="$PREFIX" + make -j4 + + if ./vg-in-place true + then + echo built valgrind passes smoke test, good + else + echo built valgrind fails smoke test + exit 1 + fi + + test -d $THISDIR/override_ld && rm -rf $THISDIR/override_ld + + # Don't use sudo if we own the destination + if test -w "$parent_of_prefix" + then + make install + else + sudo make install + fi fi |