Skip to content

Commit

Permalink
feat(actors): pack script can copy from local builds
Browse files Browse the repository at this point in the history
  • Loading branch information
rvagg committed Sep 30, 2024
1 parent 765dcc2 commit f206636
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 8 deletions.
6 changes: 6 additions & 0 deletions build/actors/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
35 changes: 27 additions & 8 deletions build/actors/pack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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[*]}"
Expand All @@ -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..."

Expand Down

0 comments on commit f206636

Please sign in to comment.