ethpandaops / dora

Dora the Explorer is a lightweight slot explorer for the ethereum beaconchain
https://beaconlight.ephemery.dev/
GNU General Public License v3.0
79 stars 26 forks source link

GLIBC_2.32 not found #137

Open roccomuso opened 1 month ago

roccomuso commented 1 month ago

Getting this error when executing bin inside latest dora_1.12.0_linux_amd64.tar.gz:

./dora-explorer: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by ./dora-explorer)

pk910 commented 1 month ago

Heya @roccomuso, Which OS are you trying to run the explorer on?

pk910 commented 1 month ago

The root cause for the issue is the CGO compilation that dora needs to compile C libs for cryptography & sqlite. When using CGO, the resulting build always targets the GLIBC version of the build system. The github workflows that are building the release binaries are running on ubuntu-latest, which always targets a recent version of GLIBC.

I've been curious to see if I can get the explorer running on older systems. And yea, it's actually not hard when building it yourself.

We could actually generate builds for older GLIBC versions by using docker for the build environment. eg. for GLIBC_2.27:

git clone https://github.com/ethpandaops/dora.git
cd dora
cat > ./Dockerfile-legacy <<- EOF
FROM ubuntu:18.04
RUN apt-get update -y && apt-get install -y --no-install-recommends \
    curl ca-certificates build-essential

# Download and install Go
ENV GO_VERSION 1.23.1
RUN curl -LO "https://go.dev/dl/go1.23.1.linux-amd64.tar.gz" && \
    tar -C /usr/local -xzf "go1.23.1.linux-amd64.tar.gz" && \
    rm "go1.23.1.linux-amd64.tar.gz"

# Set Go environment variables
ENV PATH="/usr/local/go/bin:${PATH}"
ENV GOPATH="/go"
ENV GOBIN="/go/bin"

# Set the working directory
WORKDIR /app

CMD ["/bin/bash"]
EOF

docker build --file ./Dockerfile-legacy . -t dora-build --load
docker run -it -v $(pwd):/app dora-build make build

ls ./bin

The resulting build is forward compatible with recent versions of GLIBC, but might be slightly slower due to a limited feature set. But I'm not sure if it's worth adding additional build artifacts for older systems to releases.