Skip to content
Draft
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
21 changes: 16 additions & 5 deletions docs/examples/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,20 +96,31 @@ function compile-solidity {

mkdir -p "$OUTPUT_DIR"

# Compile using the local foundry.toml with proper remappings
# Compile using the local foundry.toml with proper remappings.
# forge fetches solc from binaries.soliditylang.org on first use; transient
# DNS/TLS failures there have silently produced partial builds in CI (the loop
# kept going and compile-solidity returned success while an example's artifacts
# were never written). Wrap each forge build in ci3/retry and propagate any
# per-subdir failure so run_step retries the whole step.
(
cd "$SOLIDITY_DIR"
for subdir in */; do
if [ -d "$subdir" ] && ls "$subdir"/*.sol >/dev/null 2>&1; then
local subdir_name=$(basename "$subdir")
echo_stderr "Compiling $subdir_name..."
forge build \
--contracts "$subdir" \
--out "$OUTPUT_DIR/$subdir_name" \
--no-cache
if ! retry "forge build --contracts $subdir --out $OUTPUT_DIR/$subdir_name --no-cache"; then
echo "$subdir_name" >> "$OUTPUT_DIR/.failed"
fi
fi
done
)
if [ -f "$OUTPUT_DIR/.failed" ]; then
local failed_subdirs=()
while IFS= read -r name; do failed_subdirs+=("$name"); done < "$OUTPUT_DIR/.failed"
rm -f "$OUTPUT_DIR/.failed"
echo_stderr "ERROR: Solidity compilation failed for: ${failed_subdirs[*]}"
return 1
fi

echo_stderr "Solidity artifacts written to $OUTPUT_DIR"
}
Expand Down
Loading