commit d6ead1b68cb9645039b8e955626cdea15bc07dbb Author: Mike Perry mikeperry-git@torproject.org Date: Sun Jun 23 18:42:45 2013 -0700
Allow customization of the number of CPUs via env var. --- gitian/README.build | 5 +++++ gitian/mkbundle-linux.sh | 11 ++++++++--- gitian/mkbundle-mac.sh | 11 ++++++++--- gitian/mkbundle-windows.sh | 11 ++++++++--- 4 files changed, 29 insertions(+), 9 deletions(-)
diff --git a/gitian/README.build b/gitian/README.build index 6ac41ad..d16e5e2 100644 --- a/gitian/README.build +++ b/gitian/README.build @@ -25,6 +25,11 @@ QuickStart: source input files are checked every time you run 'make' by default so distclean should not normally be needed).
+ To set the number of make processes and virtual CPUs to use inside the VMs + to four (the default is two), use: + + $ export NUM_PROCS=4 +
Detailed Explanation of Scripts:
diff --git a/gitian/mkbundle-linux.sh b/gitian/mkbundle-linux.sh index 7d4d6ef..97ead7c 100755 --- a/gitian/mkbundle-linux.sh +++ b/gitian/mkbundle-linux.sh @@ -15,6 +15,11 @@ then exit 1 fi
+if [ -z "$NUM_PROCS" ]; +then + export NUM_PROCS=2 +fi + cd $GITIAN_DIR export PATH=$PATH:$PWD/libexec
@@ -93,7 +98,7 @@ then echo "****** Starting Tor Component of Linux Bundle (1/3 for Linux) ******" echo
- ./bin/gbuild --commit zlib=$ZLIB_TAG,libevent=$LIBEVENT_TAG,tor=$TOR_TAG $DESCRIPTOR_DIR/linux/gitian-tor.yml + ./bin/gbuild -j $NUM_PROCS --commit zlib=$ZLIB_TAG,libevent=$LIBEVENT_TAG,tor=$TOR_TAG $DESCRIPTOR_DIR/linux/gitian-tor.yml if [ $? -ne 0 ]; then mv var/build.log ./tor-fail-linux.log.`date +%Y%m%d%H%M%S` @@ -116,7 +121,7 @@ then echo "****** Starting TorBrowser Component of Linux Bundle (2/3 for Linux) ******" echo
- ./bin/gbuild --commit tor-browser=$TORBROWSER_TAG $DESCRIPTOR_DIR/linux/gitian-firefox.yml + ./bin/gbuild -j $NUM_PROCS --commit tor-browser=$TORBROWSER_TAG $DESCRIPTOR_DIR/linux/gitian-firefox.yml if [ $? -ne 0 ]; then mv var/build.log ./firefox-fail-linux.log.`date +%Y%m%d%H%M%S` @@ -140,7 +145,7 @@ then cp -a $WRAPPER_DIR/versions $GITIAN_DIR/inputs/ cd $WRAPPER_DIR && ./record-inputs.sh && cd $GITIAN_DIR
- ./bin/gbuild --commit https-everywhere=$HTTPSE_TAG,tor-launcher=$TORLAUNCHER_TAG,torbutton=$TORBUTTON_TAG $DESCRIPTOR_DIR/linux/gitian-bundle.yml + ./bin/gbuild -j $NUM_PROCS --commit https-everywhere=$HTTPSE_TAG,tor-launcher=$TORLAUNCHER_TAG,torbutton=$TORBUTTON_TAG $DESCRIPTOR_DIR/linux/gitian-bundle.yml if [ $? -ne 0 ]; then mv var/build.log ./bundle-fail-linux.log.`date +%Y%m%d%H%M%S` diff --git a/gitian/mkbundle-mac.sh b/gitian/mkbundle-mac.sh index 3e9fb35..8caf6dc 100755 --- a/gitian/mkbundle-mac.sh +++ b/gitian/mkbundle-mac.sh @@ -15,6 +15,11 @@ then exit 1 fi
+if [ -z "$NUM_PROCS" ]; +then + export NUM_PROCS=2 +fi + cd $GITIAN_DIR export PATH=$PATH:$PWD/libexec
@@ -76,7 +81,7 @@ then echo "****** Starting Tor Component of Mac Bundle (1/3 for Mac) ******" echo
- ./bin/gbuild --commit zlib=$ZLIB_TAG,libevent=$LIBEVENT_TAG,tor=$TOR_TAG $DESCRIPTOR_DIR/mac/gitian-tor.yml + ./bin/gbuild -j $NUM_PROCS --commit zlib=$ZLIB_TAG,libevent=$LIBEVENT_TAG,tor=$TOR_TAG $DESCRIPTOR_DIR/mac/gitian-tor.yml if [ $? -ne 0 ]; then mv var/build.log ./tor-fail-mac.log.`date +%Y%m%d%H%M%S` @@ -97,7 +102,7 @@ then echo "****** Starting TorBrowser Component of Mac Bundle (2/3 for Mac) ******" echo
- ./bin/gbuild --commit tor-browser=$TORBROWSER_TAG $DESCRIPTOR_DIR/mac/gitian-firefox.yml + ./bin/gbuild -j $NUM_PROCS --commit tor-browser=$TORBROWSER_TAG $DESCRIPTOR_DIR/mac/gitian-firefox.yml if [ $? -ne 0 ]; then mv var/build.log ./firefox-fail-mac.log.`date +%Y%m%d%H%M%S` @@ -122,7 +127,7 @@ then cp -a $WRAPPER_DIR/versions $GITIAN_DIR/inputs/ cd $WRAPPER_DIR && ./record-inputs.sh && cd $GITIAN_DIR
- ./bin/gbuild --commit https-everywhere=$HTTPSE_TAG,torbutton=$TORBUTTON_TAG,tor-launcher=$TORLAUNCHER_TAG $DESCRIPTOR_DIR/mac/gitian-bundle.yml + ./bin/gbuild -j $NUM_PROCS --commit https-everywhere=$HTTPSE_TAG,torbutton=$TORBUTTON_TAG,tor-launcher=$TORLAUNCHER_TAG $DESCRIPTOR_DIR/mac/gitian-bundle.yml if [ $? -ne 0 ]; then mv var/build.log ./bundle-fail-mac.log.`date +%Y%m%d%H%M%S` diff --git a/gitian/mkbundle-windows.sh b/gitian/mkbundle-windows.sh index 4a2ee49..dd3de1a 100755 --- a/gitian/mkbundle-windows.sh +++ b/gitian/mkbundle-windows.sh @@ -15,6 +15,11 @@ then exit 1 fi
+if [ -z "$NUM_PROCS" ]; +then + export NUM_PROCS=2 +fi + cd $GITIAN_DIR export PATH=$PATH:$PWD/libexec
@@ -76,7 +81,7 @@ then echo "****** Starting Tor Component of Windows Bundle (1/3 for Windows) ******" echo
- ./bin/gbuild --commit zlib=$ZLIB_TAG,libevent=$LIBEVENT_TAG,tor=$TOR_TAG $DESCRIPTOR_DIR/windows/gitian-tor.yml + ./bin/gbuild -j $NUM_PROCS --commit zlib=$ZLIB_TAG,libevent=$LIBEVENT_TAG,tor=$TOR_TAG $DESCRIPTOR_DIR/windows/gitian-tor.yml if [ $? -ne 0 ]; then mv var/build.log ./tor-fail-win32.log.`date +%Y%m%d%H%M%S` @@ -97,7 +102,7 @@ then echo "****** Starting Torbrowser Component of Windows Bundle (2/3 for Windows) ******" echo
- ./bin/gbuild --commit tor-browser=$TORBROWSER_TAG $DESCRIPTOR_DIR/windows/gitian-firefox.yml + ./bin/gbuild -j $NUM_PROCS --commit tor-browser=$TORBROWSER_TAG $DESCRIPTOR_DIR/windows/gitian-firefox.yml if [ $? -ne 0 ]; then mv var/build.log ./firefox-fail-win32.log.`date +%Y%m%d%H%M%S` @@ -121,7 +126,7 @@ then cp -a $WRAPPER_DIR/versions $GITIAN_DIR/inputs/ cd $WRAPPER_DIR && ./record-inputs.sh && cd $GITIAN_DIR
- ./bin/gbuild --commit https-everywhere=$HTTPSE_TAG,torbutton=$TORBUTTON_TAG,tor-launcher=$TORLAUNCHER_TAG,tbb-windows-installer=$NSIS_TAG $DESCRIPTOR_DIR/windows/gitian-bundle.yml + ./bin/gbuild -j $NUM_PROCS --commit https-everywhere=$HTTPSE_TAG,torbutton=$TORBUTTON_TAG,tor-launcher=$TORLAUNCHER_TAG,tbb-windows-installer=$NSIS_TAG $DESCRIPTOR_DIR/windows/gitian-bundle.yml if [ $? -ne 0 ]; then mv var/build.log ./bundle-fail-win32.log.`date +%Y%m%d%H%M%S`
tor-commits@lists.torproject.org