Bug 787982 Enable pymake on Thunderbird builds - add a wrapper at build/pymake/make.py that pulls in mozilla-central if necessary, and then uses it for the build. r=Standard8. Landing on CLOSED TREE
authorSiddharth Agarwal <sid.bugzilla@gmail.com>
Fri, 05 Oct 2012 19:44:02 +0100
changeset 11233 5a49ea8a70529f305b572cc85c93d602f33febff
parent 11232 588792b14f4308e21c57cd4bc85118f985ec414d
child 11234 ff10a63c4410b6aef23f3204330daaa4f20750ba
push id8426
push userbugzilla@standard8.plus.com
push dateFri, 05 Oct 2012 18:44:17 +0000
treeherdercomm-central@5a49ea8a7052 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersStandard8
bugs787982
Bug 787982 Enable pymake on Thunderbird builds - add a wrapper at build/pymake/make.py that pulls in mozilla-central if necessary, and then uses it for the build. r=Standard8. Landing on CLOSED TREE
build/check-sync-exceptions
build/client.py-args
build/pymake/make.py
mail/config/mozconfigs/linux32/debug
mail/config/mozconfigs/linux32/nightly
mail/config/mozconfigs/linux32/release
mail/config/mozconfigs/linux64/debug
mail/config/mozconfigs/linux64/nightly
mail/config/mozconfigs/linux64/release
mail/config/mozconfigs/macosx-universal/nightly
mail/config/mozconfigs/macosx-universal/release
mail/config/mozconfigs/macosx32/debug
mail/config/mozconfigs/macosx64/debug
mail/config/mozconfigs/win32/debug
mail/config/mozconfigs/win32/nightly
mail/config/mozconfigs/win32/release
mail/config/mozconfigs/win64/debug
mail/config/mozconfigs/win64/nightly
--- a/build/check-sync-exceptions
+++ b/build/check-sync-exceptions
@@ -1,11 +1,12 @@
 merge-installrdf.py
 pymake
 png2ico.py
+client.py-args
 
 # Ignore detritus left lying around by editing tools.
 *~
 .#*
 #*#
 *.orig
 *.rej
 
new file mode 100644
--- /dev/null
+++ b/build/client.py-args
@@ -0,0 +1,1 @@
+--hg-options='--time' --hgtool=../tools/buildfarm/utils/hgtool.py --skip-chatzilla --skip-comm --skip-inspector --skip-venkman --tinderbox-print
--- a/build/pymake/make.py
+++ b/build/pymake/make.py
@@ -1,17 +1,34 @@
-#!/usr/bin/env python
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
+# This is a wrapper around mozilla-central's pymake. If that isn't found then
+# this uses client.py to pull it in.
+
 import os
 import sys
 import subprocess
+import shlex
 
-if __name__ == '__main__':
-    print >> sys.stderr, ("Warning: This is a stub that runs GNU make. " +
-        "If you're building locally you'll want to run mozilla-central's pymake.")
-    # Work around bug 777798.
-    if os.environ.has_key("PWD"):
-        del os.environ["PWD"]
+def getpath(relpath):
+    thisdir = os.path.dirname(__file__)
+    return os.path.abspath(os.path.join(thisdir, *relpath))
+
+PYMAKE = getpath(["..", "..", "mozilla", "build", "pymake", "make.py"])
+CLIENT_PY = getpath(["..", "..", "client.py"])
+CLIENT_PY_ARGS = getpath(["..", "client.py-args"])
 
-    subprocess.check_call(["make"] + sys.argv[1:])
+def main(args):
+    if not os.path.exists(PYMAKE):
+        clientpyargs = open(CLIENT_PY_ARGS, "r").read().strip()
+        clientpyargs = shlex.split(clientpyargs)
+        subprocess.check_call([sys.executable, CLIENT_PY, "checkout"] +
+                              clientpyargs)
+
+        if not os.path.exists(PYMAKE):
+            raise Exception("Pymake not found even after client.py was run")
+
+    subprocess.check_call([sys.executable, PYMAKE] + args)
+
+if __name__ == "__main__":
+    main(sys.argv[1:])
--- a/mail/config/mozconfigs/linux32/debug
+++ b/mail/config/mozconfigs/linux32/debug
@@ -17,10 +17,10 @@ export MOZ_DEBUG_SYMBOLS=1
 # Enable parallel compiling
 CONCURRENCY=$(( `grep processor /proc/cpuinfo | wc -l` + 2 ))
 mk_add_options MOZ_MAKE_FLAGS="-j$CONCURRENCY"
 
 #Use ccache
 ac_add_options --with-ccache=/usr/bin/ccache
 
 # Run client.py
-mk_add_options CLIENT_PY_ARGS="--hg-options='--time' --hgtool=../tools/buildfarm/utils/hgtool.py --skip-chatzilla --skip-comm --skip-inspector --skip-venkman --tinderbox-print"
+mk_add_options CLIENT_PY_ARGS="$(cat $topsrcdir/build/client.py-args)"
 mk_add_options ALWAYS_RUN_CLIENT_PY=1
--- a/mail/config/mozconfigs/linux32/nightly
+++ b/mail/config/mozconfigs/linux32/nightly
@@ -19,10 +19,10 @@ export MOZ_DEBUG_SYMBOLS=1
 # Enable parallel compiling
 CONCURRENCY=$(( `grep processor /proc/cpuinfo | wc -l` + 2 ))
 mk_add_options MOZ_MAKE_FLAGS="-j$CONCURRENCY"
 
 # Use ccache
 ac_add_options --with-ccache=/usr/bin/ccache
 
 # Run client.py
-mk_add_options CLIENT_PY_ARGS="--hg-options='--time' --hgtool=../tools/buildfarm/utils/hgtool.py --skip-chatzilla --skip-comm --skip-inspector --skip-venkman --tinderbox-print"
+mk_add_options CLIENT_PY_ARGS="$(cat $topsrcdir/build/client.py-args)"
 mk_add_options ALWAYS_RUN_CLIENT_PY=1
--- a/mail/config/mozconfigs/linux32/release
+++ b/mail/config/mozconfigs/linux32/release
@@ -14,10 +14,10 @@ export MOZILLA_OFFICIAL=1
 # For NSS symbols
 export MOZ_DEBUG_SYMBOLS=1
 
 # Enable parallel compiling
 CONCURRENCY=$(( `grep processor /proc/cpuinfo | wc -l` + 2 ))
 mk_add_options MOZ_MAKE_FLAGS="-j$CONCURRENCY"
 
 # Run client.py
-mk_add_options CLIENT_PY_ARGS="--hg-options='--time' --hgtool=../tools/buildfarm/utils/hgtool.py --skip-chatzilla --skip-comm --skip-inspector --skip-venkman --tinderbox-print"
+mk_add_options CLIENT_PY_ARGS="$(cat $topsrcdir/build/client.py-args)"
 mk_add_options ALWAYS_RUN_CLIENT_PY=1
--- a/mail/config/mozconfigs/linux64/debug
+++ b/mail/config/mozconfigs/linux64/debug
@@ -17,11 +17,10 @@ export MOZ_DEBUG_SYMBOLS=1
 # Enable parallel compiling
 CONCURRENCY=$(( `grep processor /proc/cpuinfo | wc -l` + 2 ))
 mk_add_options MOZ_MAKE_FLAGS="-j$CONCURRENCY"
 
 # Use ccache
 ac_add_options --with-ccache=/usr/bin/ccache
 
 # Run client.py
-mk_add_options CLIENT_PY_ARGS="--hg-options='--time' --hgtool=../tools/buildfarm/utils/hgtool.py --skip-chatzilla --skip-comm --skip-inspector --skip-venkman --tinderbox-print"
+mk_add_options CLIENT_PY_ARGS="$(cat $topsrcdir/build/client.py-args)"
 mk_add_options ALWAYS_RUN_CLIENT_PY=1
-
--- a/mail/config/mozconfigs/linux64/nightly
+++ b/mail/config/mozconfigs/linux64/nightly
@@ -19,10 +19,10 @@ export MOZ_DEBUG_SYMBOLS=1
 # Enable parallel compiling
 CONCURRENCY=$(( `grep processor /proc/cpuinfo | wc -l` + 2 ))
 mk_add_options MOZ_MAKE_FLAGS="-j$CONCURRENCY"
 
 # Use ccache
 ac_add_options --with-ccache=/usr/bin/ccache
 
 # Run client.py
-mk_add_options CLIENT_PY_ARGS="--hg-options='--time' --hgtool=../tools/buildfarm/utils/hgtool.py --skip-chatzilla --skip-comm --skip-inspector --skip-venkman --tinderbox-print"
+mk_add_options CLIENT_PY_ARGS="$(cat $topsrcdir/build/client.py-args)"
 mk_add_options ALWAYS_RUN_CLIENT_PY=1
