diff options
author | Steve Dower <steve.dower@python.org> | 2019-11-20 17:30:47 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-20 17:30:47 (GMT) |
commit | de148f263fba75cd10d2cb010fe9c495cee4ec83 (patch) | |
tree | 7559853c00252bb9e300e6815ee3615a90e3973b /PC/layout/main.py | |
parent | abce2d9bc6b990831d303f4cf9f2de8a6712a1fc (diff) | |
download | cpython-de148f263fba75cd10d2cb010fe9c495cee4ec83.zip cpython-de148f263fba75cd10d2cb010fe9c495cee4ec83.tar.gz cpython-de148f263fba75cd10d2cb010fe9c495cee4ec83.tar.bz2 |
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.
Diffstat (limited to 'PC/layout/main.py')
-rw-r--r-- | PC/layout/main.py | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/PC/layout/main.py b/PC/layout/main.py index 3ca49d0..305cb51 100644 --- a/PC/layout/main.py +++ b/PC/layout/main.py @@ -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): @@ -497,6 +496,13 @@ def main(): "-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", help="Specify the docs build directory", @@ -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 |