Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"symbol __cxa_thread_atexit_impl, version GLIBC_2.18 not defined" running maturin 0.8.3 wheel in manylinux2014_aarch64 #369

Closed
JEnoch opened this issue Oct 26, 2020 · 7 comments

Comments

@JEnoch
Copy link

JEnoch commented Oct 26, 2020

Please provide the following information:

  • Your python version (python -V): 3.8.6
  • Your pip version (pip -V): 20.2.3
    • If this isn't the latest pip version, have you checked using the latest pip version?
      Yes: same issue with pip 20.2.4
  • The version of the bindings you're using, if any (e.g. pyo3, rust-cpython or cffi):
    None, I just run maturin --help
  • Does cargo build work?
    Not relevant
  • If on windows, have you checked that you aren't accidentally using unix path (those with the forward slash /)?
    Not on windows

Please list the exact steps required to reproduce your error with all command output and if possible with a repository:

docker run --init -it --rm quay.io/pypa/manylinux2014_aarch64:latest /bin/bash -c "/opt/python/cp38-cp38/bin/pip install maturin && /opt/python/cp38-cp38/bin/maturin --version"

The result output is:

Collecting maturin
Downloading maturin-0.8.3-py3-none-manylinux2014_aarch64.whl (4.7 MB)
  |████████████████████████████████| 4.7 MB 3.2 MB/s
Collecting toml~=0.10.0
Downloading toml-0.10.1-py2.py3-none-any.whl (19 kB)
Installing collected packages: toml, maturin
Successfully installed maturin-0.8.3 toml-0.10.1
/opt/python/cp38-cp38/bin/maturin: relocation error: /opt/python/cp38-cp38/bin/maturin: symbol __cxa_thread_atexit_impl, version GLIBC_2.18 not defined in file libc.so.6 with link time reference
@JEnoch
Copy link
Author

JEnoch commented Oct 26, 2020

The issue looks similar to the one described in https://stackoverflow.com/questions/39744926/how-can-i-compile-a-rust-program-so-it-doesnt-use-cxa-thread-atexit-impl .
Which Rust toolchain was used to build the maturin-0.8.3-py3-none-manylinux2014_aarch64.whl ?

@JEnoch
Copy link
Author

JEnoch commented Oct 27, 2020

As a workaround, I created a Docker image based on manylinux2014_aarch64 and including a compiled version of maturin 0.8.3: https://hub.docker.com/repository/docker/adlinktech/manylinux2014-aarch64-rust-nightly
See its Dockerfile.

@konstin
Copy link
Member

konstin commented Oct 28, 2020

The aarch64 builder was building a wheel that was not actually manywheel compliant, as it was built with the glibc toolchain. If tried to fix this by building a musl binary as I already do for the other platforms, but now I'm getting errors when compiling dependencies (https://cloud.drone.io/PyO3/maturin/234/1/2), so publishing a fixed wheel is blocked on figuring out ci.

@JEnoch
Copy link
Author

JEnoch commented Oct 30, 2020

I was able to compile maturin 0.9.3-alpha.3 in a Docker python:3.8-buster image after installing the aarch64 musl toolchain and applying this workaround for rust-lang/compiler-builtins#201 issue: rust-lang/rust#46651 (comment)

Thus I think adding something like this to your .drone.yml commands should be good enough:

wget http://musl.cc/aarch64-linux-musl-cross.tgz
tar xzf aarch64-linux-musl-cross.tgz -C /opt --strip-components=1
export PATH=$PATH:/opt/bin
echo '[target.aarch64-unknown-linux-musl]' >> ~/.cargo/config
echo 'linker = "aarch64-linux-musl-gcc"' >> ~/.cargo/config
echo 'rustflags = [ "-C", "target-feature=+crt-static", "-C", "link-arg=-lgcc" ]' >> ~/.cargo/config

@konstin
Copy link
Member

konstin commented Nov 10, 2020

Unfortunately, this still fails at bzip-sys: https://cloud.drone.io/PyO3/maturin/270/1/2

Config:

- name: publish
  image: python:3.8-buster
  environment:
    PATH: "/root/.local/bin:/root/.cargo/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
    MATURIN_PASSWORD:
      from_secret: MATURIN_PASSWORD
  commands:
    # https://github.com/PyO3/maturin/issues/369#issuecomment-719615672
    - wget -q http://musl.cc/aarch64-linux-musl-cross.tgz
    - tar xzf aarch64-linux-musl-cross.tgz -C /opt --strip-components=1
    - export PATH=$PATH:/opt/bin
    - mkdir ~/.cargo
    - echo '[target.aarch64-unknown-linux-musl]' >> ~/.cargo/config
    - echo 'linker = "aarch64-linux-musl-gcc"' >> ~/.cargo/config
    - echo 'rustflags = [ "-C", "target-feature=+crt-static", "-C", "link-arg=-lgcc" ]' >> ~/.cargo/config
    - curl https://sh.rustup.rs -sSf | sh -s -- --profile minimal -y
    - rustup target add aarch64-unknown-linux-musl
    - cargo build --release --target aarch64-unknown-linux-musl
    - cargo run --release --target aarch64-unknown-linux-musl -- publish -u konstin -b bin --no-sdist --target aarch64-unknown-linux-musl

@messense
Copy link
Member

@JEnoch Can you give #422 a try?

@JEnoch
Copy link
Author

JEnoch commented Feb 17, 2021

@messense Yes, I confirm the wheel you refer in #422 works like a charm in quay.io/pypa/manylinux2014_aarch64:latest.
Many thanks!

@JEnoch JEnoch closed this as completed Feb 17, 2021
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

No branches or pull requests

3 participants