--- a/mail/config/mozconfigs/linux64/release
+++ b/mail/config/mozconfigs/linux64/release
@@ -14,10 +14,10 @@ export MOZILLA_OFFICIAL=1
 # For NSS symbols
 export MOZ_DEBUG_SYMBOLS=1
 
 # Enable parallel compiling
 CONCURRENCY=$(( `grep processor /proc/cpuinfo | wc -l` + 2 ))
 mk_add_options MOZ_MAKE_FLAGS="-j$CONCURRENCY"
 
 # Run client.py
-mk_add_options CLIENT_PY_ARGS="--hg-options='--time' --hgtool=../tools/buildfarm/utils/hgtool.py --skip-chatzilla --skip-comm --skip-inspector --skip-venkman --tinderbox-print"
+mk_add_options CLIENT_PY_ARGS="$(cat $topsrcdir/build/client.py-args)"
 mk_add_options ALWAYS_RUN_CLIENT_PY=1
--- a/mail/config/mozconfigs/macosx-universal/nightly
+++ b/mail/config/mozconfigs/macosx-universal/nightly
@@ -26,10 +26,10 @@ export MOZILLA_OFFICIAL=1
 
 # Enable parallel compiling
 CONCURRENCY=$(( `sysctl hw.logicalcpu | awk {'print $2'}`  + 2 ))
 mk_add_options MOZ_MAKE_FLAGS="-j$CONCURRENCY"
 
 ac_add_options --with-ccache
 
 # Run client.py
-mk_add_options CLIENT_PY_ARGS="--hg-options='--time' --hgtool=../tools/buildfarm/utils/hgtool.py --skip-chatzilla --skip-comm --skip-inspector --skip-venkman --tinderbox-print"
+mk_add_options CLIENT_PY_ARGS="$(cat $topsrcdir/build/client.py-args)"
 mk_add_options ALWAYS_RUN_CLIENT_PY=1
--- a/mail/config/mozconfigs/macosx-universal/release
+++ b/mail/config/mozconfigs/macosx-universal/release
@@ -21,10 +21,10 @@ export MOZ_DEBUG_SYMBOLS=1
 # Needed to enable breakpad in application.ini
 export MOZILLA_OFFICIAL=1
 
 # Enable parallel compiling
 CONCURRENCY=$(( `sysctl hw.logicalcpu | awk {'print $2'}`  + 2 ))
 mk_add_options MOZ_MAKE_FLAGS="-j$CONCURRENCY"
 
 # Run client.py
-mk_add_options CLIENT_PY_ARGS="--hg-options='--time' --hgtool=../tools/buildfarm/utils/hgtool.py --skip-chatzilla --skip-comm --skip-inspector --skip-venkman --tinderbox-print"
+mk_add_options CLIENT_PY_ARGS="$(cat $topsrcdir/build/client.py-args)"
 mk_add_options ALWAYS_RUN_CLIENT_PY=1
--- a/mail/config/mozconfigs/macosx32/debug
+++ b/mail/config/mozconfigs/macosx32/debug
@@ -11,10 +11,10 @@ mk_add_options MOZ_MAKE_FLAGS="-j12"
 export MOZILLA_OFFICIAL=1
 
 # For NSS symbols
 export MOZ_DEBUG_SYMBOLS=1
 
 ac_add_options --with-ccache
 
 # Run client.py
-mk_add_options CLIENT_PY_ARGS="--hg-options='--time' --hgtool=../tools/buildfarm/utils/hgtool.py --skip-chatzilla --skip-comm --skip-inspector --skip-venkman --tinderbox-print"
+mk_add_options CLIENT_PY_ARGS="$(cat $topsrcdir/build/client.py-args)"
 mk_add_options ALWAYS_RUN_CLIENT_PY=1
--- a/mail/config/mozconfigs/macosx64/debug
+++ b/mail/config/mozconfigs/macosx64/debug
@@ -12,10 +12,10 @@ mk_add_options MOZ_MAKE_FLAGS="-j12"
 export MOZILLA_OFFICIAL=1
 
 # For NSS symbols
 export MOZ_DEBUG_SYMBOLS=1
 
 ac_add_options --with-ccache
 
 # Run client.py
-mk_add_options CLIENT_PY_ARGS="--hg-options='--time' --hgtool=../tools/buildfarm/utils/hgtool.py --skip-chatzilla --skip-comm --skip-inspector --skip-venkman --tinderbox-print"
+mk_add_options CLIENT_PY_ARGS="$(cat $topsrcdir/build/client.py-args)"
 mk_add_options ALWAYS_RUN_CLIENT_PY=1
--- a/mail/config/mozconfigs/win32/debug
+++ b/mail/config/mozconfigs/win32/debug
@@ -19,11 +19,10 @@ fi
 
 if test "$PROCESSOR_ARCHITECTURE" = "AMD64" -o "$PROCESSOR_ARCHITEW6432" = "AMD64"; then
   . $topsrcdir/build/win32/mozconfig.vs2010-win64
 else
   . $topsrcdir/build/win32/mozconfig.vs2010
 fi
 
 # Run client.py
-mk_add_options CLIENT_PY_ARGS="--hg-options='--time' --hgtool=../tools/buildfarm/utils/hgtool.py --skip-chatzilla --skip-comm --skip-inspector --skip-venkman --tinderbox-print"
+mk_add_options CLIENT_PY_ARGS="$(cat $topsrcdir/build/client.py-args)"
 mk_add_options ALWAYS_RUN_CLIENT_PY=1
-
--- a/mail/config/mozconfigs/win32/nightly
+++ b/mail/config/mozconfigs/win32/nightly
@@ -21,10 +21,10 @@ fi
 
 if test "$PROCESSOR_ARCHITECTURE" = "AMD64" -o "$PROCESSOR_ARCHITEW6432" = "AMD64"; then
   . $topsrcdir/build/win32/mozconfig.vs2010-win64
 else
   . $topsrcdir/build/win32/mozconfig.vs2010
 fi
 
 # Run client.py
-mk_add_options CLIENT_PY_ARGS="--hg-options='--time' --hgtool=../tools/buildfarm/utils/hgtool.py --skip-chatzilla --skip-comm --skip-inspector --skip-venkman --tinderbox-print"
+mk_add_options CLIENT_PY_ARGS="$(cat $topsrcdir/build/client.py-args)"
 mk_add_options ALWAYS_RUN_CLIENT_PY=1
--- a/mail/config/mozconfigs/win32/release
+++ b/mail/config/mozconfigs/win32/release
@@ -20,10 +20,10 @@ fi
 
 if test "$PROCESSOR_ARCHITECTURE" = "AMD64" -o "$PROCESSOR_ARCHITEW6432" = "AMD64"; then
   . $topsrcdir/build/win32/mozconfig.vs2010-win64
 else
   . $topsrcdir/build/win32/mozconfig.vs2010
 fi
 
 # Run client.py
-mk_add_options CLIENT_PY_ARGS="--hg-options='--time' --hgtool=../tools/buildfarm/utils/hgtool.py --skip-chatzilla --skip-comm --skip-inspector --skip-venkman --tinderbox-print"
+mk_add_options CLIENT_PY_ARGS="$(cat $topsrcdir/build/client.py-args)"
 mk_add_options ALWAYS_RUN_CLIENT_PY=1
--- a/mail/config/mozconfigs/win64/debug
+++ b/mail/config/mozconfigs/win64/debug
@@ -15,10 +15,10 @@ if test -n "${_PYMAKE}"; then
   mk_add_options MOZ_MAKE_FLAGS=-j4
 else
   mk_add_options MOZ_MAKE_FLAGS=-j1
 fi
 
 . $topsrcdir/build/win64/mozconfig.vs2010
 
 # Run client.py
-mk_add_options CLIENT_PY_ARGS="--hg-options='--time' --hgtool=../tools/buildfarm/utils/hgtool.py --skip-chatzilla --skip-comm --skip-inspector --skip-venkman --tinderbox-print"
+mk_add_options CLIENT_PY_ARGS="$(cat $topsrcdir/build/client.py-args)"
 mk_add_options ALWAYS_RUN_CLIENT_PY=1
--- a/mail/config/mozconfigs/win64/nightly
+++ b/mail/config/mozconfigs/win64/nightly
@@ -17,10 +17,10 @@ if test -n "${_PYMAKE}"; then
   mk_add_options MOZ_MAKE_FLAGS=-j4
 else
   mk_add_options MOZ_MAKE_FLAGS=-j1
 fi
 
 . $topsrcdir/build/win64/mozconfig.vs2010
 
 # Run client.py
-mk_add_options CLIENT_PY_ARGS="--hg-options='--time' --hgtool=../tools/buildfarm/utils/hgtool.py --skip-chatzilla --skip-comm --skip-inspector --skip-venkman --tinderbox-print"
+mk_add_options CLIENT_PY_ARGS="$(cat $topsrcdir/build/client.py-args)"
 mk_add_options ALWAYS_RUN_CLIENT_PY=1