cli icon indicating copy to clipboard operation
cli copied to clipboard

version 3.2.1 is not real single-binary

Open wgqimut opened this issue 2 years ago • 1 comments

Checklist

  • [x] I've searched for similar issues.
  • [x] I'm using the latest version of HTTPie.

Minimal reproduction code and steps

  1. download httpie 3.2.1 (latest httpie version) to centos7 machine
  2. run "./http"

Current result

Error loading Python lib '/tmp/_MEITUP865/libpython3.9.so.1.0': dlopen: /lib64/libc.so.6: version `GLIBC_2.25' not found (required by /tmp/_MEITUP865/libpython3.9.so.1.0)

…

Expected result

usage:
    http [METHOD] URL [REQUEST_ITEM ...]

error:
    the following arguments are required: URL

for more information:
    run 'http --help' or visit https://httpie.io/docs/cli

it seems that httpie still rely on libpython3.9.so, and libpython3.9.so rely on specific glibc version.

wgqimut avatar Jul 21 '22 05:07 wgqimut

It's not just httpie 3.2.1.

Tried other versions on docker's busybox:1.35.0 (uclibc, "has no python") and the same happened:

docker run --rm -it busybox:1.35.0
cd /tmp
rm *
touch 3.1.0  3.2.0  3.2.1
find * -type f -print -exec wget -O http-{} https://github.com/httpie/httpie/releases/download/{}/http \;
chmod +x http-*
find . -name "http*" -print -exec sh -c "{} --version" \;
# ./http-3.2.0
# sh: ./http-3.2.0: not found
# ./http-3.2.1
# sh: ./http-3.2.1: not found
# ./http-3.1.0
# sh: ./http-3.1.0: not found

It was never statically linked. ~Would building it with something like CGO_ENABLED=0 go build -static solve it? Doing it may bloat the final binary, right?~

-- EDIT -- Just noticed it's not a go project 😅

lucasfcnunes avatar Aug 06 '22 23:08 lucasfcnunes