Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gitian build flow #226

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
32 changes: 13 additions & 19 deletions contrib/gitian-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
sign=false
verify=false
build=false
setupenv=false

# Systems to build
linux=true
Expand All @@ -22,21 +21,18 @@ proc=2
mem=2000
lxc=true
osslTarUrl=http://downloads.sourceforge.net/project/osslsigncode/osslsigncode/osslsigncode-1.7.1.tar.gz
osslPatchUrl=https://meritcore.org/cfields/osslsigncode-Backports-to-1.7.1.patch
osslPatchUrl=https://bitcoincore.org/cfields/osslsigncode-Backports-to-1.7.1.patch
scriptName=$(basename -- "$0")
signProg="gpg --detach-sign"
commitFiles=true

# Help Message
read -d '' usage <<- EOF
Usage: $scriptName [-c|u|v|b|s|B|o|h|j|m|] signer version

Run this script from the directory containing the merit, gitian-builder, gitian.sigs, and merit-detached-sigs.

Arguments:
signer GPG signer to sign each build assert file
version Version number, commit, or branch to build. If building a commit or branch, the -c option must be specified

Options:
-c|--commit Indicate that the version argument is for a commit or branch
-u|--url Specify the URL of the repository. Default is https://github.com/meritlabs/merit
Expand All @@ -48,7 +44,7 @@ Options:
-j Number of processes to use. Default 2
-m Memory to allocate in MiB. Default 2000
--kvm Use KVM instead of LXC
--setup Set up the Gitian building environment. Uses KVM. If you want to use lxc, use the --lxc option. Only works on Debian-based systems (Ubuntu, Debian)
--setup Set up the Gitian building environment. Uses LXC. If you want to use KVM, use the --kvm option. Only works on Debian-based systems (Ubuntu, Debian)
--detach-sign Create the assert file for detached signing. Will not commit anything.
--no-commit Do not commit anything to git
-h|--help Print this help message
Expand Down Expand Up @@ -106,7 +102,7 @@ while :; do
fi
shift
else
echo 'Error: "--os" requires an argument containing an l (for linux), w (for windows), or x (for Mac OSX)\n'
echo 'Error: "--os" requires an argument containing an l (for linux), w (for windows), or x (for Mac OSX)'
exit 1
fi
;;
Expand Down Expand Up @@ -179,8 +175,6 @@ done
if [[ $lxc = true ]]
then
export USE_LXC=1
export LXC_BRIDGE=lxcbr0
sudo ifconfig lxcbr0 up 10.0.2.2
fi

# Check for OSX SDK
Expand All @@ -191,7 +185,7 @@ then
fi

# Get signer
if [[ -n"$1" ]]
if [[ -n "$1" ]]
then
SIGNER=$1
shift
Expand Down Expand Up @@ -224,16 +218,16 @@ fi
# Add a "v" if no -c
if [[ $commit = false ]]
then
COMMIT="v${VERSION}"
COMMIT="m${VERSION}"
fi
echo ${COMMIT}

# Setup build environment
if [[ $setup = true ]]
then
sudo apt-get install ruby apache2 git apt-cacher-ng python-vm-builder qemu-kvm qemu-utils
git clone https://github.com/bitcoin-core/gitian.sigs.git
git clone https://github.com/bitcoin-core/merit-detached-sigs.git
git clone https://github.com/meritlabs/gitian.sigs.git
git clone https://github.com/meritlabs/merit-detached-sigs.git
git clone https://github.com/devrandom/gitian-builder.git
pushd ./gitian-builder
if [[ -n "$USE_LXC" ]]
Expand All @@ -257,12 +251,12 @@ if [[ $build = true ]]
then
# Make output folder
mkdir -p ./merit-binaries/${VERSION}

# Build Dependencies
echo ""
echo "Building Dependencies"
echo ""
pushd ./gitian-builder
pushd ./gitian-builder
mkdir -p inputs
wget -N -P inputs $osslPatchUrl
wget -N -P inputs $osslTarUrl
Expand Down Expand Up @@ -331,10 +325,10 @@ then
echo "Verifying v${VERSION} Windows"
echo ""
./bin/gverify -v -d ../gitian.sigs/ -r ${VERSION}-win-unsigned ../merit/contrib/gitian-descriptors/gitian-win.yml
# Mac OSX
# Mac OSX
echo ""
echo "Verifying v${VERSION} Mac OSX"
echo ""
echo ""
./bin/gverify -v -d ../gitian.sigs/ -r ${VERSION}-osx-unsigned ../merit/contrib/gitian-descriptors/gitian-osx.yml
# Signed Windows
echo ""
Expand All @@ -345,14 +339,14 @@ then
echo ""
echo "Verifying v${VERSION} Signed Mac OSX"
echo ""
./bin/gverify -v -d ../gitian.sigs/ -r ${VERSION}-osx-signed ../merit/contrib/gitian-descriptors/gitian-osx-signer.yml
./bin/gverify -v -d ../gitian.sigs/ -r ${VERSION}-osx-signed ../merit/contrib/gitian-descriptors/gitian-osx-signer.yml
popd
fi

# Sign binaries
if [[ $sign = true ]]
then

pushd ./gitian-builder
# Sign Windows
if [[ $windows = true ]]
Expand Down
2 changes: 1 addition & 1 deletion contrib/gitian-descriptors/gitian-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ files: []
script: |

WRAP_DIR=$HOME/wrapped
HOSTS="i686-pc-linux-gnu x86_64-linux-gnu arm-linux-gnueabihf aarch64-linux-gnu"
HOSTS="x86_64-linux-gnu"
CONFIGFLAGS="--enable-glibc-back-compat --enable-reduce-exports --disable-bench --disable-gui-tests"
FAKETIME_HOST_PROGS=""
FAKETIME_PROGS="date ar ranlib nm"
Expand Down
4 changes: 1 addition & 3 deletions contrib/gitian-descriptors/gitian-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ remotes:
files: []
script: |
WRAP_DIR=$HOME/wrapped
HOSTS="i686-w64-mingw32 x86_64-w64-mingw32"
HOSTS="x86_64-w64-mingw32"
CONFIGFLAGS="--enable-reduce-exports --disable-bench --disable-gui-tests"
FAKETIME_HOST_PROGS="g++ ar ranlib nm windres strip objcopy"
FAKETIME_PROGS="date makensis zip"
Expand Down Expand Up @@ -174,6 +174,4 @@ script: |
cp $OUTDIR/merit-*setup-unsigned.exe unsigned/
find . | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ${OUTDIR}/${DISTNAME}-win-unsigned.tar.gz
mv ${OUTDIR}/${DISTNAME}-x86_64-*-debug.zip ${OUTDIR}/${DISTNAME}-win64-debug.zip
mv ${OUTDIR}/${DISTNAME}-i686-*-debug.zip ${OUTDIR}/${DISTNAME}-win32-debug.zip
mv ${OUTDIR}/${DISTNAME}-x86_64-*.zip ${OUTDIR}/${DISTNAME}-win64.zip
mv ${OUTDIR}/${DISTNAME}-i686-*.zip ${OUTDIR}/${DISTNAME}-win32.zip
8 changes: 5 additions & 3 deletions doc/gitian-building.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ To select a different button, press `Tab`.
![](gitian-building/debian_install_9_user_password.png)

- The installer will set up the clock using a time server; this process should be automatic
- Set up the clock: choose a time zone (depends on the locale settings that you picked earlier; specifics don't matter)
- Set up the clock: choose a time zone (depends on the locale settings that you picked earlier; specifics don't matter)

![](gitian-building/debian_install_10_configure_clock.png)

Expand Down Expand Up @@ -272,6 +272,8 @@ Then set up LXC and the rest with the following, which is a complex jumble of se
# that the build script can execute it without providing a password
echo "%sudo ALL=NOPASSWD: /usr/bin/lxc-start" > /etc/sudoers.d/gitian-lxc
echo "%sudo ALL=NOPASSWD: /usr/bin/lxc-execute" >> /etc/sudoers.d/gitian-lxc
# add debian to sudoers
echo 'debian ALL=(ALL:ALL) ALL' >> /etc/sudoers
# make /etc/rc.local script that sets up bridge between guest and host
echo '#!/bin/sh -e' > /etc/rc.local
echo 'brctl addbr br0' >> /etc/rc.local
Expand Down Expand Up @@ -314,8 +316,8 @@ Clone the git repositories for merit and Gitian.

```bash
git clone https://github.com/devrandom/gitian-builder.git
git clone https://github.com/meritlabs/merit
git clone https://github.com/bitcoin-core/gitian.sigs.git
git clone https://github.com/meritlabs/merit.git
git clone https://github.com/meritlabs/gitian.sigs.git
```

Setting up the Gitian image
Expand Down
8 changes: 4 additions & 4 deletions doc/release-process.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ If you're using the automated script (found in [contrib/gitian-build.sh](/contri
Check out the source code in the following directory hierarchy.

cd /path/to/your/toplevel/build
git clone https://github.com/bitcoin-core/gitian.sigs.git
git clone https://github.com/bitcoin-core/merit-detached-sigs.git
git clone https://github.com/meritlabs/gitian.sigs.git
git clone https://github.com/meritlabs/merit-detached-sigs.git
git clone https://github.com/devrandom/gitian-builder.git
git clone https://github.com/meritlabs/merit.git

Expand Down Expand Up @@ -65,7 +65,7 @@ Setup Gitian descriptors:
export SIGNER=(your Gitian key, ie bluematt, sipa, etc)
export VERSION=(new version, e.g. 0.8.0)
git fetch
git checkout v${VERSION}
git checkout m${VERSION}
popd

Ensure your gitian.sigs are up-to-date if you wish to gverify your builds against other Gitian signatures.
Expand All @@ -84,7 +84,7 @@ Ensure gitian-builder is up-to-date:

pushd ./gitian-builder
mkdir -p inputs
wget -P inputs https://meritcore.org/cfields/osslsigncode-Backports-to-1.7.1.patch
wget -P inputs https://bitcoincore.org/cfields/osslsigncode-Backports-to-1.7.1.patch
wget -P inputs http://downloads.sourceforge.net/project/osslsigncode/osslsigncode/osslsigncode-1.7.1.tar.gz
popd

Expand Down
2 changes: 1 addition & 1 deletion src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ std::string HelpMessage(HelpMessageMode mode)
std::string LicenseInfo()
{
const std::string URL_SOURCE_CODE = "<https://github.com/meritlabs/merit>";
const std::string URL_WEBSITE = "<https://meritcore.org>";
const std::string URL_WEBSITE = "<https://merit.me>";

return CopyrightHolders(strprintf(_("Copyright (C) %i-%i"), 2009, COPYRIGHT_YEAR) + " ") + "\n" +
"\n" +
Expand Down