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 "CARGO_TARGET: " $CARGO_TARGET
|
|
|
|
echo "CC: " $CC
|
|
|
|
echo "CXX: " $CXX
|
2019-01-18 12:03:18 +01:00
|
|
|
#strip ON
|
2020-01-07 16:53:02 +01:00
|
|
|
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" _____"
|
2020-01-07 16:53:02 +01:00
|
|
|
if [ "${CARGO_TARGET}" = "x86_64-unknown-linux-gnu" ] || [ "${CARGO_TARGET}" = "x86_64-apple-darwin" ]
|
2018-11-06 20:26:05 +01:00
|
|
|
then
|
2020-01-07 16:53:02 +01:00
|
|
|
# NOTE: Enables the aes-ni instructions for RustCrypto dependency.
|
|
|
|
# If you change this please remember to also update .cargo/config
|
|
|
|
export RUSTFLAGS+=" -C target-feature=+aes,+sse2,+ssse3"
|
2018-11-06 20:26:05 +01:00
|
|
|
fi
|
2020-01-07 16:53:02 +01: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
|
|
|
|
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
|
|
|
|
|
2020-01-07 16:53:02 +01:00
|
|
|
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
|
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
|
2019-10-08 20:58:34 +02:00
|
|
|
echo ">[WARN] ${binary} cannot be hashed with cross-compiled binary (keccak256)"
|
2019-03-22 11:46:57 +01:00
|
|
|
fi
|
2018-08-26 00:44:08 +02:00
|
|
|
done
|
2019-10-02 22:01:20 +02:00
|
|
|
#show sccache statistics
|
2019-10-08 20:58:34 +02:00
|
|
|
sccache --show-stats
|