Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(actors): pack script can copy from local builds #12525

Merged
merged 1 commit into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading