Skip to content

Dynamically linked Linux binaries are not compatible with MUSL C #2555

Closed

Description

@pete-woods

Describe the bug

The GitHub CLI doesn't work on Alpine Linux.

Steps to reproduce the behavior

  1. docker run --rm -it alpine
  2. apk add curl
  3. curl -fsSL 'https://github.com/cli/cli/releases/download/v1.3.1/gh_1.3.1_linux_amd64.tar.gz' | tar -C /usr/local --strip-components=1 -xz
  4. /bin/sh: /usr/local/bin/gh: not found
file /usr/local/bin/gh
/usr/local/bin/gh: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, Go BuildID=fHoTSnnFVd8_yvfygXJN/whl8jqmcJwgrVZga1VFz/1O5vTCOdUnMNVQGvoQWV/v_1Dyi7uTOxQtchpd1Ks, stripped

Expected vs actual behavior

Go binaries should work on all Linux platforms when compiled statically.

I assume you're just missing the CGO_ENABLED=0 environment variable when building.

Activity

  1. added a commit that references this issue on Dec 7, 2020
    e409988
  2. pete-woods commented on Dec 7, 2020

    @pete-woods
    ContributorAuthor

    I think #2556 is all that is needed to fix this

  3. added 3 commits that reference this issue on Dec 7, 2020
    84670da
    3949277
    03949a4
  4. pete-woods commented on Dec 18, 2020

    @pete-woods
    ContributorAuthor

    @mislav just to round this ticket off - release 1.4.0 is working for me on alpine now! 🚀

  5. mislav commented on Dec 18, 2020

    @mislav
    Contributor

    @pete-woods Awesome! Thanks for the followup!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions