Skip to content

Commit

Permalink
Merge #7283: [gitian] Default reference_datetime to commit author date
Browse files Browse the repository at this point in the history
fa42a67 [gitian] hardcode datetime for depends (MarcoFalke)
fa58c76 [gitian] Default reference_datetime to commit author date (MarcoFalke)
  • Loading branch information
laanwj committed Jun 9, 2016
2 parents 172cd7f + fa42a67 commit fd9881a
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 22 deletions.
22 changes: 16 additions & 6 deletions contrib/gitian-descriptors/gitian-linux.yml
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ suites:
- "trusty" - "trusty"
architectures: architectures:
- "amd64" - "amd64"
packages: packages:
- "curl" - "curl"
- "g++-multilib" - "g++-multilib"
- "git-core" - "git-core"
Expand All @@ -18,7 +18,6 @@ packages:
- "binutils-gold" - "binutils-gold"
- "ca-certificates" - "ca-certificates"
- "python" - "python"
reference_datetime: "2016-01-01 00:00:00"
remotes: remotes:
- "url": "https://github.com/bitcoin/bitcoin.git" - "url": "https://github.com/bitcoin/bitcoin.git"
"dir": "bitcoin" "dir": "bitcoin"
Expand All @@ -45,36 +44,47 @@ script: |
mkdir -p ${BASE_CACHE} ${SOURCES_PATH} mkdir -p ${BASE_CACHE} ${SOURCES_PATH}
fi fi
# Create global faketime wrappers function create_global_faketime_wrappers {
for prog in ${FAKETIME_PROGS}; do for prog in ${FAKETIME_PROGS}; do
echo '#!/bin/bash' > ${WRAP_DIR}/${prog} echo '#!/bin/bash' > ${WRAP_DIR}/${prog}
echo "REAL=\`which -a ${prog} | grep -v ${WRAP_DIR}/${prog} | head -1\`" >> ${WRAP_DIR}/${prog} echo "REAL=\`which -a ${prog} | grep -v ${WRAP_DIR}/${prog} | head -1\`" >> ${WRAP_DIR}/${prog}
echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${prog} echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${prog}
echo "export FAKETIME=\"${REFERENCE_DATETIME}\"" >> ${WRAP_DIR}/${prog} echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${prog}
echo "\$REAL \$@" >> $WRAP_DIR/${prog} echo "\$REAL \$@" >> $WRAP_DIR/${prog}
chmod +x ${WRAP_DIR}/${prog} chmod +x ${WRAP_DIR}/${prog}
done done
}
# Create per-host faketime wrappers function create_per-host_faketime_wrappers {
for i in $HOSTS; do for i in $HOSTS; do
for prog in ${FAKETIME_HOST_PROGS}; do for prog in ${FAKETIME_HOST_PROGS}; do
echo '#!/bin/bash' > ${WRAP_DIR}/${i}-${prog} echo '#!/bin/bash' > ${WRAP_DIR}/${i}-${prog}
echo "REAL=\`which -a ${i}-${prog} | grep -v ${WRAP_DIR}/${i}-${prog} | head -1\`" >> ${WRAP_DIR}/${i}-${prog} echo "REAL=\`which -a ${i}-${prog} | grep -v ${WRAP_DIR}/${i}-${prog} | head -1\`" >> ${WRAP_DIR}/${i}-${prog}
echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${i}-${prog} echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${i}-${prog}
echo "export FAKETIME=\"${REFERENCE_DATETIME}\"" >> ${WRAP_DIR}/${i}-${prog} echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${i}-${prog}
echo "\$REAL \$@" >> $WRAP_DIR/${i}-${prog} echo "\$REAL \$@" >> $WRAP_DIR/${i}-${prog}
chmod +x ${WRAP_DIR}/${i}-${prog} chmod +x ${WRAP_DIR}/${i}-${prog}
done done
done done
}
export PATH=${WRAP_DIR}:${PATH} export PATH=${WRAP_DIR}:${PATH}
# Faketime for depends so intermediate results are comparable
create_global_faketime_wrappers "2000-01-01 12:00:00"
create_per-host_faketime_wrappers "2000-01-01 12:00:00"
cd bitcoin cd bitcoin
BASEPREFIX=`pwd`/depends BASEPREFIX=`pwd`/depends
# Build dependencies for each host # Build dependencies for each host
for i in $HOSTS; do for i in $HOSTS; do
make ${MAKEOPTS} -C ${BASEPREFIX} HOST="${i}" make ${MAKEOPTS} -C ${BASEPREFIX} HOST="${i}"
done done
# Faketime for binaries
create_global_faketime_wrappers "${REFERENCE_DATETIME}"
create_per-host_faketime_wrappers "${REFERENCE_DATETIME}"
# Create the release tarball using (arbitrarily) the first host # Create the release tarball using (arbitrarily) the first host
./autogen.sh ./autogen.sh
CONFIG_SITE=${BASEPREFIX}/`echo "${HOSTS}" | awk '{print $1;}'`/share/config.site ./configure --prefix=/ CONFIG_SITE=${BASEPREFIX}/`echo "${HOSTS}" | awk '{print $1;}'`/share/config.site ./configure --prefix=/
Expand Down
1 change: 0 additions & 1 deletion contrib/gitian-descriptors/gitian-osx-signer.yml
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ architectures:
- "amd64" - "amd64"
packages: packages:
- "faketime" - "faketime"
reference_datetime: "2016-01-01 00:00:00"
remotes: remotes:
- "url": "https://github.com/bitcoin-core/bitcoin-detached-sigs.git" - "url": "https://github.com/bitcoin-core/bitcoin-detached-sigs.git"
"dir": "signature" "dir": "signature"
Expand Down
22 changes: 16 additions & 6 deletions contrib/gitian-descriptors/gitian-osx.yml
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ suites:
- "trusty" - "trusty"
architectures: architectures:
- "amd64" - "amd64"
packages: packages:
- "ca-certificates" - "ca-certificates"
- "curl" - "curl"
- "g++" - "g++"
Expand All @@ -27,7 +27,6 @@ packages:
- "python-dev" - "python-dev"
- "python-setuptools" - "python-setuptools"
- "fonts-tuffy" - "fonts-tuffy"
reference_datetime: "2016-01-01 00:00:00"
remotes: remotes:
- "url": "https://github.com/bitcoin/bitcoin.git" - "url": "https://github.com/bitcoin/bitcoin.git"
"dir": "bitcoin" "dir": "bitcoin"
Expand All @@ -54,29 +53,36 @@ script: |
export ZERO_AR_DATE=1 export ZERO_AR_DATE=1
# Create global faketime wrappers function create_global_faketime_wrappers {
for prog in ${FAKETIME_PROGS}; do for prog in ${FAKETIME_PROGS}; do
echo '#!/bin/bash' > ${WRAP_DIR}/${prog} echo '#!/bin/bash' > ${WRAP_DIR}/${prog}
echo "REAL=\`which -a ${prog} | grep -v ${WRAP_DIR}/${prog} | head -1\`" >> ${WRAP_DIR}/${prog} echo "REAL=\`which -a ${prog} | grep -v ${WRAP_DIR}/${prog} | head -1\`" >> ${WRAP_DIR}/${prog}
echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${prog} echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${prog}
echo "export FAKETIME=\"${REFERENCE_DATETIME}\"" >> ${WRAP_DIR}/${prog} echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${prog}
echo "\$REAL \$@" >> $WRAP_DIR/${prog} echo "\$REAL \$@" >> $WRAP_DIR/${prog}
chmod +x ${WRAP_DIR}/${prog} chmod +x ${WRAP_DIR}/${prog}
done done
}
# Create per-host faketime wrappers function create_per-host_faketime_wrappers {
for i in $HOSTS; do for i in $HOSTS; do
for prog in ${FAKETIME_HOST_PROGS}; do for prog in ${FAKETIME_HOST_PROGS}; do
echo '#!/bin/bash' > ${WRAP_DIR}/${i}-${prog} echo '#!/bin/bash' > ${WRAP_DIR}/${i}-${prog}
echo "REAL=\`which -a ${i}-${prog} | grep -v ${WRAP_DIR}/${i}-${prog} | head -1\`" >> ${WRAP_DIR}/${i}-${prog} echo "REAL=\`which -a ${i}-${prog} | grep -v ${WRAP_DIR}/${i}-${prog} | head -1\`" >> ${WRAP_DIR}/${i}-${prog}
echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${i}-${prog} echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${i}-${prog}
echo "export FAKETIME=\"${REFERENCE_DATETIME}\"" >> ${WRAP_DIR}/${i}-${prog} echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${i}-${prog}
echo "\$REAL \$@" >> $WRAP_DIR/${i}-${prog} echo "\$REAL \$@" >> $WRAP_DIR/${i}-${prog}
chmod +x ${WRAP_DIR}/${i}-${prog} chmod +x ${WRAP_DIR}/${i}-${prog}
done done
done done
}
export PATH=${WRAP_DIR}:${PATH} export PATH=${WRAP_DIR}:${PATH}
# Faketime for depends so intermediate results are comparable
create_global_faketime_wrappers "2000-01-01 12:00:00"
create_per-host_faketime_wrappers "2000-01-01 12:00:00"
cd bitcoin cd bitcoin
BASEPREFIX=`pwd`/depends BASEPREFIX=`pwd`/depends
Expand All @@ -88,6 +94,10 @@ script: |
make ${MAKEOPTS} -C ${BASEPREFIX} HOST="${i}" make ${MAKEOPTS} -C ${BASEPREFIX} HOST="${i}"
done done
# Faketime for binaries
create_global_faketime_wrappers "${REFERENCE_DATETIME}"
create_per-host_faketime_wrappers "${REFERENCE_DATETIME}"
# Create the release tarball using (arbitrarily) the first host # Create the release tarball using (arbitrarily) the first host
./autogen.sh ./autogen.sh
CONFIG_SITE=${BASEPREFIX}/`echo "${HOSTS}" | awk '{print $1;}'`/share/config.site ./configure --prefix=/ CONFIG_SITE=${BASEPREFIX}/`echo "${HOSTS}" | awk '{print $1;}'`/share/config.site ./configure --prefix=/
Expand Down
1 change: 0 additions & 1 deletion contrib/gitian-descriptors/gitian-win-signer.yml
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ architectures:
packages: packages:
- "libssl-dev" - "libssl-dev"
- "autoconf" - "autoconf"
reference_datetime: "2016-01-01 00:00:00"
remotes: remotes:
- "url": "https://github.com/bitcoin-core/bitcoin-detached-sigs.git" - "url": "https://github.com/bitcoin-core/bitcoin-detached-sigs.git"
"dir": "signature" "dir": "signature"
Expand Down
28 changes: 20 additions & 8 deletions contrib/gitian-descriptors/gitian-win.yml
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ suites:
- "trusty" - "trusty"
architectures: architectures:
- "amd64" - "amd64"
packages: packages:
- "curl" - "curl"
- "g++" - "g++"
- "git-core" - "git-core"
Expand All @@ -21,7 +21,6 @@ packages:
- "zip" - "zip"
- "ca-certificates" - "ca-certificates"
- "python" - "python"
reference_datetime: "2016-01-01 00:00:00"
remotes: remotes:
- "url": "https://github.com/bitcoin/bitcoin.git" - "url": "https://github.com/bitcoin/bitcoin.git"
"dir": "bitcoin" "dir": "bitcoin"
Expand All @@ -47,29 +46,31 @@ script: |
mkdir -p ${BASE_CACHE} ${SOURCES_PATH} mkdir -p ${BASE_CACHE} ${SOURCES_PATH}
fi fi
# Create global faketime wrappers function create_global_faketime_wrappers {
for prog in ${FAKETIME_PROGS}; do for prog in ${FAKETIME_PROGS}; do
echo '#!/bin/bash' > ${WRAP_DIR}/${prog} echo '#!/bin/bash' > ${WRAP_DIR}/${prog}
echo "REAL=\`which -a ${prog} | grep -v ${WRAP_DIR}/${prog} | head -1\`" >> ${WRAP_DIR}/${prog} echo "REAL=\`which -a ${prog} | grep -v ${WRAP_DIR}/${prog} | head -1\`" >> ${WRAP_DIR}/${prog}
echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${prog} echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${prog}
echo "export FAKETIME=\"${REFERENCE_DATETIME}\"" >> ${WRAP_DIR}/${prog} echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${prog}
echo "\$REAL \$@" >> $WRAP_DIR/${prog} echo "\$REAL \$@" >> $WRAP_DIR/${prog}
chmod +x ${WRAP_DIR}/${prog} chmod +x ${WRAP_DIR}/${prog}
done done
}
# Create per-host faketime wrappers function create_per-host_faketime_wrappers {
for i in $HOSTS; do for i in $HOSTS; do
for prog in ${FAKETIME_HOST_PROGS}; do for prog in ${FAKETIME_HOST_PROGS}; do
echo '#!/bin/bash' > ${WRAP_DIR}/${i}-${prog} echo '#!/bin/bash' > ${WRAP_DIR}/${i}-${prog}
echo "REAL=\`which -a ${i}-${prog} | grep -v ${WRAP_DIR}/${i}-${prog} | head -1\`" >> ${WRAP_DIR}/${i}-${prog} echo "REAL=\`which -a ${i}-${prog} | grep -v ${WRAP_DIR}/${i}-${prog} | head -1\`" >> ${WRAP_DIR}/${i}-${prog}
echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${i}-${prog} echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${i}-${prog}
echo "export FAKETIME=\"${REFERENCE_DATETIME}\"" >> ${WRAP_DIR}/${i}-${prog} echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${i}-${prog}
echo "\$REAL \$@" >> $WRAP_DIR/${i}-${prog} echo "\$REAL \$@" >> $WRAP_DIR/${i}-${prog}
chmod +x ${WRAP_DIR}/${i}-${prog} chmod +x ${WRAP_DIR}/${i}-${prog}
done done
done done
}
# Create per-host linker wrapper function create_per-host_linker_wrapper {
# This is only needed for trusty, as the mingw linker leaks a few bytes of # This is only needed for trusty, as the mingw linker leaks a few bytes of
# heap, causing non-determinism. See discussion in https://github.com/bitcoin/bitcoin/pull/6900 # heap, causing non-determinism. See discussion in https://github.com/bitcoin/bitcoin/pull/6900
for i in $HOSTS; do for i in $HOSTS; do
Expand All @@ -85,22 +86,33 @@ script: |
echo '#!/bin/bash' > ${WRAP_DIR}/${i}-${prog} echo '#!/bin/bash' > ${WRAP_DIR}/${i}-${prog}
echo "REAL=\`which -a ${i}-${prog} | grep -v ${WRAP_DIR}/${i}-${prog} | head -1\`" >> ${WRAP_DIR}/${i}-${prog} echo "REAL=\`which -a ${i}-${prog} | grep -v ${WRAP_DIR}/${i}-${prog} | head -1\`" >> ${WRAP_DIR}/${i}-${prog}
echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${i}-${prog} echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${i}-${prog}
echo "export FAKETIME=\"${REFERENCE_DATETIME}\"" >> ${WRAP_DIR}/${i}-${prog} echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${i}-${prog}
echo "export COMPILER_PATH=${WRAP_DIR}/${i}" >> ${WRAP_DIR}/${i}-${prog} echo "export COMPILER_PATH=${WRAP_DIR}/${i}" >> ${WRAP_DIR}/${i}-${prog}
echo "\$REAL \$@" >> $WRAP_DIR/${i}-${prog} echo "\$REAL \$@" >> $WRAP_DIR/${i}-${prog}
chmod +x ${WRAP_DIR}/${i}-${prog} chmod +x ${WRAP_DIR}/${i}-${prog}
done done
done done
}
export PATH=${WRAP_DIR}:${PATH} export PATH=${WRAP_DIR}:${PATH}
# Faketime for depends so intermediate results are comparable
create_global_faketime_wrappers "2000-01-01 12:00:00"
create_per-host_faketime_wrappers "2000-01-01 12:00:00"
create_per-host_linker_wrapper "2000-01-01 12:00:00"
cd bitcoin cd bitcoin
BASEPREFIX=`pwd`/depends BASEPREFIX=`pwd`/depends
# Build dependencies for each host # Build dependencies for each host
for i in $HOSTS; do for i in $HOSTS; do
make ${MAKEOPTS} -C ${BASEPREFIX} HOST="${i}" make ${MAKEOPTS} -C ${BASEPREFIX} HOST="${i}"
done done
# Faketime for binaries
create_global_faketime_wrappers "${REFERENCE_DATETIME}"
create_per-host_faketime_wrappers "${REFERENCE_DATETIME}"
create_per-host_linker_wrapper "${REFERENCE_DATETIME}"
# Create the release tarball using (arbitrarily) the first host # Create the release tarball using (arbitrarily) the first host
./autogen.sh ./autogen.sh
CONFIG_SITE=${BASEPREFIX}/`echo "${HOSTS}" | awk '{print $1;}'`/share/config.site ./configure --prefix=/ CONFIG_SITE=${BASEPREFIX}/`echo "${HOSTS}" | awk '{print $1;}'`/share/config.site ./configure --prefix=/
Expand Down

0 comments on commit fd9881a

Please sign in to comment.