From 722820a9796a34b1303a34a51209c6b98bdf99f9 Mon Sep 17 00:00:00 2001 From: Serhii Kupriienko Date: Fri, 4 Sep 2026 08:25:57 +0000 Subject: [PATCH 1/2] Refresh patches for 3.15.0rc2 Remap vs conda-forge: add 0020/0024-pid_t/0026-GIL-win/0027 unixy Windows; keep AR 0023 branding; move zlib-ng to 0028 and xxlimited to 0029. --- recipe/meta.yaml | 8 +- ...2-Change-FD_SETSIZE-from-512-to-2048.patch | 9 +- ...0002-Win32-Do-not-download-externals.patch | 25 +- ...-so-that-it-looks-in-sys.prefix-lib-.patch | 15 +- ...-lookup-unless-CONDA_PY_ALLOW_REG_PA.patch | 1170 +---------------- recipe/patches/0005-Unvendor-openssl.patch | 25 +- recipe/patches/0006-Unvendor-sqlite3.patch | 23 +- ...dd-CondaEcosystemModifyDllSearchPath.patch | 9 +- recipe/patches/0008-Doing-d1trimfile.patch | 274 +++- .../patches/0009-cross-compile-darwin.patch | 61 +- .../patches/0010-Fix-TZPATH-on-windows.patch | 25 +- ...ch-work-with-SYSTEM_VERSION_COMPAT-1.patch | 28 +- recipe/patches/0012-Unvendor-bzip2.patch | 11 +- recipe/patches/0013-Unvendor-libffi.patch | 9 +- recipe/patches/0014-Unvendor-tcltk.patch | 34 +- recipe/patches/0015-unvendor-xz.patch | 9 +- recipe/patches/0016-unvendor-zlib.patch | 39 +- ...-not-pass-g-to-GCC-when-not-Py_DEBUG.patch | 17 +- recipe/patches/0018-Unvendor-expat.patch | 15 +- .../patches/0019-Remove-unused-readelf.patch | 9 +- ...t-checksharedmods-if-cross-compiling.patch | 40 + .../0021-Override-configure-LIBFFI.patch | 11 +- recipe/patches/0022-Unvendor-libmpdec.patch | 20 +- ...d_t-as-it-might-conflict-with-the-ac.patch | 115 ++ recipe/patches/0025-Unvendor-zstd.patch | 44 +- ...IL_DISABLED-in-windows-to-match-unix.patch | 25 + .../0027-More-unixy-layout-for-windows.patch | 84 ++ ...b-ng.patch => 0028-Unvendor-zlib-ng.patch} | 0 ...mited-freethreading-stable-abi-link.patch} | 0 29 files changed, 725 insertions(+), 1429 deletions(-) create mode 100644 recipe/patches/0020-Don-t-checksharedmods-if-cross-compiling.patch create mode 100644 recipe/patches/0024-Do-not-define-pid_t-as-it-might-conflict-with-the-ac.patch create mode 100644 recipe/patches/0026-Set-Py_GIL_DISABLED-in-windows-to-match-unix.patch create mode 100644 recipe/patches/0027-More-unixy-layout-for-windows.patch rename recipe/patches/{0024-Unvendor-zlib-ng.patch => 0028-Unvendor-zlib-ng.patch} (100%) rename recipe/patches/{0026-xxlimited-freethreading-stable-abi-link.patch => 0029-xxlimited-freethreading-stable-abi-link.patch} (100%) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 07548c0c1..e2b9f54e9 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -88,12 +88,16 @@ source: - patches/0017-Do-not-pass-g-to-GCC-when-not-Py_DEBUG.patch - patches/0018-Unvendor-expat.patch - patches/0019-Remove-unused-readelf.patch + - patches/0020-Don-t-checksharedmods-if-cross-compiling.patch - patches/0021-Override-configure-LIBFFI.patch - patches/0022-Unvendor-libmpdec.patch - patches/0023-branding.patch - - patches/0024-Unvendor-zlib-ng.patch + - patches/0024-Do-not-define-pid_t-as-it-might-conflict-with-the-ac.patch - patches/0025-Unvendor-zstd.patch - - patches/0026-xxlimited-freethreading-stable-abi-link.patch # [win and gil_type == "disabled"] + - patches/0026-Set-Py_GIL_DISABLED-in-windows-to-match-unix.patch # [win and gil_type == "disabled"] + - patches/0027-More-unixy-layout-for-windows.patch + - patches/0028-Unvendor-zlib-ng.patch + - patches/0029-xxlimited-freethreading-stable-abi-link.patch # [win and gil_type == "disabled"] build: number: {{ build_number }} diff --git a/recipe/patches/0001-Win32-Change-FD_SETSIZE-from-512-to-2048.patch b/recipe/patches/0001-Win32-Change-FD_SETSIZE-from-512-to-2048.patch index c41a07b63..9a58073e1 100644 --- a/recipe/patches/0001-Win32-Change-FD_SETSIZE-from-512-to-2048.patch +++ b/recipe/patches/0001-Win32-Change-FD_SETSIZE-from-512-to-2048.patch @@ -1,7 +1,7 @@ -From 627caa150ced4ec40716cc62366c19a200f5cc0d Mon Sep 17 00:00:00 2001 +From b51c74365f2f62c84d2f174c2d68e38ca4e16765 Mon Sep 17 00:00:00 2001 From: Ray Donnelly Date: Wed, 16 Aug 2017 11:53:55 +0100 -Subject: [PATCH 01/25] Win32: Change FD_SETSIZE from 512 to 2048 +Subject: [PATCH 01/27] Win32: Change FD_SETSIZE from 512 to 2048 https://github.com/ContinuumIO/anaconda-issues/issues/1241 --- @@ -9,7 +9,7 @@ https://github.com/ContinuumIO/anaconda-issues/issues/1241 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/selectmodule.c b/Modules/selectmodule.c -index 2c56dbc6a5..845ff4732c 100644 +index b9fb7762e3d..e6102e8c589 100644 --- a/Modules/selectmodule.c +++ b/Modules/selectmodule.c @@ -45,7 +45,7 @@ @@ -21,6 +21,3 @@ index 2c56dbc6a5..845ff4732c 100644 #endif #if defined(HAVE_POLL_H) --- -2.51.0 - diff --git a/recipe/patches/0002-Win32-Do-not-download-externals.patch b/recipe/patches/0002-Win32-Do-not-download-externals.patch index 40805904f..f1298ce19 100644 --- a/recipe/patches/0002-Win32-Do-not-download-externals.patch +++ b/recipe/patches/0002-Win32-Do-not-download-externals.patch @@ -1,25 +1,22 @@ -From 679fdc73eded852c9d17ab4cc811d52a25735af9 Mon Sep 17 00:00:00 2001 +From dbc1c91f800e11a162eb14c42c806564802ba167 Mon Sep 17 00:00:00 2001 From: Ray Donnelly Date: Thu, 7 Sep 2017 11:35:47 +0100 -Subject: [PATCH 02/25] Win32: Do not download externals +Subject: [PATCH 02/27] Win32: Do not download externals --- PCbuild/build.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PCbuild/build.bat b/PCbuild/build.bat -index 9d2f032f5a..f062963991 100644 +index 9d2f032f5a9..faad274fc9d 100644 --- a/PCbuild/build.bat +++ b/PCbuild/build.bat -@@ -118,7 +118,7 @@ if "%IncludeSSL%"=="" set IncludeSSL=true - if "%IncludeTkinter%"=="" set IncludeTkinter=true - if "%UseJIT%" NEQ "true" set IncludeLLVM=false - --if "%IncludeExternals%"=="true" call "%dir%get_externals.bat" -+rem if "%IncludeExternals%"=="true" call "%dir%get_externals.bat" +@@ -112,7 +112,7 @@ if "%~1"=="--no-ctypes" (set IncludeCTypes=false) & shift & goto CheckOpts + if "%~1"=="--no-ssl" (set IncludeSSL=false) & shift & goto CheckOpts + if "%~1"=="--no-tkinter" (set IncludeTkinter=false) & shift & goto CheckOpts - if /I "%target%"=="Clean" set clean=true - if /I "%target%"=="CleanAll" set clean=true --- -2.51.0 - +-if "%IncludeExternals%"=="" set IncludeExternals=true ++@rem if "%IncludeExternals%"=="" set IncludeExternals=true + if "%IncludeCTypes%"=="" set IncludeCTypes=true + if "%IncludeSSL%"=="" set IncludeSSL=true + if "%IncludeTkinter%"=="" set IncludeTkinter=true diff --git a/recipe/patches/0003-Fix-find_library-so-that-it-looks-in-sys.prefix-lib-.patch b/recipe/patches/0003-Fix-find_library-so-that-it-looks-in-sys.prefix-lib-.patch index 7e5b370d2..b2533caaa 100644 --- a/recipe/patches/0003-Fix-find_library-so-that-it-looks-in-sys.prefix-lib-.patch +++ b/recipe/patches/0003-Fix-find_library-so-that-it-looks-in-sys.prefix-lib-.patch @@ -1,7 +1,7 @@ -From 32a92008fe83a0f9484ad0df5162485dfb7a637b Mon Sep 17 00:00:00 2001 +From 028de8f3d29a0aec65b80d36c00faf975268c9c0 Mon Sep 17 00:00:00 2001 From: Ray Donnelly Date: Tue, 5 Dec 2017 22:47:59 +0000 -Subject: [PATCH 03/25] Fix find_library so that it looks in sys.prefix/lib +Subject: [PATCH 03/27] Fix find_library so that it looks in sys.prefix/lib first --- @@ -10,7 +10,7 @@ Subject: [PATCH 03/25] Fix find_library so that it looks in sys.prefix/lib 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/Lib/ctypes/macholib/dyld.py b/Lib/ctypes/macholib/dyld.py -index 583c47daff..ab9b01c87e 100644 +index 583c47daff3..ab9b01c87e2 100644 --- a/Lib/ctypes/macholib/dyld.py +++ b/Lib/ctypes/macholib/dyld.py @@ -93,6 +93,10 @@ def dyld_executable_path_search(name, executable_path=None): @@ -25,7 +25,7 @@ index 583c47daff..ab9b01c87e 100644 yield os.path.join(executable_path, name[len('@executable_path/'):]) diff --git a/Lib/ctypes/util.py b/Lib/ctypes/util.py -index 35ac5b6bfd..09c3e1703d 100644 +index 015c62b31a1..e08c9520576 100644 --- a/Lib/ctypes/util.py +++ b/Lib/ctypes/util.py @@ -136,7 +136,8 @@ def dllist(): @@ -38,7 +38,7 @@ index 35ac5b6bfd..09c3e1703d 100644 '%s.dylib' % name, '%s.framework/%s' % (name, name)] for name in possible: -@@ -437,10 +438,30 @@ def _findLib_ld(name): +@@ -436,10 +437,30 @@ def _findLib_ld(name): pass # result will be None return result @@ -47,7 +47,7 @@ index 35ac5b6bfd..09c3e1703d 100644 + return None + for fullname in (name, "lib%s.so" % (name)): + path = os.path.join(sys.prefix, 'lib', fullname) -+ if os.path.exists(path): ++ if os.path.exists(path) and not os.path.isdir(path): + return path + return None + @@ -71,6 +71,3 @@ index 35ac5b6bfd..09c3e1703d 100644 # On platforms which provide dl_iterate_phdr(), dllist() is implemented --- -2.51.0 - diff --git a/recipe/patches/0004-Disable-registry-lookup-unless-CONDA_PY_ALLOW_REG_PA.patch b/recipe/patches/0004-Disable-registry-lookup-unless-CONDA_PY_ALLOW_REG_PA.patch index d95f5b374..a70b23b3f 100644 --- a/recipe/patches/0004-Disable-registry-lookup-unless-CONDA_PY_ALLOW_REG_PA.patch +++ b/recipe/patches/0004-Disable-registry-lookup-unless-CONDA_PY_ALLOW_REG_PA.patch @@ -1,19 +1,17 @@ -From 672fe0b101de2f7442fe8693129ed386becbd74c Mon Sep 17 00:00:00 2001 +From b57538bcca07d9195b7d47eb3536baa36fdc2908 Mon Sep 17 00:00:00 2001 From: Ray Donnelly Date: Sat, 27 Oct 2018 18:48:30 +0100 -Subject: [PATCH 04/25] Disable registry lookup unless CONDA_PY_ALLOW_REG_PATHS +Subject: [PATCH 04/27] Disable registry lookup unless CONDA_PY_ALLOW_REG_PATHS is not 0 Co-authored-by: Isuru Fernando --- - Modules/getpath.c | 1 + - Modules/getpath.py | 3 +- - PC/getpathp.c | 1145 ++++++++++++++++++++++++++++++++++++++++++++ - 3 files changed, 1148 insertions(+), 1 deletion(-) - create mode 100644 PC/getpathp.c + Modules/getpath.c | 1 + + Modules/getpath.py | 3 ++- + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Modules/getpath.c b/Modules/getpath.c -index 1e75993480..ff96c8e199 100644 +index 1e75993480a..ff96c8e1990 100644 --- a/Modules/getpath.c +++ b/Modules/getpath.c @@ -937,6 +937,7 @@ _PyConfig_InitPathConfig(PyConfig *config, int compute_path_config) @@ -25,7 +23,7 @@ index 1e75993480..ff96c8e199 100644 !progname_to_dict(dict, "real_executable") || !library_to_dict(dict, "library") || diff --git a/Modules/getpath.py b/Modules/getpath.py -index 6199567bd7..ea370c2f68 100644 +index c322d5c4b4c..e237c58d6bc 100644 --- a/Modules/getpath.py +++ b/Modules/getpath.py @@ -52,6 +52,7 @@ @@ -45,1157 +43,3 @@ index 6199567bd7..ea370c2f68 100644 # QUIRK: Windows also lists paths in the registry. Paths are stored # as the default value of each subkey of # {HKCU,HKLM}\Software\Python\PythonCore\{winver}\PythonPath -diff --git a/PC/getpathp.c b/PC/getpathp.c -new file mode 100644 -index 0000000000..a73ea8a0e9 ---- /dev/null -+++ b/PC/getpathp.c -@@ -0,0 +1,1145 @@ -+ -+/* Return the initial module search path. */ -+/* Used by DOS, Windows 3.1, Windows 95/98, Windows NT. */ -+ -+/* ---------------------------------------------------------------- -+ PATH RULES FOR WINDOWS: -+ This describes how sys.path is formed on Windows. It describes the -+ functionality, not the implementation (ie, the order in which these -+ are actually fetched is different). The presence of a python._pth or -+ pythonXY._pth file alongside the program overrides these rules - see -+ below. -+ -+ * Python always adds an empty entry at the start, which corresponds -+ to the current directory. -+ -+ * If the PYTHONPATH env. var. exists, its entries are added next. -+ -+ * We look in the registry for "application paths" - that is, sub-keys -+ under the main PythonPath registry key. These are added next (the -+ order of sub-key processing is undefined). -+ HKEY_CURRENT_USER is searched and added first. -+ HKEY_LOCAL_MACHINE is searched and added next. -+ (Note that all known installers only use HKLM, so HKCU is typically -+ empty) -+ -+ * We attempt to locate the "Python Home" - if the PYTHONHOME env var -+ is set, we believe it. Otherwise, we use the path of our host .EXE's -+ to try and locate one of our "landmarks" and deduce our home. -+ - If we DO have a Python Home: The relevant sub-directories (Lib, -+ DLLs, etc) are based on the Python Home -+ - If we DO NOT have a Python Home, the core Python Path is -+ loaded from the registry. (This is the main PythonPath key, -+ and both HKLM and HKCU are combined to form the path) -+ -+ * Iff - we can not locate the Python Home, have not had a PYTHONPATH -+ specified, and can't locate any Registry entries (ie, we have _nothing_ -+ we can assume is a good path), a default path with relative entries is -+ used (eg. .\Lib;.\DLLs, etc) -+ -+ -+ If a '._pth' file exists adjacent to the executable with the same base name -+ (e.g. python._pth adjacent to python.exe) or adjacent to the shared library -+ (e.g. python36._pth adjacent to python36.dll), it is used in preference to -+ the above process. The shared library file takes precedence over the -+ executable. The path file must contain a list of paths to add to sys.path, -+ one per line. Each path is relative to the directory containing the file. -+ Blank lines and comments beginning with '#' are permitted. -+ -+ In the presence of this ._pth file, no other paths are added to the search -+ path, the registry finder is not enabled, site.py is not imported and -+ isolated mode is enabled. The site package can be enabled by including a -+ line reading "import site"; no other imports are recognized. Any invalid -+ entry (other than directories that do not exist) will result in immediate -+ termination of the program. -+ -+ -+ The end result of all this is: -+ * When running python.exe, or any other .exe in the main Python directory -+ (either an installed version, or directly from the PCbuild directory), -+ the core path is deduced, and the core paths in the registry are -+ ignored. Other "application paths" in the registry are always read. -+ -+ * When Python is hosted in another exe (different directory, embedded via -+ COM, etc), the Python Home will not be deduced, so the core path from -+ the registry is used. Other "application paths" in the registry are -+ always read. -+ -+ * If Python can't find its home and there is no registry (eg, frozen -+ exe, some very strange installation setup) you get a path with -+ some default, but relative, paths. -+ -+ * An embedding application can use Py_SetPath() to override all of -+ these automatic path computations. -+ -+ * An install of Python can fully specify the contents of sys.path using -+ either a 'EXENAME._pth' or 'DLLNAME._pth' file, optionally including -+ "import site" to enable the site module. -+ -+ ---------------------------------------------------------------- */ -+ -+ -+#include "Python.h" -+#include "pycore_initconfig.h" // PyStatus -+#include "pycore_pathconfig.h" // _PyPathConfig -+#include "osdefs.h" // SEP, ALTSEP -+#include -+ -+#ifndef MS_WINDOWS -+#error getpathp.c should only be built on Windows -+#endif -+ -+#include -+#include -+ -+#ifdef HAVE_SYS_TYPES_H -+#include -+#endif /* HAVE_SYS_TYPES_H */ -+ -+#ifdef HAVE_SYS_STAT_H -+#include -+#endif /* HAVE_SYS_STAT_H */ -+ -+#include -+ -+/* Search in some common locations for the associated Python libraries. -+ * -+ * Py_GetPath() tries to return a sensible Python module search path. -+ * -+ * The approach is an adaptation for Windows of the strategy used in -+ * ../Modules/getpath.c; it uses the Windows Registry as one of its -+ * information sources. -+ * -+ * Py_SetPath() can be used to override this mechanism. Call Py_SetPath -+ * with a semicolon separated path prior to calling Py_Initialize. -+ */ -+ -+#ifndef LANDMARK -+# define LANDMARK L"lib\\os.py" -+#endif -+ -+#define INIT_ERR_BUFFER_OVERFLOW() _PyStatus_ERR("buffer overflow") -+ -+ -+typedef struct { -+ const wchar_t *path_env; /* PATH environment variable */ -+ const wchar_t *home; /* PYTHONHOME environment variable */ -+ -+ /* Registry key "Software\Python\PythonCore\X.Y\PythonPath" -+ where X.Y is the Python version (major.minor) */ -+ wchar_t *machine_path; /* from HKEY_LOCAL_MACHINE */ -+ wchar_t *user_path; /* from HKEY_CURRENT_USER */ -+ -+ const wchar_t *pythonpath_env; -+} PyCalculatePath; -+ -+ -+/* determine if "ch" is a separator character */ -+static int -+is_sep(wchar_t ch) -+{ -+#ifdef ALTSEP -+ return ch == SEP || ch == ALTSEP; -+#else -+ return ch == SEP; -+#endif -+} -+ -+ -+/* assumes 'dir' null terminated in bounds. Never writes -+ beyond existing terminator. */ -+static void -+reduce(wchar_t *dir) -+{ -+ size_t i = wcsnlen_s(dir, MAXPATHLEN+1); -+ if (i >= MAXPATHLEN+1) { -+ Py_FatalError("buffer overflow in getpathp.c's reduce()"); -+ } -+ -+ while (i > 0 && !is_sep(dir[i])) -+ --i; -+ dir[i] = '\0'; -+} -+ -+ -+static int -+change_ext(wchar_t *dest, const wchar_t *src, const wchar_t *ext) -+{ -+ if (src && src != dest) { -+ size_t src_len = wcsnlen_s(src, MAXPATHLEN+1); -+ size_t i = src_len; -+ if (i >= MAXPATHLEN+1) { -+ Py_FatalError("buffer overflow in getpathp.c's reduce()"); -+ } -+ -+ while (i > 0 && src[i] != '.' && !is_sep(src[i])) -+ --i; -+ -+ if (i == 0) { -+ dest[0] = '\0'; -+ return -1; -+ } -+ -+ if (is_sep(src[i])) { -+ i = src_len; -+ } -+ -+ if (wcsncpy_s(dest, MAXPATHLEN+1, src, i)) { -+ dest[0] = '\0'; -+ return -1; -+ } -+ } else { -+ wchar_t *s = wcsrchr(dest, L'.'); -+ if (s) { -+ s[0] = '\0'; -+ } -+ } -+ -+ if (wcscat_s(dest, MAXPATHLEN+1, ext)) { -+ dest[0] = '\0'; -+ return -1; -+ } -+ -+ return 0; -+} -+ -+ -+static int -+exists(const wchar_t *filename) -+{ -+ return GetFileAttributesW(filename) != 0xFFFFFFFF; -+} -+ -+ -+/* Is module -- check for .pyc too. -+ Assumes 'filename' MAXPATHLEN+1 bytes long - -+ may extend 'filename' by one character. */ -+static int -+ismodule(wchar_t *filename, int update_filename) -+{ -+ size_t n; -+ -+ if (exists(filename)) { -+ return 1; -+ } -+ -+ /* Check for the compiled version of prefix. */ -+ n = wcsnlen_s(filename, MAXPATHLEN+1); -+ if (n < MAXPATHLEN) { -+ int exist = 0; -+ filename[n] = L'c'; -+ filename[n + 1] = L'\0'; -+ exist = exists(filename); -+ if (!update_filename) { -+ filename[n] = L'\0'; -+ } -+ return exist; -+ } -+ return 0; -+} -+ -+ -+/* Add a path component, by appending stuff to buffer. -+ buffer must have at least MAXPATHLEN + 1 bytes allocated, and contain a -+ NUL-terminated string with no more than MAXPATHLEN characters (not counting -+ the trailing NUL). It's a fatal error if it contains a string longer than -+ that (callers must be careful!). If these requirements are met, it's -+ guaranteed that buffer will still be a NUL-terminated string with no more -+ than MAXPATHLEN characters at exit. If stuff is too long, only as much of -+ stuff as fits will be appended. -+*/ -+ -+static void -+join(wchar_t *buffer, const wchar_t *stuff) -+{ -+ if (FAILED(PathCchCombineEx(buffer, MAXPATHLEN+1, buffer, stuff, 0))) { -+ Py_FatalError("buffer overflow in getpathp.c's join()"); -+ } -+} -+ -+/* Call PathCchCanonicalizeEx(path): remove navigation elements such as "." -+ and ".." to produce a direct, well-formed path. */ -+static PyStatus -+canonicalize(wchar_t *buffer, const wchar_t *path) -+{ -+ if (buffer == NULL) { -+ return _PyStatus_NO_MEMORY(); -+ } -+ -+ if (FAILED(PathCchCanonicalizeEx(buffer, MAXPATHLEN + 1, path, 0))) { -+ return INIT_ERR_BUFFER_OVERFLOW(); -+ } -+ return _PyStatus_OK(); -+} -+ -+ -+/* gotlandmark only called by search_for_prefix, which ensures -+ 'prefix' is null terminated in bounds. join() ensures -+ 'landmark' can not overflow prefix if too long. */ -+static int -+gotlandmark(const wchar_t *prefix, const wchar_t *landmark) -+{ -+ wchar_t filename[MAXPATHLEN+1]; -+ memset(filename, 0, sizeof(filename)); -+ wcscpy_s(filename, Py_ARRAY_LENGTH(filename), prefix); -+ join(filename, landmark); -+ return ismodule(filename, FALSE); -+} -+ -+ -+/* assumes argv0_path is MAXPATHLEN+1 bytes long, already \0 term'd. -+ assumption provided by only caller, calculate_path() */ -+static int -+search_for_prefix(wchar_t *prefix, const wchar_t *argv0_path, const wchar_t *landmark) -+{ -+ /* Search from argv0_path, until landmark is found */ -+ wcscpy_s(prefix, MAXPATHLEN + 1, argv0_path); -+ do { -+ if (gotlandmark(prefix, landmark)) { -+ return 1; -+ } -+ reduce(prefix); -+ } while (prefix[0]); -+ return 0; -+} -+ -+ -+static int -+get_dllpath(wchar_t *dllpath) -+{ -+#ifdef Py_ENABLE_SHARED -+ extern HANDLE PyWin_DLLhModule; -+ if (PyWin_DLLhModule && GetModuleFileNameW(PyWin_DLLhModule, dllpath, MAXPATHLEN)) { -+ return 0; -+ } -+#endif -+ return -1; -+} -+ -+ -+#ifdef Py_ENABLE_SHARED -+ -+/* a string loaded from the DLL at startup.*/ -+extern const char *PyWin_DLLVersionString; -+ -+/* Load a PYTHONPATH value from the registry. -+ Load from either HKEY_LOCAL_MACHINE or HKEY_CURRENT_USER. -+ -+ Works in both Unicode and 8bit environments. Only uses the -+ Ex family of functions so it also works with Windows CE. -+ -+ Returns NULL, or a pointer that should be freed. -+ -+ XXX - this code is pretty strange, as it used to also -+ work on Win16, where the buffer sizes were not available -+ in advance. It could be simplied now Win16/Win32s is dead! -+*/ -+static wchar_t * -+getpythonregpath(HKEY keyBase, int skipcore) -+{ -+ HKEY newKey = 0; -+ DWORD dataSize = 0; -+ DWORD numKeys = 0; -+ LONG rc; -+ wchar_t *retval = NULL; -+ WCHAR *dataBuf = NULL; -+ static const WCHAR keyPrefix[] = L"Software\\Python\\PythonCore\\"; -+ static const WCHAR keySuffix[] = L"\\PythonPath"; -+ size_t versionLen, keyBufLen; -+ DWORD index; -+ WCHAR *keyBuf = NULL; -+ WCHAR *keyBufPtr; -+ WCHAR **ppPaths = NULL; -+ -+ /* Tried to use sysget("winver") but here is too early :-( */ -+ versionLen = strlen(PyWin_DLLVersionString); -+ /* Space for all the chars, plus one \0 */ -+ keyBufLen = sizeof(keyPrefix) + -+ sizeof(WCHAR)*(versionLen-1) + -+ sizeof(keySuffix); -+ keyBuf = keyBufPtr = PyMem_RawMalloc(keyBufLen); -+ if (keyBuf==NULL) { -+ goto done; -+ } -+ -+ memcpy_s(keyBufPtr, keyBufLen, keyPrefix, sizeof(keyPrefix)-sizeof(WCHAR)); -+ keyBufPtr += Py_ARRAY_LENGTH(keyPrefix) - 1; -+ mbstowcs(keyBufPtr, PyWin_DLLVersionString, versionLen); -+ keyBufPtr += versionLen; -+ /* NULL comes with this one! */ -+ memcpy(keyBufPtr, keySuffix, sizeof(keySuffix)); -+ /* Open the root Python key */ -+ rc=RegOpenKeyExW(keyBase, -+ keyBuf, /* subkey */ -+ 0, /* reserved */ -+ KEY_READ, -+ &newKey); -+ if (rc!=ERROR_SUCCESS) { -+ goto done; -+ } -+ /* Find out how big our core buffer is, and how many subkeys we have */ -+ rc = RegQueryInfoKeyW(newKey, NULL, NULL, NULL, &numKeys, NULL, NULL, -+ NULL, NULL, &dataSize, NULL, NULL); -+ if (rc!=ERROR_SUCCESS) { -+ goto done; -+ } -+ if (skipcore) { -+ dataSize = 0; /* Only count core ones if we want them! */ -+ } -+ /* Allocate a temp array of char buffers, so we only need to loop -+ reading the registry once -+ */ -+ ppPaths = PyMem_RawCalloc(numKeys, sizeof(WCHAR *)); -+ if (ppPaths==NULL) { -+ goto done; -+ } -+ /* Loop over all subkeys, allocating a temp sub-buffer. */ -+ for(index=0;index 0) { -+ *(szCur++) = L';'; -+ dataSize--; -+ } -+ if (ppPaths[index]) { -+ Py_ssize_t len = wcslen(ppPaths[index]); -+ wcsncpy(szCur, ppPaths[index], len); -+ szCur += len; -+ assert(dataSize > (DWORD)len); -+ dataSize -= (DWORD)len; -+ } -+ } -+ if (skipcore) { -+ *szCur = '\0'; -+ } -+ else { -+ /* If we have no values, we don't need a ';' */ -+ if (numKeys) { -+ *(szCur++) = L';'; -+ dataSize--; -+ } -+ /* Now append the core path entries - -+ this will include the NULL -+ */ -+ rc = RegQueryValueExW(newKey, NULL, 0, NULL, -+ (LPBYTE)szCur, &dataSize); -+ if (rc != ERROR_SUCCESS) { -+ PyMem_RawFree(dataBuf); -+ goto done; -+ } -+ } -+ /* And set the result - caller must free */ -+ retval = dataBuf; -+ } -+done: -+ /* Loop freeing my temp buffers */ -+ if (ppPaths) { -+ for(index=0; indexbase_executable == NULL) { -+ pathconfig->base_executable = PyMem_RawMalloc( -+ sizeof(wchar_t) * (MAXPATHLEN + 1)); -+ if (pathconfig->base_executable == NULL) { -+ return _PyStatus_NO_MEMORY(); -+ } -+ -+ status = canonicalize(pathconfig->base_executable, -+ program_full_path); -+ if (_PyStatus_EXCEPTION(status)) { -+ return status; -+ } -+ } -+ -+ wcscpy_s(program_full_path, MAXPATHLEN+1, pyvenv_launcher); -+ /* bpo-35873: Clear the environment variable to avoid it being -+ * inherited by child processes. */ -+ _wputenv_s(L"__PYVENV_LAUNCHER__", L""); -+ } -+ -+ if (pathconfig->program_full_path == NULL) { -+ pathconfig->program_full_path = PyMem_RawMalloc( -+ sizeof(wchar_t) * (MAXPATHLEN + 1)); -+ if (pathconfig->program_full_path == NULL) { -+ return _PyStatus_NO_MEMORY(); -+ } -+ -+ status = canonicalize(pathconfig->program_full_path, -+ program_full_path); -+ if (_PyStatus_EXCEPTION(status)) { -+ return status; -+ } -+ } -+ return _PyStatus_OK(); -+} -+ -+ -+static PyStatus -+read_pth_file(_PyPathConfig *pathconfig, wchar_t *prefix, const wchar_t *path, -+ int *found) -+{ -+ PyStatus status; -+ wchar_t *buf = NULL; -+ wchar_t *wline = NULL; -+ FILE *sp_file; -+ -+ sp_file = _Py_wfopen(path, L"r"); -+ if (sp_file == NULL) { -+ return _PyStatus_OK(); -+ } -+ -+ wcscpy_s(prefix, MAXPATHLEN+1, path); -+ reduce(prefix); -+ pathconfig->isolated = 1; -+ pathconfig->site_import = 0; -+ -+ size_t bufsiz = MAXPATHLEN; -+ size_t prefixlen = wcslen(prefix); -+ -+ buf = (wchar_t*)PyMem_RawMalloc(bufsiz * sizeof(wchar_t)); -+ if (buf == NULL) { -+ status = _PyStatus_NO_MEMORY(); -+ goto done; -+ } -+ buf[0] = '\0'; -+ -+ while (!feof(sp_file)) { -+ char line[MAXPATHLEN + 1]; -+ char *p = fgets(line, Py_ARRAY_LENGTH(line), sp_file); -+ if (!p) { -+ break; -+ } -+ if (*p == '\0' || *p == '\r' || *p == '\n' || *p == '#') { -+ continue; -+ } -+ while (*++p) { -+ if (*p == '\r' || *p == '\n') { -+ *p = '\0'; -+ break; -+ } -+ } -+ -+ if (strcmp(line, "import site") == 0) { -+ pathconfig->site_import = 1; -+ continue; -+ } -+ else if (strncmp(line, "import ", 7) == 0) { -+ status = _PyStatus_ERR("only 'import site' is supported " -+ "in ._pth file"); -+ goto done; -+ } -+ -+ DWORD wn = MultiByteToWideChar(CP_UTF8, 0, line, -1, NULL, 0); -+ wchar_t *wline = (wchar_t*)PyMem_RawMalloc((wn + 1) * sizeof(wchar_t)); -+ if (wline == NULL) { -+ status = _PyStatus_NO_MEMORY(); -+ goto done; -+ } -+ wn = MultiByteToWideChar(CP_UTF8, 0, line, -1, wline, wn + 1); -+ wline[wn] = '\0'; -+ -+ size_t usedsiz = wcslen(buf); -+ while (usedsiz + wn + prefixlen + 4 > bufsiz) { -+ bufsiz += MAXPATHLEN; -+ wchar_t *tmp = (wchar_t*)PyMem_RawRealloc(buf, (bufsiz + 1) * -+ sizeof(wchar_t)); -+ if (tmp == NULL) { -+ status = _PyStatus_NO_MEMORY(); -+ goto done; -+ } -+ buf = tmp; -+ } -+ -+ if (usedsiz) { -+ wcscat_s(buf, bufsiz, L";"); -+ usedsiz += 1; -+ } -+ -+ errno_t result; -+ _Py_BEGIN_SUPPRESS_IPH -+ result = wcscat_s(buf, bufsiz, prefix); -+ _Py_END_SUPPRESS_IPH -+ -+ if (result == EINVAL) { -+ status = _PyStatus_ERR("invalid argument during ._pth processing"); -+ goto done; -+ } else if (result == ERANGE) { -+ status = _PyStatus_ERR("buffer overflow during ._pth processing"); -+ goto done; -+ } -+ -+ wchar_t *b = &buf[usedsiz]; -+ join(b, wline); -+ -+ PyMem_RawFree(wline); -+ wline = NULL; -+ } -+ -+ if (pathconfig->module_search_path == NULL) { -+ pathconfig->module_search_path = _PyMem_RawWcsdup(buf); -+ if (pathconfig->module_search_path == NULL) { -+ status = _PyStatus_NO_MEMORY(); -+ goto done; -+ } -+ } -+ -+ *found = 1; -+ status = _PyStatus_OK(); -+ goto done; -+ -+done: -+ PyMem_RawFree(buf); -+ PyMem_RawFree(wline); -+ fclose(sp_file); -+ return status; -+} -+ -+ -+static int -+get_pth_filename(PyCalculatePath *calculate, wchar_t *filename, -+ const _PyPathConfig *pathconfig) -+{ -+ if (!get_dllpath(filename) && -+ !change_ext(filename, filename, L"._pth") && -+ exists(filename)) -+ { -+ return 1; -+ } -+ if (pathconfig->program_full_path[0] && -+ !change_ext(filename, pathconfig->program_full_path, L"._pth") && -+ exists(filename)) -+ { -+ return 1; -+ } -+ return 0; -+} -+ -+ -+static PyStatus -+calculate_pth_file(PyCalculatePath *calculate, _PyPathConfig *pathconfig, -+ wchar_t *prefix, int *found) -+{ -+ wchar_t filename[MAXPATHLEN+1]; -+ -+ if (!get_pth_filename(calculate, filename, pathconfig)) { -+ return _PyStatus_OK(); -+ } -+ -+ return read_pth_file(pathconfig, prefix, filename, found); -+} -+ -+ -+/* Search for an environment configuration file, first in the -+ executable's directory and then in the parent directory. -+ If found, open it for use when searching for prefixes. -+*/ -+static PyStatus -+calculate_pyvenv_file(PyCalculatePath *calculate, -+ wchar_t *argv0_path, size_t argv0_path_len) -+{ -+ wchar_t filename[MAXPATHLEN+1]; -+ const wchar_t *env_cfg = L"pyvenv.cfg"; -+ -+ /* Filename: / "pyvenv.cfg" */ -+ wcscpy_s(filename, MAXPATHLEN+1, argv0_path); -+ join(filename, env_cfg); -+ -+ FILE *env_file = _Py_wfopen(filename, L"r"); -+ if (env_file == NULL) { -+ errno = 0; -+ -+ /* Filename: / "pyvenv.cfg" */ -+ reduce(filename); -+ reduce(filename); -+ join(filename, env_cfg); -+ -+ env_file = _Py_wfopen(filename, L"r"); -+ if (env_file == NULL) { -+ errno = 0; -+ return _PyStatus_OK(); -+ } -+ } -+ -+ /* Look for a 'home' variable and set argv0_path to it, if found */ -+ wchar_t *home = NULL; -+ PyStatus status = _Py_FindEnvConfigValue(env_file, L"home", &home); -+ if (_PyStatus_EXCEPTION(status)) { -+ fclose(env_file); -+ return status; -+ } -+ if (home) { -+ wcscpy_s(argv0_path, argv0_path_len, home); -+ PyMem_RawFree(home); -+ } -+ fclose(env_file); -+ return _PyStatus_OK(); -+} -+ -+ -+static void -+calculate_home_prefix(PyCalculatePath *calculate, -+ const wchar_t *argv0_path, -+ const wchar_t *zip_path, -+ wchar_t *prefix) -+{ -+ if (calculate->home == NULL || *calculate->home == '\0') { -+ if (zip_path[0] && exists(zip_path)) { -+ wcscpy_s(prefix, MAXPATHLEN+1, zip_path); -+ reduce(prefix); -+ calculate->home = prefix; -+ } -+ else if (search_for_prefix(prefix, argv0_path, LANDMARK)) { -+ calculate->home = prefix; -+ } -+ else { -+ calculate->home = NULL; -+ } -+ } -+ else { -+ wcscpy_s(prefix, MAXPATHLEN+1, calculate->home); -+ } -+} -+ -+ -+static PyStatus -+calculate_module_search_path(PyCalculatePath *calculate, -+ _PyPathConfig *pathconfig, -+ const wchar_t *argv0_path, -+ wchar_t *prefix, -+ const wchar_t *zip_path) -+{ -+ int skiphome = calculate->home==NULL ? 0 : 1; -+ char * allow_registry_paths = getenv("CONDA_PY_ALLOW_REG_PATHS"); -+ if (!Py_IgnoreEnvironmentFlag && allow_registry_paths && allow_registry_paths[0] != '0') -+ { -+ calculate->machine_path = getpythonregpath(HKEY_LOCAL_MACHINE, skiphome); -+ calculate->user_path = getpythonregpath(HKEY_CURRENT_USER, skiphome); -+ } -+ else -+ { -+ calculate->machine_path = NULL; -+ calculate->user_path = NULL; -+ } -+ -+ /* We only use the default relative PYTHONPATH if we haven't -+ anything better to use! */ -+ int skipdefault = (calculate->pythonpath_env != NULL || -+ calculate->home != NULL || -+ calculate->machine_path != NULL || -+ calculate->user_path != NULL); -+ -+ /* We need to construct a path from the following parts. -+ (1) the PYTHONPATH environment variable, if set; -+ (2) for Win32, the zip archive file path; -+ (3) for Win32, the machine_path and user_path, if set; -+ (4) the PYTHONPATH config macro, with the leading "." -+ of each component replaced with home, if set; -+ (5) the directory containing the executable (argv0_path). -+ The length calculation calculates #4 first. -+ Extra rules: -+ - If PYTHONHOME is set (in any way) item (3) is ignored. -+ - If registry values are used, (4) and (5) are ignored. -+ */ -+ -+ /* Calculate size of return buffer */ -+ size_t bufsz = 0; -+ if (calculate->home != NULL) { -+ const wchar_t *p; -+ bufsz = 1; -+ for (p = PYTHONPATH; *p; p++) { -+ if (*p == DELIM) { -+ bufsz++; /* number of DELIM plus one */ -+ } -+ } -+ bufsz *= wcslen(calculate->home); -+ } -+ bufsz += wcslen(PYTHONPATH) + 1; -+ bufsz += wcslen(argv0_path) + 1; -+ if (calculate->user_path) { -+ bufsz += wcslen(calculate->user_path) + 1; -+ } -+ if (calculate->machine_path) { -+ bufsz += wcslen(calculate->machine_path) + 1; -+ } -+ bufsz += wcslen(zip_path) + 1; -+ if (calculate->pythonpath_env != NULL) { -+ bufsz += wcslen(calculate->pythonpath_env) + 1; -+ } -+ -+ wchar_t *buf, *start_buf; -+ buf = PyMem_RawMalloc(bufsz * sizeof(wchar_t)); -+ if (buf == NULL) { -+ return _PyStatus_NO_MEMORY(); -+ } -+ start_buf = buf; -+ -+ if (calculate->pythonpath_env) { -+ if (wcscpy_s(buf, bufsz - (buf - start_buf), -+ calculate->pythonpath_env)) { -+ return INIT_ERR_BUFFER_OVERFLOW(); -+ } -+ buf = wcschr(buf, L'\0'); -+ *buf++ = DELIM; -+ } -+ if (zip_path[0]) { -+ if (wcscpy_s(buf, bufsz - (buf - start_buf), zip_path)) { -+ return INIT_ERR_BUFFER_OVERFLOW(); -+ } -+ buf = wcschr(buf, L'\0'); -+ *buf++ = DELIM; -+ } -+ if (calculate->user_path) { -+ if (wcscpy_s(buf, bufsz - (buf - start_buf), calculate->user_path)) { -+ return INIT_ERR_BUFFER_OVERFLOW(); -+ } -+ buf = wcschr(buf, L'\0'); -+ *buf++ = DELIM; -+ } -+ if (calculate->machine_path) { -+ if (wcscpy_s(buf, bufsz - (buf - start_buf), calculate->machine_path)) { -+ return INIT_ERR_BUFFER_OVERFLOW(); -+ } -+ buf = wcschr(buf, L'\0'); -+ *buf++ = DELIM; -+ } -+ if (calculate->home == NULL) { -+ if (!skipdefault) { -+ if (wcscpy_s(buf, bufsz - (buf - start_buf), PYTHONPATH)) { -+ return INIT_ERR_BUFFER_OVERFLOW(); -+ } -+ buf = wcschr(buf, L'\0'); -+ *buf++ = DELIM; -+ } -+ } else { -+ const wchar_t *p = PYTHONPATH; -+ const wchar_t *q; -+ size_t n; -+ for (;;) { -+ q = wcschr(p, DELIM); -+ if (q == NULL) { -+ n = wcslen(p); -+ } -+ else { -+ n = q-p; -+ } -+ if (p[0] == '.' && is_sep(p[1])) { -+ if (wcscpy_s(buf, bufsz - (buf - start_buf), calculate->home)) { -+ return INIT_ERR_BUFFER_OVERFLOW(); -+ } -+ buf = wcschr(buf, L'\0'); -+ p++; -+ n--; -+ } -+ wcsncpy(buf, p, n); -+ buf += n; -+ *buf++ = DELIM; -+ if (q == NULL) { -+ break; -+ } -+ p = q+1; -+ } -+ } -+ if (argv0_path) { -+ wcscpy(buf, argv0_path); -+ buf = wcschr(buf, L'\0'); -+ *buf++ = DELIM; -+ } -+ *(buf - 1) = L'\0'; -+ -+ /* Now to pull one last hack/trick. If sys.prefix is -+ empty, then try and find it somewhere on the paths -+ we calculated. We scan backwards, as our general policy -+ is that Python core directories are at the *end* of -+ sys.path. We assume that our "lib" directory is -+ on the path, and that our 'prefix' directory is -+ the parent of that. -+ */ -+ if (prefix[0] == L'\0') { -+ wchar_t lookBuf[MAXPATHLEN+1]; -+ const wchar_t *look = buf - 1; /* 'buf' is at the end of the buffer */ -+ while (1) { -+ Py_ssize_t nchars; -+ const wchar_t *lookEnd = look; -+ /* 'look' will end up one character before the -+ start of the path in question - even if this -+ is one character before the start of the buffer -+ */ -+ while (look >= start_buf && *look != DELIM) -+ look--; -+ nchars = lookEnd-look; -+ wcsncpy(lookBuf, look+1, nchars); -+ lookBuf[nchars] = L'\0'; -+ /* Up one level to the parent */ -+ reduce(lookBuf); -+ if (search_for_prefix(prefix, lookBuf, LANDMARK)) { -+ break; -+ } -+ /* If we are out of paths to search - give up */ -+ if (look < start_buf) { -+ break; -+ } -+ look--; -+ } -+ } -+ -+ pathconfig->module_search_path = start_buf; -+ return _PyStatus_OK(); -+} -+ -+ -+static PyStatus -+calculate_path(PyCalculatePath *calculate, _PyPathConfig *pathconfig) -+{ -+ PyStatus status; -+ -+ status = get_program_full_path(pathconfig); -+ if (_PyStatus_EXCEPTION(status)) { -+ return status; -+ } -+ -+ /* program_full_path guaranteed \0 terminated in MAXPATH+1 bytes. */ -+ wchar_t argv0_path[MAXPATHLEN+1]; -+ memset(argv0_path, 0, sizeof(argv0_path)); -+ -+ wcscpy_s(argv0_path, MAXPATHLEN+1, pathconfig->program_full_path); -+ reduce(argv0_path); -+ -+ wchar_t prefix[MAXPATHLEN+1]; -+ memset(prefix, 0, sizeof(prefix)); -+ -+ /* Search for a sys.path file */ -+ int pth_found = 0; -+ status = calculate_pth_file(calculate, pathconfig, prefix, &pth_found); -+ if (_PyStatus_EXCEPTION(status)) { -+ return status; -+ } -+ if (pth_found) { -+ goto done; -+ } -+ -+ status = calculate_pyvenv_file(calculate, -+ argv0_path, Py_ARRAY_LENGTH(argv0_path)); -+ if (_PyStatus_EXCEPTION(status)) { -+ return status; -+ } -+ -+ /* Calculate zip archive path from DLL or exe path */ -+ wchar_t zip_path[MAXPATHLEN+1]; -+ memset(zip_path, 0, sizeof(zip_path)); -+ -+ if (get_dllpath(zip_path) || change_ext(zip_path, zip_path, L".zip")) -+ { -+ if (change_ext(zip_path, pathconfig->program_full_path, L".zip")) { -+ zip_path[0] = L'\0'; -+ } -+ } -+ -+ calculate_home_prefix(calculate, argv0_path, zip_path, prefix); -+ -+ if (pathconfig->module_search_path == NULL) { -+ status = calculate_module_search_path(calculate, pathconfig, -+ argv0_path, prefix, zip_path); -+ if (_PyStatus_EXCEPTION(status)) { -+ return status; -+ } -+ } -+ -+done: -+ if (pathconfig->prefix == NULL) { -+ pathconfig->prefix = _PyMem_RawWcsdup(prefix); -+ if (pathconfig->prefix == NULL) { -+ return _PyStatus_NO_MEMORY(); -+ } -+ } -+ if (pathconfig->exec_prefix == NULL) { -+ pathconfig->exec_prefix = _PyMem_RawWcsdup(prefix); -+ if (pathconfig->exec_prefix == NULL) { -+ return _PyStatus_NO_MEMORY(); -+ } -+ } -+ -+ return _PyStatus_OK(); -+} -+ -+ -+static PyStatus -+calculate_init(PyCalculatePath *calculate, _PyPathConfig *pathconfig, -+ const PyConfig *config) -+{ -+ calculate->home = pathconfig->home; -+ calculate->path_env = _wgetenv(L"PATH"); -+ -+ calculate->pythonpath_env = config->pythonpath_env; -+ -+ return _PyStatus_OK(); -+} -+ -+ -+static void -+calculate_free(PyCalculatePath *calculate) -+{ -+ PyMem_RawFree(calculate->machine_path); -+ PyMem_RawFree(calculate->user_path); -+} -+ -+ -+/* Calculate the Python path configuration. -+ -+ Inputs: -+ -+ - PyConfig.pythonpath_env: PYTHONPATH environment variable -+ - _PyPathConfig.home: Py_SetPythonHome() or PYTHONHOME environment variable -+ - PATH environment variable -+ - __PYVENV_LAUNCHER__ environment variable -+ - GetModuleFileNameW(NULL): fully qualified path of the executable file of -+ the current process -+ - ._pth configuration file -+ - pyvenv.cfg configuration file -+ - Registry key "Software\Python\PythonCore\X.Y\PythonPath" -+ of HKEY_CURRENT_USER and HKEY_LOCAL_MACHINE where X.Y is the Python -+ version. -+ -+ Outputs, 'pathconfig' fields: -+ -+ - base_executable -+ - program_full_path -+ - module_search_path -+ - prefix -+ - exec_prefix -+ - isolated -+ - site_import -+ -+ If a field is already set (non NULL), it is left unchanged. */ -+PyStatus -+_PyPathConfig_Calculate(_PyPathConfig *pathconfig, const PyConfig *config) -+{ -+ PyStatus status; -+ PyCalculatePath calculate; -+ memset(&calculate, 0, sizeof(calculate)); -+ -+ status = calculate_init(&calculate, pathconfig, config); -+ if (_PyStatus_EXCEPTION(status)) { -+ goto done; -+ } -+ -+ status = calculate_path(&calculate, pathconfig); -+ -+done: -+ calculate_free(&calculate); -+ return status; -+} -+ -+ -+/* 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 -+ by chance. -+ Return whether the DLL was found. -+*/ -+static int python3_checked = 0; -+static HANDLE hPython3; -+int -+_Py_CheckPython3(void) -+{ -+ wchar_t py3path[MAXPATHLEN+1]; -+ if (python3_checked) { -+ return hPython3 != NULL; -+ } -+ python3_checked = 1; -+ -+ /* If there is a python3.dll next to the python3y.dll, -+ use that DLL */ -+ if (!get_dllpath(py3path)) { -+ reduce(py3path); -+ join(py3path, PY3_DLLNAME); -+ hPython3 = LoadLibraryExW(py3path, NULL, LOAD_LIBRARY_SEARCH_DEFAULT_DIRS); -+ if (hPython3 != NULL) { -+ return 1; -+ } -+ } -+ -+ /* If we can locate python3.dll in our application dir, -+ use that DLL */ -+ hPython3 = LoadLibraryExW(PY3_DLLNAME, NULL, LOAD_LIBRARY_SEARCH_APPLICATION_DIR); -+ if (hPython3 != NULL) { -+ return 1; -+ } -+ -+ /* For back-compat, also search {sys.prefix}\DLLs, though -+ that has not been a normal install layout for a while */ -+ wcscpy(py3path, Py_GetPrefix()); -+ if (py3path[0]) { -+ join(py3path, L"DLLs\\" PY3_DLLNAME); -+ hPython3 = LoadLibraryExW(py3path, NULL, LOAD_LIBRARY_SEARCH_DEFAULT_DIRS); -+ } -+ return hPython3 != NULL; -+} --- -2.51.0 - diff --git a/recipe/patches/0005-Unvendor-openssl.patch b/recipe/patches/0005-Unvendor-openssl.patch index 8b62ffc15..822ce4fe9 100644 --- a/recipe/patches/0005-Unvendor-openssl.patch +++ b/recipe/patches/0005-Unvendor-openssl.patch @@ -1,7 +1,7 @@ -From 276b560be39f6a6c475fee2f2bf2e56ef582ea6b Mon Sep 17 00:00:00 2001 +From 8650098599959095301e15c2cecf74da06e709c3 Mon Sep 17 00:00:00 2001 From: Nehal J Wani Date: Sat, 24 Nov 2018 20:38:02 -0600 -Subject: [PATCH 05/25] Unvendor openssl +Subject: [PATCH 05/27] Unvendor openssl Co-authored-by: Isuru Fernando --- @@ -13,7 +13,7 @@ Co-authored-by: Isuru Fernando 5 files changed, 9 insertions(+), 56 deletions(-) diff --git a/PCbuild/openssl.props b/PCbuild/openssl.props -index 5fd708b211..044cefd95e 100644 +index 5fd708b211e..044cefd95ea 100644 --- a/PCbuild/openssl.props +++ b/PCbuild/openssl.props @@ -2,10 +2,10 @@ @@ -45,7 +45,7 @@ index 5fd708b211..044cefd95e 100644 - diff --git a/PCbuild/openssl.vcxproj b/PCbuild/openssl.vcxproj -index 7ca750dda8..17eee400eb 100644 +index 7ca750dda8f..17eee400ebb 100644 --- a/PCbuild/openssl.vcxproj +++ b/PCbuild/openssl.vcxproj @@ -60,40 +60,8 @@ @@ -90,7 +90,7 @@ index 7ca750dda8..17eee400eb 100644 diff --git a/PCbuild/python.props b/PCbuild/python.props -index 8d931bba28..744ce0c540 100644 +index 79f705a1ed3..744ce0c540a 100644 --- a/PCbuild/python.props +++ b/PCbuild/python.props @@ -91,6 +91,7 @@ @@ -112,8 +112,8 @@ index 8d931bba28..744ce0c540 100644 - $(libffiDir)$(ArchName)\ - $(libffiOutDir)include $(ExternalsDir)\mpdecimal-4.0.0\ -- $(ExternalsDir)openssl-3.5.7\ -- $(ExternalsDir)openssl-bin-3.5.7\$(ArchName)\ +- $(ExternalsDir)openssl-3.5.8\ +- $(ExternalsDir)openssl-bin-3.5.8\$(ArchName)\ - $(opensslOutDir)include $(ExternalsDir)\nasm-2.11.06\ - $(ExternalsDir)\zlib-1.3.1\ @@ -123,7 +123,7 @@ index 8d931bba28..744ce0c540 100644 diff --git a/PCbuild/python.vcxproj b/PCbuild/python.vcxproj -index 417ede34c5..c73404ad2a 100644 +index 417ede34c54..75f2bd9984a 100644 --- a/PCbuild/python.vcxproj +++ b/PCbuild/python.vcxproj @@ -110,6 +110,9 @@ @@ -131,13 +131,13 @@ index 417ede34c5..c73404ad2a 100644 + -+ _CRT_SECURE_NO_WARNINGS;$(PreprocessorDefinitions) ++ _CRT_SECURE_NO_WARNINGS;$(PreprocessorDefinitions) + diff --git a/PCbuild/pythonw.vcxproj b/PCbuild/pythonw.vcxproj -index 244cdf622a..03376ab24f 100644 +index 244cdf622ad..03ba2a20dd2 100644 --- a/PCbuild/pythonw.vcxproj +++ b/PCbuild/pythonw.vcxproj @@ -105,6 +105,9 @@ @@ -145,11 +145,8 @@ index 244cdf622a..03376ab24f 100644 + -+ _CRT_SECURE_NO_WARNINGS;$(PreprocessorDefinitions) ++ _CRT_SECURE_NO_WARNINGS;$(PreprocessorDefinitions) + --- -2.51.0 - diff --git a/recipe/patches/0006-Unvendor-sqlite3.patch b/recipe/patches/0006-Unvendor-sqlite3.patch index 9b833fa74..4d34774f3 100644 --- a/recipe/patches/0006-Unvendor-sqlite3.patch +++ b/recipe/patches/0006-Unvendor-sqlite3.patch @@ -1,7 +1,7 @@ -From 899f7eb683a5bd5ca83e732899b2a55f06e9daa0 Mon Sep 17 00:00:00 2001 +From 75dc2785a2034779d3cc6853822356f447f00d84 Mon Sep 17 00:00:00 2001 From: Nehal J Wani Date: Tue, 5 Oct 2021 12:42:06 -0700 -Subject: [PATCH 06/25] Unvendor sqlite3 +Subject: [PATCH 06/27] Unvendor sqlite3 --- PCbuild/_sqlite3.vcxproj | 9 ++++----- @@ -10,7 +10,7 @@ Subject: [PATCH 06/25] Unvendor sqlite3 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/PCbuild/_sqlite3.vcxproj b/PCbuild/_sqlite3.vcxproj -index 9ae0a0fc3a..9baaafed51 100644 +index 9ae0a0fc3a0..9baaafed518 100644 --- a/PCbuild/_sqlite3.vcxproj +++ b/PCbuild/_sqlite3.vcxproj @@ -93,9 +93,12 @@ @@ -39,20 +39,20 @@ index 9ae0a0fc3a..9baaafed51 100644 diff --git a/PCbuild/pcbuild.sln b/PCbuild/pcbuild.sln -index 09a989d386..086ca1132c 100644 +index 09a989d3864..74b961e877f 100644 --- a/PCbuild/pcbuild.sln +++ b/PCbuild/pcbuild.sln -@@ -99,8 +99,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pyexpat", "pyexpat.vcxproj" +@@ -73,8 +73,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_elementtree", "_elementtre EndProject - Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_hashlib", "_hashlib.vcxproj", "{447F05A8-F581-4CAC-A466-5AC7936E207E}" + Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_socket", "_socket.vcxproj", "{86937F53-C189-40EF-8CE8-8759D8E7D480}" EndProject --Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sqlite3", "sqlite3.vcxproj", "{A1A295E5-463C-437F-81CA-1F32367685DA}" +-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_sqlite3", "_sqlite3.vcxproj", "{13CECB97-4119-4316-9D42-8534019A5A44}" -EndProject - Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_multiprocessing", "_multiprocessing.vcxproj", "{9E48B300-37D1-11DD-8C41-005056C00008}" + Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_ssl", "_ssl.vcxproj", "{C6E20F84-3247-4AD6-B051-B073268F73BA}" EndProject - Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "python3dll", "python3dll.vcxproj", "{885D4898-D08D-4091-9C40-C700CFE3FC5A}" + Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_testcapi", "_testcapi.vcxproj", "{6901D91C-6E48-4BB7-9FEC-700C8131DF1D}" diff --git a/PCbuild/sqlite3.vcxproj b/PCbuild/sqlite3.vcxproj -index f12ec348b3..f9e5e449a4 100644 +index f12ec348b37..f9e5e449a49 100644 --- a/PCbuild/sqlite3.vcxproj +++ b/PCbuild/sqlite3.vcxproj @@ -88,12 +88,12 @@ @@ -74,6 +74,3 @@ index f12ec348b3..f9e5e449a4 100644 --- -2.51.0 - diff --git a/recipe/patches/0007-Add-CondaEcosystemModifyDllSearchPath.patch b/recipe/patches/0007-Add-CondaEcosystemModifyDllSearchPath.patch index 430297fe2..fd88fa19f 100644 --- a/recipe/patches/0007-Add-CondaEcosystemModifyDllSearchPath.patch +++ b/recipe/patches/0007-Add-CondaEcosystemModifyDllSearchPath.patch @@ -1,7 +1,7 @@ -From 963af4cbd75892a8f2ee510732321eac654d40ae Mon Sep 17 00:00:00 2001 +From 7a3599e45ce0e457d8c17ba47ac180d1388d4d03 Mon Sep 17 00:00:00 2001 From: Ray Donnelly Date: Tue, 24 Dec 2019 18:37:17 +0100 -Subject: [PATCH 07/25] Add CondaEcosystemModifyDllSearchPath() +Subject: [PATCH 07/27] Add CondaEcosystemModifyDllSearchPath() The python interpreter is modifed so that it works as if the python interpreter was called with the following conda directories. @@ -33,7 +33,7 @@ Co-authored-by: Isuru Fernando 1 file changed, 95 insertions(+) diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c -index 3933c321ed..9a4a8c5a02 100644 +index 516d467141a..156524cc7ce 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -88,6 +88,10 @@ @@ -152,6 +152,3 @@ index 3933c321ed..9a4a8c5a02 100644 return _PyRuntimeState_Init(&_PyRuntime); } --- -2.51.0 - diff --git a/recipe/patches/0008-Doing-d1trimfile.patch b/recipe/patches/0008-Doing-d1trimfile.patch index 18385d333..ab21da5bd 100644 --- a/recipe/patches/0008-Doing-d1trimfile.patch +++ b/recipe/patches/0008-Doing-d1trimfile.patch @@ -1,7 +1,7 @@ -From f687076d98d083d37f8323882e0ce34bd4a7f996 Mon Sep 17 00:00:00 2001 +From 691c214c845462b7a49266e568312946a80dcd67 Mon Sep 17 00:00:00 2001 From: Ray Donnelly Date: Tue, 31 Dec 2019 21:47:47 +0100 -Subject: [PATCH 08/25] Doing d1trimfile +Subject: [PATCH 08/27] Doing d1trimfile --- PCbuild/_asyncio.vcxproj | 20 ++++++++++++++++++++ @@ -16,6 +16,7 @@ Subject: [PATCH 08/25] Doing d1trimfile PCbuild/_multiprocessing.vcxproj | 12 ++++++++++++ PCbuild/_overlapped.vcxproj | 12 ++++++++++++ PCbuild/_queue.vcxproj | 20 ++++++++++++++++++++ + PCbuild/_remote_debugging.vcxproj | 6 ++++++ PCbuild/_socket.vcxproj | 12 ++++++++++++ PCbuild/_sqlite3.vcxproj | 4 ++++ PCbuild/_ssl.vcxproj | 12 ++++++++++++ @@ -26,29 +27,37 @@ Subject: [PATCH 08/25] Doing d1trimfile PCbuild/_testimportmultiple.vcxproj | 20 ++++++++++++++++++++ PCbuild/_testinternalcapi.vcxproj | 20 ++++++++++++++++++++ PCbuild/_testmultiphase.vcxproj | 4 ++++ + PCbuild/_testsinglephase.vcxproj | 4 ++++ PCbuild/_tkinter.vcxproj | 4 ++++ - PCbuild/liblzma.vcxproj | 5 +++++ + PCbuild/_uuid.vcxproj | 6 ++++++ + PCbuild/_wmi.vcxproj | 4 ++++ + PCbuild/_zstd.vcxproj | 4 ++++ + PCbuild/liblzma.vcxproj | 4 ++++ PCbuild/pyexpat.vcxproj | 4 ++++ PCbuild/pylauncher.vcxproj | 4 ++++ PCbuild/pyshellext.vcxproj | 4 ++++ PCbuild/python.vcxproj | 4 ++++ PCbuild/python3dll.vcxproj | 4 ++++ + PCbuild/python3tdll.vcxproj | 4 ++++ PCbuild/python_uwp.vcxproj | 2 +- - PCbuild/pythoncore.vcxproj | 6 +++--- - PCbuild/pythonw.vcxproj | 12 ++++++++++++ + PCbuild/pythoncore.vcxproj | 2 +- + PCbuild/pythonw.vcxproj | 20 ++++++++++++-------- PCbuild/pythonw_uwp.vcxproj | 2 +- PCbuild/pywlauncher.vcxproj | 4 ++++ PCbuild/select.vcxproj | 12 ++++++++++++ + PCbuild/sqlite3.vcxproj | 4 ++++ PCbuild/unicodedata.vcxproj | 20 ++++++++++++++++++++ PCbuild/venvlauncher.vcxproj | 4 ++++ PCbuild/venvwlauncher.vcxproj | 4 ++++ PCbuild/winsound.vcxproj | 12 ++++++++++++ PCbuild/xxlimited.vcxproj | 6 ++++++ PCbuild/xxlimited_35.vcxproj | 6 ++++++ - 41 files changed, 355 insertions(+), 6 deletions(-) + PCbuild/xxlimited_3_13.vcxproj | 6 ++++++ + PCbuild/zlib-ng.vcxproj | 4 ++++ + 50 files changed, 394 insertions(+), 12 deletions(-) diff --git a/PCbuild/_asyncio.vcxproj b/PCbuild/_asyncio.vcxproj -index 76b0ffd660..1402860e19 100644 +index 76b0ffd660d..1402860e19b 100644 --- a/PCbuild/_asyncio.vcxproj +++ b/PCbuild/_asyncio.vcxproj @@ -91,6 +91,26 @@ @@ -79,7 +88,7 @@ index 76b0ffd660..1402860e19 100644 diff --git a/PCbuild/_bz2.vcxproj b/PCbuild/_bz2.vcxproj -index e0dc6ec187..9e75e57cb6 100644 +index e0dc6ec187a..9e75e57cb6e 100644 --- a/PCbuild/_bz2.vcxproj +++ b/PCbuild/_bz2.vcxproj @@ -97,6 +97,10 @@ @@ -94,7 +103,7 @@ index e0dc6ec187..9e75e57cb6 100644 diff --git a/PCbuild/_ctypes.vcxproj b/PCbuild/_ctypes.vcxproj -index 63d5fa49cd..6329f3d960 100644 +index 63d5fa49cd4..6329f3d960f 100644 --- a/PCbuild/_ctypes.vcxproj +++ b/PCbuild/_ctypes.vcxproj @@ -95,6 +95,10 @@ @@ -109,7 +118,7 @@ index 63d5fa49cd..6329f3d960 100644 /EXPORT:DllGetClassObject,PRIVATE /EXPORT:DllCanUnloadNow,PRIVATE %(AdditionalOptions) diff --git a/PCbuild/_ctypes_test.vcxproj b/PCbuild/_ctypes_test.vcxproj -index f15b80852e..e565441ca4 100644 +index f15b80852e3..e565441ca4c 100644 --- a/PCbuild/_ctypes_test.vcxproj +++ b/PCbuild/_ctypes_test.vcxproj @@ -93,6 +93,26 @@ @@ -140,7 +149,7 @@ index f15b80852e..e565441ca4 100644 diff --git a/PCbuild/_decimal.vcxproj b/PCbuild/_decimal.vcxproj -index 3ba49370d5..921d22e47b 100644 +index 3ba49370d58..921d22e47b3 100644 --- a/PCbuild/_decimal.vcxproj +++ b/PCbuild/_decimal.vcxproj @@ -99,6 +99,10 @@ @@ -155,7 +164,7 @@ index 3ba49370d5..921d22e47b 100644 diff --git a/PCbuild/_elementtree.vcxproj b/PCbuild/_elementtree.vcxproj -index 46e34a5ea8..fb1589557d 100644 +index 46e34a5ea82..fb1589557da 100644 --- a/PCbuild/_elementtree.vcxproj +++ b/PCbuild/_elementtree.vcxproj @@ -94,7 +94,11 @@ @@ -172,7 +181,7 @@ index 46e34a5ea8..fb1589557d 100644 diff --git a/PCbuild/_freeze_module.vcxproj b/PCbuild/_freeze_module.vcxproj -index 17b98c9d9e..b3998a47f2 100644 +index 198563b4d8d..2f184fc8399 100644 --- a/PCbuild/_freeze_module.vcxproj +++ b/PCbuild/_freeze_module.vcxproj @@ -93,6 +93,10 @@ @@ -187,7 +196,7 @@ index 17b98c9d9e..b3998a47f2 100644 Console diff --git a/PCbuild/_hashlib.vcxproj b/PCbuild/_hashlib.vcxproj -index 2cd205224b..1ff3a9cdec 100644 +index 2cd205224bc..1ff3a9cdeca 100644 --- a/PCbuild/_hashlib.vcxproj +++ b/PCbuild/_hashlib.vcxproj @@ -96,6 +96,18 @@ @@ -210,7 +219,7 @@ index 2cd205224b..1ff3a9cdec 100644 diff --git a/PCbuild/_lzma.vcxproj b/PCbuild/_lzma.vcxproj -index 40107d4b76..321f41d8d2 100644 +index 40107d4b76c..321f41d8d27 100644 --- a/PCbuild/_lzma.vcxproj +++ b/PCbuild/_lzma.vcxproj @@ -95,6 +95,10 @@ @@ -225,7 +234,7 @@ index 40107d4b76..321f41d8d2 100644 $(OutDir)liblzma$(PyDebugExt).lib;%(AdditionalDependencies) diff --git a/PCbuild/_multiprocessing.vcxproj b/PCbuild/_multiprocessing.vcxproj -index a65397f532..58f1d506dc 100644 +index a65397f532a..58f1d506dc8 100644 --- a/PCbuild/_multiprocessing.vcxproj +++ b/PCbuild/_multiprocessing.vcxproj @@ -95,6 +95,18 @@ @@ -248,7 +257,7 @@ index a65397f532..58f1d506dc 100644 diff --git a/PCbuild/_overlapped.vcxproj b/PCbuild/_overlapped.vcxproj -index 224bf05d53..d3221fcce3 100644 +index 224bf05d530..d3221fcce32 100644 --- a/PCbuild/_overlapped.vcxproj +++ b/PCbuild/_overlapped.vcxproj @@ -95,6 +95,18 @@ @@ -271,7 +280,7 @@ index 224bf05d53..d3221fcce3 100644 diff --git a/PCbuild/_queue.vcxproj b/PCbuild/_queue.vcxproj -index 80a1c3c6a4..8d4555299a 100644 +index 80a1c3c6a4a..8d4555299ae 100644 --- a/PCbuild/_queue.vcxproj +++ b/PCbuild/_queue.vcxproj @@ -91,6 +91,26 @@ @@ -301,8 +310,25 @@ index 80a1c3c6a4..8d4555299a 100644 +diff --git a/PCbuild/_remote_debugging.vcxproj b/PCbuild/_remote_debugging.vcxproj +index 41aadbd13d0..7fbaafdbe64 100644 +--- a/PCbuild/_remote_debugging.vcxproj ++++ b/PCbuild/_remote_debugging.vcxproj +@@ -93,6 +93,12 @@ + <_ProjectFileVersion>10.0.30319.1 + + ++ ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% ++ + + ntdll.lib;%(AdditionalDependencies) + diff --git a/PCbuild/_socket.vcxproj b/PCbuild/_socket.vcxproj -index 41af089592..993426d4cf 100644 +index 41af0895921..993426d4cf8 100644 --- a/PCbuild/_socket.vcxproj +++ b/PCbuild/_socket.vcxproj @@ -95,6 +95,18 @@ @@ -325,7 +351,7 @@ index 41af089592..993426d4cf 100644 diff --git a/PCbuild/_sqlite3.vcxproj b/PCbuild/_sqlite3.vcxproj -index 9baaafed51..a850c5a895 100644 +index 9baaafed518..a850c5a8955 100644 --- a/PCbuild/_sqlite3.vcxproj +++ b/PCbuild/_sqlite3.vcxproj @@ -95,6 +95,10 @@ @@ -340,7 +366,7 @@ index 9baaafed51..a850c5a895 100644 $(condaDir)\lib\sqlite3.lib;%(AdditionalDependencies) diff --git a/PCbuild/_ssl.vcxproj b/PCbuild/_ssl.vcxproj -index ce21f992ff..34561515c1 100644 +index ce21f992ff8..34561515c12 100644 --- a/PCbuild/_ssl.vcxproj +++ b/PCbuild/_ssl.vcxproj @@ -96,6 +96,18 @@ @@ -363,7 +389,7 @@ index ce21f992ff..34561515c1 100644 diff --git a/PCbuild/_testbuffer.vcxproj b/PCbuild/_testbuffer.vcxproj -index 4e721e8ce0..048adde095 100644 +index 4e721e8ce09..048adde0951 100644 --- a/PCbuild/_testbuffer.vcxproj +++ b/PCbuild/_testbuffer.vcxproj @@ -92,6 +92,26 @@ @@ -394,7 +420,7 @@ index 4e721e8ce0..048adde095 100644 diff --git a/PCbuild/_testcapi.vcxproj b/PCbuild/_testcapi.vcxproj -index 64e50b67be..83233bfe86 100644 +index 64e50b67be4..83233bfe869 100644 --- a/PCbuild/_testcapi.vcxproj +++ b/PCbuild/_testcapi.vcxproj @@ -92,6 +92,26 @@ @@ -425,7 +451,7 @@ index 64e50b67be..83233bfe86 100644 diff --git a/PCbuild/_testconsole.vcxproj b/PCbuild/_testconsole.vcxproj -index 69d312b17a..ea230fa812 100644 +index 69d312b17a5..ea230fa8126 100644 --- a/PCbuild/_testconsole.vcxproj +++ b/PCbuild/_testconsole.vcxproj @@ -92,6 +92,10 @@ @@ -440,7 +466,7 @@ index 69d312b17a..ea230fa812 100644 Console diff --git a/PCbuild/_testembed.vcxproj b/PCbuild/_testembed.vcxproj -index a7ea8787e0..eab72171e3 100644 +index a7ea8787e0c..eab72171e3b 100644 --- a/PCbuild/_testembed.vcxproj +++ b/PCbuild/_testembed.vcxproj @@ -89,6 +89,10 @@ @@ -455,7 +481,7 @@ index a7ea8787e0..eab72171e3 100644 Console diff --git a/PCbuild/_testimportmultiple.vcxproj b/PCbuild/_testimportmultiple.vcxproj -index c35ac83c1c..c9d7f5d22b 100644 +index c35ac83c1c7..c9d7f5d22b7 100644 --- a/PCbuild/_testimportmultiple.vcxproj +++ b/PCbuild/_testimportmultiple.vcxproj @@ -92,6 +92,26 @@ @@ -486,7 +512,7 @@ index c35ac83c1c..c9d7f5d22b 100644 diff --git a/PCbuild/_testinternalcapi.vcxproj b/PCbuild/_testinternalcapi.vcxproj -index f3e423fa04..ac28571799 100644 +index f3e423fa046..ac285717998 100644 --- a/PCbuild/_testinternalcapi.vcxproj +++ b/PCbuild/_testinternalcapi.vcxproj @@ -92,6 +92,26 @@ @@ -517,7 +543,7 @@ index f3e423fa04..ac28571799 100644 diff --git a/PCbuild/_testmultiphase.vcxproj b/PCbuild/_testmultiphase.vcxproj -index e730fe308a..625e50af7f 100644 +index e730fe308ab..625e50af7f6 100644 --- a/PCbuild/_testmultiphase.vcxproj +++ b/PCbuild/_testmultiphase.vcxproj @@ -92,6 +92,10 @@ @@ -527,12 +553,27 @@ index e730fe308a..625e50af7f 100644 + /d1trimfile:%SRC_DIR% + /d1trimfile:%SRC_DIR% + /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% + + + Console +diff --git a/PCbuild/_testsinglephase.vcxproj b/PCbuild/_testsinglephase.vcxproj +index bf4dabf66c1..6068fb3c204 100644 +--- a/PCbuild/_testsinglephase.vcxproj ++++ b/PCbuild/_testsinglephase.vcxproj +@@ -92,6 +92,10 @@ + + + _CONSOLE;%(PreprocessorDefinitions) ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% + /d1trimfile:%SRC_DIR% Console diff --git a/PCbuild/_tkinter.vcxproj b/PCbuild/_tkinter.vcxproj -index 87f6005fff..de9358312a 100644 +index 87f6005fffc..de9358312ac 100644 --- a/PCbuild/_tkinter.vcxproj +++ b/PCbuild/_tkinter.vcxproj @@ -97,6 +97,10 @@ @@ -546,15 +587,61 @@ index 87f6005fff..de9358312a 100644 $(tcltkLib);%(AdditionalDependencies) +diff --git a/PCbuild/_uuid.vcxproj b/PCbuild/_uuid.vcxproj +index 50d81cc7916..64fcf61fa3a 100644 +--- a/PCbuild/_uuid.vcxproj ++++ b/PCbuild/_uuid.vcxproj +@@ -93,6 +93,12 @@ + <_ProjectFileVersion>10.0.30319.1 + + ++ ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% ++ + + rpcrt4.lib;%(AdditionalDependencies) + +diff --git a/PCbuild/_wmi.vcxproj b/PCbuild/_wmi.vcxproj +index 22fa8960982..516db060fb3 100644 +--- a/PCbuild/_wmi.vcxproj ++++ b/PCbuild/_wmi.vcxproj +@@ -95,6 +95,10 @@ + + + /std:c++20 %(AdditionalOptions) ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% + + + wbemuuid.lib;propsys.lib;%(AdditionalDependencies) +diff --git a/PCbuild/_zstd.vcxproj b/PCbuild/_zstd.vcxproj +index 6f91b8d05cc..683a44535ca 100644 +--- a/PCbuild/_zstd.vcxproj ++++ b/PCbuild/_zstd.vcxproj +@@ -96,6 +96,10 @@ + + WIN32;ZSTD_MULTITHREAD=1;%(PreprocessorDefinitions) + $(zstdDir)lib\;$(zstdDir)lib\common;$(zstdDir)lib\compress;$(zstdDir)lib\decompress;$(zstdDir)lib\dictBuilder;%(AdditionalIncludeDirectories) ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% + + + diff --git a/PCbuild/liblzma.vcxproj b/PCbuild/liblzma.vcxproj -index 75d4e16234..f54587584b 100644 +index 75d4e162346..d50534affa1 100644 --- a/PCbuild/liblzma.vcxproj +++ b/PCbuild/liblzma.vcxproj -@@ -95,6 +95,11 @@ +@@ -95,6 +95,10 @@ $(lzmaDir)windows;$(lzmaDir)src/liblzma/common;$(lzmaDir)src/common;$(lzmaDir)src/liblzma/api;$(lzmaDir)src/liblzma/check;$(lzmaDir)src/liblzma/delta;$(lzmaDir)src/liblzma/lz;$(lzmaDir)src/liblzma/lzma;$(lzmaDir)src/liblzma/rangecoder;$(lzmaDir)src/liblzma/simple;%(AdditionalIncludeDirectories) 4244;4267;4996;%(DisableSpecificWarnings) %(AdditionalOptions) -Wno-deprecated-declarations -+ 4028;4113;4133;4244;4267;4996;%(DisableSpecificWarnings) + /d1trimfile:%SRC_DIR% + /d1trimfile:%SRC_DIR% + /d1trimfile:%SRC_DIR% @@ -563,7 +650,7 @@ index 75d4e16234..f54587584b 100644 diff --git a/PCbuild/pyexpat.vcxproj b/PCbuild/pyexpat.vcxproj -index 8a60ee15eb..6518e0e1b1 100644 +index 8a60ee15eb4..6518e0e1b1c 100644 --- a/PCbuild/pyexpat.vcxproj +++ b/PCbuild/pyexpat.vcxproj @@ -92,6 +92,10 @@ @@ -578,7 +665,7 @@ index 8a60ee15eb..6518e0e1b1 100644 diff --git a/PCbuild/pylauncher.vcxproj b/PCbuild/pylauncher.vcxproj -index ca422ef4d0..0c692649ed 100644 +index ca422ef4d02..0c692649ed6 100644 --- a/PCbuild/pylauncher.vcxproj +++ b/PCbuild/pylauncher.vcxproj @@ -93,6 +93,10 @@ @@ -593,7 +680,7 @@ index ca422ef4d0..0c692649ed 100644 shell32.lib;pathcch.lib;%(AdditionalDependencies) diff --git a/PCbuild/pyshellext.vcxproj b/PCbuild/pyshellext.vcxproj -index ea432d6bc9..13bc692103 100644 +index ea432d6bc9a..13bc6921030 100644 --- a/PCbuild/pyshellext.vcxproj +++ b/PCbuild/pyshellext.vcxproj @@ -92,6 +92,10 @@ @@ -608,7 +695,7 @@ index ea432d6bc9..13bc692103 100644 version.lib;shlwapi.lib;%(AdditionalDependencies) diff --git a/PCbuild/python.vcxproj b/PCbuild/python.vcxproj -index c73404ad2a..30312dd638 100644 +index 75f2bd9984a..27ca69880a9 100644 --- a/PCbuild/python.vcxproj +++ b/PCbuild/python.vcxproj @@ -92,6 +92,10 @@ @@ -623,7 +710,7 @@ index c73404ad2a..30312dd638 100644 Console diff --git a/PCbuild/python3dll.vcxproj b/PCbuild/python3dll.vcxproj -index 3d8ac1b235..8f8da3d0bb 100644 +index 3d8ac1b2353..8f8da3d0bb0 100644 --- a/PCbuild/python3dll.vcxproj +++ b/PCbuild/python3dll.vcxproj @@ -93,6 +93,10 @@ @@ -633,12 +720,27 @@ index 3d8ac1b235..8f8da3d0bb 100644 + /d1trimfile:%SRC_DIR% + /d1trimfile:%SRC_DIR% + /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% + + + true +diff --git a/PCbuild/python3tdll.vcxproj b/PCbuild/python3tdll.vcxproj +index 796712cca31..b2929246b44 100644 +--- a/PCbuild/python3tdll.vcxproj ++++ b/PCbuild/python3tdll.vcxproj +@@ -93,6 +93,10 @@ + + PYTHON_DLL_NAME="$(PyDllName)";%(PreprocessorDefinitions) + false ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% + /d1trimfile:%SRC_DIR% true diff --git a/PCbuild/python_uwp.vcxproj b/PCbuild/python_uwp.vcxproj -index 3f8772d30b..d80968e351 100644 +index 3f8772d30b4..d80968e351a 100644 --- a/PCbuild/python_uwp.vcxproj +++ b/PCbuild/python_uwp.vcxproj @@ -90,7 +90,7 @@ @@ -651,26 +753,20 @@ index 3f8772d30b..d80968e351 100644 windowsapp.lib;%(AdditionalDependencies) diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj -index e255ed5af1..b455b3089c 100644 +index e255ed5af19..e2f8f42449a 100644 --- a/PCbuild/pythoncore.vcxproj +++ b/PCbuild/pythoncore.vcxproj -@@ -99,11 +99,11 @@ +@@ -99,7 +99,7 @@ - /Zm200 %(AdditionalOptions) + /d1trimfile:%SRC_DIR% $(PySourcePath)Modules\_hacl;$(PySourcePath)Modules\_hacl\include;$(PySourcePath)Python;%(AdditionalIncludeDirectories) -- $(zlibNgDir);$(GeneratedZlibNgDir);%(AdditionalIncludeDirectories) -+ $(zlibDir);%(AdditionalIncludeDirectories) + $(zlibNgDir);$(GeneratedZlibNgDir);%(AdditionalIncludeDirectories) $(GeneratedJitStencilsDir);%(AdditionalIncludeDirectories) -- _USRDLL;Py_BUILD_CORE;Py_BUILD_CORE_BUILTIN;Py_ENABLE_SHARED;MS_DLL_ID="$(SysWinVer)";ZLIB_COMPAT;%(PreprocessorDefinitions) -+ _USRDLL;Py_BUILD_CORE;Py_BUILD_CORE_BUILTIN;Py_ENABLE_SHARED;MS_DLL_ID="$(SysWinVer)";%(PreprocessorDefinitions) - _Py_HAVE_ZLIB;%(PreprocessorDefinitions) - _Py_JIT;%(PreprocessorDefinitions) - _Py_TIER2=$(UseTIER2);%(PreprocessorDefinitions) diff --git a/PCbuild/pythonw.vcxproj b/PCbuild/pythonw.vcxproj -index 03376ab24f..6437dfa6a9 100644 +index 03ba2a20dd2..193eb2ecb88 100644 --- a/PCbuild/pythonw.vcxproj +++ b/PCbuild/pythonw.vcxproj @@ -96,6 +96,18 @@ @@ -692,8 +788,22 @@ index 03376ab24f..6437dfa6a9 100644 +@@ -118,12 +130,4 @@ + + + +- +- +- +- + +\ No newline at end of file diff --git a/PCbuild/pythonw_uwp.vcxproj b/PCbuild/pythonw_uwp.vcxproj -index f548d02264..fa4e75f971 100644 +index f548d022642..fa4e75f9712 100644 --- a/PCbuild/pythonw_uwp.vcxproj +++ b/PCbuild/pythonw_uwp.vcxproj @@ -90,7 +90,7 @@ @@ -706,7 +816,7 @@ index f548d02264..fa4e75f971 100644 windowsapp.lib;%(AdditionalDependencies) diff --git a/PCbuild/pywlauncher.vcxproj b/PCbuild/pywlauncher.vcxproj -index 1694548935..551dbc21bb 100644 +index 1694548935a..551dbc21bb1 100644 --- a/PCbuild/pywlauncher.vcxproj +++ b/PCbuild/pywlauncher.vcxproj @@ -93,6 +93,10 @@ @@ -721,7 +831,7 @@ index 1694548935..551dbc21bb 100644 shell32.lib;pathcch.lib;%(AdditionalDependencies) diff --git a/PCbuild/select.vcxproj b/PCbuild/select.vcxproj -index d7448fd4d7..a51c71d2b7 100644 +index d7448fd4d72..a51c71d2b72 100644 --- a/PCbuild/select.vcxproj +++ b/PCbuild/select.vcxproj @@ -94,6 +94,18 @@ @@ -743,8 +853,23 @@ index d7448fd4d7..a51c71d2b7 100644 +diff --git a/PCbuild/sqlite3.vcxproj b/PCbuild/sqlite3.vcxproj +index f9e5e449a49..16ed999655a 100644 +--- a/PCbuild/sqlite3.vcxproj ++++ b/PCbuild/sqlite3.vcxproj +@@ -101,6 +101,10 @@ + SQLITE_ENABLE_MATH_FUNCTIONS;SQLITE_ENABLE_FTS4;SQLITE_ENABLE_FTS5;SQLITE_ENABLE_RTREE;SQLITE_OMIT_AUTOINIT;SQLITE_API=__declspec(dllexport);%(PreprocessorDefinitions) + Level1 + %(AdditionalOptions) -Wno-unused ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% + + + SQLITE_VERSION=$(SqliteVersion);SQLITE_MAJOR_VERSION=$(SqliteMajorVersion);SQLITE_MINOR_VERSION=$(SqliteMinorVersion);SQLITE_MICRO_VERSION=$(SqliteMicroVersion);SQLITE_PATCH_VERSION=$(SqlitePatchVersion);%(PreprocessorDefinitions) diff --git a/PCbuild/unicodedata.vcxproj b/PCbuild/unicodedata.vcxproj -index 781f938e2a..714a2382c1 100644 +index 781f938e2ab..714a2382c1e 100644 --- a/PCbuild/unicodedata.vcxproj +++ b/PCbuild/unicodedata.vcxproj @@ -91,6 +91,26 @@ @@ -775,7 +900,7 @@ index 781f938e2a..714a2382c1 100644 diff --git a/PCbuild/venvlauncher.vcxproj b/PCbuild/venvlauncher.vcxproj -index a2e8ffa82b..705e507050 100644 +index a2e8ffa82b1..705e507050f 100644 --- a/PCbuild/venvlauncher.vcxproj +++ b/PCbuild/venvlauncher.vcxproj @@ -97,6 +97,10 @@ @@ -790,7 +915,7 @@ index a2e8ffa82b..705e507050 100644 PY_ICON;%(PreprocessorDefinitions) diff --git a/PCbuild/venvwlauncher.vcxproj b/PCbuild/venvwlauncher.vcxproj -index f2aaf83fe2..d9c47683f2 100644 +index f2aaf83fe2b..d9c47683f25 100644 --- a/PCbuild/venvwlauncher.vcxproj +++ b/PCbuild/venvwlauncher.vcxproj @@ -97,6 +97,10 @@ @@ -805,7 +930,7 @@ index f2aaf83fe2..d9c47683f2 100644 PYW_ICON;%(PreprocessorDefinitions) diff --git a/PCbuild/winsound.vcxproj b/PCbuild/winsound.vcxproj -index c26029b15a..d76a3fb853 100644 +index c26029b15a3..d76a3fb8537 100644 --- a/PCbuild/winsound.vcxproj +++ b/PCbuild/winsound.vcxproj @@ -96,6 +96,18 @@ @@ -828,7 +953,7 @@ index c26029b15a..d76a3fb853 100644 diff --git a/PCbuild/xxlimited.vcxproj b/PCbuild/xxlimited.vcxproj -index f0c3616600..cc906a14cf 100644 +index f0c36166001..cc906a14cf4 100644 --- a/PCbuild/xxlimited.vcxproj +++ b/PCbuild/xxlimited.vcxproj @@ -93,6 +93,12 @@ @@ -845,7 +970,7 @@ index f0c3616600..cc906a14cf 100644 wsock32.lib;%(AdditionalDependencies) diff --git a/PCbuild/xxlimited_35.vcxproj b/PCbuild/xxlimited_35.vcxproj -index bfaf4e2536..4f8a3b37e3 100644 +index bfaf4e25366..4f8a3b37e35 100644 --- a/PCbuild/xxlimited_35.vcxproj +++ b/PCbuild/xxlimited_35.vcxproj @@ -93,6 +93,12 @@ @@ -861,6 +986,35 @@ index bfaf4e2536..4f8a3b37e3 100644 wsock32.lib;%(AdditionalDependencies) --- -2.51.0 - +diff --git a/PCbuild/xxlimited_3_13.vcxproj b/PCbuild/xxlimited_3_13.vcxproj +index 7a9760fd431..cff5e4b6850 100644 +--- a/PCbuild/xxlimited_3_13.vcxproj ++++ b/PCbuild/xxlimited_3_13.vcxproj +@@ -93,6 +93,12 @@ + <_ProjectFileVersion>10.0.30319.1 + + ++ ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% ++ + + wsock32.lib;%(AdditionalDependencies) + +diff --git a/PCbuild/zlib-ng.vcxproj b/PCbuild/zlib-ng.vcxproj +index ffe8e70f2db..e92cdbca987 100644 +--- a/PCbuild/zlib-ng.vcxproj ++++ b/PCbuild/zlib-ng.vcxproj +@@ -99,6 +99,10 @@ + %(PreprocessorDefinitions);X86_FEATURES;X86_HAVE_XSAVE_INTRIN;X86_SSE2;X86_SSSE3;X86_SSE42;X86_PCLMULQDQ_CRC;X86_AVX2;X86_AVX512;X86_AVX512VNNI;X86_VPCLMULQDQ_CRC + %(PreprocessorDefinitions);ZLIB_DEBUG + %(PreprocessorDefinitions);HAVE_BUILTIN_CTZ ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% ++ /d1trimfile:%SRC_DIR% + + + diff --git a/recipe/patches/0009-cross-compile-darwin.patch b/recipe/patches/0009-cross-compile-darwin.patch index 898978784..39f0e7607 100644 --- a/recipe/patches/0009-cross-compile-darwin.patch +++ b/recipe/patches/0009-cross-compile-darwin.patch @@ -1,15 +1,35 @@ -From e26e3077221a90864c2a5f295cc7c98f6bc0c449 Mon Sep 17 00:00:00 2001 -From: Isuru Fernando -Date: Thu, 26 Nov 2020 18:47:37 +0000 -Subject: [PATCH 09/25] Allow cross compiling for Darwin +From 3c3434e2e741c2c2bf1a9a4bab9d71dc6d1935c1 Mon Sep 17 00:00:00 2001 +From: Ray Donnelly +Date: Fri, 2 Oct 2020 00:03:12 +0200 +Subject: [PATCH 09/27] cross compile darwin +By Isuru Fernando. --- - configure | 3 +++ - configure.ac | 3 +++ - 2 files changed, 6 insertions(+) + Lib/platform.py | 7 ++++++- + configure | 6 ++++++ + configure.ac | 6 ++++++ + 3 files changed, 18 insertions(+), 1 deletion(-) +diff --git a/Lib/platform.py b/Lib/platform.py +index 36489d4fdd9..37278847c0a 100644 +--- a/Lib/platform.py ++++ b/Lib/platform.py +@@ -474,7 +474,12 @@ def win32_ver(release='', version='', csd='', ptype=''): + def _mac_ver_xml(): + fn = '/System/Library/CoreServices/SystemVersion.plist' + if not os.path.exists(fn): +- return None ++ if 'SDKROOT' in os.environ: ++ fn = os.environ['SDKROOT'] + fn ++ if not os.path.exists(fn): ++ return None ++ else: ++ return None + + try: + import plistlib diff --git a/configure b/configure -index 08a7c663ce..10a347ff0a 100755 +index a68a98c5a4d..a7d9fa69814 100755 --- a/configure +++ b/configure @@ -4155,6 +4155,9 @@ then @@ -22,8 +42,18 @@ index 08a7c663ce..10a347ff0a 100755 *-*-cygwin*) ac_sys_system=Cygwin ;; +@@ -4638,6 +4641,9 @@ if test "$cross_compiling" = yes; then + esac + ;; + *-gnu) ++ _host_ident=$host_cpu ++ ;; ++ *-*-darwin*) + _host_ident=$host_cpu + ;; + *-*-cygwin*) diff --git a/configure.ac b/configure.ac -index ead82d6da0..48f0fda91a 100644 +index ed8b53dd3a4..cc9554e5b39 100644 --- a/configure.ac +++ b/configure.ac @@ -333,6 +333,9 @@ then @@ -36,6 +66,13 @@ index ead82d6da0..48f0fda91a 100644 *-*-cygwin*) ac_sys_system=Cygwin ;; --- -2.51.0 - +@@ -786,6 +789,9 @@ if test "$cross_compiling" = yes; then + *-gnu) + _host_ident=$host_cpu + ;; ++ *-*-darwin*) ++ _host_ident=$host_cpu ++ ;; + *-*-cygwin*) + _host_ident= + ;; diff --git a/recipe/patches/0010-Fix-TZPATH-on-windows.patch b/recipe/patches/0010-Fix-TZPATH-on-windows.patch index e2b7d86c4..e45be6e36 100644 --- a/recipe/patches/0010-Fix-TZPATH-on-windows.patch +++ b/recipe/patches/0010-Fix-TZPATH-on-windows.patch @@ -1,24 +1,29 @@ -From 43d4626a65c58958b72cb3aa2c4a1940ecd8cf86 Mon Sep 17 00:00:00 2001 +From aab9fadd4195b340be1eed7152f2de1242939a6e Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Wed, 7 Oct 2020 10:08:30 -0500 -Subject: [PATCH 10/25] Fix TZPATH on windows +Subject: [PATCH 10/27] Fix TZPATH on windows --- - Lib/sysconfig/__init__.py | 1 + - 1 file changed, 1 insertion(+) + Lib/sysconfig/__init__.py | 2 ++ + 1 file changed, 2 insertions(+) diff --git a/Lib/sysconfig/__init__.py b/Lib/sysconfig/__init__.py -index 47415adce0..78659c358d 100644 +index 4f8ebf15d36..1230a48208e 100644 --- a/Lib/sysconfig/__init__.py +++ b/Lib/sysconfig/__init__.py -@@ -550,6 +550,7 @@ def _init_config_vars(): +@@ -175,6 +175,7 @@ def joinuser(*args): + _PY_VERSION = sys.version.split()[0] + _PY_VERSION_SHORT = f'{sys.version_info[0]}.{sys.version_info[1]}' + _PY_VERSION_SHORT_NO_DOT = f'{sys.version_info[0]}{sys.version_info[1]}' ++_PREFIX = os.path.normpath(sys.prefix) + _BASE_PREFIX = os.path.normpath(sys.base_prefix) + _BASE_EXEC_PREFIX = os.path.normpath(sys.base_exec_prefix) + # Mutex guarding initialization of _CONFIG_VARS. +@@ -553,6 +554,7 @@ def _init_config_vars(): if os.name == 'nt': _init_non_posix(_CONFIG_VARS) _CONFIG_VARS['VPATH'] = sys._vpath -+ _CONFIG_VARS['TZPATH'] = os.path.join(prefix, "share", "zoneinfo") ++ _CONFIG_VARS['TZPATH'] = os.path.join(_PREFIX, "share", "zoneinfo") if _HAS_USER_BASE: # Setting 'userbase' is done below the call to the # init function to enable using 'get_config_var' in --- -2.51.0 - diff --git a/recipe/patches/0011-Make-dyld-search-work-with-SYSTEM_VERSION_COMPAT-1.patch b/recipe/patches/0011-Make-dyld-search-work-with-SYSTEM_VERSION_COMPAT-1.patch index 9833efb8f..ed95965d3 100644 --- a/recipe/patches/0011-Make-dyld-search-work-with-SYSTEM_VERSION_COMPAT-1.patch +++ b/recipe/patches/0011-Make-dyld-search-work-with-SYSTEM_VERSION_COMPAT-1.patch @@ -1,7 +1,7 @@ -From 64f19e5f4cd9980a0bef00a0b0f5bee2ffef38d9 Mon Sep 17 00:00:00 2001 +From 724d20af3df5662b352ec3c18bc7b45db157cd6e Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Mon, 25 Jan 2021 03:28:08 -0600 -Subject: [PATCH 11/25] Make dyld search work with SYSTEM_VERSION_COMPAT=1 +Subject: [PATCH 11/27] Make dyld search work with SYSTEM_VERSION_COMPAT=1 In macOS Big Sur, if the executable was compiled with `MACOSX_DEPLOYMENT_TARGET=10.15` or below, then SYSTEM_VERSION_COMPAT=1 is the default which means that Big Sur @@ -10,12 +10,15 @@ reports itself as 10.16 which means that `__builtin_available(macOS 11.0)` will This can be observed by using the python 3.9.1 universal2 installer and using it on x86_64 Big Sur or with Rossetta 2 on arm64 Big Sur. (Not an issue with native arm64 as that part is compiled with `MACOSX_DEPLOYMENT_TARGET=11.0`) + +We also suppress a warning due to the mismatch between header using 11.0 +and this code using 10.16 --- - Modules/_ctypes/callproc.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) + Modules/_ctypes/callproc.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Modules/_ctypes/callproc.c b/Modules/_ctypes/callproc.c -index ccc57e347b..427b909479 100644 +index 746034c8004..d42585c08c5 100644 --- a/Modules/_ctypes/callproc.c +++ b/Modules/_ctypes/callproc.c @@ -1503,7 +1503,7 @@ copy_com_pointer(PyObject *self, PyObject *args) @@ -27,6 +30,15 @@ index ccc57e347b..427b909479 100644 # else # define HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH_RUNTIME \ (_dyld_shared_cache_contains_path != NULL) --- -2.51.0 - +@@ -1546,8 +1546,10 @@ static PyObject *py_dyld_shared_cache_contains_path(PyObject *self, PyObject *ar + if (PyUnicode_FSConverter(name, &name2) == 0) + return NULL; + name_str = PyBytes_AS_STRING(name2); +- ++#pragma clang diagnostic push ++#pragma clang diagnostic ignored "-Wunguarded-availability-new" + r = _dyld_shared_cache_contains_path(name_str); ++#pragma clang diagnostic pop + Py_DECREF(name2); + + if (r) { diff --git a/recipe/patches/0012-Unvendor-bzip2.patch b/recipe/patches/0012-Unvendor-bzip2.patch index f9872abe2..6a709fb74 100644 --- a/recipe/patches/0012-Unvendor-bzip2.patch +++ b/recipe/patches/0012-Unvendor-bzip2.patch @@ -1,7 +1,7 @@ -From b9459d0a8ac97cabd836aa762e6db31b509da911 Mon Sep 17 00:00:00 2001 +From 1ced7d55db59f46781fe0e12548a5adc464b7ba1 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Mon, 16 Aug 2021 02:56:27 -0700 -Subject: [PATCH 12/25] Unvendor bzip2 +Subject: [PATCH 12/27] Unvendor bzip2 --- PCbuild/_bz2.vcxproj | 15 +++++---------- @@ -9,7 +9,7 @@ Subject: [PATCH 12/25] Unvendor bzip2 2 files changed, 6 insertions(+), 35 deletions(-) diff --git a/PCbuild/_bz2.vcxproj b/PCbuild/_bz2.vcxproj -index 9e75e57cb6..01d637caa4 100644 +index 9e75e57cb6e..01d637caa40 100644 --- a/PCbuild/_bz2.vcxproj +++ b/PCbuild/_bz2.vcxproj @@ -94,7 +94,7 @@ @@ -47,7 +47,7 @@ index 9e75e57cb6..01d637caa4 100644 diff --git a/PCbuild/_bz2.vcxproj.filters b/PCbuild/_bz2.vcxproj.filters -index 7c0b516253..c1f960608c 100644 +index 7c0b5162537..c1f960608c3 100644 --- a/PCbuild/_bz2.vcxproj.filters +++ b/PCbuild/_bz2.vcxproj.filters @@ -21,33 +21,9 @@ @@ -85,6 +85,3 @@ index 7c0b516253..c1f960608c 100644 Header Files\bzip2 --- -2.51.0 - diff --git a/recipe/patches/0013-Unvendor-libffi.patch b/recipe/patches/0013-Unvendor-libffi.patch index 72f01859b..8766e55fe 100644 --- a/recipe/patches/0013-Unvendor-libffi.patch +++ b/recipe/patches/0013-Unvendor-libffi.patch @@ -1,14 +1,14 @@ -From 7a26480947fe09db5ed1b030abdb14b48527d905 Mon Sep 17 00:00:00 2001 +From edca283a374525e9b4faa0d9f8542ffa4affb5bd Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Mon, 16 Aug 2021 03:07:40 -0700 -Subject: [PATCH 13/25] Unvendor libffi +Subject: [PATCH 13/27] Unvendor libffi --- PCbuild/libffi.props | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/PCbuild/libffi.props b/PCbuild/libffi.props -index 22c9550e2c..97fb5966bf 100644 +index 22c9550e2c0..97fb5966bfb 100644 --- a/PCbuild/libffi.props +++ b/PCbuild/libffi.props @@ -2,20 +2,11 @@ @@ -36,6 +36,3 @@ index 22c9550e2c..97fb5966bf 100644 - \ No newline at end of file --- -2.51.0 - diff --git a/recipe/patches/0014-Unvendor-tcltk.patch b/recipe/patches/0014-Unvendor-tcltk.patch index b1acb759c..ad4039e78 100644 --- a/recipe/patches/0014-Unvendor-tcltk.patch +++ b/recipe/patches/0014-Unvendor-tcltk.patch @@ -1,15 +1,15 @@ -From 97a631d412cac9ee29c3aa91ceef4dd540c1a852 Mon Sep 17 00:00:00 2001 +From 889a90193669f738dca1a7b8e6be73eae5e32001 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Fri, 20 Aug 2021 10:23:51 -0700 -Subject: [PATCH 14/25] Unvendor tcltk +Subject: [PATCH 14/27] Unvendor tcltk --- - PCbuild/_tkinter.vcxproj | 6 ------ - PCbuild/tcltk.props | 7 +++---- - 2 files changed, 3 insertions(+), 10 deletions(-) + PCbuild/_tkinter.vcxproj | 6 ------ + PCbuild/tcltk.props | 12 +++++------- + 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/PCbuild/_tkinter.vcxproj b/PCbuild/_tkinter.vcxproj -index de9358312a..3fe2c29c82 100644 +index de9358312ac..3fe2c29c823 100644 --- a/PCbuild/_tkinter.vcxproj +++ b/PCbuild/_tkinter.vcxproj @@ -128,12 +128,6 @@ @@ -26,23 +26,27 @@ index de9358312a..3fe2c29c82 100644 diff --git a/PCbuild/tcltk.props b/PCbuild/tcltk.props -index 28e8c0db4d..cf2b2dc14e 100644 +index 1d6b4f57f09..22a3f0be581 100644 --- a/PCbuild/tcltk.props +++ b/PCbuild/tcltk.props -@@ -13,10 +13,9 @@ +@@ -12,15 +12,13 @@ + $([System.Version]::Parse($(TkVersion)).Minor) $([System.Version]::Parse($(TkVersion)).Build) $([System.Version]::Parse($(TkVersion)).Revision) - +- - $(ExternalsDir)tcl-core-$(TclVersion)\ - $(ExternalsDir)tcl-$(TclVersion)\ - $(ExternalsDir)tk-$(TkVersion)\ - $(ExternalsDir)tcltk-$(TclVersion)\$(ArchName)\ + t + tcl9 +- TCLSH_NATIVE="$(tcltkDir)\..\win32\bin\tclsh$(TclMajorVersion)$(TclMinorVersion)$(tcltkSuffix).exe" +- TCL_WITH_EXTERNAL_TOMMATH; + $(condaDir) + $(condaDir) ++ $(condaDir) + $(condaDir) - t - tcl9 - TCLSH_NATIVE="$(tcltkDir)\..\win32\bin\tclsh$(TclMajorVersion)$(TclMinorVersion)$(tcltkSuffix).exe" --- -2.51.0 - ++ $(condaDir)\bin\tclsh$(TclMajorVersion)$(TclMinorVersion)t.exe + + + tcl$(TclMajorVersion)$(TclMinorVersion)$(tcltkSuffix)$(TclDebugExt).dll diff --git a/recipe/patches/0015-unvendor-xz.patch b/recipe/patches/0015-unvendor-xz.patch index b89b5c0da..359132678 100644 --- a/recipe/patches/0015-unvendor-xz.patch +++ b/recipe/patches/0015-unvendor-xz.patch @@ -1,14 +1,14 @@ -From e587dc314ab5a6fb2db6faabdca8f67db3e07f35 Mon Sep 17 00:00:00 2001 +From ffa2c3c2a6771f1a924bb67d55c7a2265d2bc16d Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Sat, 25 Sep 2021 10:07:05 -0700 -Subject: [PATCH 15/25] unvendor xz +Subject: [PATCH 15/27] unvendor xz --- PCbuild/_lzma.vcxproj | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/PCbuild/_lzma.vcxproj b/PCbuild/_lzma.vcxproj -index 321f41d8d2..6811fd1709 100644 +index 321f41d8d27..6811fd1709e 100644 --- a/PCbuild/_lzma.vcxproj +++ b/PCbuild/_lzma.vcxproj @@ -93,15 +93,15 @@ @@ -41,6 +41,3 @@ index 321f41d8d2..6811fd1709 100644 --- -2.51.0 - diff --git a/recipe/patches/0016-unvendor-zlib.patch b/recipe/patches/0016-unvendor-zlib.patch index 66249f723..cfe65a60c 100644 --- a/recipe/patches/0016-unvendor-zlib.patch +++ b/recipe/patches/0016-unvendor-zlib.patch @@ -1,15 +1,15 @@ -From aa5d252b4b3a1c87c491efddb23e190c21d630a2 Mon Sep 17 00:00:00 2001 +From cd2d9d38cfeed1e5a8dd7aa9a91358353f6a8025 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Wed, 29 Sep 2021 15:21:55 -0700 -Subject: [PATCH 16/25] unvendor zlib +Subject: [PATCH 16/27] unvendor zlib --- - PCbuild/pythoncore.vcxproj | 8 ++-- + PCbuild/pythoncore.vcxproj | 14 ++----- PCbuild/pythoncore.vcxproj.filters | 66 ------------------------------ - 2 files changed, 4 insertions(+), 70 deletions(-) + 2 files changed, 4 insertions(+), 76 deletions(-) diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj -index b455b3089c..00e29eae26 100644 +index e2f8f42449a..7d5432d5428 100644 --- a/PCbuild/pythoncore.vcxproj +++ b/PCbuild/pythoncore.vcxproj @@ -82,7 +82,7 @@ @@ -25,24 +25,40 @@ index b455b3089c..00e29eae26 100644 /d1trimfile:%SRC_DIR% $(PySourcePath)Modules\_hacl;$(PySourcePath)Modules\_hacl\include;$(PySourcePath)Python;%(AdditionalIncludeDirectories) -- $(zlibDir);%(AdditionalIncludeDirectories) +- $(zlibNgDir);$(GeneratedZlibNgDir);%(AdditionalIncludeDirectories) + $(condaDir)\include;%(AdditionalIncludeDirectories) $(GeneratedJitStencilsDir);%(AdditionalIncludeDirectories) - _USRDLL;Py_BUILD_CORE;Py_BUILD_CORE_BUILTIN;Py_ENABLE_SHARED;MS_DLL_ID="$(SysWinVer)";%(PreprocessorDefinitions) + _USRDLL;Py_BUILD_CORE;Py_BUILD_CORE_BUILTIN;Py_ENABLE_SHARED;MS_DLL_ID="$(SysWinVer)";ZLIB_COMPAT;%(PreprocessorDefinitions) _Py_HAVE_ZLIB;%(PreprocessorDefinitions) -@@ -113,8 +113,8 @@ +@@ -113,11 +113,11 @@ Py_STACKREF_DEBUG;%(PreprocessorDefinitions) - version.lib;ws2_32.lib;pathcch.lib;bcrypt.lib;%(AdditionalDependencies) - zlib-ng$(PyDebugExt).lib;%(AdditionalDependencies) + version.lib;ws2_32.lib;pathcch.lib;bcrypt.lib;zlib.lib;%(AdditionalDependencies) -+ $(condaDir)\lib;%(AdditionalLibraryDirectories) $(GeneratedJitStencilsDir)jit_shim-aarch64-pc-windows-msvc.o;%(AdditionalDependencies) $(GeneratedJitStencilsDir)jit_shim-i686-pc-windows-msvc.o;%(AdditionalDependencies) $(GeneratedJitStencilsDir)jit_shim-x86_64-pc-windows-msvc.o;%(AdditionalDependencies) ++ $(condaDir)\lib;%(AdditionalLibraryDirectories) + + + +@@ -711,12 +711,6 @@ + + + +- +- +- {fb91c8b2-6fbc-3a01-b644-1637111f902d} +- false +- +- + + + diff --git a/PCbuild/pythoncore.vcxproj.filters b/PCbuild/pythoncore.vcxproj.filters -index 649ee1859f..6fb1a6b5d0 100644 +index 649ee1859ff..6fb1a6b5d0f 100644 --- a/PCbuild/pythoncore.vcxproj.filters +++ b/PCbuild/pythoncore.vcxproj.filters @@ -939,39 +939,6 @@ @@ -125,6 +141,3 @@ index 649ee1859f..6fb1a6b5d0 100644 Python --- -2.51.0 - diff --git a/recipe/patches/0017-Do-not-pass-g-to-GCC-when-not-Py_DEBUG.patch b/recipe/patches/0017-Do-not-pass-g-to-GCC-when-not-Py_DEBUG.patch index b3eb55caf..a7f464f78 100644 --- a/recipe/patches/0017-Do-not-pass-g-to-GCC-when-not-Py_DEBUG.patch +++ b/recipe/patches/0017-Do-not-pass-g-to-GCC-when-not-Py_DEBUG.patch @@ -1,7 +1,7 @@ -From af3022ca37ee1fdbee83ff0849ebf545e422c0b9 Mon Sep 17 00:00:00 2001 +From 65cafcd546fc3f9989bcced6cf3b258ef7504e6c Mon Sep 17 00:00:00 2001 From: Ray Donnelly Date: Wed, 16 Aug 2017 11:45:28 +0100 -Subject: [PATCH 17/25] Do not pass -g to GCC when not Py_DEBUG +Subject: [PATCH 17/27] Do not pass -g to GCC when not Py_DEBUG This bloats our exe and our modules a lot. --- @@ -10,10 +10,10 @@ This bloats our exe and our modules a lot. 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/configure b/configure -index 10a347ff0a..8b80a9bdf0 100755 +index a7d9fa69814..3499d97f59e 100755 --- a/configure +++ b/configure -@@ -5842,9 +5842,9 @@ if test $ac_test_CFLAGS; then +@@ -5850,9 +5850,9 @@ if test $ac_test_CFLAGS; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then @@ -25,7 +25,7 @@ index 10a347ff0a..8b80a9bdf0 100755 fi else if test "$GCC" = yes; then -@@ -9755,7 +9755,7 @@ then +@@ -9769,7 +9769,7 @@ then if test "$Py_DEBUG" = 'true' ; then OPT="-g $PYDEBUG_CFLAGS -Wall" else @@ -35,10 +35,10 @@ index 10a347ff0a..8b80a9bdf0 100755 ;; *) diff --git a/configure.ac b/configure.ac -index 48f0fda91a..d9f2ac3c54 100644 +index cc9554e5b39..8b818a7a7d7 100644 --- a/configure.ac +++ b/configure.ac -@@ -2373,7 +2373,7 @@ then +@@ -2384,7 +2384,7 @@ then if test "$Py_DEBUG" = 'true' ; then OPT="-g $PYDEBUG_CFLAGS -Wall" else @@ -47,6 +47,3 @@ index 48f0fda91a..d9f2ac3c54 100644 fi ;; *) --- -2.51.0 - diff --git a/recipe/patches/0018-Unvendor-expat.patch b/recipe/patches/0018-Unvendor-expat.patch index b985d85fd..154c55696 100644 --- a/recipe/patches/0018-Unvendor-expat.patch +++ b/recipe/patches/0018-Unvendor-expat.patch @@ -1,7 +1,7 @@ -From c92291273b620838b4c2bd924820d25165b6edeb Mon Sep 17 00:00:00 2001 +From 54fc26859353a5361f603c88f704b17e5726b147 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Wed, 29 Mar 2023 23:07:10 -0500 -Subject: [PATCH 18/25] Unvendor expat +Subject: [PATCH 18/27] Unvendor expat --- PCbuild/_elementtree.vcxproj | 26 ++---------- @@ -11,7 +11,7 @@ Subject: [PATCH 18/25] Unvendor expat 4 files changed, 8 insertions(+), 114 deletions(-) diff --git a/PCbuild/_elementtree.vcxproj b/PCbuild/_elementtree.vcxproj -index fb1589557d..f47bcd8e4e 100644 +index fb1589557da..f47bcd8e4e6 100644 --- a/PCbuild/_elementtree.vcxproj +++ b/PCbuild/_elementtree.vcxproj @@ -93,37 +93,19 @@ @@ -57,7 +57,7 @@ index fb1589557d..f47bcd8e4e 100644 diff --git a/PCbuild/_elementtree.vcxproj.filters b/PCbuild/_elementtree.vcxproj.filters -index f6b55d8ff8..88a13faa68 100644 +index f6b55d8ff82..88a13faa683 100644 --- a/PCbuild/_elementtree.vcxproj.filters +++ b/PCbuild/_elementtree.vcxproj.filters @@ -17,69 +17,10 @@ @@ -131,7 +131,7 @@ index f6b55d8ff8..88a13faa68 100644 diff --git a/PCbuild/pyexpat.vcxproj b/PCbuild/pyexpat.vcxproj -index 6518e0e1b1..8bc1bcec7e 100644 +index 6518e0e1b1c..8bc1bcec7e8 100644 --- a/PCbuild/pyexpat.vcxproj +++ b/PCbuild/pyexpat.vcxproj @@ -90,25 +90,19 @@ @@ -165,7 +165,7 @@ index 6518e0e1b1..8bc1bcec7e 100644 diff --git a/PCbuild/pyexpat.vcxproj.filters b/PCbuild/pyexpat.vcxproj.filters -index 230531033f..b8280b4049 100644 +index 230531033fc..b8280b4049c 100644 --- a/PCbuild/pyexpat.vcxproj.filters +++ b/PCbuild/pyexpat.vcxproj.filters @@ -11,33 +11,10 @@ @@ -202,6 +202,3 @@ index 230531033f..b8280b4049 100644 --- -2.51.0 - diff --git a/recipe/patches/0019-Remove-unused-readelf.patch b/recipe/patches/0019-Remove-unused-readelf.patch index 473eae538..ff73be2de 100644 --- a/recipe/patches/0019-Remove-unused-readelf.patch +++ b/recipe/patches/0019-Remove-unused-readelf.patch @@ -1,7 +1,7 @@ -From 065d570bcf3e09a8031f164d45c6e28d02130b4d Mon Sep 17 00:00:00 2001 +From 0e65951e0e93ff7d6835f1b561ce37717b816a4f Mon Sep 17 00:00:00 2001 From: Charles Bousseau Date: Thu, 25 May 2023 17:56:53 -0400 -Subject: [PATCH 19/25] Remove unused readelf +Subject: [PATCH 19/27] Remove unused readelf readelf has been dropped. .. date: 2022-11-02-10-56-40 @@ -15,7 +15,7 @@ Drop unused build dependency on ``readelf``. 1 file changed, 1 deletion(-) diff --git a/Makefile.pre.in b/Makefile.pre.in -index c282074140..b1711d1d38 100644 +index 8008a96c1c8..5174b36bc53 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -38,7 +38,6 @@ CC= @CC@ @@ -26,6 +26,3 @@ index c282074140..b1711d1d38 100644 SOABI= @SOABI@ ABIFLAGS= @ABIFLAGS@ ABI_THREAD= @ABI_THREAD@ --- -2.51.0 - diff --git a/recipe/patches/0020-Don-t-checksharedmods-if-cross-compiling.patch b/recipe/patches/0020-Don-t-checksharedmods-if-cross-compiling.patch new file mode 100644 index 000000000..42c31a9ed --- /dev/null +++ b/recipe/patches/0020-Don-t-checksharedmods-if-cross-compiling.patch @@ -0,0 +1,40 @@ +From dc47a794138f800714283dc19cbf896406afb7ca Mon Sep 17 00:00:00 2001 +From: "Uwe L. Korn" +Date: Fri, 1 Sep 2023 23:32:14 +0200 +Subject: [PATCH 20/27] Don't checksharedmods if cross-compiling + +--- + Makefile.pre.in | 2 +- + if_runnable.sh | 10 ++++++++++ + 2 files changed, 11 insertions(+), 1 deletion(-) + create mode 100755 if_runnable.sh + +diff --git a/Makefile.pre.in b/Makefile.pre.in +index 5174b36bc53..374c3e7a70d 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -1633,7 +1633,7 @@ checksharedmods: sharedmods $(PYTHON_FOR_BUILD_DEPS) $(BUILDPYTHON) + else \ + $(RUNSHARED) $(PYTHON_FOR_BUILD) $(srcdir)/Tools/build/check_extension_modules.py --generate-missing-stdlib-info; \ + fi +- @$(RUNSHARED) $(PYTHON_FOR_BUILD) $(srcdir)/Tools/build/check_extension_modules.py ++ @$(RUNSHARED) $(srcdir)/if_runnable.sh $(PYTHON_FOR_BUILD) $(srcdir)/Tools/build/check_extension_modules.py + + .PHONY: rundsymutil + rundsymutil: sharedmods $(PYTHON_FOR_BUILD_DEPS) $(BUILDPYTHON) +diff --git a/if_runnable.sh b/if_runnable.sh +new file mode 100755 +index 00000000000..dcfde5b751e +--- /dev/null ++++ b/if_runnable.sh +@@ -0,0 +1,10 @@ ++#!/bin/bash ++ ++if [[ "${target_platform}" == "${build_platform}" || "${CROSSCOMPILING_EMULATOR:-}" != "" ]]; then ++ if [[ "$1" == "./"* ]]; then ++ exec $@ ++ else ++ export ${@:1:$#-2} ++ exec ${@: -2} ++ fi ++fi diff --git a/recipe/patches/0021-Override-configure-LIBFFI.patch b/recipe/patches/0021-Override-configure-LIBFFI.patch index 475948bae..cd461d6d4 100644 --- a/recipe/patches/0021-Override-configure-LIBFFI.patch +++ b/recipe/patches/0021-Override-configure-LIBFFI.patch @@ -1,17 +1,17 @@ -From e1776d8ce5769ee895e6d57ea0633d0582fe7da7 Mon Sep 17 00:00:00 2001 +From ef6353504192f7cdc868c49dec3bcf39200655a9 Mon Sep 17 00:00:00 2001 From: "Uwe L. Korn" Date: Tue, 5 Sep 2023 21:51:31 +0200 -Subject: [PATCH 20/25] Override configure LIBFFI +Subject: [PATCH 21/27] Override configure LIBFFI --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure -index 8b80a9bdf0..cb4fb61827 100755 +index 3499d97f59e..9dfc1191b20 100755 --- a/configure +++ b/configure -@@ -15914,7 +15914,7 @@ if test "x$ac_cv_lib_ffi_ffi_call" = xyes +@@ -15929,7 +15929,7 @@ if test "x$ac_cv_lib_ffi_ffi_call" = xyes then : have_libffi=yes @@ -20,6 +20,3 @@ index 8b80a9bdf0..cb4fb61827 100755 LIBFFI_LIBS="-lffi" fi --- -2.51.0 - diff --git a/recipe/patches/0022-Unvendor-libmpdec.patch b/recipe/patches/0022-Unvendor-libmpdec.patch index 6b4a07e98..ae319a9ee 100644 --- a/recipe/patches/0022-Unvendor-libmpdec.patch +++ b/recipe/patches/0022-Unvendor-libmpdec.patch @@ -1,17 +1,17 @@ -From 89e04f3a9e693c7d0a819ce74b9bb11316813a95 Mon Sep 17 00:00:00 2001 +From 0b8863c5e493e62060b90a6f7ee08d241f0872c2 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Fri, 16 Aug 2024 21:34:43 -0500 -Subject: [PATCH 21/25] Unvendor libmpdec +Subject: [PATCH 22/27] Unvendor libmpdec --- - PCbuild/_decimal.vcxproj | 52 +++++----------------------------------- - 1 file changed, 6 insertions(+), 46 deletions(-) + PCbuild/_decimal.vcxproj | 51 ++++++---------------------------------- + 1 file changed, 7 insertions(+), 44 deletions(-) diff --git a/PCbuild/_decimal.vcxproj b/PCbuild/_decimal.vcxproj -index 921d22e47b..c1eb96fae1 100644 +index 921d22e47b3..0f49d7923f5 100644 --- a/PCbuild/_decimal.vcxproj +++ b/PCbuild/_decimal.vcxproj -@@ -93,64 +93,24 @@ +@@ -93,64 +93,27 @@ @@ -33,7 +33,7 @@ index 921d22e47b..c1eb96fae1 100644 + mpdec.lib;%(AdditionalDependencies) + -- + - - - @@ -53,7 +53,8 @@ index 921d22e47b..c1eb96fae1 100644 - - - -- ++ + - @@ -82,6 +83,3 @@ index 921d22e47b..c1eb96fae1 100644 --- -2.51.0 - diff --git a/recipe/patches/0024-Do-not-define-pid_t-as-it-might-conflict-with-the-ac.patch b/recipe/patches/0024-Do-not-define-pid_t-as-it-might-conflict-with-the-ac.patch new file mode 100644 index 000000000..73f483000 --- /dev/null +++ b/recipe/patches/0024-Do-not-define-pid_t-as-it-might-conflict-with-the-ac.patch @@ -0,0 +1,115 @@ +From e23a12e19347d11d8bb04e3a752b0d47b30bf79f Mon Sep 17 00:00:00 2001 +From: Isuru Fernando +Date: Sun, 12 Jan 2025 10:37:29 +0530 +Subject: [PATCH 24/27] Do not define pid_t as it might conflict with the + actual definition + +--- + Modules/_testcapi/long.c | 4 ++++ + Modules/_testcapimodule.c | 4 ++++ + Modules/_testlimitedcapi/long.c | 4 ++++ + Modules/clinic/posixmodule.c.h | 4 ++++ + Modules/posixmodule.c | 1 + + PC/pyconfig.h | 2 -- + Python/remote_debug.h | 3 +++ + 7 files changed, 20 insertions(+), 2 deletions(-) + +diff --git a/Modules/_testcapi/long.c b/Modules/_testcapi/long.c +index 008a7d37726..7829e9cc714 100644 +--- a/Modules/_testcapi/long.c ++++ b/Modules/_testcapi/long.c +@@ -6,6 +6,10 @@ + #include "util.h" + #include "clinic/long.c.h" + ++#ifdef _MSC_VER ++typedef int pid_t; ++#endif ++ + /*[clinic input] + module _testcapi + [clinic start generated code]*/ +diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c +index fb18a866e62..7ef862ef1ad 100644 +--- a/Modules/_testcapimodule.c ++++ b/Modules/_testcapimodule.c +@@ -15,6 +15,10 @@ + #include "frameobject.h" // PyFrame_New() + #include "marshal.h" // PyMarshal_WriteLongToFile() + ++#ifdef _MSC_VER ++typedef int pid_t; ++#endif ++ + #ifdef bool + # error "The public headers should not include , see gh-90904" + #endif +diff --git a/Modules/_testlimitedcapi/long.c b/Modules/_testlimitedcapi/long.c +index 99b9e96760d..932fef0497f 100644 +--- a/Modules/_testlimitedcapi/long.c ++++ b/Modules/_testlimitedcapi/long.c +@@ -8,6 +8,10 @@ + #include "util.h" + #include "clinic/long.c.h" + ++#ifdef _MSC_VER ++typedef int pid_t; ++#endif ++ + /*[clinic input] + module _testlimitedcapi + [clinic start generated code]*/ +diff --git a/Modules/clinic/posixmodule.c.h b/Modules/clinic/posixmodule.c.h +index 45e509d0030..65b87843b20 100644 +--- a/Modules/clinic/posixmodule.c.h ++++ b/Modules/clinic/posixmodule.c.h +@@ -10,6 +10,10 @@ preserve + #include "pycore_long.h" // _PyLong_UnsignedInt_Converter() + #include "pycore_modsupport.h" // _PyArg_UnpackKeywords() + ++#if (defined(MS_WINDOWS_DESKTOP) || defined(MS_WINDOWS_APP) || defined(MS_WINDOWS_SYSTEM)) ++typedef int pid_t; ++#endif ++ + PyDoc_STRVAR(os_stat__doc__, + "stat($module, /, path, *, dir_fd=None, follow_symlinks=True)\n" + "--\n" +diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c +index 0b42b059541..a8aff655bd1 100644 +--- a/Modules/posixmodule.c ++++ b/Modules/posixmodule.c +@@ -222,6 +222,7 @@ + # if defined(MS_WINDOWS_DESKTOP) || defined(MS_WINDOWS_SYSTEM) + # define HAVE_SYMLINK + # endif /* MS_WINDOWS_DESKTOP | MS_WINDOWS_SYSTEM */ ++typedef int pid_t; + #endif + + +diff --git a/PC/pyconfig.h b/PC/pyconfig.h +index 72a475777b7..5149fbcf301 100644 +--- a/PC/pyconfig.h ++++ b/PC/pyconfig.h +@@ -240,8 +240,6 @@ typedef _W64 int Py_ssize_t; + #endif + #endif /* MS_WIN32 && !MS_WIN64 */ + +-typedef int pid_t; +- + /* define some ANSI types that are not defined in earlier Win headers */ + #if _MSC_VER >= 1200 + /* This file only exists in VC 6.0 or higher */ +diff --git a/Python/remote_debug.h b/Python/remote_debug.h +index 7b7380d25bf..0d89e46d054 100644 +--- a/Python/remote_debug.h ++++ b/Python/remote_debug.h +@@ -28,6 +28,9 @@ extern "C" { + #endif + + #include "pyconfig.h" ++#ifdef _WIN32 ++typedef int pid_t; ++#endif + #include "internal/pycore_ceval.h" + + #ifdef __linux__ diff --git a/recipe/patches/0025-Unvendor-zstd.patch b/recipe/patches/0025-Unvendor-zstd.patch index 51b461d09..3a84b0fe4 100644 --- a/recipe/patches/0025-Unvendor-zstd.patch +++ b/recipe/patches/0025-Unvendor-zstd.patch @@ -1,27 +1,30 @@ -From b81adf9cc72e86156e23ab6d30f1b95fb5849ba7 Mon Sep 17 00:00:00 2001 -From: Ian Fitchet -Date: Mon, 30 Jun 2025 11:42:39 +0100 -Subject: [PATCH 24/25] Unvendor zstd +From ea36797c92b325459e176e6856a03b9ce1d2335c Mon Sep 17 00:00:00 2001 +From: "Uwe L. Korn" +Date: Tue, 22 Jul 2025 18:07:54 +0200 +Subject: [PATCH 25/27] Unvendor zstd --- - PCbuild/_zstd.vcxproj | 59 ++----------- - PCbuild/_zstd.vcxproj.filters | 159 ---------------------------------- - 2 files changed, 5 insertions(+), 213 deletions(-) + PCbuild/_zstd.vcxproj | 58 +------------ + PCbuild/_zstd.vcxproj.filters | 157 +--------------------------------- + 2 files changed, 6 insertions(+), 209 deletions(-) diff --git a/PCbuild/_zstd.vcxproj b/PCbuild/_zstd.vcxproj -index 6f91b8d05c..57e35741a4 100644 +index 683a44535ca..fa113b0cd87 100644 --- a/PCbuild/_zstd.vcxproj +++ b/PCbuild/_zstd.vcxproj -@@ -95,72 +95,23 @@ +@@ -95,76 +95,26 @@ WIN32;ZSTD_MULTITHREAD=1;%(PreprocessorDefinitions) - $(zstdDir)lib\;$(zstdDir)lib\common;$(zstdDir)lib\compress;$(zstdDir)lib\decompress;$(zstdDir)lib\dictBuilder;%(AdditionalIncludeDirectories) + $(condaDir)\include;%(AdditionalIncludeDirectories) + /d1trimfile:%SRC_DIR% + /d1trimfile:%SRC_DIR% + /d1trimfile:%SRC_DIR% + /d1trimfile:%SRC_DIR% + -+ $(condaDir)\lib;%(AdditionalLibraryDirectories) -+ zstd.lib;%(AdditionalDependencies) ++ $(condaDir)\lib\zstd.lib;%(AdditionalDependencies) + @@ -91,7 +94,7 @@ index 6f91b8d05c..57e35741a4 100644 diff --git a/PCbuild/_zstd.vcxproj.filters b/PCbuild/_zstd.vcxproj.filters -index eec666e5ea..a2aa391f39 100644 +index eec666e5eaf..5028bb5592d 100644 --- a/PCbuild/_zstd.vcxproj.filters +++ b/PCbuild/_zstd.vcxproj.filters @@ -30,96 +30,6 @@ @@ -191,13 +194,14 @@ index eec666e5ea..a2aa391f39 100644 -@@ -131,75 +41,6 @@ +@@ -131,73 +41,10 @@ Header Files - -- Header Files\zstd -- ++ + Header Files\zstd + - - Header Files\zstd - @@ -262,11 +266,7 @@ index eec666e5ea..a2aa391f39 100644 - Header Files\zstd - - -- Header Files\zstd -- ++ + Header Files\zstd + - - --- -2.51.0 - diff --git a/recipe/patches/0026-Set-Py_GIL_DISABLED-in-windows-to-match-unix.patch b/recipe/patches/0026-Set-Py_GIL_DISABLED-in-windows-to-match-unix.patch new file mode 100644 index 000000000..2ac6b7c1d --- /dev/null +++ b/recipe/patches/0026-Set-Py_GIL_DISABLED-in-windows-to-match-unix.patch @@ -0,0 +1,25 @@ +From 22389266909ab9f32571100e4b7c338aba13561d Mon Sep 17 00:00:00 2001 +From: Isuru Fernando +Date: Tue, 2 Dec 2025 09:46:56 -0800 +Subject: [PATCH 26/27] Set Py_GIL_DISABLED in windows to match unix + +This is not set upstream because the windows distribution supports +free-threaded and default builds at the same time. We have the +luxury of not having to do that. +--- + PC/pyconfig.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/PC/pyconfig.h b/PC/pyconfig.h +index 5149fbcf301..52892d685cc 100644 +--- a/PC/pyconfig.h ++++ b/PC/pyconfig.h +@@ -110,6 +110,8 @@ WIN32 is still required for the locale module. + #if Py_GIL_DISABLED == 0 + #undef Py_GIL_DISABLED + #endif ++#else ++#define Py_GIL_DISABLED 1 + #endif + + /* Compiler specific defines */ diff --git a/recipe/patches/0027-More-unixy-layout-for-windows.patch b/recipe/patches/0027-More-unixy-layout-for-windows.patch new file mode 100644 index 000000000..4fb9cc769 --- /dev/null +++ b/recipe/patches/0027-More-unixy-layout-for-windows.patch @@ -0,0 +1,84 @@ +From a8d05c46483270c807cf22d5487f70b8997cbc31 Mon Sep 17 00:00:00 2001 +From: Isuru Fernando +Date: Fri, 22 May 2026 14:21:19 -0700 +Subject: [PATCH 27/27] More unixy layout for windows + +See https://github.com/conda-forge/cfep/pull/65 +--- + Lib/site.py | 1 + + Lib/sysconfig/__init__.py | 12 +++++++++++- + Modules/getpath.py | 4 ++-- + PCbuild/pythoncore.vcxproj | 2 +- + 4 files changed, 15 insertions(+), 4 deletions(-) + +diff --git a/Lib/site.py b/Lib/site.py +index 89e136d7b10..5bc762fdd03 100644 +--- a/Lib/site.py ++++ b/Lib/site.py +@@ -770,6 +770,7 @@ def getsitepackages(prefixes=None): + "site-packages") + sitepackages.append(path) + else: ++ sitepackages.append(os.path.join(prefix, "lib", "python", "site-packages")) + sitepackages.append(prefix) + sitepackages.append(os.path.join(prefix, "Lib", "site-packages")) + return sitepackages +diff --git a/Lib/sysconfig/__init__.py b/Lib/sysconfig/__init__.py +index 1230a48208e..955a7896ca3 100644 +--- a/Lib/sysconfig/__init__.py ++++ b/Lib/sysconfig/__init__.py +@@ -58,6 +58,16 @@ + 'scripts': '{base}/Scripts', + 'data': '{base}', + }, ++ 'nt_conda': { ++ 'stdlib': '{installed_base}/{platlibdir}/{implementation_lower}', ++ 'platstdlib': '{base}/{platlibdir}/{implementation_lower}', ++ 'purelib': '{base}/lib/{implementation_lower}/site-packages', ++ 'platlib': '{base}/{platlibdir}/{implementation_lower}/site-packages', ++ 'include': '{installed_base}/include/{implementation_lower}', ++ 'platinclude': '{installed_platbase}/include/{implementation_lower}', ++ 'scripts': '{base}/Scripts', ++ 'data': '{base}', ++ }, + + # Downstream distributors can overwrite the default install scheme. + # This is done to support downstream modifications where distributors change +@@ -279,7 +289,7 @@ def _expand_vars(scheme, vars): + def _get_preferred_schemes(): + if os.name == 'nt': + return { +- 'prefix': 'nt', ++ 'prefix': 'nt_conda', + 'home': 'posix_home', + 'user': 'nt_user', + } +diff --git a/Modules/getpath.py b/Modules/getpath.py +index e237c58d6bc..4ccd9179e84 100644 +--- a/Modules/getpath.py ++++ b/Modules/getpath.py +@@ -190,9 +190,9 @@ + elif os_name == 'nt': + BUILDDIR_TXT = 'pybuilddir.txt' + DEFAULT_PROGRAM_NAME = f'python' +- STDLIB_SUBDIR = 'Lib' ++ STDLIB_SUBDIR = f'{platlibdir}\\python' + STDLIB_LANDMARKS = [f'{STDLIB_SUBDIR}\\os.py', f'{STDLIB_SUBDIR}\\os.pyc'] +- PLATSTDLIB_LANDMARK = f'{platlibdir}' ++ PLATSTDLIB_LANDMARK = f'{platlibdir}\\python\\lib-dynload' + BUILDSTDLIB_LANDMARKS = ['Lib\\os.py'] + VENV_LANDMARK = 'pyvenv.cfg' + ZIP_LANDMARK = f'python{VERSION_MAJOR}{VERSION_MINOR}{PYDEBUGEXT or ""}.zip' +diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj +index 7d5432d5428..aaf80b13a89 100644 +--- a/PCbuild/pythoncore.vcxproj ++++ b/PCbuild/pythoncore.vcxproj +@@ -129,7 +129,7 @@ + VERSION=NULL; + VPATH="$(PyVPath)"; + PYDEBUGEXT="$(PyDebugExt)"; +- PLATLIBDIR="DLLs"; ++ PLATLIBDIR="lib"; + %(PreprocessorDefinitions) + + diff --git a/recipe/patches/0024-Unvendor-zlib-ng.patch b/recipe/patches/0028-Unvendor-zlib-ng.patch similarity index 100% rename from recipe/patches/0024-Unvendor-zlib-ng.patch rename to recipe/patches/0028-Unvendor-zlib-ng.patch diff --git a/recipe/patches/0026-xxlimited-freethreading-stable-abi-link.patch b/recipe/patches/0029-xxlimited-freethreading-stable-abi-link.patch similarity index 100% rename from recipe/patches/0026-xxlimited-freethreading-stable-abi-link.patch rename to recipe/patches/0029-xxlimited-freethreading-stable-abi-link.patch From fdded4cf4df72d9f61f1ff736ac626f91233e58c Mon Sep 17 00:00:00 2001 From: Serhii Kupriienko Date: Fri, 4 Sep 2026 08:28:22 +0000 Subject: [PATCH 2/2] =?UTF-8?q?PKG-17802=20=E2=80=94=20Python=203.15.0rc2,?= =?UTF-8?q?=20unixy=20Windows=20layout?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bump rc1→rc2 + sha256. Install Windows stdlib/headers to lib\python and include\python (0027 getpath). Drop sitecustomize python3.1 path (conda#10969). CBC zip-clobber python/numpy/is_freethreading/is_python_min so PY_VER=3.15. Keep gil_type. --- recipe/build_base.bat | 79 ++++++++++++++++++---------------- recipe/conda_build_config.yaml | 13 ++++-- recipe/meta.yaml | 9 ++-- recipe/sitecustomize.py | 2 - 4 files changed, 55 insertions(+), 48 deletions(-) diff --git a/recipe/build_base.bat b/recipe/build_base.bat index d6a221ec7..38c8ec98f 100644 --- a/recipe/build_base.bat +++ b/recipe/build_base.bat @@ -102,43 +102,44 @@ for %%x in (python%THREAD%%_D%.pdb python%VERNODOTS%%THREAD%%_D%.pdb pythonw%THR @echo on -:: AR: classic Win prefix (DLLs/, Lib/, libs/, include/). CPython getpath -:: landmarks Lib\os.py; CF install_base.bat uses the same layout. -copy %SRC_DIR%\LICENSE %PREFIX%\LICENSE_PYTHON.txt +:: 0027 unixy Win prefix (lib\python, include\python). getpath landmarks lib\python\os.py. +mkdir %PREFIX%\lib\python +copy %SRC_DIR%\LICENSE %PREFIX%\lib\python\LICENSE_PYTHON.txt if errorlevel 1 exit 1 -:: Populate the DLLs directory -mkdir %PREFIX%\DLLs -xcopy /s /y %SRC_DIR%\PCBuild\%BUILD_PATH%\*.pyd %PREFIX%\DLLs\ +:: Populate lib-dynload (was DLLs) +mkdir %PREFIX%\lib\python\lib-dynload +xcopy /s /y %SRC_DIR%\PCBuild\%BUILD_PATH%\*.pyd %PREFIX%\lib\python\lib-dynload\ if errorlevel 1 exit 1 -copy /Y %SRC_DIR%\PC\icons\py.ico %PREFIX%\DLLs\ +copy /Y %SRC_DIR%\PC\icons\py.ico %PREFIX%\lib\python\lib-dynload\ if errorlevel 1 exit 1 -copy /Y %SRC_DIR%\PC\icons\pyc.ico %PREFIX%\DLLs\ +copy /Y %SRC_DIR%\PC\icons\pyc.ico %PREFIX%\lib\python\lib-dynload\ if errorlevel 1 exit 1 :: Populate the Tools directory -mkdir %PREFIX%\Tools -xcopy /s /y /i %SRC_DIR%\Tools\i18n %PREFIX%\Tools\i18n +mkdir %PREFIX%\lib\python\Tools +xcopy /s /y /i %SRC_DIR%\Tools\i18n %PREFIX%\lib\python\Tools\i18n if errorlevel 1 exit 1 -xcopy /s /y /i %SRC_DIR%\Tools\scripts %PREFIX%\Tools\scripts +xcopy /s /y /i %SRC_DIR%\Tools\scripts %PREFIX%\lib\python\Tools\scripts if errorlevel 1 exit 1 -del %PREFIX%\Tools\scripts\README +del %PREFIX%\lib\python\Tools\scripts\README if errorlevel 1 exit 1 -del %PREFIX%\Tools\scripts\idle3 +del %PREFIX%\lib\python\Tools\scripts\idle3 if errorlevel 1 exit 1 -move /y %PREFIX%\Tools\scripts\pydoc3 %PREFIX%\Tools\scripts\pydoc3.py +move /y %PREFIX%\lib\python\Tools\scripts\pydoc3 %PREFIX%\lib\python\Tools\scripts\pydoc3.py if errorlevel 1 exit 1 :: Populate the include directory -xcopy /s /y %SRC_DIR%\Include %PREFIX%\include\ +mkdir %PREFIX%\include\python +xcopy /s /y %SRC_DIR%\Include %PREFIX%\include\python\ if errorlevel 1 exit 1 :: Copy generated pyconfig.h -copy /Y %SRC_DIR%\PC\pyconfig.h %PREFIX%\include\ +copy /Y %SRC_DIR%\PC\pyconfig.h %PREFIX%\include\python\ if errorlevel 1 exit 1 :: Populate the Scripts directory @@ -150,50 +151,52 @@ for %%x in (idle pydoc) do ( if errorlevel 1 exit 1 ) -:: Populate the libs directory -if not exist %PREFIX%\libs mkdir %PREFIX%\libs -if exist %SRC_DIR%\PCbuild\%BUILD_PATH%\python%VERNODOTS%%THREAD%%_D%.lib copy /Y %SRC_DIR%\PCbuild\%BUILD_PATH%\python%VERNODOTS%%THREAD%%_D%.lib %PREFIX%\libs\ -if errorlevel 1 exit 1 -if exist %SRC_DIR%\PCbuild\%BUILD_PATH%\python3%THREAD%%_D%.lib copy /Y %SRC_DIR%\PCbuild\%BUILD_PATH%\python3%THREAD%%_D%.lib %PREFIX%\libs\ -if errorlevel 1 exit 1 -if exist %SRC_DIR%\PCbuild\%BUILD_PATH%\_tkinter%_D%.lib copy /Y %SRC_DIR%\PCbuild\%BUILD_PATH%\_tkinter%_D%.lib %PREFIX%\libs\ -if errorlevel 1 exit 1 +:: Populate the libs directory (and lib, matching CF unixy layout) +for %%x in (lib libs) do ( + if not exist %PREFIX%\%%x mkdir %PREFIX%\%%x + if exist %SRC_DIR%\PCbuild\%BUILD_PATH%\python%VERNODOTS%%THREAD%%_D%.lib copy /Y %SRC_DIR%\PCbuild\%BUILD_PATH%\python%VERNODOTS%%THREAD%%_D%.lib %PREFIX%\%%x\ + if errorlevel 1 exit 1 + if exist %SRC_DIR%\PCbuild\%BUILD_PATH%\python3%THREAD%%_D%.lib copy /Y %SRC_DIR%\PCbuild\%BUILD_PATH%\python3%THREAD%%_D%.lib %PREFIX%\%%x\ + if errorlevel 1 exit 1 + if exist %SRC_DIR%\PCbuild\%BUILD_PATH%\_tkinter%_D%.lib copy /Y %SRC_DIR%\PCbuild\%BUILD_PATH%\_tkinter%_D%.lib %PREFIX%\%%x\ + if errorlevel 1 exit 1 +) -:: Populate the Lib directory -del %PREFIX%\libs\libpython*.a -xcopy /s /y %SRC_DIR%\Lib %PREFIX%\Lib\ +:: Populate lib\python (stdlib) +del %PREFIX%\lib\libpython*.a +xcopy /s /y %SRC_DIR%\Lib %PREFIX%\lib\python\ if errorlevel 1 exit 1 :: Copy venv[w]launcher scripts to venv\scripts\nt :: See https://github.com/python/cpython/blob/b4a316087c32d83e375087fd35fc511bc430ee8b/Lib/venv/__init__.py#L334-L376 if exist %SRC_DIR%\PCbuild\%BUILD_PATH%\venvlauncher%THREAD%%_D%.exe ( @rem We did copy pythonw.exe until 3.12 but starting with 3.13 we seem to need the latter. Should we omit the first? - copy /Y %SRC_DIR%\PCbuild\%BUILD_PATH%\venvlauncher%THREAD%%_D%.exe %PREFIX%\Lib\venv\scripts\nt\python.exe - copy /Y %SRC_DIR%\PCbuild\%BUILD_PATH%\venvlauncher%THREAD%%_D%.exe %PREFIX%\Lib\venv\scripts\nt\venvlauncher%THREAD%%_D%.exe + copy /Y %SRC_DIR%\PCbuild\%BUILD_PATH%\venvlauncher%THREAD%%_D%.exe %PREFIX%\lib\python\venv\scripts\nt\python.exe + copy /Y %SRC_DIR%\PCbuild\%BUILD_PATH%\venvlauncher%THREAD%%_D%.exe %PREFIX%\lib\python\venv\scripts\nt\venvlauncher%THREAD%%_D%.exe ) else ( echo "WARNING :: %SRC_DIR%\PCbuild\%BUILD_PATH%\venvlauncher%THREAD%%_D%.exe does not exist" ) if exist %SRC_DIR%\PCbuild\%BUILD_PATH%\venvwlauncher%THREAD%%_D%.exe ( @rem We did copy pythonw.exe until 3.12 but starting with 3.13 we seem to need the latter. Should we omit the first? - copy /Y %SRC_DIR%\PCbuild\%BUILD_PATH%\venvwlauncher%THREAD%%_D%.exe %PREFIX%\Lib\venv\scripts\nt\pythonw.exe - copy /Y %SRC_DIR%\PCbuild\%BUILD_PATH%\venvwlauncher%THREAD%%_D%.exe %PREFIX%\Lib\venv\scripts\nt\venvwlauncher%THREAD%%_D%.exe + copy /Y %SRC_DIR%\PCbuild\%BUILD_PATH%\venvwlauncher%THREAD%%_D%.exe %PREFIX%\lib\python\venv\scripts\nt\pythonw.exe + copy /Y %SRC_DIR%\PCbuild\%BUILD_PATH%\venvwlauncher%THREAD%%_D%.exe %PREFIX%\lib\python\venv\scripts\nt\venvwlauncher%THREAD%%_D%.exe ) else ( echo "WARNING :: %SRC_DIR%\PCbuild\%BUILD_PATH%\venvwlauncher%THREAD%%_D%.exe does not exist" ) :: Remove test data to save space. :: Though keep `support` as some things use that. -mkdir %PREFIX%\Lib\test_keep +mkdir %PREFIX%\lib\python\test_keep if errorlevel 1 exit 1 -move %PREFIX%\Lib\test\__init__.py %PREFIX%\Lib\test_keep\ +move %PREFIX%\lib\python\test\__init__.py %PREFIX%\lib\python\test_keep\ if errorlevel 1 exit 1 -move %PREFIX%\Lib\test\support %PREFIX%\Lib\test_keep\ +move %PREFIX%\lib\python\test\support %PREFIX%\lib\python\test_keep\ if errorlevel 1 exit 1 -rd /s /q %PREFIX%\Lib\test +rd /s /q %PREFIX%\lib\python\test if errorlevel 1 exit 1 -move %PREFIX%\Lib\test_keep %PREFIX%\Lib\test +move %PREFIX%\lib\python\test_keep %PREFIX%\lib\python\test if errorlevel 1 exit 1 :: We need our Python to be found! @@ -202,7 +205,7 @@ if "%EXE_T%" neq "" copy %PREFIX%\python%EXE_T%.exe %PREFIX%\python.exe set "PYTHON=%PREFIX%\python.exe" :: bytecode compile the standard library -%PYTHON% -Wi %PREFIX%\Lib\compileall.py -f -q -x "bad_coding|badsyntax|py2_" %PREFIX%\Lib +%PYTHON% -Wi %PREFIX%\lib\python\compileall.py -f -q -x "bad_coding|badsyntax|py2_" %PREFIX%\lib\python if errorlevel 1 exit 1 :: Ensure that scripts are generated @@ -227,7 +230,7 @@ echo "Testing import of os (no DLL needed) does not print: The specified module if %errorlevel% neq 1 exit /b 1 echo "Testing import of %%m (DLL located via PATH needed) does not print: The specified module could not be found" -:: The names are our unvendored modules mapped to ...\DLLs\X.pyd +:: The names are our unvendored modules mapped to ...\lib\python\lib-dynload\X.pyd :: missing: libffi, expat, zlib(-ng) :: Also %errorlevel% will not be updated round the loop so use && to diff --git a/recipe/conda_build_config.yaml b/recipe/conda_build_config.yaml index a7a4ea2c3..5e998d424 100644 --- a/recipe/conda_build_config.yaml +++ b/recipe/conda_build_config.yaml @@ -1,9 +1,16 @@ +# Clobber aggregate's python zip (python/numpy/is_freethreading/is_python_min). +# conda-build requires ALL four keys at the same length; otherwise 3.15 is not a +# subspace of aggregate python 3.10–3.14 (no rocket) and PY_VER stays 3.10. python: - - 3.15 # [ANACONDA_ROCKET_ENABLE_PY315] + - 3.15 +numpy: + - 2.5 +is_freethreading: + - false +is_python_min: + - false python_impl: - cpython -numpy: - - 2.5 # [ANACONDA_ROCKET_ENABLE_PY315] # Override aggregate global tk 8.6 — build/test against tk 9 from pkgs/main tk: - '9.0' diff --git a/recipe/meta.yaml b/recipe/meta.yaml index e2b9f54e9..400dbb1d5 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -1,5 +1,5 @@ {% set version = "3.15.0" %} -{% set dev = "rc1" %} +{% set dev = "rc2" %} {% set dev_ = "" %} {% set ver2 = '.'.join(version.split('.')[0:2]) %} {% set ver2nd = ''.join(version.split('.')[0:2]) %} @@ -61,7 +61,7 @@ source: {% else %} - url: https://www.python.org/ftp/python/{{ version }}/Python-{{ version }}{{ dev }}.tar.xz # md5 from: https://www.python.org/downloads/release/python-{{ ver3nd }}/ - sha256: f84dad680ab2147417d2739355c2678f0f9acffe4ae8ef77895de1454b384b07 + sha256: 8d93af5eaaaea5adfd41bd786a7ba3f03f2ad1ab57c6a65e0b963deab91d5ad7 {% endif %} patches: - patches/0001-Win32-Change-FD_SETSIZE-from-512-to-2048.patch @@ -291,9 +291,8 @@ outputs: - if not exist %PREFIX%\\Scripts\\idle-script.py exit 1 # [win] - if not exist %PREFIX%\\Scripts\\idle.exe exit 1 # [win] - if not exist %PREFIX%\\Scripts\\pydoc.exe exit 1 # [win] - # AR: classic Win layout (Lib/, include/, libs/). getpath looks for Lib\os.py; - # CF install_base.bat is the same — not lib\python. - - if not exist %PREFIX%\\include\\pyconfig.h exit 1 # [win] + # 0027 unixy Win layout: getpath landmarks lib\python\os.py and include\python. + - if not exist %PREFIX%\\include\\python\\pyconfig.h exit 1 # [win] - if not exist %PREFIX%\\libs\\python{{ ver2nd }}{{ abi_suffix }}.lib exit 1 # [win] - pushd tests - pushd prefix-replacement # [unix] diff --git a/recipe/sitecustomize.py b/recipe/sitecustomize.py index 20b014495..ed3876fa7 100644 --- a/recipe/sitecustomize.py +++ b/recipe/sitecustomize.py @@ -14,8 +14,6 @@ # /lib/python3.14t/site-packages. if 't' in sys.abiflags: dirs_to_add.append(os.path.join(sys.prefix, 'lib', f'python3.{sys.version_info[1]}', 'site-packages')) -# Workaround for https://github.com/conda/conda/issues/10969 -dirs_to_add.append(os.path.join(sys.prefix, 'lib', f'python3.1', 'site-packages')) # A python version independent directory that ABI3 and noarch packages can use. # This is unused at the moment, but keeping it here for experimentation. dirs_to_add.append(os.path.join(sys.prefix, 'lib', f'python', 'site-packages'))