Skip to content

Go binaries built with CGO_ENABLED=1 do not work through nix #325

@rdnt

Description

@rdnt

Dynamically linked go binaries built inside bob with nix are not executable under different environments (e.g. inside a docker container on the same system).

file ./server

./server: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /nix/store/2j8jqmnd9l7plihhf713yf291c9vyqjm-glibc-2.35-224/lib/ld-linux-x86-64.so.2, Go BuildID=ESlrWFpDn31BIxzZZX0h/0i-We6XI5_Rb-pGBXFbh/lRcJKtpA40xmRxkHsnUm/u7T_cAmfqXS1MDeQwScw, with debug_info, not stripped


CGO_ENABLED=0 is required, I presume, for all Go binaries created through bob. We should consider adding it to the docs, and investigate the underlying problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions