Skip to content

fix: statically link Linux amd64 binary with musl#23

Open
devrel-ditto wants to merge 1 commit intoava-labs:mainfrom
devrel-ditto:fix/static-linux-binary
Open

fix: statically link Linux amd64 binary with musl#23
devrel-ditto wants to merge 1 commit intoava-labs:mainfrom
devrel-ditto:fix/static-linux-binary

Conversation

@devrel-ditto
Copy link

Summary

Fixes #22 — Linux release binary requires glibc 2.38+, fails on Amazon Linux 2023 and other common distros.

Problem

ubuntu-latest on GitHub Actions is now Ubuntu 24.04 (glibc 2.39). The Linux amd64 binary dynamically links against it:

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

Affected distros: Amazon Linux 2023, Ubuntu 22.04, Debian 12, RHEL/Rocky 9.

Fix

  • Switch Linux amd64 builds to musl-gcc with -extldflags '-static'
  • Produces a fully static binary that runs on any Linux distro
  • No change to macOS or Linux arm64 builds

Testing

Built and verified on Amazon Linux 2023 (glibc 2.34):

$ platform-cli version
platform dev

$ platform-cli wallet balance --network fuji --key-name test
P-Chain Address: P-fuji1s2dmfe7g8gavpykfp2u2euy0njmqlw78khrdcd
Balance: 0.000000000 AVAX

The release binary requires glibc 2.38+ because ubuntu-latest (24.04)
dynamically links against its system glibc. This breaks on Amazon
Linux 2023, Ubuntu 22.04, RHEL 9, and other common distros.

Switch Linux amd64 builds to musl-gcc with static linking, producing
a portable binary that runs on any Linux distro.

Fixes ava-labs#22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant