Skip to content

Commit

Permalink
back-port build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
gmas committed Mar 12, 2019
1 parent ef27fc6 commit acf055d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 20 deletions.
7 changes: 4 additions & 3 deletions scripts/copy-groth-params.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
#!/usr/bin/env bash
copy_groth_params() {
mkdir -p /tmp/filecoin-proof-parameters
pushd /tmp/filecoin-proof-parameters
local params_dir="${FILECOIN_PARAMETER_CACHE:-"/tmp/filecoin-proof-parameters/"}"
local params_file=v9-zigzag-proof-of-replication-52431242c129794fe51d373ae29953f2ff52abd94c78756e318ce45f3e4946d8
mkdir -p ${params_dir}
pushd ${params_dir}
if [[ ! -e ${params_file} ]]; then
echo "groth parameter ${params_file} was not found"
echo "try rerunning 'go run ./build/*.go deps'"
exit 1
fi
ln -s ${params_file} params.out
ln -sf ${params_file} params.out
popd
}

Expand Down
2 changes: 1 addition & 1 deletion scripts/install-bls-signatures.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ install_local() {
exit 1
fi

git submodule update --init --recursive
git submodule update --init --recursive bls-signatures/bls-signatures

pushd bls-signatures/bls-signatures

Expand Down
28 changes: 12 additions & 16 deletions scripts/install-rust-fil-proofs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,13 @@
install_precompiled() {
RELEASE_SHA1=`git rev-parse @:./proofs/rust-fil-proofs`
RELEASE_NAME="rust-fil-proofs-`uname`"
OLD_RELEASE_NAME="rust-proofs-`uname`"
RELEASE_TAG="${RELEASE_SHA1:0:16}"

if [ -z $GITHUB_TOKEN ]; then
echo "\$GITHUB_TOKEN not set"
return 1
fi
RELEASE_RESPONSE=`curl \
--location \
"https://api.github.com/repos/filecoin-project/rust-fil-proofs/releases/tags/$RELEASE_TAG"`

RELEASE_RESPONSE=`
curl \
--header "Authorization: token $GITHUB_TOKEN" \
"https://api.github.com/repos/filecoin-project/rust-fil-proofs/releases/tags/$RELEASE_TAG"
`

RELEASE_ID=`echo $RELEASE_RESPONSE | jq '.id'`

Expand All @@ -24,12 +19,11 @@ install_precompiled() {
return 1
fi

RELEASE_URL=`echo $RELEASE_RESPONSE | jq -r ".assets[] | select(.name | contains(\"$RELEASE_NAME\")) | .url"`
RELEASE_URL=`echo $RELEASE_RESPONSE | jq -r ".assets[] | select(.name | contains(\"$OLD_RELEASE_NAME\")) | .url"`


ASSET_URL=`curl \
--head \
--header "Authorization: token $GITHUB_TOKEN" \
--header "Accept:application/octet-stream" \
--location \
--output /dev/null \
Expand All @@ -40,11 +34,11 @@ install_precompiled() {

TAR_NAME="${RELEASE_NAME}_${ASSET_ID}"
if [ ! -f "/tmp/${TAR_NAME}.tar.gz" ]; then
curl --output "/tmp/${TAR_NAME}.tar.gz" "$ASSET_URL"
if [ $? -ne "0" ]; then
echo "asset failed to be downloaded"
return 1
fi
curl --output "/tmp/${TAR_NAME}.tar.gz" "$ASSET_URL"
if [ $? -ne "0" ]; then
echo "asset failed to be downloaded"
return 1
fi
fi

mkdir -p proofs/bin
Expand Down Expand Up @@ -81,6 +75,8 @@ install_local() {
cp proofs/rust-fil-proofs/target/release/libfilecoin_proofs.pc ./proofs/lib/pkgconfig/
}

git submodule update --init --recursive proofs/rust-fil-proofs

if [ -z "$FILECOIN_USE_PRECOMPILED_RUST_PROOFS" ]; then
echo "using local rust-fil-proofs"
install_local
Expand Down

0 comments on commit acf055d

Please sign in to comment.