LeoHsiao1 / pyexiv2

Read and write image metadata, including EXIF, IPTC, XMP, ICC Profile.
GNU General Public License v3.0
196 stars 39 forks source link

Source not available after 2.5.0 #103

Closed guilhermef closed 1 year ago

guilhermef commented 1 year ago

Hi @LeoHsiao1, I've been having some issues when trying to install the latest version on Mac M1. The source isn't available in Pypi, only the wheels and there's no wheel for Mac M1.

Can you release also the package in .tar.gz?

Thanks.

LeoHsiao1 commented 1 year ago

Hi. When you execute pip install pyexiv2, it will try to download the pyexiv2 and exiv2 compilation files. However, both exiv2 and pyexiv2 are compiled using Github Action for amd64 architecture only. Mac M1 uses the arm architecture. So, you need git clone exiv2 and pyexiv2, then compile them manually. See pyexiv2/lib.

Although I wanted to avoid the compile time for users, I didn't have a trusted ARM computer. Maybe Github Action will offer one in the future.

guilhermef commented 1 year ago

@LeoHsiao1 I've been using QEmu to compile for ARM on other projects: https://github.com/uraimo/run-on-arch-action It works well.

guilhermef commented 1 year ago

I also have this PR on the Thumbor project, that compiles to multiple architectures https://github.com/thumbor/thumbor/pull/1498/files using cibuildwheel

LeoHsiao1 commented 1 year ago

Thanks for your advice. I learned about uraimo/run-on-arch-action@v2 in the evening. It seems like it only supports Ubuntu, not MacOS. I'm not familiar with the arm and aarch64 architectures. Can we cross-compile them on the amd64 machine provided by GitHub action?

cibuildwheel supports cross-compilation. But it relies on python setup.py to build, requiring C++ compilation commands to be converted into Python code. It looks tricky. Also, I searched for GitLab Runner, Travis CI and CircleCI. But none of them offer free MacOS Arm machines.

guilhermef commented 1 year ago

According to this page, it's possible to cross-compile for Arm on Mac: https://developer.apple.com/documentation/apple-silicon/building-a-universal-macos-binary

LeoHsiao1 commented 1 year ago

Good morning. I learned that cross-compiling is possible. So I tried to build, and the first challenge I found was how to build exiv2. There are some C++ code compatibility problems that I couldn't solve. The good news is that this PR https://github.com/Exiv2/exiv2/pull/1235 tries to build exiv2 on arm machines. But the work is not yet done.

LeoHsiao1 commented 1 year ago

Currently, exiv2 only supports compilation on amd64 platform. Compilations on other platforms may work, but there is no documentation. pyexiv2 also has this limitation.