Browse Source

gitian: sort generated source distribution archive for windows

Make the bitcoin-X.X.X.tar.gz deterministic.
0.10
Wladimir J. van der Laan 11 years ago
parent
commit
4ce9106ff8
  1. 19
      contrib/gitian-descriptors/gitian-win.yml

19
contrib/gitian-descriptors/gitian-win.yml

@ -35,6 +35,7 @@ script: |
export TZ=UTC export TZ=UTC
INDIR=$HOME/build INDIR=$HOME/build
OPTFLAGS='-O2' OPTFLAGS='-O2'
TEMPDIR="$HOME/tempdir"
NEEDDIST=1 NEEDDIST=1
# Qt: workaround for determinism in resource ordering # Qt: workaround for determinism in resource ordering
# Qt5's rcc uses a QHash to store the files for the resource. # Qt5's rcc uses a QHash to store the files for the resource.
@ -54,6 +55,7 @@ script: |
else else
HOST=x86_64-w64-mingw32 HOST=x86_64-w64-mingw32
fi fi
export PATH=$STAGING/host/bin:$PATH
mkdir -p $STAGING $BUILDDIR $BINDIR mkdir -p $STAGING $BUILDDIR $BINDIR
# #
cd $STAGING cd $STAGING
@ -63,22 +65,18 @@ script: |
unzip $INDIR/protobuf-win${BITS}-2.5.0-gitian-r4.zip unzip $INDIR/protobuf-win${BITS}-2.5.0-gitian-r4.zip
if [ "$NEEDDIST" == "1" ]; then if [ "$NEEDDIST" == "1" ]; then
# Make source code archive which is architecture independent so it only needs to be done once # Make source code archive which is architecture independent so it only needs to be done once
cd $HOME/build/ cd $HOME/build/bitcoin
cd bitcoin
export PATH=$STAGING/host/bin:$PATH
export TAR_OPTIONS=--mtime=`echo $REFERENCE_DATETIME | awk '{ print $1 }'`
./autogen.sh ./autogen.sh
./configure --bindir=$OUTDIR --prefix=$STAGING --host=$HOST --with-qt-plugindir=$STAGING/plugins --with-qt-incdir=$STAGING/include --with-qt-bindir=$STAGING/host/bin --with-boost=$STAGING --disable-maintainer-mode --with-protoc-bindir=$STAGING/host/bin --disable-dependency-tracking CPPFLAGS="-I$STAGING/include ${OPTFLAGS}" LDFLAGS="-L$STAGING/lib ${OPTFLAGS}" CXXFLAGS="-frandom-seed=bitcoin ${OPTFLAGS}" ./configure --bindir=$OUTDIR --prefix=$STAGING --host=$HOST --with-qt-plugindir=$STAGING/plugins --with-qt-incdir=$STAGING/include --with-qt-bindir=$STAGING/host/bin --with-boost=$STAGING --disable-maintainer-mode --with-protoc-bindir=$STAGING/host/bin --disable-dependency-tracking CPPFLAGS="-I$STAGING/include ${OPTFLAGS}" LDFLAGS="-L$STAGING/lib ${OPTFLAGS}" CXXFLAGS="-frandom-seed=bitcoin ${OPTFLAGS}"
make dist make dist
mkdir -p $OUTDIR/src DISTNAME=`echo bitcoin-*.tar.gz`
cp -f bitcoin-*.tar.* $OUTDIR/src
NEEDDIST=0 NEEDDIST=0
fi fi
# Build platform-dependent executables from source archive # Build platform-dependent executables from source archive
cd $BUILDDIR cd $BUILDDIR
mkdir -p distsrc mkdir -p distsrc
cd distsrc cd distsrc
tar --strip-components=1 -xf $HOME/build/bitcoin/bitcoin-*.tar.* tar --strip-components=1 -xf $HOME/build/bitcoin/$DISTNAME
./configure --bindir=$BINDIR --prefix=$STAGING --host=$HOST --with-qt-plugindir=$STAGING/plugins --with-qt-incdir=$STAGING/include --with-qt-bindir=$STAGING/host/bin --with-boost=$STAGING --disable-maintainer-mode --with-protoc-bindir=$STAGING/host/bin --disable-dependency-tracking CPPFLAGS="-I$STAGING/include ${OPTFLAGS}" LDFLAGS="-L$STAGING/lib ${OPTFLAGS}" CXXFLAGS="-frandom-seed=bitcoin ${OPTFLAGS}" ./configure --bindir=$BINDIR --prefix=$STAGING --host=$HOST --with-qt-plugindir=$STAGING/plugins --with-qt-incdir=$STAGING/include --with-qt-bindir=$STAGING/host/bin --with-boost=$STAGING --disable-maintainer-mode --with-protoc-bindir=$STAGING/host/bin --disable-dependency-tracking CPPFLAGS="-I$STAGING/include ${OPTFLAGS}" LDFLAGS="-L$STAGING/lib ${OPTFLAGS}" CXXFLAGS="-frandom-seed=bitcoin ${OPTFLAGS}"
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
@ -90,3 +88,10 @@ script: |
unset FAKETIME unset FAKETIME
done # for BITS in done # for BITS in
# sort distribution tar file and normalize user/group/mtime information for deterministic output
mkdir -p $OUTDIR/src
rm -rf $TEMPDIR
mkdir -p $TEMPDIR
cd $TEMPDIR
tar -xvf $HOME/build/bitcoin/$DISTNAME | sort | tar --no-recursion -cT /dev/stdin --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 --mtime="$REFERENCE_DATETIME" | gzip -n > $OUTDIR/src/$DISTNAME

Loading…
Cancel
Save