mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-33125: Add support for building and releasing Windows ARM64 packages (GH-16828)
Note that the support is not actually enabled yet, and so we won't be publishing these packages. However, for those who want to build it themselves (even by reusing the Azure Pipelines definition), it's now relatively easy to enable.
This commit is contained in:
parent
abce2d9bc6
commit
de148f263f
29 changed files with 286 additions and 74 deletions
|
@ -285,14 +285,13 @@ def _compile_one_py(src, dest, name, optimize, checked=True):
|
|||
log_warning("Failed to compile {}", src)
|
||||
return None
|
||||
|
||||
|
||||
# name argument added to address bpo-37641
|
||||
def _py_temp_compile(src, name, ns, dest_dir=None, checked=True):
|
||||
if not ns.precompile or src not in PY_FILES or src.parent in DATA_DIRS:
|
||||
return None
|
||||
dest = (dest_dir or ns.temp) / (src.stem + ".pyc")
|
||||
return _compile_one_py(
|
||||
src, dest, name, optimize=2, checked=checked
|
||||
)
|
||||
return _compile_one_py(src, dest, name, optimize=2, checked=checked)
|
||||
|
||||
|
||||
def _write_to_zip(zf, dest, src, ns, checked=True):
|
||||
|
@ -496,6 +495,13 @@ def main():
|
|||
parser.add_argument(
|
||||
"-b", "--build", metavar="dir", help="Specify the build directory", type=Path
|
||||
)
|
||||
parser.add_argument(
|
||||
"--arch",
|
||||
metavar="architecture",
|
||||
help="Specify the target architecture",
|
||||
type=str,
|
||||
default=None,
|
||||
)
|
||||
parser.add_argument(
|
||||
"--doc-build",
|
||||
metavar="dir",
|
||||
|
@ -587,6 +593,8 @@ def main():
|
|||
ns.doc_build = (Path.cwd() / ns.doc_build).resolve()
|
||||
if ns.include_cat and not ns.include_cat.is_absolute():
|
||||
ns.include_cat = (Path.cwd() / ns.include_cat).resolve()
|
||||
if not ns.arch:
|
||||
ns.arch = "amd64" if sys.maxsize > 2 ** 32 else "win32"
|
||||
|
||||
if ns.copy and not ns.copy.is_absolute():
|
||||
ns.copy = (Path.cwd() / ns.copy).resolve()
|
||||
|
@ -602,6 +610,7 @@ def main():
|
|||
Source: {ns.source}
|
||||
Build: {ns.build}
|
||||
Temp: {ns.temp}
|
||||
Arch: {ns.arch}
|
||||
|
||||
Copy to: {ns.copy}
|
||||
Zip to: {ns.zip}
|
||||
|
@ -609,6 +618,15 @@ Catalog: {ns.catalog}""",
|
|||
ns=ns,
|
||||
)
|
||||
|
||||
if ns.arch not in ("win32", "amd64", "arm32", "arm64"):
|
||||
log_error("--arch is not a valid value (win32, amd64, arm32, arm64)")
|
||||
return 4
|
||||
if ns.arch in ("arm32", "arm64"):
|
||||
for n in ("include_idle", "include_tcltk"):
|
||||
if getattr(ns, n):
|
||||
log_warning(f"Disabling --{n.replace('_', '-')} on unsupported platform")
|
||||
setattr(ns, n, False)
|
||||
|
||||
if ns.include_idle and not ns.include_tcltk:
|
||||
log_warning("Assuming --include-tcltk to support --include-idle")
|
||||
ns.include_tcltk = True
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue