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

[BUG] No universal/fat binary installed on macOS since version 3.0.0 #277

Closed
obfuscated opened this issue Mar 21, 2023 · 4 comments
Closed
Labels
wontfix This will not be worked on

Comments

@obfuscated
Copy link

obfuscated commented Mar 21, 2023

pip3 install --user charset-normalizer installs a module that is not capable of running in Rosetta2 on macOS.
pip3 install --user charset-normalizer<3.0.0 is required in order to get a working build in Rosetta2.

Using vtool -show-build on the so in the package shows us that it is not a universal (arm64, x86_64) binary, but just an arm64 binary.

/Users/my/Library/Python/3.9/lib/python/site-packages/charset_normalizer/md__mypyc.cpython-39-darwin.so:
Load command 8
      cmd LC_BUILD_VERSION
  cmdsize 32
 platform MACOS
    minos 11.0
      sdk 12.3
   ntools 1
     tool LD
  version 819.6
  • OS: macOS 13.2.1
  • Python version 3.9
  • Package version >=3.0.0
@obfuscated obfuscated added bug Something isn't working help wanted Extra attention is needed labels Mar 21, 2023
@Ousret
Copy link
Collaborator

Ousret commented Mar 22, 2023

I am not familiar with Rosetta2 but I understand the base concept.

Given the information you shared:

Python 3.9, charset-normalizer >= 3.0 and macOS 13

pip has its own logic on how it chooses the right wheel for you. I understand you want a universal wheel for macOS, nonetheless, pip chooses arm64 only.

Here are the files that potentially match your environment.

charset_normalizer-3.1.0-cp39-cp39-macosx_11_0_arm64.whl (123.0 kB [afficher les empreintes](https://pypi.org/project/charset-normalizer/#copy-hash-modal-07b9deb3-60ee-483b-879a-0cbb4c79be39))

Uploaded 6 mars 2023 cp39

charset_normalizer-3.1.0-cp39-cp39-macosx_10_9_x86_64.whl (124.7 kB [afficher les empreintes](https://pypi.org/project/charset-normalizer/#copy-hash-modal-5c62d203-3032-48ea-b111-51a06e840136))

Uploaded 6 mars 2023 cp39

charset_normalizer-3.1.0-cp39-cp39-macosx_10_9_universal2.whl (201.9 kB [afficher les empreintes](https://pypi.org/project/charset-normalizer/#copy-hash-modal-ab83e29e-9728-4eff-9919-c28631d975df))

Uploaded 6 mars 2023 cp39

So pip retrieves charset_normalizer-3.1.0-cp39-cp39-macosx_11_0_arm64.whl and it is normal as the others two are not supported.
Due to limitations on our side, we cannot automatically provide a wheel that matches your expectations.

Finally, to achieve what you want either:

(i) pip install -U https://files.pythonhosted.org/packages/ef/81/14b3b8f01ddaddad6cdec97f2f599aa2fa466bd5ee9af99b08b7713ccd29/charset_normalizer-3.1.0-py3-none-any.whl
(ii) pip uninstall -y charset-normalizer && pip install -U charset-normalizer --no-binary :all:

By doing so, you lose the extra speed. But I expect that it won't affect you.
It is not an issue, so I am closing this.

@Ousret Ousret closed this as not planned Won't fix, can't repro, duplicate, stale Mar 22, 2023
@obfuscated
Copy link
Author

I don't know what limitations you're talking about, it is not explained.
The only thing you need to do to fix this is to pass -arch x86_64 -arch arm64 to you c/c++/linker commands.
Or you need to do separate builds and merge them with lipo, but this is rarely needed, only where the build features asm files that need to be build with two separate assemblers. For simple projects the double arch method works.

I don't know what charset_normalizer-3.1.0-cp39-cp39-macosx_10_9_universal2.whl is. Probably it is 32+64bit universal binary, so technically you're able to build universal binaries and building arm+x86 binary uses the same machinery in the toolchain.

@Ousret
Copy link
Collaborator

Ousret commented Mar 22, 2023

I don't know what limitations you're talking about, it is not explained.

We use pypa/cibuildwheel to automate the process of publishing wheels. We cannot further extend what is offered without introducing uncertainty and risks. Maintaining this is already borderline too much for my sanity.

The only thing you need to do to fix this is to pass -arch x86_64 -arch arm64 to you c/c++/linker commands.

I am well aware of that. It is not that simple, every action taken must be tested with the at most care. And I don't have the time for it.

Unless you are willing to help by contributing and testing extensively, I am afraid that the conversation will end up soon.
Just install the non-binary wheel. Thank you.

Regards,

edit/p.s. related pypa/cibuildwheel#1333 and numpy/numpy#18143
experts already stated their opinions on that.

@obfuscated
Copy link
Author

Thank you for keeping pip a broken mess. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants