Skip to content
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

[python3] Update to 3.11.4 #31727

Merged
merged 41 commits into from
Aug 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
0445fd0
[python3] Update to 3.11.3
Osyotr May 29, 2023
9a0b7f5
Force set PythonForBuild on windows
Osyotr May 31, 2023
2b8c3e7
Set LD_LIBRARY_PATH on unix
Osyotr May 31, 2023
3b84995
Always use vcpkg_find_acquire_program(PYTHON3) on windows
Osyotr Jun 1, 2023
03e3afc
Remove LD_LIBRARY_PATH shenanigans
Osyotr Jun 1, 2023
6e51001
[vtk] Parse python version from include folder
Osyotr Jun 1, 2023
379c1e8
Fix static builds on windows
Osyotr Jun 1, 2023
87cfd06
Pass --with-build-python on unix
Osyotr Jun 1, 2023
753ea87
[omniorb] Fix python version in patch
Osyotr Jun 1, 2023
387742e
Resurrect rpath patch
Osyotr Jun 1, 2023
07b5daf
[python3] fix usage
Osyotr Jun 4, 2023
c359012
[gobject-introspection] don't hardcode python version
Osyotr Jun 4, 2023
6cf722e
Update vcpkg_find_aquire_program(PYTHON3)
Osyotr Jun 4, 2023
7996ca0
[paraview] don't hardcode python version
Osyotr Jun 4, 2023
0006e0e
[vtk-dicom] don't hardcode python version
Osyotr Jun 4, 2023
131b2cb
Update python in vcpkgTools.xml
Osyotr Jun 4, 2023
8874d2e
Fix host arch detection in vcpkg_find_acquire_program(PYTHON3)
Osyotr Jun 5, 2023
f1cf57d
[libpq] Don't hardcode python version
Osyotr Jun 11, 2023
1f72bb1
[shiva] Don't pass python variables
Osyotr Jun 11, 2023
caa5574
[vcpkg-get-python-packages] Delete unused file, update hardcoded pyth…
Osyotr Jun 11, 2023
aae4df3
[python3] update to 3.11.4
Osyotr Jun 11, 2023
4515ed9
[omniorb] Use PREPEND in vcpkg_add_to_path
Osyotr Jun 11, 2023
d9531b8
libpq quickfix
Osyotr Jun 11, 2023
938cad3
re-fix libpq
Osyotr Jun 12, 2023
711730d
fix vcpkg-get-python-packages
Osyotr Jun 12, 2023
8632d98
Make windows 7 patch compatible with unix builds
Osyotr Jun 27, 2023
d4a1299
Copy pyd files to bin
Osyotr Jun 27, 2023
129fa83
Fix static builds
Osyotr Jun 28, 2023
72346ea
Merge remote-tracking branch 'origin/master' into py3_update
Osyotr Jun 28, 2023
e969167
Merge remote-tracking branch 'origin/master' into py3_update
Osyotr Jul 4, 2023
969d095
Speculatively fix osx regression
Osyotr Jul 4, 2023
0867437
Fix omniorb on unix
Jul 5, 2023
cb8e1e0
[gobject-introspection] fix windows builds
Osyotr Jul 6, 2023
24a3084
[vtk] Update vendored copy of mpi4py for python 3.11 support
Osyotr Jul 25, 2023
49f4cdb
Merge remote-tracking branch 'origin/master' into py3_update
Osyotr Jul 25, 2023
a20c180
[mdl-sdk] Fix python
Osyotr Jul 25, 2023
7fbd04d
[gobject-introspection] fix the fix of a fix...
Osyotr Jul 27, 2023
6f3c783
Merge remote-tracking branch 'origin/master' into py3_update
Osyotr Jul 27, 2023
e7225fe
Update versions
Osyotr Jul 27, 2023
c216d78
Merge remote-tracking branch 'origin/master' into py3_update
Osyotr Aug 3, 2023
a4c1a7c
Undo changes in gobject-introspection and vcpkg_find_aquire_program(P…
Osyotr Aug 3, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions ports/gobject-introspection/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ vcpkg_download_distfile(ARCHIVE

vcpkg_extract_source_archive(
SOURCE_PATH
ARCHIVE ${ARCHIVE}
ARCHIVE "${ARCHIVE}"
PATCHES
0001-g-ir-tool-template.in.patch
0002-cross-build.patch
Expand All @@ -29,7 +29,7 @@ if(VCPKG_CROSSCOMPILING AND
endif()

vcpkg_configure_meson(
SOURCE_PATH ${SOURCE_PATH}
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS_DEBUG
${OPTIONS_DEBUG}
OPTIONS_RELEASE
Expand All @@ -50,8 +50,6 @@ vcpkg_copy_pdbs()

vcpkg_fixup_pkgconfig()

file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)

set(GI_TOOLS
g-ir-compiler
g-ir-generate
Expand All @@ -74,8 +72,13 @@ foreach(script IN LISTS GI_SCRIPTS)
file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/bin/${script}")
endforeach()

if(VCPKG_TARGET_IS_WINDOWS)
file(GLOB _pyd_lib_files "${CURRENT_PACKAGES_DIR}/lib/gobject-introspection/giscanner/_giscanner.*.lib")
file(REMOVE ${_pyd_lib_files})
endif()

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/lib/${PORT}")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/man")

set(VCPKG_POLICY_MISMATCHED_NUMBER_OF_BINARIES enabled) # _giscanner.lib
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")
2 changes: 1 addition & 1 deletion ports/gobject-introspection/python.patch
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ index 2a9d68556..cffe9014c 100644

# python headers
-cc.check_header('Python.h', dependencies: [python.dependency()], required: true)
+libpython_dep = dependency('python-3.10', method : 'pkg-config')
+libpython_dep = dependency('python-@0@'.format(python_version), method : 'pkg-config')
+cc.check_header('Python.h', dependencies: [libpython_dep], required: true)

2 changes: 1 addition & 1 deletion ports/gobject-introspection/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "gobject-introspection",
"version": "1.72.0",
"port-version": 3,
"port-version": 4,
"description": "A middleware layer between C libraries (using GObject) and language bindings.",
"homepage": "https://gi.readthedocs.io/en/latest/",
"license": null,
Expand Down
2 changes: 1 addition & 1 deletion ports/libpq/build-msvc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function(build_msvc build_type source_path)
file(STRINGS "${CURRENT_INSTALLED_DIR}/lib/pkgconfig/openssl.pc" OPENSSL_VERSION REGEX "Version:")
string(APPEND config "\$config->{openssl_version} = '${OPENSSL_VERSION}';\n")
endif()
string(APPEND config "\$config->{python_version} = '3.10';\n")
string(APPEND config "\$config->{python_version} = '3.${PYTHON_VERSION_MINOR}';\n")
string(APPEND config "\$config->{tcl_version} = '90';\n")
file(WRITE "${build_path}/src/tools/msvc/config.pl" "${config}")

Expand Down
5 changes: 5 additions & 0 deletions ports/libpq/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ vcpkg_extract_source_archive(
windows/spin_delay.patch
)

file(GLOB _py3_include_path "${CURRENT_HOST_INSTALLED_DIR}/include/python3*")
string(REGEX MATCH "python3\\.([0-9]+)" _python_version_tmp "${_py3_include_path}")
set(PYTHON_VERSION_MINOR "${CMAKE_MATCH_1}")
vcpkg_replace_string("${SOURCE_PATH}/configure.ac" "python_version=3.REPLACEME" "python_version=3.${PYTHON_VERSION_MINOR}")

if("client" IN_LIST FEATURES)
set(HAS_TOOLS TRUE)
else()
Expand Down
2 changes: 1 addition & 1 deletion ports/libpq/unix/python.patch
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ index a35395e..3c1b3e2 100644
PGAC_PATH_PYTHON
- PGAC_CHECK_PYTHON_EMBED_SETUP
+ python_majorversion=3
+ python_version=3.10
+ python_version=3.REPLACEME
+ PKG_CHECK_MODULES(PYTHON_EMBED, python-${python_version}-embed)
+ python_includespec="${PYTHON_EMBED_CFLAGS}"
+ python_libdir=[$(echo " ${PYTHON_EMBED_LIBS}" | sed -e 's/\( -L[^ ]*\).*/\1/' -e 's/^.* -L//')]
Expand Down
4 changes: 2 additions & 2 deletions ports/libpq/vcpkg-libs.props.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<VcpkgLz4Libs>@CURRENT_INSTALLED_DIR@/debug/lib/lz4d.lib</VcpkgLz4Libs>
<VcpkgNlsLibs>@CURRENT_INSTALLED_DIR@/debug/lib/intl.lib;@CURRENT_INSTALLED_DIR@/debug/lib/iconv.lib;@CURRENT_INSTALLED_DIR@/debug/lib/charset.lib</VcpkgNlsLibs>
<VcpkgOpensslLibs>@CURRENT_INSTALLED_DIR@/debug/lib/libssl.lib;@CURRENT_INSTALLED_DIR@/debug/lib/libcrypto.lib;crypt32.lib;ws2_32.lib;secur32.lib</VcpkgOpensslLibs>
<VcpkgPythonLibs>@CURRENT_INSTALLED_DIR@/debug/lib/python310_d.lib</VcpkgPythonLibs>
<VcpkgPythonLibs>@CURRENT_INSTALLED_DIR@/debug/lib/python3@PYTHON_VERSION_MINOR@_d.lib</VcpkgPythonLibs>
<VcpkgTcl90Libs>@CURRENT_INSTALLED_DIR@/debug/lib/tcl90g.lib</VcpkgTcl90Libs>
<VcpkgTcl90sLibs>@CURRENT_INSTALLED_DIR@/debug/lib/tcl90sg.lib</VcpkgTcl90sLibs>
<VcpkgTcl90sxLibs>@CURRENT_INSTALLED_DIR@/debug/lib/tcl90sgx.lib</VcpkgTcl90sxLibs>
Expand All @@ -19,7 +19,7 @@
<VcpkgLz4Libs>@CURRENT_INSTALLED_DIR@/lib/lz4.lib</VcpkgLz4Libs>
<VcpkgNlsLibs>@CURRENT_INSTALLED_DIR@/lib/intl.lib;@CURRENT_INSTALLED_DIR@/lib/iconv.lib;@CURRENT_INSTALLED_DIR@/lib/charset.lib</VcpkgNlsLibs>
<VcpkgOpensslLibs>@CURRENT_INSTALLED_DIR@/lib/libssl.lib;@CURRENT_INSTALLED_DIR@/lib/libcrypto.lib;crypt32.lib;ws2_32.lib;secur32.lib</VcpkgOpensslLibs>
<VcpkgPythonLibs>@CURRENT_INSTALLED_DIR@/lib/python310.lib</VcpkgPythonLibs>
<VcpkgPythonLibs>@CURRENT_INSTALLED_DIR@/lib/python3@PYTHON_VERSION_MINOR@.lib</VcpkgPythonLibs>
<VcpkgTcl90Libs>@CURRENT_INSTALLED_DIR@/lib/tcl90.lib</VcpkgTcl90Libs>
<VcpkgTcl90sLibs>@CURRENT_INSTALLED_DIR@/lib/tcl90s.lib</VcpkgTcl90sLibs>
<VcpkgTcl90sxLibs>@CURRENT_INSTALLED_DIR@/lib/tcl90sx.lib</VcpkgTcl90sxLibs>
Expand Down
1 change: 1 addition & 0 deletions ports/libpq/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "libpq",
"version": "15.3",
"port-version": 1,
"description": "The official database access API of postgresql",
"homepage": "https://www.postgresql.org/",
"license": "PostgreSQL",
Expand Down
11 changes: 11 additions & 0 deletions ports/mdl-sdk/011-fix-python.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/src/mdl/compiler/compiler_hlsl/gen_hlsl_intrinsics.py
+++ b/src/mdl/compiler/compiler_hlsl/gen_hlsl_intrinsics.py
@@ -383,7 +383,7 @@ namespace {
def get_db_hlsl():
global g_db_hlsl
if g_db_hlsl is None:
- with open(g_templ_name, "rU") as f:
+ with open(g_templ_name, "r") as f:
g_db_hlsl = db_hlsl(f)
return g_db_hlsl

1 change: 1 addition & 0 deletions ports/mdl-sdk/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ vcpkg_from_github(
008-build-static-llvm.patch
009-include-priority-vendored-llvm.patch
010-workaround-gcc-bit.patch
011-fix-python.patch
)

string(COMPARE NOTEQUAL "${VCPKG_CRT_LINKAGE}" "static" _MVSC_CRT_LINKAGE_OPTION)
Expand Down
2 changes: 1 addition & 1 deletion ports/mdl-sdk/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "mdl-sdk",
"version": "2021.1.2",
"port-version": 1,
"port-version": 2,
"description": "NVIDIA Material Definition Language SDK",
"homepage": "https://github.com/NVIDIA/MDL-SDK",
"license": "BSD-3-Clause",
Expand Down
7 changes: 7 additions & 0 deletions ports/omniorb/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
set(ENV{PYTHONPATH} "${CURRENT_HOST_INSTALLED_DIR}/tools/python3/Lib${VCPKG_HOST_PATH_SEPARATOR}${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/lib/python${VCPKG_HOST_PATH_SEPARATOR}${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/lib/python")
endif()

if(NOT VCPKG_TARGET_IS_WINDOWS)
file(GLOB _py3_include_path "${CURRENT_HOST_INSTALLED_DIR}/include/python3*")
string(REGEX MATCH "python3\\.([0-9]+)" _python_version_tmp "${_py3_include_path}")
set(PYTHON_VERSION_MINOR "${CMAKE_MATCH_1}")
list(APPEND OPTIONS "PYTHON=${CURRENT_HOST_INSTALLED_DIR}/tools/python3/python3.${PYTHON_VERSION_MINOR}")
endif()

vcpkg_find_acquire_program(FLEX)
cmake_path(GET FLEX PARENT_PATH FLEX_DIR)
vcpkg_add_to_path("${FLEX_DIR}")
Expand Down
2 changes: 1 addition & 1 deletion ports/omniorb/python-fixes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ index 1380018..fb321a5 100644
PYVERSION := $(shell $(PYTHON) -c 'import sys; sys.stdout.write(".".join(sys.version.split(".")[:2]))')
PYPREFIX := $(shell $(PYTHON) -c 'import sys; sys.stdout.write(sys.exec_prefix.replace("\\","/"))')
-PYINCDIR := $(shell $(PYTHON) -c 'import sys, distutils.sysconfig; sys.stdout.write(distutils.sysconfig.get_python_inc().replace("\\","/"))')
+PYINCDIR := $(includedir)/python3.10
+PYINCDIR := $(includedir)/python$(PYVERSION)

PythonSHAREDLIB_SUFFIX = $(shell $(PYTHON) -c 'import sys, distutils.sysconfig; sys.stdout.write((distutils.sysconfig.get_config_var("SO") or ".so").lstrip("."))')

Expand Down
2 changes: 1 addition & 1 deletion ports/omniorb/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "omniorb",
"version": "4.3.0",
"port-version": 1,
"port-version": 2,
"description": "omniORB is a robust high performance CORBA ORB for C++",
"homepage": "https://omniorb.sourceforge.io/",
"license": "LGPL-2.1-or-later",
Expand Down
5 changes: 4 additions & 1 deletion ports/paraview/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,10 @@ file(COPY "${ICET_SOURCE_PATH}/" DESTINATION "${SOURCE_PATH}/ThirdParty/IceT/vtk
if("python" IN_LIST FEATURES)
set(python_ver "")
if(NOT VCPKG_TARGET_IS_WINDOWS)
set(python_ver 3.10)
file(GLOB _py3_include_path "${CURRENT_HOST_INSTALLED_DIR}/include/python3*")
string(REGEX MATCH "python3\\.([0-9]+)" _python_version_tmp ${_py3_include_path})
set(PYTHON_VERSION_MINOR "${CMAKE_MATCH_1}")
set(python_ver "3.${PYTHON_VERSION_MINOR}")
endif()
list(APPEND ADDITIONAL_OPTIONS
-DPython3_FIND_REGISTRY=NEVER
Expand Down
2 changes: 1 addition & 1 deletion ports/paraview/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "paraview",
"version": "5.11.0",
"port-version": 2,
"port-version": 3,
"description": "VTK-based Data Analysis and Visualization Application",
"homepage": "https://www.paraview.org/",
"license": "BSD-3-Clause",
Expand Down
4 changes: 2 additions & 2 deletions ports/python3/0001-only-build-required-projects.patch
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ diff --git a/PCbuild/pcbuild.proj b/PCbuild/pcbuild.proj
index 4d416c589e..ede9868a8f 100644
--- a/PCbuild/pcbuild.proj
+++ b/PCbuild/pcbuild.proj
@@ -49,17 +49,17 @@
@@ -60,17 +60,17 @@
<!-- python3.dll -->
<Projects Include="python3dll.vcxproj" />
<!-- py[w].exe -->
Expand All @@ -49,7 +49,7 @@ index 4d416c589e..ede9868a8f 100644
+ <!-- _ssl will NOT build _socket as well -->
+ <ExtensionModules Include="_socket" Condition="true" />
+ <ExternalModules Include="_ssl;_hashlib" Condition="true" />
<ExternalModules Include="_tkinter" Condition="$(IncludeTkinter) and $(Platform) != 'ARM' and $(Platform) != 'ARM64'" />
<ExternalModules Include="_tkinter" Condition="$(IncludeTkinter)" />
<ExtensionModules Include="@(ExternalModules->'%(Identity)')" Condition="$(IncludeExternals)" />
<Projects Include="@(ExtensionModules->'%(Identity).vcxproj')" Condition="$(IncludeExtensions)" />
--
Expand Down
67 changes: 65 additions & 2 deletions ports/python3/0002-static-library.patch
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,38 @@ builds the pythoncore as a static library instead of a DLL
PCbuild/pythoncore.vcxproj | 4 ++--
2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/Modules/getpath.c b/Modules/getpath.c
index d7d3cf081e..34269f0b75 100644
--- a/Modules/getpath.c
+++ b/Modules/getpath.c
@@ -801,10 +801,12 @@ static int
library_to_dict(PyObject *dict, const char *key)
{
#ifdef MS_WINDOWS
+#ifdef Py_ENABLE_SHARED
extern HMODULE PyWin_DLLhModule;
if (PyWin_DLLhModule) {
return winmodule_to_dict(dict, key, PyWin_DLLhModule);
}
+#endif
#elif defined(WITH_NEXT_FRAMEWORK)
static char modPath[MAXPATHLEN + 1];
static int modPathInitialized = -1;
diff --git a/PC/pyconfig.h b/PC/pyconfig.h
index d7d3cf081e..34269f0b75 100644
--- a/PC/pyconfig.h
+++ b/PC/pyconfig.h
@@ -251,6 +251,7 @@ typedef int pid_t;
@@ -251,6 +251,9 @@ typedef int pid_t;

/* For Windows the Python core is in a DLL by default. Test
Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */
+#ifndef Py_NO_ENABLE_SHARED
+#define Py_NO_ENABLE_SHARED
+#endif
#if !defined(MS_NO_COREDLL) && !defined(Py_NO_ENABLE_SHARED)
# define Py_ENABLE_SHARED 1 /* standard symbol for shared library */
# define MS_COREDLL /* deprecated old symbol */
@@ -276,6 +277,14 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */
@@ -276,6 +277,15 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */
# endif /* _DEBUG */
# endif /* _MSC_VER */
# endif /* Py_BUILD_CORE */
Expand All @@ -30,6 +49,7 @@ index d7d3cf081e..34269f0b75 100644
+# pragma comment(lib, "version.lib")
+# pragma comment(lib, "shlwapi.lib")
+# pragma comment(lib, "ws2_32.lib")
+# pragma comment(lib, "bcrypt.lib")
+# if Py_WINVER > 0x0601
+# pragma comment(lib, "pathcch.lib")
+# endif /* Py_WINVER */
Expand Down Expand Up @@ -71,6 +91,49 @@ index 2625d0293d..2f8bdaa931 100644
<PreprocessorDefinitions Condition="$(IncludeExternals)">_Py_HAVE_ZLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj
index 2625d0293d..2f8bdaa931 100644
--- a/PCbuild/_freeze_module.vcxproj
+++ b/PCbuild/_freeze_module.vcxproj
@@ -88,7 +88,7 @@
<PropertyGroup Label="UserMacros" />
<ItemDefinitionGroup>
<ClCompile>
- <PreprocessorDefinitions>Py_NO_ENABLE_SHARED;Py_BUILD_CORE;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>Py_NO_ENABLE_SHARED;Py_BUILD_CORE;_CONSOLE;MS_DLL_ID="$(SysWinVer)";%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Optimization>Disabled</Optimization>
<WholeProgramOptimization>false</WholeProgramOptimization>
</ClCompile>
diff --git a/Python/dynload_win.c b/Python/dynload_win.c
index ac49f7867a..f3583345ff 100644
--- a/Python/dynload_win.c
+++ b/Python/dynload_win.c
@@ -163,6 +163,7 @@ static char *GetPythonImport (HINSTANCE hModule)
return NULL;
}

+#ifdef Py_ENABLE_SHARED
/* Load python3.dll before loading any extension module that might refer
to it. That way, we can be sure that always the python3.dll corresponding
to this python DLL is loaded, not a python3.dll that might be on the path
@@ -216,6 +217,7 @@ _Py_CheckPython3(void)
return hPython3 != NULL;
#undef MAXPATHLEN
}
+#endif /* Py_ENABLE_SHARED */

dl_funcptr _PyImport_FindSharedFuncptrWindows(const char *prefix,
const char *shortname,
@@ -224,7 +226,9 @@ dl_funcptr _PyImport_FindSharedFuncptrWindows(const char *prefix,
dl_funcptr p;
char funcname[258], *import_python;

+#ifdef Py_ENABLE_SHARED
_Py_CheckPython3();
+#endif /* Py_ENABLE_SHARED */

#if USE_UNICODE_WCHAR_CACHE
const wchar_t *wpathname = _PyUnicode_AsUnicode(pathname);
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index ac49f7867a..f3583345ff 100644
--- a/Python/sysmodule.c
Expand Down
8 changes: 4 additions & 4 deletions ports/python3/0003-use-vcpkg-zlib.patch
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj
index dbe236829a..5f30a35eb3 100644
--- a/PCbuild/pythoncore.vcxproj
+++ b/PCbuild/pythoncore.vcxproj
@@ -507,8 +507,10 @@
<ClCompile Include="..\Python\thread.c" />
<ClCompile Include="..\Python\traceback.c" />
@@ -540,8 +540,10 @@
<ClCompile Include="..\Python\deepfreeze\deepfreeze.c" />
<!-- END deepfreeze -->
</ItemGroup>
- <ItemGroup Condition="$(IncludeExternals)">
+ <ItemGroup>
Expand All @@ -25,7 +25,7 @@ index dbe236829a..5f30a35eb3 100644
<ClCompile Include="$(zlibDir)\adler32.c" />
<ClCompile Include="$(zlibDir)\compress.c" />
<ClCompile Include="$(zlibDir)\crc32.c" />
@@ -556,7 +558,7 @@
@@ -593,7 +595,7 @@
<Target Name="_WarnAboutToolset" BeforeTargets="PrepareForBuild" Condition="$(PlatformToolset) != 'v140' and $(PlatformToolset) != 'v141' and $(PlatformToolset) != 'v142' and $(PlatformToolset) != 'v143'">
<Warning Text="Toolset $(PlatformToolset) is not used for official builds. Your build may have errors or incompatibilities." />
</Target>
Expand Down
2 changes: 1 addition & 1 deletion ports/python3/0004-devendor-external-dependencies.patch
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ index b2d9f5d57d..4efb826a05 100644
- <ClCompile>
+ <ClCompile Condition="false">
<AdditionalIncludeDirectories>$(PySourcePath)Modules\expat;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;PYEXPAT_EXPORTS;HAVE_EXPAT_H;XML_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;PYEXPAT_EXPORTS;XML_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
- <ItemGroup>
Expand Down
Loading