Skip to content

Commit 19a73ef

Browse files
committed
windows: x86 build fixes
Recent changes to support shared builds broke x86 builds. This commit should hopefully restore support.
1 parent fbf63c5 commit 19a73ef

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

cpython-windows/build.py

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@
4646
"_ctypes": {},
4747
"_decimal": {},
4848
"_elementtree": {},
49-
"_hashlib": {"shared_depends_amd64": ["libcrypto-1_1-x64"]},
49+
"_hashlib": {
50+
"shared_depends_amd64": ["libcrypto-1_1-x64"],
51+
"shared_depends_win32": ["libcrypto-1_1"],
52+
},
5053
"_lzma": {
5154
"ignore_additional_depends": {"$(OutDir)liblzma$(PyDebugExt).lib"},
5255
"static_depends": ["liblzma"],
@@ -60,6 +63,7 @@
6063
# project files.
6164
"_ssl": {
6265
"shared_depends_amd64": ["libcrypto-1_1-x64", "libssl-1_1-x64"],
66+
"shared_depends_win32": ["libcrypto-1_1", "libssl-1_1"],
6367
"static_depends_no_project": ["libcrypto_static", "libssl_static"],
6468
},
6569
"_queue": {},
@@ -689,16 +693,17 @@ def hack_props(td: pathlib.Path, pcbuild_path: pathlib.Path, arch: str, static:
689693
else:
690694
if arch == "amd64":
691695
suffix = b"x64"
692-
elif arch == "x86":
693-
suffix = b"x86"
696+
elif arch == "win32":
697+
suffix = None
694698
else:
695699
raise Exception("unhandled architecture: %s" % arch)
696700

697-
static_replace_in_file(
698-
openssl_props,
699-
b"<_DLLSuffix>-1_1</_DLLSuffix>",
700-
b"<_DLLSuffix>-1_1-%s</_DLLSuffix>" % suffix,
701-
)
701+
if suffix:
702+
static_replace_in_file(
703+
openssl_props,
704+
b"<_DLLSuffix>-1_1</_DLLSuffix>",
705+
b"<_DLLSuffix>-1_1-%s</_DLLSuffix>" % suffix,
706+
)
702707

703708

704709
def hack_project_files(
@@ -1499,7 +1504,8 @@ def build_cpython(arch: str, pgo=False, build_mode="static"):
14991504
# We need all the OpenSSL library files in the same directory to appease
15001505
# install rules.
15011506
if not static:
1502-
openssl_root = td / "openssl" / arch
1507+
openssl_arch = {"amd64": "amd64", "x86": "win32"}[arch]
1508+
openssl_root = td / "openssl" / openssl_arch
15031509
openssl_bin_path = openssl_root / "bin"
15041510
openssl_lib_path = openssl_root / "lib"
15051511

0 commit comments

Comments
 (0)