gst-plugin-scanner appears to be using the wrong dll binary path when searching for python module dlls under msys2 ucrt64 with 1.24.1
Describe your issue
Under msys2 using the ucrt64 variant of the packages 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).
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
Observed 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.
- C:\msys64\ucrt64\lib\python3.11\site-packages\gi\libgirepository-1.0-1.dll
- C:\msys64\ucrt64\libexec\gstreamer-1.0\libgirepository-1.0-1.dll
- C:\Windows\System32\libgirepository-1.0-1.dll
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) 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.
Setup
- Operating System:
- Windows 10
- MSYS2 UCRT64
- GStreamer Version:
- 1.24.1
Steps to reproduce the bug
- install msys2 (https://stackoverflow.com/questions/37460073/msys-vs-mingw-internal-environment-variables)
- follow steps at https://pygobject.readthedocs.io/en/latest/getting_started.html
- open ucrt64 shell
- pacman -Suy
- pacman -S mingw-w64-ucrt-x86_64-gtk4 mingw-w64-ucrt-x86_64-python3 mingw-w64-ucrt-x86_64-python3-pip mingw-w64-ucrt-x86_64-python3-gobject mingw-w64-ucrt-x86_64-python-wheel
- pacman -S mingw-w64-ucrt-x86_64-gstreamer mingw-w64-ucrt-x86_64-gst-devtools mingw-w64-ucrt-x86_64-gst-plugins-base mingw-w64-ucrt-x86_64-gst-plugin-gtk mingw-w64-ucrt-x86_64-gst-plugins-bad mingw-w64-ucrt-x86_64-gst-plugins-bad-libs mingw-w64-ucrt-x86_64-gst-plugins-good mingw-w64-ucrt-x86_64-gst-plugins-ugly mingw-w64-ucrt-x86_64-gst-python
- pacman -S mingw-w64-ucrt-x86_64-python-psutil
- building libgstpython.dll (https://gstreamer.freedesktop.org/documentation/installing/building-from-source-using-meson.html?gi-language=python)
- pacman -S git mingw-w64-ucrt-x86_64-meson-python mingw-w64-ucrt-x86_64-cc mingw-w64-ucrt-x86_64-meson mingw-w64-ucrt-x86_64-ninja mingw-w64-ucrt-x86_64-pkg-config mingw-w64-ucrt-x86_64-pygobject-devel mingw-w64-ucrt-x86_64-python
- git clone https://gitlab.freedesktop.org/gstreamer/gstreamer.git
- cd gstreamer
- git checkout 1.24.1
- cd subprojects/gst-python/
- meson build
- cd build
- ninja
- cp plugin/libgstpython.dll /ucrt64/lib/gstreamer-1.0/libgstpython.dll
- gst-inspect-1.0.exe > /dev/null
** (gst-plugin-scanner.exe:1708): CRITICAL **: 10:06:16.091: pygobject initialization failed: could not import gobje
ct (error was: ImportError('DLL load failed while importing _gi: The specified module could not be found.'))
How reproducible is the bug?
I have a clean VM with 1.22.5 installed and nothing else under MSYS and I can build the libgstpython.dll and use it on that system fine still. But as soon as I update anything, or attempt a fresh install to 1.24.1 I run into this issue. I can reproduce it every time on a clean VM.
Screenshots if relevant
Solutions you have tried
- I tried incrementally updating pacman packages between my working snapshot that was running 1.22.5 and 1.24.1 but pacman doesn't support partial package updates so I was unable to isolate precisely which package or which version change broke things....
- Also check "under observed behavior" for more details, but I think I was able to successfully get the 1.22.5 libgstpython.dll working under 1.24.1, until the plugin cache detected a change and attempted to rescan the plugin and failed.
- I think mingw 64 is more mainstream than ucrt64 so I repeat the above build steps using mingw64 and I ran into the exact same issue, so it applies to both variants.
Related non-duplicate issues
I'm not sure but I originally thought this may be related to changes in !6159 (merged)