Browse Source

gitian: Make windows dependencies outputs fully deterministic

Sort .zip order, and other determinism changes to make sure builds
are repeatable for windows deps.
0.10
Wladimir J. van der Laan 11 years ago
parent
commit
c43d1e5549
  1. 10
      contrib/gitian-descriptors/boost-win.yml
  2. 6
      contrib/gitian-descriptors/deps-win.yml
  3. 6
      contrib/gitian-descriptors/protobuf-win.yml
  4. 17
      contrib/gitian-descriptors/qt-win.yml

10
contrib/gitian-descriptors/boost-win.yml

@ -16,6 +16,8 @@ files:
- "boost-mingw-gas-cross-compile-2013-03-03.patch" - "boost-mingw-gas-cross-compile-2013-03-03.patch"
script: | script: |
# Defines # Defines
export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1
export FAKETIME=$REFERENCE_DATETIME
export TZ=UTC export TZ=UTC
INDIR=$HOME/build INDIR=$HOME/build
# Input Integrity Check # Input Integrity Check
@ -35,7 +37,7 @@ script: |
mkdir -p $INSTALLPREFIX $BUILDDIR mkdir -p $INSTALLPREFIX $BUILDDIR
cd $BUILDDIR cd $BUILDDIR
# #
tar xjf $INDIR/boost_1_55_0.tar.bz2 tar --warning=no-timestamp -xjf $INDIR/boost_1_55_0.tar.bz2
cd boost_1_55_0 cd boost_1_55_0
GCCVERSION=$($HOST-g++ -E -dM $(mktemp --suffix=.h) | grep __VERSION__ | cut -d ' ' -f 3 | cut -d '"' -f 2) GCCVERSION=$($HOST-g++ -E -dM $(mktemp --suffix=.h) | grep __VERSION__ | cut -d ' ' -f 3 | cut -d '"' -f 2)
echo "using gcc : $GCCVERSION : $HOST-g++ echo "using gcc : $GCCVERSION : $HOST-g++
@ -70,10 +72,6 @@ script: |
./bjam toolset=gcc binary-format=pe target-os=windows threadapi=win32 address-model=$BITS threading=multi variant=release link=static runtime-link=static --user-config=user-config.jam --without-mpi --without-python -sNO_BZIP2=1 -sNO_ZLIB=1 --layout=tagged --build-type=complete --prefix="$INSTALLPREFIX" $MAKEOPTS install ./bjam toolset=gcc binary-format=pe target-os=windows threadapi=win32 address-model=$BITS threading=multi variant=release link=static runtime-link=static --user-config=user-config.jam --without-mpi --without-python -sNO_BZIP2=1 -sNO_ZLIB=1 --layout=tagged --build-type=complete --prefix="$INSTALLPREFIX" $MAKEOPTS install
# #
cd "$INSTALLPREFIX" cd "$INSTALLPREFIX"
export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 find | sort | zip -@ $OUTDIR/boost-win$BITS-1.55.0-gitian-r6.zip
export FAKETIME=$REFERENCE_DATETIME
zip -r $OUTDIR/boost-win$BITS-1.55.0-gitian-r6.zip *
unset LD_PRELOAD
unset FAKETIME
done # for BITS in done # for BITS in

6
contrib/gitian-descriptors/deps-win.yml

@ -107,11 +107,13 @@ script: |
# #
tar xjf $INDIR/qrencode-3.4.3.tar.bz2 tar xjf $INDIR/qrencode-3.4.3.tar.bz2
cd qrencode-3.4.3 cd qrencode-3.4.3
png_CFLAGS="-I$INSTALLPREFIX/include" png_LIBS="-L$INSTALLPREFIX/lib -lpng" ./configure --prefix=$INSTALLPREFIX --host=$HOST --enable-static --disable-shared --without-tools --disable-maintainer-mode --disable-dependency-tracking png_CFLAGS="-I$INSTALLPREFIX/include" png_LIBS="-L$INSTALLPREFIX/lib -lpng" ./configure --prefix=$INSTALLPREFIX --host=$HOST --enable-static --disable-shared --without-tools --disable-dependency-tracking
# Workaround to prevent re-configuring by make (resulting in missing m4 error); make all files have a date in the past
find . -print0 | xargs -r0 touch -t 200001010000
make make
make install make install
cd .. cd ..
# #
cd $INSTALLPREFIX cd $INSTALLPREFIX
zip -r $OUTDIR/bitcoin-deps-win$BITS-gitian-r10.zip include lib find include lib | sort | zip -@ $OUTDIR/bitcoin-deps-win$BITS-gitian-r10.zip
done # for BITS in done # for BITS in

6
contrib/gitian-descriptors/protobuf-win.yml

@ -44,13 +44,13 @@ script: |
# Now recompile with the mingw cross-compiler: # Now recompile with the mingw cross-compiler:
make distclean make distclean
./configure --prefix=$INSTALLPREFIX --enable-shared=no --disable-dependency-tracking --with-protoc=$INSTALLPREFIX/host/bin/protoc --host=$HOST CXXFLAGS="-frandom-seed=11 ${OPTFLAGS}" ./configure --prefix=$INSTALLPREFIX --enable-shared=no --disable-dependency-tracking --with-protoc=$INSTALLPREFIX/host/bin/protoc --host=$HOST CXXFLAGS="-frandom-seed=11 ${OPTFLAGS}"
export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1
export FAKETIME=$REFERENCE_DATETIME
make make
make install make install
# #
cd $INSTALLPREFIX cd $INSTALLPREFIX
export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 find include lib host | sort | zip -@ $OUTDIR/protobuf-win$BITS-2.5.0-gitian-r4.zip
export FAKETIME=$REFERENCE_DATETIME
zip -r $OUTDIR/protobuf-win$BITS-2.5.0-gitian-r4.zip include lib host
unset LD_PRELOAD unset LD_PRELOAD
unset FAKETIME unset FAKETIME
done # for BITS in done # for BITS in

17
contrib/gitian-descriptors/qt-win.yml

@ -55,18 +55,9 @@ script: |
cd qt-everywhere-opensource-src-5.2.0 cd qt-everywhere-opensource-src-5.2.0
SPECNAME="win32-g++" SPECNAME="win32-g++"
SPECFILE="qtbase/mkspecs/${SPECNAME}/qmake.conf" SPECFILE="qtbase/mkspecs/${SPECNAME}/qmake.conf"
sed 's/$TODAY/2011-01-30/' -i configure sed 's/qt_instdate=`date +%Y-%m-%d`/qt_instdate=2011-01-30/' -i qtbase/configure
sed --posix "s|QMAKE_CFLAGS = -pipe -fno-keep-inline-dllexport|QMAKE_CFLAGS\t\t= -pipe -fno-keep-inline-dllexport -isystem /usr/$HOST/include/ -frandom-seed=qtbuild -I$DEPSDIR/include|" -i ${SPECFILE} sed --posix "s|QMAKE_CFLAGS = -pipe -fno-keep-inline-dllexport|QMAKE_CFLAGS\t\t= -pipe -fno-keep-inline-dllexport -isystem /usr/$HOST/include/ -frandom-seed=qtbuild -I$DEPSDIR/include|" -i ${SPECFILE}
sed --posix "s|QMAKE_LFLAGS =|QMAKE_LFLAGS\t\t= -L$DEPSDIR/lib|" -i ${SPECFILE} sed --posix "s|QMAKE_LFLAGS =|QMAKE_LFLAGS\t\t= -L$DEPSDIR/lib|" -i ${SPECFILE}
# ar adds timestamps to every object file included in the static library
# providing -D as ar argument is supposed to solve it, but doesn't work as qmake strips off the arguments and adds -M to pass a script...
# which somehow cannot be combined with other flags.
# use faketime only for ar, as it confuses make/qmake into hanging sometimes
sed --posix "s|QMAKE_LIB = \\\$\\\${CROSS_COMPILE}ar -ru|QMAKE_LIB\t\t= $HOME/ar -Dr|" -i ${SPECFILE}
echo '#!/bin/bash' > $HOME/ar
echo 'export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1' >> $HOME/ar
echo "$HOST-ar \"\$@\"" >> $HOME/ar
chmod +x $HOME/ar
# Don't load faketime while compiling Qt, qmake will get stuck in nearly infinite loops # Don't load faketime while compiling Qt, qmake will get stuck in nearly infinite loops
#export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 #export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1
export FAKETIME=$REFERENCE_DATETIME export FAKETIME=$REFERENCE_DATETIME
@ -76,10 +67,12 @@ script: |
make $MAKEOPTS install make $MAKEOPTS install
# #
cd $INSTALLPREFIX cd $INSTALLPREFIX
# Remove unused non-deterministic stuff
rm host/bin/qtpaths.exe lib/libQt5Bootstrap.a lib/libQt5Bootstrap.la
# as zip stores file timestamps, use faketime to intercept stat calls to set dates for all files to reference date # as zip stores file timestamps, use faketime to intercept stat calls to set dates for all files to reference date
export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1
zip -r $OUTDIR/qt-win${BITS}-5.2.0-gitian-r2.zip * find -print0 | xargs -r0 touch # fix up timestamps before packaging
find | sort | zip -@ $OUTDIR/qt-win${BITS}-5.2.0-gitian-r2.zip
unset LD_PRELOAD unset LD_PRELOAD
unset FAKETIME unset FAKETIME
done # for BITS in done # for BITS in

Loading…
Cancel
Save