Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python v3.12.5 #175

Merged
merged 116 commits into from
Sep 9, 2024
Merged

Conversation

naveen521kk
Copy link
Member

@naveen521kk naveen521kk commented Sep 4, 2024

Range diff:

  1:  b9c69bf57cd =   1:  9ceb372bb69 sysconfig: make _sysconfigdata.py relocatable
  2:  c349719ad44 =   2:  1ea7b5164a2 build: add --with-nt-threads and make it default on mingw
  3:  54c49640c27 =   3:  fd21cb0694a Define `MS_WINDOWS` (and others) when compiling with MINGW
  4:  4f7786cbf80 =   4:  2e01cb07c1c configure: add `MACHDEP` and `platform` on MINGW
  5:  0c2a00c27aa =   5:  047a87386c4 Add default configuration for MINGW
  6:  cdbf83278a1 =   6:  ab2442bc969 configure: enable largefile support by default for Mingw
  7:  37424ab3b95 =   7:  877d1f1c062 Add `PC/` to `CPPFLAGS` and to `SRCDIRS` on Mingw
  8:  63c64473df6 =   8:  a76f9afaa1e posixmodule.c: Define necessary headers for compiling on MINGW
  9:  6ae67a8b1f0 =   9:  bedda8d12dc Build winreg by default when compiling for MINGW
 10:  e64166a220e =  10:  e046e521a82 pyport.h: Add support for MINGW
 11:  175caef177d =  11:  57ca17112d3 configure: add options so that shared build is possible on MINGW
 12:  7d2d590da71 =  12:  99a24357e9d Add dynamic loading support for MINGW
 13:  2cef9a90220 =  13:  f0c922d6453 Ignore main program for frozen scripts on MINGW
 14:  1da317ac6e3 =  14:  9c97f87a880 Detect winsock2 and setup _socket module on MINGW
 15:  d53eb47f222 =  15:  409ce272346 Enable some windows specific modules
 16:  10149a78b03 =  16:  af9d2550fbd sysconfig: MINGW build extensions with GCC
 17:  77e7dad5d1d =  17:  6cb7abd5d7e sysconfig: treat MINGW builds as POSIX builds
 18:  c7c28e844ca =  18:  4cd0d8c614e Add support for stdcall without underscore
 19:  206bdd2be7d =  19:  53e2d5802a7 Customize site for MINGW
 20:  be03be69230 =  20:  19e00a9878a add python config sh
 21:  216a7fef504 !  21:  dd698613c44 mingw: prefer unix sep if MSYSTEM environment variable
    @@ Modules/posixmodule.c: os__getfinalpathname_impl(PyObject *module, path_t *path)
      
     +    Py_NormalizeSepsW(target_path);
          result = PyUnicode_FromWideChar(target_path, result_length);
    -     if (result && path->narrow) {
    +     if (result && PyBytes_Check(path->object)) {
              Py_SETREF(result, PyUnicode_EncodeFSDefault(result));
     
      ## Python/initconfig.c ##
     @@ Python/initconfig.c: static const char usage_envvars[] =
    - "PYTHONVERBOSE           : trace import statements (-v)\n"
    - "PYTHONWARNINGS=arg      : warning control (-W arg)\n";
    + "PYTHONWARNINGS  : warning control (-W)\n"
    + ;
      
     -#if defined(MS_WINDOWS)
     +#if defined(_MSC_VER)
 22:  894a6d30cbd =  22:  b08cb8f875d msys cygwin semi native build sysconfig
 23:  f932c3d21ae =  23:  c6a4f5ccbd3 sysconfig: mingw sysconfig like posix
 24:  f6b5ccaebb9 =  24:  59056d94dcd mingw use backslashes in compileall py
 25:  39dc626fa37 =  25:  315565ca8cf mingw pdcurses_ISPAD
 26:  b6618fd164c =  26:  5c8ad039e82 remove_path_max.default
 27:  4a9078f3f39 =  27:  2ccb6956e8a dont link with gettext
 28:  774710a2154 =  28:  12bd6811780 ctypes python dll
 29:  8e4d2ab3809 =  29:  cd1ac628355 gdbm module includes
 30:  6499cbfbfa9 =  30:  4dd2340bd71 use gnu_printf in format
 31:  81bfbaabab3 =  31:  d04756daaa7 mingw fix ssl dont use enum_certificates
 32:  46c5de660b7 =  32:  399dfacacd0 fix using dllhandle and winver mingw
 33:  5e0a48384fb =  33:  ab6a00ff651 Add AMD64 to sys config so msvccompiler get_build_version works
 34:  ec57238583f =  34:  87db3f81a15 MINGW link with additional library
 35:  32cf53fc0ff =  35:  157384958a5 install msilib
 36:  87bc3aedc10 =  36:  527325bc5a0 fix signal module build
 37:  631c774c6b1 =  37:  3bb49515d45 build: build winconsoleio and _testconsole
 38:  d3687f2585f =  38:  6ed7d7c5315 expose sem_unlink
 39:  542a2d46be1 =  39:  3642815f8c3 Use cygpty while using isatty
 40:  52cab5ad7ba =  40:  622f8b2cf70 build: link win resource files and build pythonw
 41:  2ce010ce13a =  41:  e4b78976c62 fix isselectable
 42:  2b67fbdb9fd =  42:  a0b0ffca4bb configure.ac: fix inet_pton check
 43:  942ce0ac166 =  43:  b0dccdcfe91 pass gen profile ldflags
 44:  4f5ce776066 =  44:  ee1c6dc7e65 pkg config windows must link ext with python lib
 45:  2209bcf1e00 =  45:  12640fcd4d4 importlib bootstrap path sep
 46:  a236eba8384 =  46:  2813be01e91 warnings fixes
 47:  6d9f3fe8ccd =  47:  2c742d3899f fix build testinternalcapi
 48:  da616a0b349 =  48:  e61cb4c83b3 clang arm64
 49:  43f2ea75dde !  49:  494b12bd578 configure.ac: set MINGW stack reserve
    @@ configure.ac: then
     +	case $host in
     +	*-*-mingw*)
     +		# for https://bugs.python.org/issue40458 on MINGW
    -+		LINKFORSHARED="-Wl,--stack,2000000";;
    ++		LINKFORSHARED="-Wl,--stack,4194304";;
     +	esac
      fi
      AC_MSG_RESULT([$LINKFORSHARED])
 50:  1860e5a5ee7 =  50:  f8f20113ce6 Don't use os.pathsep to find EOF not all distributions in win32 have them as \ instead check using sys.platform
 51:  efa19dfbf3d =  51:  e864c2fc0da Fix extension suffix for c-extensions on mingw
 52:  3a72056f0b4 =  52:  9407ecb65e3 Change the `get_platform()` method in sysconfig
 53:  441d13f416a =  53:  2daa99b39aa build: Fix ncursesw include lookup
 54:  2a749b39772 =  54:  b0333f57581 tests: fix test_bytes
 55:  49032031188 =  55:  9189a5bab6e time: fix strftime not raising for invalid year values
 56:  4e38eab6ba6 =  56:  11970de4b51 ctypes: find_library('c') should return None with ucrt
 57:  cd274c6a6ba =  57:  9e75c8a1901 build: Disable checks for dlopen/dlfcn
 58:  3002b516f9a =  58:  9e824194698 Fix install location of the import library
 59:  6d8ce76ab34 =  59:  d00e141feac build: Integrate venvlauncher build/installation into the Makefile
 60:  cdf16e5cb3f =  60:  2c95724f4af configure.ac: set _WIN32_WINNT version
 61:  aa626c00d72 =  61:  f234ef63140 configure.ac: don't check for clock_ functions
 62:  bc61e3a1175 =  62:  9b349c89fb1 expanduser: normpath paths coming from env vars
 63:  4c1a33f2684 =  63:  1aab26eddfc CI: test the build and add some mingw specific tests
 64:  731fa5ca973 =  64:  acbb4f96aa0 Define PY3_DLLNAME to fix build
 65:  453ebc55f3c =  65:  459f05031e8 _testconsole.c: Fix casing & path sep
 66:  52eb9560ea5 =  66:  722ccaddbd3 Return consistent architecture markers for python on mingw/armv7
 67:  0ade53e4e7d =  67:  9f75de1aee2 handle ncursesw pkg-config when cross-compiling
 68:  29d1642bfc2 =  68:  0b0e6919215 mingw_smoketests: fix _UCRT condition
 69:  66065e2d38e =  69:  519449e7f7f Modify `sys.winver` to match upstream
 70:  83258d903c0 =  70:  39745f76a93 Change user site-packages path to include the environment info
 71:  fd99658f3eb =  71:  d5668b6111c configure: Include a header in the check for _beginthread
 72:  a98d668d5be =  72:  3f05a697512 configure.ac: Default to --without-c-locale-coercion on Windows
 73:  3a8acec4421 !  73:  d222b08707d Fix failing tests
    @@ Lib/test/test_sysconfig.py
      
      
     @@ Lib/test/test_sysconfig.py: def test_nt_venv_scheme(self):
    -         self.assertEqual(libpath, sysconfig.get_path('purelib', scheme='nt_venv'))
    +         self.assertEqual(libpath, sysconfig.get_path('purelib', scheme='nt_venv', vars=vars))
      
          def test_venv_scheme(self):
     -        if sys.platform == 'win32':
 74:  078fffbb899 =  74:  267a4a309d6 Don't change os.sep with an empty MSYSTEM env var, not just a missing one
 75:  87662963e70 =  75:  43ea6d7eb9c def VPATH when compiling `Python/sysmodule.c`
 76:  d556fd37841 =  76:  f5a8d795c41 Make `_Py_CheckPython3` extern
 77:  59989dddda6 =  77:  eb3f13adcf9 link with bcrypt
 78:  742c6c9041d =  78:  9a834410bfb correctly find native python
 79:  d161651cab4 =  79:  0e2fc3f0bda Add extra flags for `_bootstrap_python`
 80:  955c80002f5 =  80:  c16fbe8fc7f posixmodule: undefine `HAVE_OPENDIR`
 81:  4b36c1161c3 =  81:  518d1237306 getpath.py: add support for mingw
 82:  cbaff611ec2 =  82:  d5f589c6c80 Don't  build _posixsubprocess on Windows.
 83:  62d0b819f5c =  83:  590b0a31236 `_ssl`: link with `ws2_32`
 84:  062c8ba1084 =  84:  e4890df1c51 Always normalize path in abspath
 85:  4be4188154f =  85:  9b99df6ad1d Include `winsock.h` when checking for netdb function
 86:  31037b3ba9a =  86:  323f1a6e7c8 include `_multiprocessing/semaphore.c` on win32
 87:  8b688d3c233 =  87:  f8390fc19e9 configure: build `mmap` module on win32
 88:  29cd24b1d69 =  88:  50c1a4ea33f venv creation fixes
 89:  4b83207f4c8 =  89:  f855d992e8c move the `shutdown` function where `winsock.h` is included
 90:  7e1ed60a355 =  90:  0c48bb9499d configure.ac: set BUILDEXEEXT and EXEEXT
 91:  7219ae643fe =  91:  66d55fe5bfb configure.ac: fix building some test modules
 92:  4492bf83d5e =  92:  987d88f1dc9 Don't convert `sysconfig.get_config_var('VPATH')` to an absolute path
 93:  ab3ef7381c0 =  93:  5aebb877c5d Always convert `/` to `\\` before passing though pathcch functions
 94:  4a4b6538594 =  94:  0982bf22e6b Build venvlauncher.exe from PC/launcher.c
 95:  c4d0bdb74de =  95:  cadc2ad939d getpath.py: fix `dirname`
 96:  51fa807b635 =  96:  2a9b6a211a0 getpath: use normpath on all generated paths
 97:  e23c9747e36 =  97:  97d8683dcfc pathconfig: normpath sys.path[0]
 98:  f2d1898d485 =  98:  a2e78ae35fb smoketests: add some tests for sys/site paths
 99:  cd2927084b4 =  99:  2a8b3f86114 Search DLLs only on paths added using `add_dll_directory()`.
100:  4c28b3108f8 = 100:  41fc8f49da7 Build and install libpython3.dll
101:  a6e3077cf64 = 101:  dae15ffc520 Port GetPythonImport() to mingw
102:  788013a59ef = 102:  323a045e318 LoadLibraryExW: make sure to only use backslashes for paths
103:  6a326b63d58 = 103:  8525ab3314e mingw_smoketests: add a test to check if sysconfig returns correct values for `LIBDIR`
104:  bd516776575 = 104:  0f8ed1b9879 Add missing library for multiprocessing module
105:  561fc7c0f4e = 105:  4981f5bae37 selectmodule: add support for MINGW
106:  cc5ceaf8377 = 106:  ddbd10e6d3b readline: disable on MINGW
107:  3bb9185ebf5 = 107:  c8492a013d1 Add libraries to fix compile of ctypes on MINGW
108:  9448873e84b = 108:  3e1625b7d02 Add `-lpython<version>` while linking stdlib
109:  7df6f8165a1 = 109:  21bcf2f843e Enable `_uuid` on MINGW
110:  8530c9cb494 = 110:  21cc5676a2e Enable curses library on MINGW
111:  9c61a4117b2 = 111:  aecc6c698a6 mingw_smoketests: disable distutils related tests
112:  64f2dfd43a6 = 112:  1743be55dc0 mingw_smoketests: skip test_c_ext_build for in-tree builds
113:  ec4403d0144 = 113:  4f07f4111fd configure.ac: use autoconf 2.69
114:  2ce1791f6be <   -:  ----------- [3.12] gh-114440: Close writer pipe in multiprocessing.Queue, not concurrent.futures (GH-114489)
115:  ad679e52304 <   -:  ----------- [3.12] gh-115133: Fix tests for XMLPullParser with Expat 2.6.0 (GH-115164) (GH-115288)
116:  4d9ee66b361 ! 114:  e0df848d8c2 CI: clean up ignored tests
    @@ .github/workflows/mingw.yml: jobs:
     
      ## Lib/test/test_wmi.py ##
     @@
    --# Test the internal _wmi module on Windows
    --# This is used by the platform module, and potentially others
    --
    --import unittest
    --from test.support import import_helper, requires_resource
    --
    --
    --# Do this first so test will be skipped if module doesn't exist
    + 
    + 
    + # Do this first so test will be skipped if module doesn't exist
     -_wmi = import_helper.import_module('_wmi', required_on=['win'])
    --
    --
    --class WmiTests(unittest.TestCase):
    --    def test_wmi_query_os_version(self):
    --        r = _wmi.exec_query("SELECT Version FROM Win32_OperatingSystem").split("\0")
    --        self.assertEqual(1, len(r))
    --        k, eq, v = r[0].partition("=")
    --        self.assertEqual("=", eq, r[0])
    --        self.assertEqual("Version", k, r[0])
    --        # Best we can check for the version is that it's digits, dot, digits, anything
    --        # Otherwise, we are likely checking the result of the query against itself
    --        self.assertRegex(v, r"\d+\.\d+.+$", r[0])
    --
    --    def test_wmi_query_repeated(self):
    --        # Repeated queries should not break
    --        for _ in range(10):
    --            self.test_wmi_query_os_version()
    --
    --    def test_wmi_query_error(self):
    --        # Invalid queries fail with OSError
    --        try:
    --            _wmi.exec_query("SELECT InvalidColumnName FROM InvalidTableName")
    --        except OSError as ex:
    --            if ex.winerror & 0xFFFFFFFF == 0x80041010:
    --                # This is the expected error code. All others should fail the test
    --                return
    --        self.fail("Expected OSError")
    --
    --    def test_wmi_query_repeated_error(self):
    --        for _ in range(10):
    --            self.test_wmi_query_error()
    --
    --    def test_wmi_query_not_select(self):
    --        # Queries other than SELECT are blocked to avoid potential exploits
    --        with self.assertRaises(ValueError):
    --            _wmi.exec_query("not select, just in case someone tries something")
    --
    --    @requires_resource('cpu')
    --    def test_wmi_query_overflow(self):
    --        # Ensure very big queries fail
    --        # Test multiple times to ensure consistency
    --        for _ in range(2):
    --            with self.assertRaises(OSError):
    --                _wmi.exec_query("SELECT * FROM CIM_DataFile")
    --
    --    def test_wmi_query_multiple_rows(self):
    --        # Multiple instances should have an extra null separator
    --        r = _wmi.exec_query("SELECT ProcessId FROM Win32_Process WHERE ProcessId < 1000")
    --        self.assertFalse(r.startswith("\0"), r)
    --        self.assertFalse(r.endswith("\0"), r)
    --        it = iter(r.split("\0"))
    --        try:
    --            while True:
    --                self.assertRegex(next(it), r"ProcessId=\d+")
    --                self.assertEqual("", next(it))
    --        except StopIteration:
    --            pass
    --
    --    def test_wmi_query_threads(self):
    --        from concurrent.futures import ThreadPoolExecutor
    --        query = "SELECT ProcessId FROM Win32_Process WHERE ProcessId < 1000"
    --        with ThreadPoolExecutor(4) as pool:
    --            task = [pool.submit(_wmi.exec_query, query) for _ in range(32)]
    --            for t in task:
    --                self.assertRegex(t.result(), "ProcessId=")
    -+# Test the internal _wmi module on Windows
    -+# This is used by the platform module, and potentially others
    -+
    -+import unittest
    -+from test.support import import_helper, requires_resource
    -+
    -+
    -+# Do this first so test will be skipped if module doesn't exist
    -+_wmi = import_helper.import_module('_wmi')
    -+
    -+
    -+class WmiTests(unittest.TestCase):
    -+    def test_wmi_query_os_version(self):
    -+        r = _wmi.exec_query("SELECT Version FROM Win32_OperatingSystem").split("\0")
    -+        self.assertEqual(1, len(r))
    -+        k, eq, v = r[0].partition("=")
    -+        self.assertEqual("=", eq, r[0])
    -+        self.assertEqual("Version", k, r[0])
    -+        # Best we can check for the version is that it's digits, dot, digits, anything
    -+        # Otherwise, we are likely checking the result of the query against itself
    -+        self.assertRegex(v, r"\d+\.\d+.+$", r[0])
    -+
    -+    def test_wmi_query_repeated(self):
    -+        # Repeated queries should not break
    -+        for _ in range(10):
    -+            self.test_wmi_query_os_version()
    -+
    -+    def test_wmi_query_error(self):
    -+        # Invalid queries fail with OSError
    -+        try:
    -+            _wmi.exec_query("SELECT InvalidColumnName FROM InvalidTableName")
    -+        except OSError as ex:
    -+            if ex.winerror & 0xFFFFFFFF == 0x80041010:
    -+                # This is the expected error code. All others should fail the test
    -+                return
    -+        self.fail("Expected OSError")
    -+
    -+    def test_wmi_query_repeated_error(self):
    -+        for _ in range(10):
    -+            self.test_wmi_query_error()
    -+
    -+    def test_wmi_query_not_select(self):
    -+        # Queries other than SELECT are blocked to avoid potential exploits
    -+        with self.assertRaises(ValueError):
    -+            _wmi.exec_query("not select, just in case someone tries something")
    -+
    -+    @requires_resource('cpu')
    -+    def test_wmi_query_overflow(self):
    -+        # Ensure very big queries fail
    -+        # Test multiple times to ensure consistency
    -+        for _ in range(2):
    -+            with self.assertRaises(OSError):
    -+                _wmi.exec_query("SELECT * FROM CIM_DataFile")
    -+
    -+    def test_wmi_query_multiple_rows(self):
    -+        # Multiple instances should have an extra null separator
    -+        r = _wmi.exec_query("SELECT ProcessId FROM Win32_Process WHERE ProcessId < 1000")
    -+        self.assertFalse(r.startswith("\0"), r)
    -+        self.assertFalse(r.endswith("\0"), r)
    -+        it = iter(r.split("\0"))
    -+        try:
    -+            while True:
    -+                self.assertRegex(next(it), r"ProcessId=\d+")
    -+                self.assertEqual("", next(it))
    -+        except StopIteration:
    -+            pass
    -+
    -+    def test_wmi_query_threads(self):
    -+        from concurrent.futures import ThreadPoolExecutor
    -+        query = "SELECT ProcessId FROM Win32_Process WHERE ProcessId < 1000"
    -+        with ThreadPoolExecutor(4) as pool:
    -+            task = [pool.submit(_wmi.exec_query, query) for _ in range(32)]
    -+            for t in task:
    -+                self.assertRegex(t.result(), "ProcessId=")
    ++_wmi = import_helper.import_module('_wmi')
    + 
    + 
    + def wmi_exec_query(query):
     
      ## mingw_ignorefile.txt ##
     @@ mingw_ignorefile.txt: test.test_ctypes.test_loading.LoaderTest.test_load_dll_with_flags
    @@ mingw_ignorefile.txt: test.test_site._pthFileTests.*
     -test.test_logging.IPv6SysLogHandlerTest.*
     +
     +test.test_dict.DictTest.test_splittable_to_generic_combinedtable
    ++test.test_capi.test_run.CAPITest.test_run_fileexflags
     
      ## mingw_ignorefile_msvcrt.txt (new) ##
     @@
117:  1e278fca29c = 115:  23de042562c gcc: make `incompatible-pointer-types` as warning
  -:  ----------- > 116:  d22c87c3dd5 CI: normalize path in test_makefile

Summary:

  • increased stack size because of failing test on clang64 - not sure if it's okay though (see here)
  • normalize path in test_makefile tests (\\ vs /) see d22c87c

mingwandroid and others added 30 commits September 4, 2024 10:24
Co-authored-by: Алексей <alexey.pawlow@gmail.com>
Co-authored-by: lovetox <8661218+lovetox@users.noreply.github.com>
Co-authored-by: Naveen M K <naveen521kk@gmail.com>
Co-authored-by: Алексей <alexey.pawlow@gmail.com>
Co-authored-by: Christoph Reiter <reiter.christoph@gmail.com>
This is used throughout the Python code but is not defined
when compiling with Mingw-w64 compilers, so define it.
In MSVC these are defined in PC/pyconfig.h, we have to
define it manually because pyconfig.h is created by
autotools.

Co-authored-by: Алексей <alexey.pawlow@gmail.com>
Co-authored-by: Christoph Reiter <reiter.christoph@gmail.com>
Co-authored-by: Naveen M K <naveen521kk@gmail.com>
Co-authored-by: Алексей <alexey.pawlow@gmail.com>
Co-authored-by: Алексей <alexey.pawlow@gmail.com>
Co-authored-by: Christoph Reiter <reiter.christoph@gmail.com>
Largefile is supported on Windows.

Co-authored-by: Naveen M K <naveen521kk@gmail.com>
Co-authored-by: Алексей <alexey.pawlow@gmail.com>
Co-authored-by: Christoph Reiter <reiter.christoph@gmail.com>
Co-authored-by: Naveen M K <naveen521kk@gmail.com>
Also, build `nt` module instead of `posix` when compiling
with MINGW.

Co-authored-by: Naveen M K <naveen521kk@gmail.com>
Co-authored-by: Алексей <alexey.pawlow@gmail.com>
Co-authored-by: Алексей <alexey.pawlow@gmail.com>
Co-authored-by: Christoph Reiter <reiter.christoph@gmail.com>
Co-authored-by: Naveen M K <naveen521kk@gmail.com>
Co-authored-by: Алексей <alexey.pawlow@gmail.com>
Co-authored-by: Naveen M K <naveen521kk@gmail.com>
Co-authored-by: Алексей <alexey.pawlow@gmail.com>
Co-authored-by: Алексей <alexey.pawlow@gmail.com>
Co-authored-by: Алексей <alexey.pawlow@gmail.com>
Co-authored-by: Naveen M K <naveen521kk@gmail.com>
Co-authored-by: Алексей <alexey.pawlow@gmail.com>
Co-authored-by: Naveen M K <naveen521kk@gmail.com>
This is the case used in MINGW

Co-authored-by: Алексей <alexey.pawlow@gmail.com>
Co-authored-by: Алексей <alexey.pawlow@gmail.com>
Co-authored-by: Christoph Reiter <reiter.christoph@gmail.com>
Co-authored-by: Алексей <alexey.pawlow@gmail.com>
Co-authored-by: Christoph Reiter <reiter.christoph@gmail.com>
Co-authored-by: Алексей <alexey.pawlow@gmail.com>
Co-authored-by: Christoph Reiter <reiter.christoph@gmail.com>
Co-authored-by: cat <cat@wolfgirl.org>
Co-authored-by: Naveen M K <naveen521kk@gmail.com>
Co-authored-by: Алексей <alexey.pawlow@gmail.com>
Co-authored-by: Алексей <alexey.pawlow@gmail.com>
Co-authored-by: Алексей <alexey.pawlow@gmail.com>
Co-authored-by: Алексей <alexey.pawlow@gmail.com>
Co-authored-by: Алексей <alexey.pawlow@gmail.com>
Co-authored-by: Алексей <alexey.pawlow@gmail.com>
Co-authored-by: Christoph Reiter <reiter.christoph@gmail.com>
Co-authored-by: Алексей <alexey.pawlow@gmail.com>
Co-authored-by: Алексей <alexey.pawlow@gmail.com>
lazka and others added 26 commits September 9, 2024 19:01
they are guarded by dlopen being present, but if module loading is enabled
is more correct.
they don't seems to handle `/` as path separator correctly
- Use function available in original msvcrt.dll
  _wdupenv_s -> _wgetenv_s
  fread_s -> fread
- Add a test for checking the new launchers
also, fix finding prefix when in a venv
Instead of just calling normpath in abspath just call normpath
on all the config results. This makes sure we don't change getpath.py
too much and still cover all outputs.

This fixes sys.exec_prefix not matching sys.prefix, see
msys2-contrib#142
this gets added as first element in sys.path.
use normpath to make sure it uses the right path separator
This is the default behavior on upstream Python. We previously
reverted this behavior because it broke some use cases.

The old behavior can be restored by setting the environment variable
PYTHONLEGACYWINDOWSDLLLOADING to 1.

Fixes msys2-contrib#48
Also fixes msys2-contrib#141

Signed-off-by: Naveen M K <naveen521kk@gmail.com>
This provides the limited ABI as a separate DLL, forwarding to the
real one. This makes linking with "-lpython3" work.

Fixes python#147
This looks for DLL names in the import table but while with MSVC the DLL
is named python311.dll in our case it is named libpython3.11.dll.
Adjust the strings and lengths accordingly.
It seems like in case the path passed to it is absolute, but contains
forward slashes then LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR does not work
and DLLs in the same directory as the extension are not considered.

This occurs in our fork because in MSYS2-mode the extension loader will
normalize to forward slashes before.

Normalize everything to backslashes again before passing it to LoadLibraryExW.

Fixes python#151
`ws2_32` is required when building that module
llvm-mingw only has autoconf 2.69
Remove tests which are passing now, or no longer exist, and
move tests which only fail with msvcrt into a separate file.
gcc 14 changed `incompatible-pointer-types` from warning to error
for now, make it as warning to avoid build failure
@naveen521kk naveen521kk marked this pull request as ready for review September 9, 2024 16:03
@naveen521kk naveen521kk merged commit ce773f3 into msys2-contrib:mingw-v3.12.5 Sep 9, 2024
5 of 12 checks passed
@naveen521kk naveen521kk deleted the wip-mingw-v3.12.5 branch September 9, 2024 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants