Skip to content

Commit

Permalink
Add generate precompile script to fix CGO flags issue (#489)
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronbuchwald authored Feb 6, 2023
1 parent c667f95 commit 50da2fd
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions scripts/generate_precompile.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash
set -e

# This script generates a Stateful Precompile stub based off of a Solidity ABI file.
# It first sets the necessary CGO_FLAGs for the BLST library used in AvalancheGo and
# then runs PrecompileGen.
if ! [[ "$0" =~ scripts/generate_precompile.sh ]]; then
echo "must be run from repository root, but got $0"
exit 255
fi

# Load the versions
SUBNET_EVM_PATH=$(
cd "$(dirname "${BASH_SOURCE[0]}")"
cd .. && pwd
)

# Load the constants
source "$SUBNET_EVM_PATH"/scripts/constants.sh

go run ./cmd/precompilegen/main.go $@

0 comments on commit 50da2fd

Please sign in to comment.