Skip to content

Commit

Permalink
use debian for geth race build
Browse files Browse the repository at this point in the history
  • Loading branch information
Savid committed Oct 10, 2024
1 parent f81abfe commit 2561749
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions geth/build-race.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,25 @@
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
cd ${SCRIPT_DIR}/../source

# need to update dockerfile to use debian instead of alpine
ORIGINAL_DOCKER_FILE="Dockerfile"
NEW_DOCKER_FILE="Dockerfile.race"

sed -e 's|-alpine AS builder| AS builder|' \
-e 's|RUN apk add --no-cache gcc musl-dev linux-headers git|RUN apt-get update \&\& apt-get install -y --no-install-recommends build-essential git \&\& rm -rf /var/lib/apt/lists/*|' \
-e 's|RUN cd /go-ethereum \&\& go run build/ci.go install -static ./cmd/geth|RUN cd /go-ethereum \&\& go run build/ci.go install ./cmd/geth|' \
-e 's|FROM alpine:latest|FROM debian:bookworm-slim|' \
-e 's|RUN apk add --no-cache ca-certificates|RUN apt-get update \&\& apt-get install -y --no-install-recommends ca-certificates \&\& rm -rf /var/lib/apt/lists/*|' \
"$ORIGINAL_DOCKER_FILE" > "$NEW_DOCKER_FILE"

if((`stat -c%s "${ORIGINAL_DOCKER_FILE}"`==`stat -c%s "${NEW_DOCKER_FILE}"`));then
echo "no changes detected, aborting..."
echo "needed to update dockerfile"
exit 1
fi

mv $NEW_DOCKER_FILE $ORIGINAL_DOCKER_FILE

# need to add -race flag to geth custom build script
ORIGINAL_CI_FILE="build/ci.go"
NEW_CI_FILE="build/ci.race.go"
Expand Down

0 comments on commit 2561749

Please sign in to comment.