Open 46cv8 opened 6 months ago
Soo my original analysis was slightly flawed, the bug is real, but the reason it works under 1.22.5 is because gst-plugin-scanner.exe is never called under 1.22.5 it is however called in 1.24.1. Renaming gst-plugin-scanner.exe to gst-plugin-scanner.exe.bak so it can't be called seems to be sufficient to get things working again. I suspect gst-plugin-scanner may have always been using the wrong path for python module dlls, the only reason it wasn't an issue until now is because it was not actually being called for 1.22.5 and earlier.
So the workaround is just to delete it for now. But please be aware it is indeed broken and searching the wrong path and needs to be fixed.
Does export PYTHONLEGACYWINDOWSDLLLOADING=1
help?
Sorry for my late reply! Yes! This fixes it! I will add this to my application. Thanks so much :)
Thanks. Then this is likely related to https://github.com/msys2-contrib/cpython-mingw/issues/161
Description / Steps to reproduce the issue
Under msys2 using the ucrt64 and mingw64 variants (possibly others but I haven't tested) the path that gst-plugin-scanner is passing to libpython.dll is causing it to scan in the wrong path for the python dlls (see below for more details). Just to be clear this works fine under 1.22.5 and even 1.22.9 if memory serves me correctly (but I don't have a snapshot I can test against for 1.22.9).
Investigation done:
I posted an issue over at freedesktop for the gstreamer guys but I'm not sure this is a gstreamer issue, it seems like it may be more of a msys2 issue as it is searching the windows path, when it should be searching /ucrt64/bin or /mingw64/bin... https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3434
Expected behavior
On my working 1.22.5 environment gst-plugin-scanner. first scans in the following folder to look for the dll and fails to find it.
C:\msys64\ucrt64\lib\python3.11\site-packages\gi\libgirepository-1.0-1.dll
Then finds it in the second place it looks.
C:\msys64\ucrt64\bin\libgirepository-1.0-1.dll
Actual behavior
On my newly installed 1.24.1 environment gst-plugin-scanner scans in three locations all of which don't have the required dlls.
I had originally thought libgstpython changes were the source of the issue, but I don't think they are. Doing some careful file copying to make sure the gstreamer plugin cache never detected a change to libgstpython.dll. I was actually able to get gstreamer 1.24.1 to use the 1.22.5 libgstpython.dll and it didn't run into the issue and was even able to run my python gstreamer plugin fine. I then invalidated the plugin cache, and immediately (even though libgstpython.dll was the same one it had been using successfully) gst-plugin-scanner started to throw errors because it thought the dll's used by various python site-package libraries were missing, because it is searching in the wrong path.
Verification
Windows Version
MINGW64_NT-10.0-19044
Are you willing to submit a PR?
No response