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

Delocate doesn't support Namespace Packages (e.g. https://packaging.python.org/guides/packaging-namespace-packages/) #95

Closed
rowillia opened this issue Feb 20, 2021 · 1 comment · Fixed by #123
Labels

Comments

@rowillia
Copy link

Repro (Attempting to build a wheel for protobuf)

  1. git clone [email protected]:protocolbuffers/protobuf.git
  2. cd protobuf
  3. ./autogen.sh
  4. CXXFLAGS="-fPIC -g -O2" ./configure
  5. make -j8
  6. cd python
  7. python setup.py bdist_wheel --cpp_implementation
  8. delocate-listdeps --depending --all dist/protobuf-3.14.0-cp36-cp36m-macosx_10_15_x86_64.whl
  9. delocate-wheel -w fixed_wheels -v dist/protobuf-3.14.0-cp36-cp36m-macosx_10_15_x86_64.whl
  10. delocate-listdeps --depending --all dist/protobuf-3.14.0-cp36-cp36m-macosx_10_15_x86_64.whl

Note that the wheel has not been fixed.

If you modify setup.py and remove namespace_packages this work correctly.

I'm unsure if this is just another manifestation of #45

@rowillia
Copy link
Author

Would #38 fix this?

@HexDecimal HexDecimal added the bug label Sep 19, 2021
matthew-brett added a commit that referenced this issue Sep 21, 2021
MRG: Allow for delocating top level modules.

This delocates libraries into one directory per wheel.  I've added a top-level package-less wheel to test with.

Prevents copying duplicate libraries when a wheel has multiple packages.  Fixes #35.

Fixes issues where the module to work on is at the top-level, such as a wheel with no packages.  Generally any current issue where delocate mysteriously doesn't bundle libraries has been fixed.  Fixes #72, fixes #22, fixes #45, fixes #63, fixes #121, fixes #66, fixes #49, fixes #67.

See `_decide_dylib_bundle_directory` for how the folder to use is determined.  I've followed the advice from #72 to use an auditwheel-style name.  Wheels without packages use the folder `{package_name}.dylibs`, wheels with packages will put a `.dylibs` folder in only one of the packages preferring the one that matches the wheel name.  The one directory will hold the dependencies of the entire wheel.

After that the fix was simple:  In `delocate_wheel` call `delocate_path` only once and call it with a `tree_path` that includes the entire wheel.

Since this always collects everything regardless of if a package is found or not.  This will also resolve issues where namespace packages couldn't be delocated.  Fixes #95.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants