2018-08-26 00:44:08 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e # fail on any error
|
|
|
|
set -u # treat unset variables as error
|
2018-10-02 01:03:58 +02:00
|
|
|
|
2019-10-02 22:01:20 +02:00
|
|
|
export CC="sccache "$CC
|
|
|
|
export CXX="sccache "$CXX
|
2018-08-26 00:44:08 +02:00
|
|
|
echo "__________Show ENVIROMENT__________"
|
2018-10-02 01:03:58 +02:00
|
|
|
echo "CI_SERVER_NAME: " $CI_SERVER_NAME
|
|
|
|
echo "CARGO_HOME: " $CARGO_HOME
|
|
|
|
echo "CARGO_TARGET: " $CARGO_TARGET
|
|
|
|
echo "CC: " $CC
|
|
|
|
echo "CXX: " $CXX
|
2019-01-18 12:03:18 +01:00
|
|
|
#strip ON
|
|
|
|
export RUSTFLAGS=" -C link-arg=-s"
|
2018-08-26 00:44:08 +02:00
|
|
|
|
2019-01-15 17:27:43 +01:00
|
|
|
echo "_____ Building target: "$CARGO_TARGET" _____"
|
2018-11-06 20:26:05 +01:00
|
|
|
if [ "${CARGO_TARGET}" = "armv7-linux-androideabi" ]
|
|
|
|
then
|
2019-04-12 18:51:01 +02:00
|
|
|
time cargo build --target $CARGO_TARGET --verbose --color=always --release -p parity-clib --features final
|
2018-11-06 20:26:05 +01:00
|
|
|
else
|
2019-06-18 20:24:21 +02:00
|
|
|
if [ "${CARGO_TARGET}" = "x86_64-unknown-linux-gnu" ] || [ "${CARGO_TARGET}" = "x86_64-apple-darwin" ]
|
|
|
|
then
|
|
|
|
# NOTE: Enables the aes-ni instructions for RustCrypto dependency.
|
|
|
|
# If you change this please remember to also update .cargo/config
|
|
|
|
export RUSTFLAGS="$RUSTFLAGS -Ctarget-feature=+aes,+sse2,+ssse3"
|
|
|
|
fi
|
2019-04-12 18:51:01 +02:00
|
|
|
time cargo build --target $CARGO_TARGET --verbose --color=always --release --features final
|
|
|
|
time cargo build --target $CARGO_TARGET --verbose --color=always --release -p evmbin
|
|
|
|
time cargo build --target $CARGO_TARGET --verbose --color=always --release -p ethstore-cli
|
|
|
|
time cargo build --target $CARGO_TARGET --verbose --color=always --release -p ethkey-cli
|
2018-11-06 20:26:05 +01:00
|
|
|
fi
|
|
|
|
|
2018-08-26 00:44:08 +02:00
|
|
|
echo "_____ Post-processing binaries _____"
|
2019-02-21 19:14:59 +01:00
|
|
|
rm -rf artifacts/*
|
2019-02-07 18:49:50 +01:00
|
|
|
mkdir -p artifacts/$CARGO_TARGET
|
|
|
|
cd artifacts/$CARGO_TARGET
|
|
|
|
|
2019-01-15 17:27:43 +01:00
|
|
|
if [ "${CARGO_TARGET}" = "armv7-linux-androideabi" ]
|
|
|
|
then
|
|
|
|
cp -v ../../target/$CARGO_TARGET/release/libparity.so ./libparity.so
|
|
|
|
else
|
|
|
|
cp -v ../../target/$CARGO_TARGET/release/parity ./parity
|
|
|
|
cp -v ../../target/$CARGO_TARGET/release/parity-evm ./parity-evm
|
|
|
|
cp -v ../../target/$CARGO_TARGET/release/ethstore ./ethstore
|
|
|
|
cp -v ../../target/$CARGO_TARGET/release/ethkey ./ethkey
|
|
|
|
fi
|
2018-11-06 20:26:05 +01:00
|
|
|
|
2018-08-26 00:44:08 +02:00
|
|
|
echo "_____ Calculating checksums _____"
|
|
|
|
for binary in $(ls)
|
|
|
|
do
|
2019-02-25 12:56:38 +01:00
|
|
|
rhash --sha256 $binary -o $binary.sha256 #do we still need this hash (SHA2)?
|
2019-03-22 11:46:57 +01:00
|
|
|
if [[ $CARGO_TARGET == *"x86_64"* ]];
|
|
|
|
then
|
|
|
|
./parity tools hash $binary > $binary.sha3
|
|
|
|
else
|
|
|
|
echo "> ${binary} cannot be hashed with cross-compiled binary (keccak256)"
|
|
|
|
fi
|
2018-08-26 00:44:08 +02:00
|
|
|
done
|
2019-10-02 22:01:20 +02:00
|
|
|
#show sccache statistics
|
|
|
|
sccache --stop-server
|