aboutsummaryrefslogtreecommitdiff
path: root/contrib/gitian
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/gitian')
-rw-r--r--contrib/gitian/README.md11
-rw-r--r--contrib/gitian/gitian-android.yml16
-rwxr-xr-xcontrib/gitian/gitian-build.py82
-rw-r--r--contrib/gitian/gitian-freebsd.yml133
-rw-r--r--contrib/gitian/gitian-linux.yml51
-rw-r--r--contrib/gitian/gitian-osx.yml5
-rw-r--r--contrib/gitian/gitian-win.yml47
7 files changed, 227 insertions, 118 deletions
diff --git a/contrib/gitian/README.md b/contrib/gitian/README.md
index 4fa393283..7e3502bcf 100644
--- a/contrib/gitian/README.md
+++ b/contrib/gitian/README.md
@@ -167,13 +167,12 @@ If all went well, this produces a number of (uncommitted) `.assert` files in the
Checking your work
------------------
-Take a look in the assert files and note the SHA256 checksums listed there. eg for `v0.15.0.0` you should get this checksum:
+Take a look in the assert files and note the SHA256 checksums listed there.
-```
-2b95118f53d98d542a85f8732b84ba13b3cd20517ccb40332b0edd0ddf4f8c62 monero-x86_64-linux-gnu.tar.gz
-```
+You should verify that the checksum that is listed matches each of the binaries you actually built.
+This may be done on Linux using the `sha256sum` command or on MacOS using `shasum --algorithm 256` for example.
-You should verify that this is really the checksum you get on that file you built. You can also look in the gitian.sigs repo and / or [getmonero.org release checksums](https://web.getmonero.org/downloads/hashes.txt) to see if others got the same checksum for the same version tag. If there is ever a mismatch -- **STOP! Something is wrong**. Contact others on IRC / github to figure out what is going on.
+You can also look in the [gitian.sigs](https://github.com/monero-project/gitian.sigs/) repo and / or [getmonero.org release checksums](https://web.getmonero.org/downloads/hashes.txt) to see if others got the same checksum for the same version tag. If there is ever a mismatch -- **STOP! Something is wrong**. Contact others on IRC / github to figure out what is going on.
Signing assert files
@@ -188,8 +187,8 @@ VERSION=v0.15.0.0
gpg --detach-sign ${VERSION}-linux/${GH_USER}/monero-linux-*-build.assert
gpg --detach-sign ${VERSION}-win/${GH_USER}/monero-win-*-build.assert
gpg --detach-sign ${VERSION}-osx/${GH_USER}/monero-osx-*-build.assert
+gpg --detach-sign ${VERSION}-android/${GH_USER}/monero-android-*-build.assert
```
-<!-- TODO: Replace * above with ${VERSION} once gitian builds correct file name -->
This will create a `.sig` file for each `.assert` file above (2 files for each platform).
diff --git a/contrib/gitian/gitian-android.yml b/contrib/gitian/gitian-android.yml
index ce213e056..02614b1a5 100644
--- a/contrib/gitian/gitian-android.yml
+++ b/contrib/gitian/gitian-android.yml
@@ -39,14 +39,13 @@ script: |
WRAP_DIR=$HOME/wrapped
HOSTS="arm-linux-android aarch64-linux-android"
- FAKETIME_HOST_PROGS="clang clang++ ar ranlib nm"
+ FAKETIME_HOST_PROGS="clang clang++ ar nm"
FAKETIME_PROGS="date"
HOST_CFLAGS="-O2 -g"
HOST_CXXFLAGS="-O2 -g"
HOST_LDFLAGS=-static-libstdc++
export GZIP="-9n"
- export TAR_OPTIONS="--mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME""
export TZ="UTC"
export BUILD_DIR=`pwd`
mkdir -p ${WRAP_DIR}
@@ -89,14 +88,13 @@ script: |
}
# Faketime for depends so intermediate results are comparable
- DUMMYTIME="2000-01-01 12:00:00"
export PATH_orig=${PATH}
- create_global_faketime_wrappers "$DUMMYTIME"
- create_per-host_faketime_wrappers "$DUMMYTIME"
+ create_global_faketime_wrappers "2000-01-01 12:00:00"
+ create_per-host_faketime_wrappers "2000-01-01 12:00:00"
export PATH=${WRAP_DIR}:${PATH}
# gcc 7+ honors SOURCE_DATE_EPOCH, no faketime needed
- export SOURCE_DATE_EPOCH=`date -d "$DUMMYTIME" +%s`
+ export SOURCE_DATE_EPOCH=`date -d 2000-01-01T12:00:00 +%s`
git config --global core.abbrev 9
cd monero
@@ -109,6 +107,7 @@ script: |
BASEPREFIX=`pwd`/contrib/depends
# Build dependencies for each host
+ export TAR_OPTIONS=--mtime=2000-01-01T12:00:00
for i in $HOSTS; do
make ${MAKEOPTS} -C ${BASEPREFIX} HOST="${i}"
done
@@ -117,12 +116,11 @@ script: |
export PATH=${PATH_orig}
create_global_faketime_wrappers "${REFERENCE_DATETIME}"
create_per-host_faketime_wrappers "${REFERENCE_DATETIME}"
- export PATH=${WRAP_DIR}:${PATH}
- ORIGPATH="$PATH"
# Build in a new dir for each host
+ export TAR_OPTIONS=--mtime=${REFERENCE_DATE}T${REFERENCE_TIME}
for i in ${HOSTS}; do
- export PATH=${BASEPREFIX}/${i}/native/bin:${ORIGPATH}
+ export PATH=${WRAP_DIR}:${BASEPREFIX}/${i}/native/bin:${PATH_orig}
mkdir build && cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=${BASEPREFIX}/${i}/share/toolchain.cmake -DCMAKE_BUILD_TYPE=Release
make ${MAKEOPTS}
diff --git a/contrib/gitian/gitian-build.py b/contrib/gitian/gitian-build.py
index b60cc9309..64eb218bb 100755
--- a/contrib/gitian/gitian-build.py
+++ b/contrib/gitian/gitian-build.py
@@ -8,6 +8,12 @@ import sys
gsigs = 'https://github.com/monero-project/gitian.sigs.git'
gbrepo = 'https://github.com/devrandom/gitian-builder.git'
+platforms = {'l': ['Linux', 'linux', 'tar.bz2'],
+ 'a': ['Android', 'android', 'tar.bz2'],
+ 'f': ['FreeBSD', 'freebsd', 'tar.bz2'],
+ 'w': ['Windows', 'win', 'zip'],
+ 'm': ['MacOS', 'osx', 'tar.bz2'] }
+
def setup():
global args, workdir
programs = ['apt-cacher-ng', 'ruby', 'git', 'make', 'wget']
@@ -22,11 +28,7 @@ def setup():
if not os.path.isdir('builder'):
subprocess.check_call(['git', 'clone', gbrepo, 'builder'])
os.chdir('builder')
- subprocess.check_call(['git', 'config', 'user.email', 'gitianuser@localhost'])
- subprocess.check_call(['git', 'config', 'user.name', 'gitianuser'])
- subprocess.check_call(['git', 'checkout', '963322de8420c50502c4cc33d4d7c0d84437b576'])
- subprocess.check_call(['git', 'fetch', 'origin', '72c51f0bd2adec4eedab4dbd06c9229b9c4eb0e3'])
- subprocess.check_call(['git', 'cherry-pick', '72c51f0bd2adec4eedab4dbd06c9229b9c4eb0e3'])
+ subprocess.check_call(['git', 'checkout', 'c0f77ca018cb5332bfd595e0aff0468f77542c23'])
os.makedirs('inputs', exist_ok=True)
os.chdir('inputs')
if not os.path.isdir('monero'):
@@ -52,39 +54,32 @@ def rebuild():
print('\nBuilding Dependencies\n')
os.makedirs('../out/' + args.version, exist_ok=True)
- if args.linux:
- print('\nCompiling ' + args.version + ' Linux')
- subprocess.check_call(['bin/gbuild', '-j', args.jobs, '-m', args.memory, '--commit', 'monero='+args.commit, '--url', 'monero='+args.url, 'inputs/monero/contrib/gitian/gitian-linux.yml'])
- subprocess.check_call(['bin/gsign', '-p', args.sign_prog, '--signer', args.signer, '--release', args.version+'-linux', '--destination', '../sigs/', 'inputs/monero/contrib/gitian/gitian-linux.yml'])
- subprocess.check_call('mv build/out/monero-*.tar.bz2 ../out/'+args.version, shell=True)
-
- if args.android:
- print('\nCompiling ' + args.version + ' Android')
- subprocess.check_call(['bin/gbuild', '-j', args.jobs, '-m', args.memory, '--commit', 'monero='+args.commit, '--url', 'monero='+args.url, 'inputs/monero/contrib/gitian/gitian-android.yml'])
- subprocess.check_call(['bin/gsign', '-p', args.sign_prog, '--signer', args.signer, '--release', args.version+'-android', '--destination', '../sigs/', 'inputs/monero/contrib/gitian/gitian-android.yml'])
- subprocess.check_call('mv build/out/monero-*.tar.bz2 ../out/'+args.version, shell=True)
-
- if args.windows:
- print('\nCompiling ' + args.version + ' Windows')
- subprocess.check_call(['bin/gbuild', '-j', args.jobs, '-m', args.memory, '--commit', 'monero='+args.commit, '--url', 'monero='+args.url, 'inputs/monero/contrib/gitian/gitian-win.yml'])
- subprocess.check_call(['bin/gsign', '-p', args.sign_prog, '--signer', args.signer, '--release', args.version+'-win', '--destination', '../sigs/', 'inputs/monero/contrib/gitian/gitian-win.yml'])
- subprocess.check_call('mv build/out/monero*.zip ../out/'+args.version, shell=True)
-
- if args.macos:
- print('\nCompiling ' + args.version + ' MacOS')
- subprocess.check_call(['bin/gbuild', '-j', args.jobs, '-m', args.memory, '--commit', 'monero='+args.commit, '--url', 'monero'+args.url, 'inputs/monero/contrib/gitian/gitian-osx.yml'])
- subprocess.check_call(['bin/gsign', '-p', args.sign_prog, '--signer', args.signer, '--release', args.version+'-osx', '--destination', '../sigs/', 'inputs/monero/contrib/gitian/gitian-osx.yml'])
- subprocess.check_call('mv build/out/monero*.tar.bz2 ../out/'+args.version, shell=True)
+
+ for i in args.os:
+ if i is 'm' and args.nomac:
+ continue
+
+ os_name = platforms[i][0]
+ tag_name = platforms[i][1]
+ suffix = platforms[i][2]
+
+ print('\nCompiling ' + args.version + ' ' + os_name)
+ infile = 'inputs/monero/contrib/gitian/gitian-' + tag_name + '.yml'
+ subprocess.check_call(['bin/gbuild', '-j', args.jobs, '-m', args.memory, '--commit', 'monero='+args.commit, '--url', 'monero='+args.url, infile])
+ subprocess.check_call(['bin/gsign', '-p', args.sign_prog, '--signer', args.signer, '--release', args.version+'-linux', '--destination', '../sigs/', infile])
+ subprocess.check_call('mv build/out/monero-*.' + suffix + ' ../out/'+args.version, shell=True)
+ print('Moving var/install.log to var/install-' + tag_name + '.log')
+ subprocess.check_call('mv var/install.log var/install-' + tag_name + '.log', shell=True)
+ print('Moving var/build.log to var/build-' + tag_name + '.log')
+ subprocess.check_call('mv var/build.log var/build-' + tag_name + '.log', shell=True)
os.chdir(workdir)
if args.commit_files:
print('\nCommitting '+args.version+' Unsigned Sigs\n')
os.chdir('sigs')
- subprocess.check_call(['git', 'add', args.version+'-linux/'+args.signer])
- subprocess.check_call(['git', 'add', args.version+'-android/'+args.signer])
- subprocess.check_call(['git', 'add', args.version+'-win/'+args.signer])
- subprocess.check_call(['git', 'add', args.version+'-osx/'+args.signer])
+ for i, v in platforms:
+ subprocess.check_call(['git', 'add', args.version+'-'+v[1]+'/'+args.signer])
subprocess.check_call(['git', 'commit', '-m', 'Add '+args.version+' unsigned sigs for '+args.signer])
os.chdir(workdir)
@@ -109,14 +104,9 @@ def verify():
global args, workdir
os.chdir('builder')
- print('\nVerifying v'+args.version+' Linux\n')
- subprocess.check_call(['bin/gverify', '-v', '-d', '../sigs/', '-r', args.version+'-linux', 'inputs/monero/contrib/gitian/gitian-linux.yml'])
- print('\nVerifying v'+args.version+' Android\n')
- subprocess.check_call(['bin/gverify', '-v', '-d', '../sigs/', '-r', args.version+'-android', 'inputs/monero/contrib/gitian/gitian-android.yml'])
- print('\nVerifying v'+args.version+' Windows\n')
- subprocess.check_call(['bin/gverify', '-v', '-d', '../sigs/', '-r', args.version+'-win', 'inputs/monero/contrib/gitian/gitian-win.yml'])
- print('\nVerifying v'+args.version+' MacOS\n')
- subprocess.check_call(['bin/gverify', '-v', '-d', '../sigs/', '-r', args.version+'-osx', 'inputs/monero/contrib/gitian/gitian-osx.yml'])
+ for i, v in platforms:
+ print('\nVerifying v'+args.version+' '+v[0]+'\n')
+ subprocess.check_call(['bin/gverify', '-v', '-d', '../sigs/', '-r', args.version+'-'+v[1], 'inputs/monero/contrib/gitian/gitian-'+v[1]+'.yml'])
os.chdir(workdir)
def main():
@@ -129,7 +119,7 @@ def main():
parser.add_argument('-v', '--verify', action='store_true', dest='verify', help='Verify the Gitian build')
parser.add_argument('-b', '--build', action='store_true', dest='build', help='Do a Gitian build')
parser.add_argument('-B', '--buildsign', action='store_true', dest='buildsign', help='Build both signed and unsigned binaries')
- parser.add_argument('-o', '--os', dest='os', default='lawm', help='Specify which Operating Systems the build is for. Default is %(default)s. l for Linux, a for Android, w for Windows, m for MacOS')
+ parser.add_argument('-o', '--os', dest='os', default='lafwm', help='Specify which Operating Systems the build is for. Default is %(default)s. l for Linux, a for Android, f for FreeBSD, w for Windows, m for MacOS')
parser.add_argument('-r', '--rebuild', action='store_true', dest='rebuild', help='Redo a Gitian build')
parser.add_argument('-R', '--rebuildsign', action='store_true', dest='rebuildsign', help='Redo and sign a Gitian build')
parser.add_argument('-j', '--jobs', dest='jobs', default='2', help='Number of processes to use. Default %(default)s')
@@ -146,11 +136,6 @@ def main():
args = parser.parse_args()
workdir = os.getcwd()
- args.linux = 'l' in args.os
- args.android = 'a' in args.os
- args.windows = 'w' in args.os
- args.macos = 'm' in args.os
-
args.is_bionic = b'bionic' in subprocess.check_output(['lsb_release', '-cs'])
if args.buildsign:
@@ -177,10 +162,11 @@ def main():
os.environ['LXC_GUEST_IP'] = '10.0.3.5'
# Disable MacOS build if no SDK found
- if args.macos and not os.path.isfile('builder/inputs/MacOSX10.11.sdk.tar.gz'):
- args.macos = False
+ args.nomac = False
+ if 'm' in args.os and not os.path.isfile('builder/inputs/MacOSX10.11.sdk.tar.gz'):
if args.build:
print('Cannot build for MacOS, SDK does not exist. Will build for other OSes')
+ args.nomac = True
script_name = os.path.basename(sys.argv[0])
# Signer and version shouldn't be empty
diff --git a/contrib/gitian/gitian-freebsd.yml b/contrib/gitian/gitian-freebsd.yml
new file mode 100644
index 000000000..0220b82a5
--- /dev/null
+++ b/contrib/gitian/gitian-freebsd.yml
@@ -0,0 +1,133 @@
+---
+name: "monero-freebsd-0.15"
+enable_cache: true
+suites:
+- "bionic"
+architectures:
+- "amd64"
+packages:
+- "curl"
+- "clang-8"
+- "gperf"
+- "gcc-7"
+- "g++-7"
+- "gcc"
+- "g++"
+- "binutils-gold"
+- "git"
+- "pkg-config"
+- "build-essential"
+- "autoconf"
+- "libtool"
+- "automake"
+- "faketime"
+- "bsdmainutils"
+- "ca-certificates"
+- "python"
+- "cmake"
+- "ccache"
+- "protobuf-compiler"
+- "libdbus-1-dev"
+- "libharfbuzz-dev"
+- "libprotobuf-dev"
+- "python3-zmq"
+remotes:
+- "url": "https://github.com/monero-project/monero.git"
+ "dir": "monero"
+files: []
+script: |
+
+ WRAP_DIR=$HOME/wrapped
+ HOSTS="x86_64-unknown-freebsd"
+ FAKETIME_HOST_PROGS=""
+ FAKETIME_PROGS="clang-8 clang++-8 date"
+ HOST_CFLAGS="-O2 -g"
+ HOST_CXXFLAGS="-O2 -g"
+ HOST_LDFLAGS=-static-libstdc++
+
+ export GZIP="-9n"
+ export TZ="UTC"
+ export BUILD_DIR=`pwd`
+ mkdir -p ${WRAP_DIR}
+ if test -n "$GBUILD_CACHE_ENABLED"; then
+ export SOURCES_PATH=${GBUILD_COMMON_CACHE}
+ export BASE_CACHE=${GBUILD_PACKAGE_CACHE}
+ mkdir -p ${BASE_CACHE} ${SOURCES_PATH}
+ fi
+
+ export ZERO_AR_DATE=1
+
+ function create_global_faketime_wrappers {
+ for prog in ${FAKETIME_PROGS}; do
+ echo '#!/usr/bin/env bash' > ${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 FAKETIME=\"$1\"" >> ${WRAP_DIR}/${prog}
+ echo "\$REAL \$@" >> $WRAP_DIR/${prog}
+ chmod +x ${WRAP_DIR}/${prog}
+ done
+ }
+
+ function create_per-host_faketime_wrappers {
+ for i in $HOSTS; do
+ for prog in ${FAKETIME_HOST_PROGS}; do
+ WRAPPER=${WRAP_DIR}/${i}-${prog}
+ echo '#!/usr/bin/env bash' > ${WRAPPER}
+ echo "REAL=\`which -a ${i}-${prog} | grep -v ${WRAP_DIR}/${i}-${prog} | head -1\`" >> ${WRAPPER}
+ echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAPPER}
+ echo "export FAKETIME=\"$1\"" >> ${WRAPPER}
+ echo "$NDKDIR/${ABI}-$prog \$@" >> ${WRAPPER}
+ chmod +x ${WRAPPER}
+ done
+ done
+ }
+
+ # Faketime for depends so intermediate results are comparable
+ export PATH_orig=${PATH}
+ create_global_faketime_wrappers "2000-01-01 12:00:00"
+ create_per-host_faketime_wrappers "2000-01-01 12:00:00"
+ export PATH=${WRAP_DIR}:${PATH}
+
+ # gcc 7+ honors SOURCE_DATE_EPOCH, no faketime needed
+ export SOURCE_DATE_EPOCH=`date -d 2000-01-01T12:00:00 +%s`
+
+ git config --global core.abbrev 9
+ cd monero
+ # Set the version string that gets added to the tar archive name
+ version="`git describe`"
+ if [[ $version == *"-"*"-"* ]]; then
+ version="`git rev-parse --short=9 HEAD`"
+ version="`echo $version | head -c 9`"
+ fi
+
+ BASEPREFIX=`pwd`/contrib/depends
+ # Build dependencies for each host
+ export TAR_OPTIONS=--mtime=2000-01-01T12:00:00
+ for i in $HOSTS; do
+ make ${MAKEOPTS} -C ${BASEPREFIX} HOST="${i}"
+ done
+
+ # Faketime for binaries
+ export PATH=${PATH_orig}
+ create_global_faketime_wrappers "${REFERENCE_DATETIME}"
+ create_per-host_faketime_wrappers "${REFERENCE_DATETIME}"
+
+ ORIGPATH="$PATH"
+ # Build in a new dir for each host
+ export SOURCE_DATE_EPOCH=`date -d ${REFERENCE_DATE}T${REFERENCE_TIME} +%s`
+ export TAR_OPTIONS=--mtime=${REFERENCE_DATE}T${REFERENCE_TIME}
+ for i in ${HOSTS}; do
+ export PATH=${WRAP_DIR}:${BASEPREFIX}/${i}/native/bin:${ORIGPATH}
+ mkdir build && cd build
+ cmake .. -DCMAKE_TOOLCHAIN_FILE=${BASEPREFIX}/${i}/share/toolchain.cmake -DCMAKE_BUILD_TYPE=Release
+ make ${MAKEOPTS}
+ chmod 755 bin/*
+ cp ../LICENSE bin
+ chmod 644 bin/LICENSE
+ DISTNAME=monero-${i}-${version}
+ mv bin ${DISTNAME}
+ find ${DISTNAME}/ | sort | tar --no-recursion --owner=0 --group=0 -c -T - | bzip2 -9 > ${OUTDIR}/${DISTNAME}.tar.bz2
+ cd ..
+ rm -rf build
+ done
+
diff --git a/contrib/gitian/gitian-linux.yml b/contrib/gitian/gitian-linux.yml
index d2124e45c..9c2ebac9b 100644
--- a/contrib/gitian/gitian-linux.yml
+++ b/contrib/gitian/gitian-linux.yml
@@ -50,14 +50,13 @@ script: |
WRAP_DIR=$HOME/wrapped
HOSTS="x86_64-linux-gnu arm-linux-gnueabihf aarch64-linux-gnu i686-linux-gnu"
- FAKETIME_HOST_PROGS="gcc g++"
- FAKETIME_PROGS="date ar ranlib nm"
+ FAKETIME_HOST_PROGS=""
+ FAKETIME_PROGS="date"
HOST_CFLAGS="-O2 -g"
HOST_CXXFLAGS="-O2 -g"
HOST_LDFLAGS=-static-libstdc++
export GZIP="-9n"
- export TAR_OPTIONS="--mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME""
export TZ="UTC"
export BUILD_DIR=`pwd`
mkdir -p ${WRAP_DIR}
@@ -105,29 +104,15 @@ script: |
# x86 needs /usr/include/i386-linux-gnu/asm pointed to /usr/include/x86_64-linux-gnu/asm,
# but we can't write there. Instead, create a link here and force it to be included in the
- # search paths by wrapping gcc/g++.
+ # search paths.
+ # This problem goes away if linux-libc-dev:i386 pkg exists, but it's not in bionic.
- mkdir -p $EXTRA_INCLUDES_BASE/i686-pc-linux-gnu
- rm -f $WRAP_DIR/extra_includes/i686-pc-linux-gnu/asm
- ln -s /usr/include/x86_64-linux-gnu/asm $EXTRA_INCLUDES_BASE/i686-pc-linux-gnu/asm
+ mkdir -p $EXTRA_INCLUDES_BASE/i686-linux-gnu
+ rm -f $WRAP_DIR/extra_includes/i686-linux-gnu/asm
+ ln -s /usr/include/x86_64-linux-gnu/asm $EXTRA_INCLUDES_BASE/i686-linux-gnu/asm
- for prog in gcc g++; do
- rm -f ${WRAP_DIR}/${prog}
- cat << EOF > ${WRAP_DIR}/${prog}
- #!/usr/bin/env bash
- REAL="`which -a ${prog}-7 | grep -v ${WRAP_DIR}/${prog} | head -1`"
- for var in "\$@"
- do
- if [ "\$var" = "-m32" ]; then
- export C_INCLUDE_PATH="$EXTRA_INCLUDES_BASE/i686-pc-linux-gnu"
- export CPLUS_INCLUDE_PATH="$EXTRA_INCLUDES_BASE/i686-pc-linux-gnu"
- break
- fi
- done
- \$REAL \$@
- EOF
- chmod +x ${WRAP_DIR}/${prog}
- done
+ # gcc 7+ honors SOURCE_DATE_EPOCH, no faketime needed
+ export SOURCE_DATE_EPOCH=`date -d 2000-01-01T12:00:00 +%s`
git config --global core.abbrev 9
cd monero
@@ -140,13 +125,17 @@ script: |
BASEPREFIX=`pwd`/contrib/depends
# Build dependencies for each host
+ export TAR_OPTIONS=--mtime=2000-01-01T12:00:00
for i in $HOSTS; do
EXTRA_INCLUDES="$EXTRA_INCLUDES_BASE/$i"
if [ -d "$EXTRA_INCLUDES" ]; then
- export HOST_ID_SALT="$EXTRA_INCLUDES"
+ export C_INCLUDE_PATH="$EXTRA_INCLUDES"
+ export CPLUS_INCLUDE_PATH="$EXTRA_INCLUDES"
+ else
+ unset C_INCLUDE_PATH
+ unset CPLUS_INCLUDE_PATH
fi
make ${MAKEOPTS} -C ${BASEPREFIX} HOST="${i}" V=1
- unset HOST_ID_SALT
done
# Faketime for binaries
@@ -157,9 +146,19 @@ script: |
ORIGPATH="$PATH"
# Build in a new dir for each host
+ export SOURCE_DATE_EPOCH=`date -d ${REFERENCE_DATE}T${REFERENCE_TIME} +%s`
+ export TAR_OPTIONS=--mtime=${REFERENCE_DATE}T${REFERENCE_TIME}
for i in ${HOSTS}; do
export PATH=${BASEPREFIX}/${i}/native/bin:${ORIGPATH}
mkdir build && cd build
+ EXTRA_INCLUDES="$EXTRA_INCLUDES_BASE/$i"
+ if [ -d "$EXTRA_INCLUDES" ]; then
+ export C_INCLUDE_PATH="$EXTRA_INCLUDES"
+ export CPLUS_INCLUDE_PATH="$EXTRA_INCLUDES"
+ else
+ unset C_INCLUDE_PATH
+ unset CPLUS_INCLUDE_PATH
+ fi
cmake .. -DCMAKE_TOOLCHAIN_FILE=${BASEPREFIX}/${i}/share/toolchain.cmake -DBACKCOMPAT=ON
make ${MAKEOPTS}
chmod 755 bin/*
diff --git a/contrib/gitian/gitian-osx.yml b/contrib/gitian/gitian-osx.yml
index 1f9928bb5..ecc7d4b59 100644
--- a/contrib/gitian/gitian-osx.yml
+++ b/contrib/gitian/gitian-osx.yml
@@ -32,10 +32,9 @@ script: |
WRAP_DIR=$HOME/wrapped
HOSTS="x86_64-apple-darwin11"
FAKETIME_HOST_PROGS=""
- FAKETIME_PROGS="ar ranlib date dmg genisoimage"
+ FAKETIME_PROGS="ar ranlib date dmg genisoimage python"
export GZIP="-9n"
- export TAR_OPTIONS="--mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME""
export TZ="UTC"
export BUILD_DIR=`pwd`
mkdir -p ${WRAP_DIR}
@@ -92,6 +91,7 @@ script: |
tar -C ${BASEPREFIX}/SDKs -xf ${BUILD_DIR}/MacOSX10.11.sdk.tar.gz
# Build dependencies for each host
+ export TAR_OPTIONS=--mtime=2000-01-01T12:00:00
for i in $HOSTS; do
make ${MAKEOPTS} -C ${BASEPREFIX} HOST="${i}"
done
@@ -104,6 +104,7 @@ script: |
ORIGPATH="$PATH"
# Build in a new dir for each host
+ export TAR_OPTIONS=--mtime=${REFERENCE_DATE}T${REFERENCE_TIME}
for i in ${HOSTS}; do
export PATH=${BASEPREFIX}/${i}/native/bin:${ORIGPATH}
mkdir build && cd build
diff --git a/contrib/gitian/gitian-win.yml b/contrib/gitian/gitian-win.yml
index 7bfb14a95..bd85695c1 100644
--- a/contrib/gitian/gitian-win.yml
+++ b/contrib/gitian/gitian-win.yml
@@ -22,6 +22,19 @@ packages:
- "python"
- "rename"
- "cmake"
+alternatives:
+-
+ package: "i686-w64-mingw32-g++"
+ path: "/usr/bin/i686-w64-mingw32-g++-posix"
+-
+ package: "i686-w64-mingw32-gcc"
+ path: "/usr/bin/i686-w64-mingw32-gcc-posix"
+-
+ package: "x86_64-w64-mingw32-g++"
+ path: "/usr/bin/x86_64-w64-mingw32-g++-posix"
+-
+ package: "x86_64-w64-mingw32-gcc"
+ path: "/usr/bin/x86_64-w64-mingw32-gcc-posix"
remotes:
- "url": "https://github.com/monero-project/monero.git"
"dir": "monero"
@@ -29,13 +42,12 @@ files: []
script: |
WRAP_DIR=$HOME/wrapped
HOSTS="i686-w64-mingw32 x86_64-w64-mingw32"
- FAKETIME_HOST_PROGS="ar ranlib nm windres strip objcopy"
+ FAKETIME_HOST_PROGS="windres objcopy"
FAKETIME_PROGS="date zip"
HOST_CFLAGS="-O2 -g"
HOST_CXXFLAGS="-O2 -g"
export GZIP="-9n"
- export TAR_OPTIONS="--mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME""
export TZ="UTC"
export BUILD_DIR=`pwd`
mkdir -p ${WRAP_DIR}
@@ -69,37 +81,15 @@ script: |
done
}
- function create_per-host_linker_wrapper {
- # 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
- for i in $HOSTS; do
- mkdir -p ${WRAP_DIR}/${i}
- for prog in collect2; do
- echo '#!/usr/bin/env bash' > ${WRAP_DIR}/${i}/${prog}
- REAL=$(${i}-gcc -print-prog-name=${prog})
- echo "export MALLOC_PERTURB_=255" >> ${WRAP_DIR}/${i}/${prog}
- echo "${REAL} \$@" >> $WRAP_DIR/${i}/${prog}
- chmod +x ${WRAP_DIR}/${i}/${prog}
- done
- for prog in gcc g++; do
- echo '#!/usr/bin/env bash' > ${WRAP_DIR}/${i}-${prog}
- echo "REAL=\`which -a ${i}-${prog}-posix | 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 FAKETIME=\"$1\"" >> ${WRAP_DIR}/${i}-${prog}
- echo "export COMPILER_PATH=${WRAP_DIR}/${i}" >> ${WRAP_DIR}/${i}-${prog}
- echo "\$REAL \$@" >> $WRAP_DIR/${i}-${prog}
- chmod +x ${WRAP_DIR}/${i}-${prog}
- done
- done
- }
-
# Faketime for depends so intermediate results are comparable
export PATH_orig=${PATH}
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"
export PATH=${WRAP_DIR}:${PATH}
+ # gcc 7+ honors SOURCE_DATE_EPOCH, no faketime needed
+ export SOURCE_DATE_EPOCH=`date -d 2000-01-01T12:00:00 +%s`
+
git config --global core.abbrev 9
cd monero
# Set the version string that gets added to the tar archive name
@@ -111,6 +101,7 @@ script: |
BASEPREFIX=`pwd`/contrib/depends
# Build dependencies for each host
+ export TAR_OPTIONS=--mtime=2000-01-01T12:00:00
for i in $HOSTS; do
EXTRA_INCLUDES="$EXTRA_INCLUDES_BASE/$i"
if [ -d "$EXTRA_INCLUDES" ]; then
@@ -129,6 +120,8 @@ script: |
ORIGPATH="$PATH"
# Run cmake and make, for each create a new build/ directory,
# compile from there, archive, export and delete the archive again
+ export SOURCE_DATE_EPOCH=`date -d ${REFERENCE_DATE}T${REFERENCE_TIME} +%s`
+ export TAR_OPTIONS=--mtime=${REFERENCE_DATE}T${REFERENCE_TIME}
for i in ${HOSTS}; do
export PATH=${BASEPREFIX}/${i}/native/bin:${ORIGPATH}
mkdir build && cd build