diff --git a/build/actors/README.md b/build/actors/README.md index 981ad726a10..2ea8145e6ab 100644 --- a/build/actors/README.md +++ b/build/actors/README.md @@ -24,3 +24,9 @@ To build a bundle, but specify a different release/tag for a specific network, a ```bash ./pack.sh v8 dev/20220602 mainnet=v8.0.0 calibrationnet=v8.0.0-rc.1 ``` + +Alternatively, if using a set of locally compiled builtin-actors bundles (`make all-bundles` in builtin-actors), you can specify the path to the directory containing the bundles. For example: + +```bash +./pack v15 local/20240930 /path/to/builtin-actors/build/actors +``` diff --git a/build/actors/pack.sh b/build/actors/pack.sh index e594bb2daf6..f833bb356e2 100755 --- a/build/actors/pack.sh +++ b/build/actors/pack.sh @@ -5,14 +5,20 @@ NETWORKS=(devnet mainnet caterpillarnet butterflynet testing testing-fake-proofs set -e if [[ $# -lt 2 ]]; then - echo "Usage: $0 VERSION RELEASE [NETWORK=RELEASE_OVERRIDE]..." >&2 - echo "expected at least two arguments, an actors version (e.g., v8), an actors release, and any number of release overrides." >&2 + echo "Usage: $0 VERSION RELEASE [LOCAL_DIR] [NETWORK=RELEASE_OVERRIDE]..." >&2 + echo "expected at least two arguments, an actors version (e.g., v8), an actors release, an optional local directory, and any number of release overrides." >&2 exit 1 fi VERSION="$1" # actors version RELEASE="$2" # actors release name -RELEASE_OVERRIDES=("${@:3}") +LOCAL_DIR="" +if [[ $# -ge 3 && ! "${3}" =~ "=" ]]; then + LOCAL_DIR="$3" + RELEASE_OVERRIDES=("${@:4}") +else + RELEASE_OVERRIDES=("${@:3}") +fi echo "Downloading bundles for actors version ${VERSION} release ${RELEASE}" echo "With release overrides ${RELEASE_OVERRIDES[*]}" @@ -36,13 +42,26 @@ for network in "${NETWORKS[@]}"; do fi done encoded_release="$(encode_release "$release")" - echo "Downloading $release for network $network." - wget "https://github.com/filecoin-project/builtin-actors/releases/download/${encoded_release}/builtin-actors-${network}"{.car,.sha256} + if [[ -n "$LOCAL_DIR" ]]; then + if [[ -f "${LOCAL_DIR}/builtin-actors-${network}.car" ]]; then + echo "Fetching $release for network $network from local directory." + cp "${LOCAL_DIR}/builtin-actors-${network}.car" . + else + echo "Error: File ${LOCAL_DIR}/builtin-actors-${network}.car not found in local directory." + exit 1 + fi + else + echo "Downloading $release for network $network." + wget "https://github.com/filecoin-project/builtin-actors/releases/download/${encoded_release}/builtin-actors-${network}"{.car,.sha256} + fi done -echo "Checking the checksums..." - -sha256sum -c -- *.sha256 +if [[ -z "$LOCAL_DIR" ]]; then + echo "Checking the checksums..." + sha256sum -c -- *.sha256 +else + echo "Skipping checksum verification for local files." +fi echo "Packing..."