Skip to content

Linux release binary requires glibc 2.38+, fails on Amazon Linux 2023 and older distros #22

@devrel-ditto

Description

@devrel-ditto

Problem

The Linux release binary (platform-cli_1.0.1_linux_amd64.tar.gz) dynamically links against glibc and requires version 2.38+:

platform-cli: /lib64/libc.so.6: version `GLIBC_2.38' not found (required by platform-cli)

This is because ubuntu-latest on GitHub Actions is Ubuntu 24.04 (glibc 2.39). The binary won't run on:

  • Amazon Linux 2023 (glibc 2.34)
  • Ubuntu 22.04 (glibc 2.35)
  • Debian 12 (glibc 2.36)
  • RHEL 9 / Rocky 9 (glibc 2.34)

Root Cause

The release workflow uses CGO_ENABLED=1 (required for blst and libevm) with the default dynamic linker on ubuntu-latest. The resulting binary is dynamically linked against the CI runner's glibc.

Suggested Fix

Statically link the Linux binaries using musl. In .github/workflows/release.yml, for the Linux amd64 build:

  1. Install musl-tools: sudo apt-get install -y musl-tools
  2. Set CC=musl-gcc
  3. Add -extldflags '-static' to ldflags

This produces a fully static binary that runs on any Linux distro regardless of glibc version.

Environment

  • platform-cli v1.0.1, linux/amd64 release binary
  • Amazon Linux 2023 (glibc 2.34, kernel 6.1)
  • Workaround: building from source works fine

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions