Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Commit be20d34

Browse files
export BLST (#124)
1 parent f5c4c02 commit be20d34

File tree

6 files changed

+37
-0
lines changed

6 files changed

+37
-0
lines changed

scripts/build.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ if ! [[ "$0" =~ scripts/build.sh ]]; then
99
exit 255
1010
fi
1111

12+
SPACESVM_PATH=$(
13+
cd "$(dirname "${BASH_SOURCE[0]}")"
14+
cd .. && pwd
15+
)
16+
source "$SPACESVM_PATH"/scripts/constants.sh
17+
1218
# Set default binary directory location
1319
name="sqja3uK17MJxfC7AN8nGadBw9JK5BcrsNwNynsqP5Gih8M5Bm"
1420

scripts/constants.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
3+
# Set the CGO flags to use the portable version of BLST
4+
#
5+
# We use "export" here instead of just setting a bash variable because we need
6+
# to pass this flag to all child processes spawned by the shell.
7+
export CGO_CFLAGS="-O -D__BLST_PORTABLE__"

scripts/run.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ if ! [[ "$0" =~ scripts/run.sh ]]; then
1414
exit 255
1515
fi
1616

17+
SPACESVM_PATH=$(
18+
cd "$(dirname "${BASH_SOURCE[0]}")"
19+
cd .. && pwd
20+
)
21+
source "$SPACESVM_PATH"/scripts/constants.sh
22+
1723
VERSION=$1
1824
if [[ -z "${VERSION}" ]]; then
1925
echo "Missing version argument!"

scripts/tests.integration.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ if ! [[ "$0" =~ scripts/tests.integration.sh ]]; then
66
exit 255
77
fi
88

9+
SPACESVM_PATH=$(
10+
cd "$(dirname "${BASH_SOURCE[0]}")"
11+
cd .. && pwd
12+
)
13+
source "$SPACESVM_PATH"/scripts/constants.sh
14+
915
# to install the ginkgo binary (required for test build and run)
1016
go install -v github.com/onsi/ginkgo/v2/ginkgo@v2.0.0-rc2
1117

scripts/tests.lint.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ if ! [[ "$0" =~ scripts/tests.lint.sh ]]; then
99
exit 255
1010
fi
1111

12+
SPACESVM_PATH=$(
13+
cd "$(dirname "${BASH_SOURCE[0]}")"
14+
cd .. && pwd
15+
)
16+
source "$SPACESVM_PATH"/scripts/constants.sh
17+
1218
if [ "$#" -eq 0 ]; then
1319
# by default, check all source code
1420
# to test only "mempool" package

scripts/tests.unit.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,10 @@ if ! [[ "$0" =~ scripts/tests.unit.sh ]]; then
66
exit 255
77
fi
88

9+
SPACESVM_PATH=$(
10+
cd "$(dirname "${BASH_SOURCE[0]}")"
11+
cd .. && pwd
12+
)
13+
source "$SPACESVM_PATH"/scripts/constants.sh
14+
915
go test -race -timeout="3m" -coverprofile="coverage.out" -covermode="atomic" $(go list ./... | grep -v tests)

0 commit comments

Comments
 (0)