-
-
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
Windows arm64 dependency cross-compilation fixes #7559
Conversation
winbuild/build_prepare.py
Outdated
elif args.architecture == "ARM64" and platform.machine() != "ARM64": | ||
print( | ||
"\nWarning: Cross-compiling FriBiDi is currently not supported, disabling" | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You didn't want to use warnings.warn()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like that it can sometimes appear at a random point in the output due to using stderr instead of stdout so I hadn't even tested it. I've just tried it and found that:
- in Terminal, it seems to always print in the intended order;
- in PyCharm, it can print out of order, but uses a red highlight.
I've therefore changed the code to use warnings.warn
.
# libjpeg-turbo does not detect MSVC x86_arm64 cross-compiler correctly | ||
'if(MSVC_IDE AND CMAKE_GENERATOR_PLATFORM MATCHES "arm64")': "if({architecture} STREQUAL ARM64)", # noqa: E501 | ||
}, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this change something that could be suggested to https://github.com/libjpeg-turbo/libjpeg-turbo, so that it could one day no longer require patching?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, not easily.
CMake does not provide a value for the target CPU architecture, only the host CPU architecture: https://stackoverflow.com/a/12024211/1648883
The {architecture}
string here is referring to the Python value from
Pillow/winbuild/build_prepare.py
Line 712 in af83f67
"architecture": args.architecture, |
Co-authored-by: Hugo van Kemenade <[email protected]>
For #6679 and #7390 (comment)
When compiling Pillow directly on an ARM64 system, I found it worked after installing the correct Visual Studio components.
Cross-compiling required a few patches to the dependencies.
Changes proposed in this pull request: