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
add support for building wheels for windows on arm64 #920
Changes from 11 commits
325b1c3
e8898c0
cfeba93
76248e2
c91d158
9bf6b0a
454f5d2
dfae980
aaf23c9
dffac66
4cc5fb0
19e11ff
ff6ac4f
05becce
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -87,6 +87,8 @@ python_configurations = [ | |
{ identifier = "cp39-win_amd64", version = "3.9.8", arch = "64" }, | ||
{ identifier = "cp310-win32", version = "3.10.0", arch = "32" }, | ||
{ identifier = "cp310-win_amd64", version = "3.10.0", arch = "64" }, | ||
{ identifier = "cp310-win_arm64", version = "3.9.9", arch = "ARM64" }, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This identifier appears to be wrong? should be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't we have two, possibly, then? 3.9.9 and 3.10.0? Not sure what's actually available. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Ah, copy-paste error. I will fix it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yes, both are available. I thought I had it in my patch. Will fix thtat |
||
{ identifier = "cp310-win_arm64", version = "3.10.0", arch = "ARM64" }, | ||
{ identifier = "pp37-win_amd64", version = "3.7", arch = "64", url = "https://downloads.python.org/pypy/pypy3.7-v7.3.7-win64.zip" }, | ||
{ identifier = "pp38-win_amd64", version = "3.8", arch = "64", url = "https://downloads.python.org/pypy/pypy3.8-v7.3.7-win64.zip" }, | ||
] |
Original file line number | Diff line number | Diff line change | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -7,6 +7,8 @@ | |||||||||||||||
from typing import Dict, List, NamedTuple, Optional, Sequence, Set | ||||||||||||||||
from zipfile import ZipFile | ||||||||||||||||
|
||||||||||||||||
from packaging.version import Version | ||||||||||||||||
|
||||||||||||||||
from .architecture import Architecture | ||||||||||||||||
from .environment import ParsedEnvironment | ||||||||||||||||
from .logger import log | ||||||||||||||||
|
@@ -43,9 +45,8 @@ def shell( | |||||||||||||||
|
||||||||||||||||
|
||||||||||||||||
def get_nuget_args(version: str, arch: str) -> List[str]: | ||||||||||||||||
python_name = "python" | ||||||||||||||||
if arch == "32": | ||||||||||||||||
python_name += "x86" | ||||||||||||||||
platform_suffix = {"32": "x86", "64": "", "ARM64": "arm64"} | ||||||||||||||||
python_name = "python" + platform_suffix[arch] | ||||||||||||||||
return [ | ||||||||||||||||
python_name, | ||||||||||||||||
"-Version", | ||||||||||||||||
|
@@ -73,10 +74,7 @@ def get_python_configurations( | |||||||||||||||
|
||||||||||||||||
python_configurations = [PythonConfiguration(**item) for item in full_python_configs] | ||||||||||||||||
|
||||||||||||||||
map_arch = { | ||||||||||||||||
"32": Architecture.x86, | ||||||||||||||||
"64": Architecture.AMD64, | ||||||||||||||||
} | ||||||||||||||||
map_arch = {"32": Architecture.x86, "64": Architecture.AMD64, "ARM64": Architecture.ARM64} | ||||||||||||||||
joerick marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||
|
||||||||||||||||
# skip builds as required | ||||||||||||||||
python_configurations = [ | ||||||||||||||||
|
@@ -189,10 +187,28 @@ def setup_python( | |||||||||||||||
# Install pip | ||||||||||||||||
|
||||||||||||||||
requires_reinstall = not (installation_path / "Scripts" / "pip.exe").exists() | ||||||||||||||||
|
||||||||||||||||
if requires_reinstall: | ||||||||||||||||
# maybe pip isn't installed at all. ensurepip resolves that. | ||||||||||||||||
call(["python", "-m", "ensurepip"], env=env, cwd=CIBW_INSTALL_PATH) | ||||||||||||||||
|
||||||||||||||||
# pip bundled with python 3.10 for arm64 lacks windows launcher and requires an extra pip force-reinstall to get pip executable | ||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||
if python_configuration.arch == "ARM64" and Version(get_pip_version(env)) < Version("21.3"): | ||||||||||||||||
call( | ||||||||||||||||
[ | ||||||||||||||||
"python", | ||||||||||||||||
"-m", | ||||||||||||||||
"pip", | ||||||||||||||||
"install", | ||||||||||||||||
"--force-reinstall", | ||||||||||||||||
"--upgrade", | ||||||||||||||||
"pip", | ||||||||||||||||
*dependency_constraint_flags, | ||||||||||||||||
], | ||||||||||||||||
env=env, | ||||||||||||||||
cwd=CIBW_INSTALL_PATH, | ||||||||||||||||
) | ||||||||||||||||
|
||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This might be overcomplicated. If the pip executable is missing, we should already detect that. Could you try looking for whatever you're missing, like-
or if that doesn't work, just this would be okay for now I think-
probably better to move this up to after the requires_reinstall set line too. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's exactly what I tried at first but unfortunately didn't work. The issue is that pip bundled with python 3.10 builds executables such as pip.exe for x64 platform. The first re-install of pip updates pip module but builds pip.exe using the old pip which still generates x64 executable. But the second re-install uses updated pip and correctly builds pip.exe for the target. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah, hmm, okay. I think I understand. What is the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd expect this is a temporary problem and should be fixed once a newer pip is bundled? That's a guess, though, and it would be nice to verify this really was fixed in 21.3 and is not just a problem with nuget. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, the fix is available from pip release 21.3 so we don't have to do the extra install. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Got it. I've suggested adding this explanation as a comment, which will help let us know when it can be removed. |
||||||||||||||||
# upgrade pip to the version matching our constraints | ||||||||||||||||
# if necessary, reinstall it to ensure that it's available on PATH as 'pip.exe' | ||||||||||||||||
call( | ||||||||||||||||
|
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.
Looks like this table markdown isn't parsing any more. Do the first two Pythons have too many columns?
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.
The line in-between is wrong.
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.
->
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've tried in a markdown editor and it didn't spot that. Sorry I will fix that.