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

auditwheel error on bigartm wheel #840

Closed
ofrei opened this issue Sep 3, 2017 · 8 comments
Closed

auditwheel error on bigartm wheel #840

ofrei opened this issue Sep 3, 2017 · 8 comments

Comments

@ofrei
Copy link
Contributor

ofrei commented Sep 3, 2017

pr #830 implement a feature that build a python wheel. I've tried to run auditwheel, but it fails:

RuntimeError: Invalid binary wheel, found shared library "libartm.so" in purelib folder.
The wheel has to be platlib compliant in order to be repaired by auditwheel.

Unpacking the wheel shows that it has the following structure:

bigartm-0.8.3.data
  purelib
    artm
      *.py (bunch of .py files which constitutes python API of bigartm)
      libartm.so 
bigartm-0.8.3.dist-info

I'm surprised to see a purelib here. I would expect that our artm folder goes into the root, and we don't have bigartm-0.8.3.data folder. I'm not quite sure, but I've looked into numpy wheel, and it seems to be different -- they barely use .data folder, and there is numpy folder under the root, which also contains .so files.

@vmarkovtsev do you know how to fix this? I'm not quire sure how BinaryDistribution(Distribution) and AddLibraryBuild(build_py) work. Perhaps the issue is how does setup.py bdist_wheel detect that library is platlib and not a purelib? They say it is automatic, but how it works?

bdist_wheel will detect that the code is not pure Python, and build a wheel that’s named such that it’s only usable on the platform that it was built on

@vmarkovtsev
Copy link
Contributor

I will look into this, weird, this setup worked for one of our projects.

@ofrei
Copy link
Contributor Author

ofrei commented Sep 3, 2017

Thanks! I have a good progress with building bigartm on manylinux docker image (and it seems to work - I've tested the resulting wheel in ubuntu:14.04 image). So as long as auditwheel works I think I'll be able to push those wheels on PyPi. The only trouble is, how to build wheels for mac? Do I have to buy a mac?.. Anyway, let's first sort out auditwheel first :)

@aborg-dev
Copy link
Contributor

You can try to use Travis OSX build environment: https://docs.travis-ci.com/user/reference/osx/

@ofrei ofrei mentioned this issue Oct 21, 2017
8 tasks
@JeanPaulShapo
Copy link
Contributor

I think there is problem in implementaion of install command in standard distutils library in finalize_options:

# Pick the actual directory to install all modules to: either
# install_purelib or install_platlib, depending on whether this
# module distribution is pure or not.  Of course, if the user
# already specified install_lib, use their selection.
if self.install_lib is None:
    if self.distribution.ext_modules: # has extensions: non-pure
        self.install_lib = self.install_platlib
    else:
        self.install_lib = self.install_purelib

In order to install into platform-dependent directory, you must have at least one extension, but they don't check for has_ext_modules function! That's why there is some weird behaviour.

One of the possible solutions is to override default behaviour in custom subclass of install command:

class InstallPlatlib(install):
    def finalize_options(self):
        install.finalize_options(self)
        if self.distribution.has_ext_modules():
            self.install_lib = self.install_platlib

@ofrei
Copy link
Contributor Author

ofrei commented Nov 8, 2017

@JeanPaulShapo Thanks! I'll give it a try...

@zurk
Copy link

zurk commented Feb 23, 2018

@ofrei, I discovered the same problem for https://github.com/src-d/minhashcuda project
I was able to solve it with older auditwheel version.
try to use 1.4 or 1.5. If you decide to use 1.5 you should also update patchelf Debian package to 0.9 version.

Good luck!

@ofrei
Copy link
Contributor Author

ofrei commented Feb 25, 2018

@zurk Thanks! I'll give it a try

@bt2901
Copy link
Contributor

bt2901 commented Dec 17, 2019

Found easy workaround: pypa/auditwheel#28 (comment)

You should create setup.cfg in /bigartm/python with the following text:

[install]
install_lib=

With cautious optimism, here's a provisional wheel file: https://www.dropbox.com/s/ju3s7p1sac9kpem/bigartm-0.9.0-cp37-cp37m-manylinux1_x86_64.whl?dl=0

dilawar pushed a commit to dilawar/Smoldyn that referenced this issue Jul 8, 2020
dilawar pushed a commit to dilawar/Smoldyn that referenced this issue Jul 10, 2020
- Sphinx generates use docs
- Doxygen generates c/c++ api docs
- travis generases wheels and upload them to PyPi.

Squashed commit of the following:

commit e1df8b9
Author: Dilawar Singh <dilawars@ncbs.res.in>
Date:   Fri Jul 10 00:41:55 2020 +0530

    set -x on osx build

commit ac34b39
Author: Dilawar Singh <dilawars@ncbs.res.in>
Date:   Fri Jul 10 00:27:38 2020 +0530

    got the makefile back.

commit d7b1801
Author: Dilawar Singh <dilawars@ncbs.res.in>
Date:   Thu Jul 9 23:42:04 2020 +0530

    doxygen is integreated into RST.
    Thanks to https://stackoverflow.com/a/31820846/1805129

commit c69244f
Author: Dilawar Singh <dilawars@ncbs.res.in>
Date:   Thu Jul 9 22:17:19 2020 +0530

    Doxygen docs should be separate.

commit 6da0d2c
Author: Dilawar Singh <dilawars@ncbs.res.in>
Date:   Thu Jul 9 20:56:39 2020 +0530

    Added API documentation.

commit c3de8bc
Author: Dilawar Singh <dilawars@ncbs.res.in>
Date:   Thu Jul 9 17:30:44 2020 +0530

    use python3 executable from command line...

commit f0dd108
Author: Dilawar Singh <dilawars@ncbs.res.in>
Date:   Thu Jul 9 17:14:55 2020 +0530

    Added smoldyn to requirement file with --pre tags.

commit 8222a89
Author: Dilawar Singh <dilawars@ncbs.res.in>
Date:   Thu Jul 9 17:08:53 2020 +0530

    probably the right syntax for multiple OSX.

commit 9ae2bbe
Author: Dilawar Singh <dilawar.s.rajput@gmail.com>
Date:   Thu Jul 9 16:29:02 2020 +0530

    use top-level README.md file

commit 9b2135a
Merge: b8c5a28 8ae13d6
Author: Dilawar Singh <dilawar.s.rajput@gmail.com>
Date:   Thu Jul 9 16:12:45 2020 +0530

    Merge branch 'devel' of https://github.com/dilawar/Smoldyn-official into devel

commit b8c5a28
Author: Dilawar Singh <dilawar.s.rajput@gmail.com>
Date:   Thu Jul 9 16:12:23 2020 +0530

    Added two more OSX images.

commit 8ae13d6
Author: Dilawar Singh <dilawar.s.rajput@gmail.com>
Date:   Thu Jul 9 10:33:07 2020 +0000

    Passing locally...

commit 052fee9
Author: Dilawar Singh <dilawar.s.rajput@gmail.com>
Date:   Thu Jul 9 10:11:48 2020 +0000

    Builds for 3.7, 3.8, and 3.9

commit 8b87cfa
Author: Dilawar Singh <dilawars@ncbs.res.in>
Date:   Wed Jul 8 17:55:03 2020 +0000

    After few hacks (thanks bigartm/bigartm#840), wheels are building fine for 3.7 with proper tags.

commit f4bf6ea
Author: Dilawar Singh <dilawars@ncbs.res.in>
Date:   Wed Jul 8 22:09:03 2020 +0530

    install vim in docker image as well.

commit 982fa28
Author: Dilawar Singh <dilawars@ncbs.res.in>
Date:   Wed Jul 8 22:07:41 2020 +0530

    moved setup.py to devel folder.

commit 826c6d5
Author: Dilawar Singh <dilawars@ncbs.res.in>
Date:   Wed Jul 8 21:08:39 2020 +0530

    keeping the abi version in so file.

commit 10afb57
Author: Dilawar Singh <dilawars@ncbs.res.in>
Date:   Wed Jul 8 11:15:36 2020 +0530

    local version string is forbidden on PyPI.

commit 2658960
Author: Dilawar Singh <dilawars@ncbs.res.in>
Date:   Wed Jul 8 11:07:28 2020 +0530

    Added new token on travis.

commit da99c2c
Author: Dilawar Singh <dilawars@ncbs.res.in>
Date:   Wed Jul 8 10:54:43 2020 +0530

    build wheels on OSX.

commit 9a5542f
Author: Dilawar Singh <dilawars@ncbs.res.in>
Date:   Wed Jul 8 10:23:58 2020 +0530

    generate wheel

commit d35a1ba
Author: Dilawar Singh <dilawars@ncbs.res.in>
Date:   Wed Jul 8 10:18:37 2020 +0530

    Aded git config info to dockerfile.

commit 2e89cd2
Author: Dilawar Singh <dilawars@ncbs.res.in>
Date:   Tue Jul 7 21:01:31 2020 +0530

    fresh checkout in docker image.

commit fcf83d3
Author: Dilawar Singh <dilawars@ncbs.res.in>
Date:   Tue Jul 7 20:27:05 2020 +0530

    Another try on travis

commit 11ac773
Author: Dilawar Singh <dilawars@ncbs.res.in>
Date:   Tue Jul 7 20:21:26 2020 +0530

    Fixed paths.

commit a866229
Author: Dilawar Singh <dilawars@ncbs.res.in>
Date:   Tue Jul 7 20:15:42 2020 +0530

    Enabled X11 forwarding..

commit 9afdc79
Author: Dilawar Singh <dilawars@ncbs.res.in>
Date:   Tue Jul 7 19:50:32 2020 +0530

    script -> devel

commit b1678ac
Author: Dilawar Singh <dilawars@ncbs.res.in>
Date:   Tue Jul 7 19:24:10 2020 +0530

    added __version__ string.

commit 3ae3073
Author: Dilawar Singh <dilawars@ncbs.res.in>
Date:   Tue Jul 7 13:13:00 2020 +0000

    Fixes to wheel.

commit 9956506
Author: Dilawar Singh <dilawars@ncbs.res.in>
Date:   Tue Jul 7 04:43:45 2020 +0530

    Updated version.

commit 8370b90
Author: Dilawar Singh <dilawars@ncbs.res.in>
Date:   Mon Jul 6 23:53:11 2020 +0530

    use version 2 on rtd.

commit 1d5c383
Author: Dilawar Singh <dilawars@ncbs.res.in>
Date:   Mon Jul 6 23:49:33 2020 +0530

    Added rtd configurations.

commit 44b01b8
Author: Dilawar Singh <dilawars@ncbs.res.in>
Date:   Mon Jul 6 23:37:36 2020 +0530

    RST documentation.

commit a39b058
Author: Dilawar Singh <dilawars@ncbs.res.in>
Date:   Mon Jul 6 04:10:18 2020 +0530

    sphinx is back.

commit 6c90dbc
Author: Dilawar Singh <dilawars@ncbs.res.in>
Date:   Mon Jul 6 04:03:57 2020 +0530

    removed unneccessary files.
@bt2901 bt2901 closed this as completed Aug 12, 2020
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

6 participants