-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Failed to build Windows ARM64 dependencies #6679
Comments
AFAIK none of the regular Pillow contributors have access to a Windows system running on ARM64, build support for that platform was added in #5811. However, |
I should have access to a "Windows Dev Kit 2023" soon and will try to build Pillow among other packages |
AMD64 builds fine though. It's only ARM64 that ends up failing. If you have access to an M1/M2 Mac you could also use that to install the ARM64 Windows 11 on Parallels or UTM and then run the ARM64 Python that way |
You made this comment, but it's not appearing, so I imagine you deleted it. That didn't solve the problem after all? |
It did make some progress after installing that, but ended up failing at some point in the process: https://gist.github.com/infinitepower18/e1190d4ba2a08bd5fa74f08d20499b7b |
The error is triggered by libimagequant, but seems to be in a C++ standard library file:
I think this error should have been prevented by the commit ImageOptim/libimagequant@94adecb. This makes me think that libimagequant is not required to build Pillow, you can skip it with: |
|
Oops, I thought I already replied two days ago...
Are you actually running on an ARM64 system, or are you attempting to cross-compile? Compiling FriBiDi requires compiling and running short programs to parse the Unicode specification and generate source code. These should be compiled for the host system, while the final DLL should be compiled for the target system. From the output I'm guessing these were compiled for ARM64 which cannot be run on your host system. However, FriBiDi is also an optional dependency you can skip: |
I was doing it on a normal x64 system, but I do have Windows ARM64 running in a VM on my M1 Pro MacBook Pro. However after installing the required tools on Windows ARM64 I am back to the error that I initially reported. Which I don't get because I installed the ARM64 build tools as well. Not sure what I'm doing wrong here. |
Do you have a Windows 10 SDK installed as a VS2022 component on the ARM64 system? BTW, FriBiDi is the last dependency, and optional, so you could just skip to running |
Just noting here for my future reference: The x86_64 build tools should not be needed, but I suspect Pillow/winbuild/build_prepare.py Line 404 in 7adda3d
This should probably end with It should probably also require |
Good news. Besides the mentioned change in build_prepare.py, there are only two issues in dependencies:
Both issues are easy to fix/patch and the Pillow build succeeds and passes all tests besides the usual
Here's the wheel: |
That was just added to
Already fixed in a future release: uclouvain/openjpeg#1422 Having an ARM64 Windows CI would have quickly caught both of those issues.
I've created #6703 to mark it as "known failing". It will still get run, but will no longer mark the pytest session as a fail. |
Another issue with that test is that it leaves temporary files (obj and exe) behind. Probably better to remove the test altogether if it doesn't get maintained. |
One can only hope these will make it to GitHub as well... In the meantime, a self-hosted runner using the "Windows Dev Kit 2023" is the only option (see e.g. the MSYS2 one using the older kit). |
Here is a Windows arm wheel for Pillow 9.4.0 - #6750 (comment) |
I've attempted to compile Pillow on a borrowed MacBook running Windows on ARM in a VM and got the same error message. It turns out I was missing the following Visual Studio Build Tools components:
These correspond to the following IDs according to https://learn.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-build-tools?view=vs-2022&preserve-view=true:
Without these components, the build tools were silently selecting the x86 compiler and linker instead. Installing those components and trying again fixed the issue for me. Interestingly, the former component (i.e. C++ modules) is only needed in the Visual Studio Build Tools edition, the Community edition does not list or require this component at all. I've created #7559 to fix the Visual Studio component check as well as some cross-compilation errors. |
What did you do?
I'm trying to build a Python 3.11 ARM64 wheel for Windows ARM64 using the provided instructions and used the command
build_prepare.py --architecture=ARM64
. However it fails when I try to build the dependencies afterwards. I have Visual Studio Community 2022 installed on my system.What did you expect to happen?
The dependencies should have been built successfully.
What actually happened?
Fails when trying to build for ARM64
What are your OS, Python and Pillow versions?
The text was updated successfully, but these errors were encountered: