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

libcrypt-2-*.12.so not found during auditwheel repair #411

Closed
myselfhimself opened this issue Dec 22, 2019 · 9 comments · Fixed by #581
Closed

libcrypt-2-*.12.so not found during auditwheel repair #411

myselfhimself opened this issue Dec 22, 2019 · 9 comments · Fixed by #581

Comments

@myselfhimself
Copy link

Hello,
This was possibly dealt with in #305 on this tracker, though I do not understand how to fix/mitigate the issue.
In the manylinux2010_x86_64 python 3.7 auditwheel repair step after building a cpython/c++ binding module wheel, I have the following log:
https://github.com/dtschump/gmic-py/runs/358967116

..with especially this non-funny failing auditwheel repair linking error:

  File "/usr/local/bin/auditwheel", line 10, in <module>
    sys.exit(main())
  File "/opt/_internal/cpython-3.7.5/lib/python3.7/site-packages/auditwheel/main.py", line 50, in main
    rval = args.func(args, p)
  File "/opt/_internal/cpython-3.7.5/lib/python3.7/site-packages/auditwheel/main_repair.py", line 83, in execute
    update_tags=args.UPDATE_TAGS)
  File "/opt/_internal/cpython-3.7.5/lib/python3.7/site-packages/auditwheel/repair.py", line 101, in repair_wheel
    needed = elf_read_dt_needed(path)
  File "/opt/_internal/cpython-3.7.5/lib/python3.7/site-packages/auditwheel/elfutils.py", line 16, in elf_read_dt_needed
    raise ValueError('Could not find soname in %s' % fn)
ValueError: Could not find soname in .libsgmic/libcrypt-2-a5d5a997.12.so
gmic-2.8.1.dev0-cp34-cp34m-linux_x86_64.whl

I am already pulling the :latest Docker image tag.
Should I yum install libxcrypt or libcrypt-compat or so first?
Should I consider manylinux2014 instead? (my project does not plan to support very old linuxes for now).

Here is the original issue link on our side:
https://github.com/dtschump/gmic-py/issues/9

Thank you for your help :)

@myselfhimself myselfhimself changed the title libcrypt-2-*.12.so not found during auditwheel libcrypt-2-*.12.so not found during auditwheel repair Dec 22, 2019
@myselfhimself
Copy link
Author

Using manylinux2014 does not help, with the following auditwheel repair error:

 auditwheel repair wheelhouse/gmic-2.8.1.dev1-cp35-cp35m-linux_x86_64.whl --plat manylinux2014_x86_64 -w /io/wheelhouse/
INFO:auditwheel.main_repair:Repairing gmic-2.8.1.dev1-cp35-cp35m-linux_x86_64.whl
usage: auditwheel [-h] [-V] [-v] command ...
auditwheel: error: cannot repair "wheelhouse/gmic-2.8.1.dev1-cp35-cp35m-linux_x86_64.whl" to "manylinux2014_x86_64" ABI because of the presence of too-recent versioned symbols. You'll need to compile the wheel on an older toolchain.
gmic-2.8.1.dev1-cp35-cp35m-linux_x86_64.whl
gmic-2.8.1.dev1-cp36-cp36m-linux_x86_64.whl
gmic-2.8.1.dev1-cp37-cp37m-linux_x86_64.whl
gmic-2.8.1.dev1-cp38-cp38-linux_x86_64.whl

The manylinux2014 build/repair log is here :
https://github.com/dtschump/gmic-py/runs/360777824

@myselfhimself
Copy link
Author

I have removed the dependency on libcurl so libcrzpt is not linked any more and the auditwheel repair operation continues and succeeds

@myselfhimself
Copy link
Author

Closing, anyone in need may reopen this.

@dralley
Copy link

dralley commented Feb 24, 2020

I believe the issue is that libcurl inside this environment is dynamically linked against libcrypt.so.1

Installed:
  libcurl-devel.x86_64 0:7.29.0-54.el7_7.2                                      

Dependency Updated:
  curl.x86_64 0:7.29.0-54.el7_7.2       libcurl.x86_64 0:7.29.0-54.el7_7.2      

Complete!
+ ls -la /lib64/
+ grep libcurl
lrwxrwxrwx.  1 root root      16 Feb 24 18:39 libcurl.so -> libcurl.so.4.3.0
lrwxrwxrwx.  1 root root      16 Feb 24 18:39 libcurl.so.4 -> libcurl.so.4.3.0
-rwxr-xr-x.  1 root root  439320 Feb  4 17:00 libcurl.so.4.3.0
+ ldd /lib64/libcurl.so.4
+ grep libcrypt
        libcrypto.so.10 => /lib64/libcrypto.so.10 (0x00007f41742d8000)
        libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007f4173428000)

(Taken from inside the manylinux 2014 docker image)

So as a packager, I can't avoid this problem without avoiding libcurl or building it from source myself such that it links against libcrypt.so.2.

When I run ldd on the .so inside my own package on Fedora, the host system, it correctly shows that libcrypt.so.2 is being loaded. In the docker environment, it shows libcrypt.so.1. But because it's just a transitive dependency, it doesn't "break" on either system, because my library doesn't care about libcrypt, just libcurl, and it's the same on both systems.

This makes sense because libcrypt doesn't show as a direct dependency via. readelf.

@myselfhimself
Copy link
Author

myselfhimself commented Feb 24, 2020 via email

@dralley
Copy link

dralley commented Feb 24, 2020

Hopefully this will resolve the problem properly: pypa/auditwheel#230

@myselfhimself
Copy link
Author

Should I reopen this issue until pypa/auditwheel#230 is resolved?

@dralley
Copy link

dralley commented Feb 25, 2020

That would be reasonable, but do whatever you like!

@vapier
Copy link

vapier commented Mar 27, 2020

i hit this kind of error when trying to build a wheel that utilized libcrypt.so.1. i traced it back to Centos 6's glibc shipping a libcrypto.so.1 that patchelf does not handle correctly and ends up corrupting it in a way that tools get confused when they try to process the ELF later on.

details of the patchelf bug can be found at NixOS/patchelf#197.

this impacts the manylinux2010 container only. the manylinux2014 container doesn't seem to have a weird libcrypto.so.1 file.

i hacked around it by slightly modifying the librypt.so.1 in the image. this makes patchelf pick the correct section header table when it rewrites the soname.

$ printf '\x1a' | dd of=/lib64/libcrypt-2.12.so count=1 bs=1 conv=notrunc seek=$((0x9f68))

still experimenting with this.

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 a pull request may close this issue.

3 participants