commit 82153228c675451dc5b37d8302beff0a93e981e4 Author: Georg Koppen gk@torproject.org Date: Mon Sep 22 20:10:38 2014 +0000
Use newer libfaketime (0.9.6).
libfaketime 0.8 breaks the ESR 31 build (see #12461 comment 8 and later and #12812 comment 8 for the gory details). We therefore use a newer version that provides us with an environment variable to skip certain processes when faking time. --- gitian/descriptors/linux/gitian-firefox.yml | 33 +++++++++++++++++++++---- gitian/descriptors/mac/gitian-firefox.yml | 29 ++++++++++++++++++---- gitian/descriptors/windows/gitian-firefox.yml | 22 ++++++++++++++--- gitian/fetch-inputs.sh | 1 + gitian/mkbundle-linux.sh | 2 +- gitian/mkbundle-mac.sh | 2 +- gitian/mkbundle-windows.sh | 2 +- gitian/versions.nightly | 1 + 8 files changed, 76 insertions(+), 16 deletions(-)
diff --git a/gitian/descriptors/linux/gitian-firefox.yml b/gitian/descriptors/linux/gitian-firefox.yml index 07927fb..d7958b0 100644 --- a/gitian/descriptors/linux/gitian-firefox.yml +++ b/gitian/descriptors/linux/gitian-firefox.yml @@ -6,7 +6,6 @@ architectures: - "i386" - "amd64" packages: -- "faketime" - "unzip" - "zip" - "libglib2.0-dev" @@ -32,6 +31,8 @@ reference_datetime: "2000-01-01 00:00:00" remotes: - "url": "https://git.torproject.org/tor-browser.git" "dir": "tor-browser" +- "url": "https://github.com/wolfcw/libfaketime" + "dir": "faketime" files: - "binutils-linux32-utils.zip" - "binutils-linux64-utils.zip" @@ -49,8 +50,6 @@ script: | export CFLAGS="-frandom-seed=tor" export CXXFLAGS="-frandom-seed=tor" export TZ=UTC - export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 - export FAKETIME=$REFERENCE_DATETIME export LC_ALL=C umask 0022 # @@ -92,18 +91,42 @@ script: | # mkdir -p $INSTDIR/Browser/ mkdir -p $INSTDIR/Debug/Browser/components - # + + # Building libfaketime + cd faketime + make + DESTDIR="$INSTDIR/faketime" make install + export LD_PRELOAD="$INSTDIR/faketime/usr/local/lib/faketime/libfaketime.so.1" + export FAKETIME=$REFERENCE_DATETIME + cd .. + cd tor-browser # .git and the src takes up a lot of useless space, and we need the space to build rm -rf .git find -type f | xargs touch --date="$REFERENCE_DATETIME" rm -f configure rm -f js/src/configure + # |configure| can't cope with nano seconds faked. And even if we would revert + # that feature it would hang sometimes for unknown but to libfaketime related + # reasons. + export LD_PRELOAD="" make -f client.mk configure CONFIGURE_ARGS="--with-tor-browser-version=${TORBROWSER_VERSION} --enable-update-channel=${TORBROWSER_UPDATE_CHANNEL}" + # We need libfaketime for all the timestamps e.g. written into the libraries. + # BUT we need to exclude |make build| from it. Otherwise the build fails close + # to the end, see #12461 comment 8 and later. Additionally, we need to avoid + # breaking the ICU compilation. Exlcuding |bash| helps here. See #12461 + # comment 13. + export LD_PRELOAD="$INSTDIR/faketime/usr/local/lib/faketime/libfaketime.so.1" + export FAKETIME_SKIP_CMDS="bash,make" find -type f | xargs touch --date="$REFERENCE_DATETIME" - # make BUILD_HOSTNAME="gitian" $MAKEOPTS -f client.mk build + # Packaging is broken with libfaketime enabled, thus we disable it again. See + # #12461 comments 11 and 12 for details. + export LD_PRELOAD="" make -C obj-* package INNER_MAKE_PACKAGE=true + # Without libfaketime enabled we would get different omni.ja and *debug.zip + # files. + export LD_PRELOAD="$INSTDIR/faketime/usr/local/lib/faketime/libfaketime.so.1" cp -a obj-*/dist/firefox/* $INSTDIR/Browser/ # Remove firefox-bin (we don't use it, see ticket #10126) rm -f $INSTDIR/Browser/firefox-bin diff --git a/gitian/descriptors/mac/gitian-firefox.yml b/gitian/descriptors/mac/gitian-firefox.yml index 40693b0..b07a261 100644 --- a/gitian/descriptors/mac/gitian-firefox.yml +++ b/gitian/descriptors/mac/gitian-firefox.yml @@ -10,12 +10,13 @@ packages: - "zip" - "autoconf" - "autoconf2.13" -- "faketime" - "yasm" reference_datetime: "2000-01-01 00:00:00" remotes: - "url": "https://git.torproject.org/tor-browser.git" "dir": "tor-browser" +- "url": "https://github.com/wolfcw/libfaketime" + "dir": "faketime" files: - "apple-uni-sdk-10.6_20110407-0.flosoft1_i386.deb" - "x86_64-apple-darwin10.tar.xz" @@ -26,15 +27,21 @@ files: script: | INSTDIR="$HOME/install/" source versions - export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 - export FAKETIME=$REFERENCE_DATETIME export TZ=UTC export LC_ALL=C umask 0022 # mkdir -p $INSTDIR/TorBrowser.app/Contents/MacOS/ mkdir -p $OUTDIR/ - # + + # Building libfaketime. + cd faketime + make + DESTDIR="$INSTDIR/faketime" make install + export LD_PRELOAD="$INSTDIR/faketime/usr/local/lib/faketime/libfaketime.so.1" + export FAKETIME=$REFERENCE_DATETIME + cd .. + sudo dpkg -i *.deb tar -xavf x86_64-apple-darwin10.tar.xz # XXX: Needed for the otool patch. But we should replace that one with a @@ -57,9 +64,21 @@ script: | find -type f | xargs touch --date="$REFERENCE_DATETIME" rm -f configure rm -f js/src/configure + # |configure| can't cope with nano seconds faked. And even if we would revert + # that feature it would hang sometimes for unknown but to libfaketime related + # reasons. + export LD_PRELOAD="" make -f client.mk configure CONFIGURE_ARGS="--with-tor-browser-version=${TORBROWSER_VERSION} --enable-update-channel=${TORBROWSER_UPDATE_CHANNEL}" find -type f | xargs touch --date="$REFERENCE_DATETIME" - # + # We need libfaketime for all the timestamps e.g. written into the libraries. + # BUT we need to exclude |make build| from it. Otherwise the build fails close + # to the end, see #12812 comment 6 and #12461 comment 8 and later. + # Additionally, we need to exclude |rsync| due to #10153 which is reproducible + # reliably with the new libfaketime. + export LD_PRELOAD="$INSTDIR/faketime/usr/local/lib/faketime/libfaketime.so.1" + # XXX Order matters as for some reason the env variable has only the first + # command assigned when it comes to the rsync parts in the build process. + export FAKETIME_SKIP_CMDS="rsync,make" make BUILD_HOSTNAME="gitian" $MAKEOPTS -f client.mk build # make -C obj-macos package INNER_MAKE_PACKAGE=true diff --git a/gitian/descriptors/windows/gitian-firefox.yml b/gitian/descriptors/windows/gitian-firefox.yml index da0c8b1..bcffffe 100644 --- a/gitian/descriptors/windows/gitian-firefox.yml +++ b/gitian/descriptors/windows/gitian-firefox.yml @@ -9,12 +9,13 @@ packages: - "zip" - "autoconf" - "autoconf2.13" -- "faketime" - "yasm" reference_datetime: "2000-01-01 00:00:00" remotes: - "url": "https://git.torproject.org/tor-browser.git" "dir": "tor-browser" +- "url": "https://github.com/wolfcw/libfaketime" + "dir": "faketime" files: - "mingw-w64-win32-utils.zip" - "re-dzip.sh" @@ -28,8 +29,6 @@ files: script: | INSTDIR="$HOME/install" source versions - export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 - export FAKETIME=$REFERENCE_DATETIME export TZ=UTC export LC_ALL=C umask 0022 @@ -41,6 +40,14 @@ script: | # Make sure our custom mingw gets used. export PATH=$INSTDIR/mingw-w64/bin:$PATH
+ # Building libfaketime + cd faketime + make + DESTDIR="$INSTDIR/faketime" make install + export LD_PRELOAD="$INSTDIR/faketime/usr/local/lib/faketime/libfaketime.so.1" + export FAKETIME=$REFERENCE_DATETIME + cd .. + # We don't want to link against msvcrt.dll due to bug 9084. i686-w64-mingw32-g++ -dumpspecs > msvcr100.spec sed 's/msvcrt/msvcr100/' -i msvcr100.spec @@ -71,6 +78,10 @@ script: | find -type f | xargs touch --date="$REFERENCE_DATETIME" rm -f configure rm -f js/src/configure + # |configure| can't cope with nano seconds faked. And even if we would revert + # that feature it would hang sometimes for unknown but to libfaketime related + # reasons. + export LD_PRELOAD="" make -f client.mk configure CONFIGURE_ARGS="--with-tor-browser-version=${TORBROWSER_VERSION} --enable-update-channel=${TORBROWSER_UPDATE_CHANNEL}" find -type f | xargs touch --date="$REFERENCE_DATETIME" # @@ -78,6 +89,11 @@ script: | cp ~/build/i686* ~/build/bin/ export PATH=~/build/bin:$PATH # + # We need libfaketime for all the timestamps e.g. written into the libraries. + # BUT we need to exclude |make build| from it. Otherwise the build fails close + # to the end, see #12811 comment 14 and #12461 comment 8 and later. + export LD_PRELOAD="$INSTDIR/faketime/usr/local/lib/faketime/libfaketime.so.1" + export FAKETIME_SKIP_CMDS="make" make BUILD_HOSTNAME="gitian" $MAKEOPTS -f client.mk build # make -C obj-* package INNER_MAKE_PACKAGE=true diff --git a/gitian/fetch-inputs.sh b/gitian/fetch-inputs.sh index ad82ddf..3a4dc87 100755 --- a/gitian/fetch-inputs.sh +++ b/gitian/fetch-inputs.sh @@ -294,6 +294,7 @@ libdmg-hfsplus https://github.com/vasi/libdmg-hfsplus.git $LIBDMG_TAG txsocksx https://github.com/habnabit/txsocksx.git $TXSOCKSX_TAG goptlib https://git.torproject.org/pluggable-transports/goptlib.git $GOPTLIB_TAG meek https://git.torproject.org/pluggable-transports/meek.git $MEEK_TAG +faketime https://github.com/wolfcw/libfaketime $FAKETIME_TAG EOF
exit 0 diff --git a/gitian/mkbundle-linux.sh b/gitian/mkbundle-linux.sh index 8a4e55f..4106e74 100755 --- a/gitian/mkbundle-linux.sh +++ b/gitian/mkbundle-linux.sh @@ -197,7 +197,7 @@ then echo "****** Starting TorBrowser Component of Linux Bundle (3/5 for Linux) ******" echo
- ./bin/gbuild -j $NUM_PROCS -m $VM_MEMORY --commit tor-browser=$TORBROWSER_TAG $DESCRIPTOR_DIR/linux/gitian-firefox.yml + ./bin/gbuild -j $NUM_PROCS -m $VM_MEMORY --commit tor-browser=$TORBROWSER_TAG,faketime=$FAKETIME_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` diff --git a/gitian/mkbundle-mac.sh b/gitian/mkbundle-mac.sh index d71c824..9a43685 100755 --- a/gitian/mkbundle-mac.sh +++ b/gitian/mkbundle-mac.sh @@ -165,7 +165,7 @@ then echo "****** Starting TorBrowser Component of Mac Bundle (3/5 for Mac) ******" echo
- ./bin/gbuild -j $NUM_PROCS -m $VM_MEMORY --commit tor-browser=$TORBROWSER_TAG $DESCRIPTOR_DIR/mac/gitian-firefox.yml + ./bin/gbuild -j $NUM_PROCS -m $VM_MEMORY --commit tor-browser=$TORBROWSER_TAG,faketime=$FAKETIME_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` diff --git a/gitian/mkbundle-windows.sh b/gitian/mkbundle-windows.sh index d7fc722..56830a0 100755 --- a/gitian/mkbundle-windows.sh +++ b/gitian/mkbundle-windows.sh @@ -168,7 +168,7 @@ then echo "****** Starting Torbrowser Component of Windows Bundle (3/5 for Windows) ******" echo
- ./bin/gbuild -j $NUM_PROCS -m $VM_MEMORY --commit tor-browser=$TORBROWSER_TAG $DESCRIPTOR_DIR/windows/gitian-firefox.yml + ./bin/gbuild -j $NUM_PROCS -m $VM_MEMORY --commit tor-browser=$TORBROWSER_TAG,faketime=$FAKETIME_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` diff --git a/gitian/versions.nightly b/gitian/versions.nightly index 58d647f..a59e8a1 100755 --- a/gitian/versions.nightly +++ b/gitian/versions.nightly @@ -27,6 +27,7 @@ LIBDMG_TAG=dfd5e5cc3dc1191e37d3c3a6118975afdd1d7014 TXSOCKSX_TAG=216eb0894a1755872f4789f9458aa6cf543b8433 # unsigned habnabit/1.13.0.2 GOPTLIB_TAG=master MEEK_TAG=master +FAKETIME_TAG=70aa6b394d9341522dffe8a5a5cf5929e82cc6b9 # unsigned v0.9.6
GITIAN_TAG=tor-browser-builder-3.x-7