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

Support mach bootstrap-gstreamer on Windows #25335

Open
MeFisto94 opened this issue Dec 18, 2019 · 3 comments · May be fixed by #25337
Open

Support mach bootstrap-gstreamer on Windows #25335

MeFisto94 opened this issue Dec 18, 2019 · 3 comments · May be fixed by #25337

Comments

@MeFisto94
Copy link
Contributor

@MeFisto94 MeFisto94 commented Dec 18, 2019

Currently installing gstreamer is a bit tedious on Windows:
Multiple msi's have to be installed, a package manager (chocolatey) has to be installed or pkg-conf-lite has to be installed manually and the paths have to be adjusted.

In my case, GStreamer was suggesting me E:\gstreamer as installation location, which is where pkg-config isn't looking. In fact it only seemed to look in it's own directory (provided servo doesn't pass a custom hardcoded path to where GStreamer usually lands, I suspect C:\gstreamer).

wget https://downloads.sourceforge.net/project/pkgconfiglite/0.28-1/pkg-config-lite-0.28-1_bin-win32.zip
unzip pkg-config-lite-0.28-1_bin-win32.zip -d pkg-config
cd pkg-config/pkg-config-lite-0.28-1/ && mv * ../ && cd ../ && rm -rf pkg-config-lite-0.28-1 && cd ../

This is the script I used to install pkg-config into .servo/msvc-dependencies, which would be Pull Request one: Adding this to mach as well as properly outputting an error when os != linux (and windows, so soon: when os == mac), because right now, mach bootstrap-gstreamer doesn't output anything when not on Linux.

This made servo build using
PATH=$PATH:~/.cargo/bin:$(pwd)/.servo/msvc-dependencies/pkg-config/bin PKG_CONFIG_PATH="/e/gstreamer/1.0/x86_64/lib/pkgconfig" mach build -d

So far so good, but then I hit

 Finished release [optimized] target(s) in 39m 29s
Der Befehl "editbin" ist entweder falsch geschrieben oder
konnte nicht gefunden werden.
Packaging EGL DLLs
Packaging gstreamer DLLs
Could not find GStreamer installation directory.
Packaging MSVC DLLs
DLL file `api-ms-win-crt-runtime-l1-1-0.dll` not found!
Build FAILED in 0:39:29

Which is something mach does, I have to look into where it tries to locate GStreamer and why and how we could do that when installing gstreamer into msvc-dependencies (Or look in the PKG_CONFIG_PATH)

@highfive
Copy link

@highfive highfive commented Dec 18, 2019

@jdm
Copy link
Member

@jdm jdm commented Dec 18, 2019

gstreamer packaging logic is in

def package_gstreamer_dlls(env, servo_exe_dir, target, uwp):
.

@MeFisto94
Copy link
Contributor Author

@MeFisto94 MeFisto94 commented Dec 18, 2019

Further investigation shows that https://github.com/servo/servo/blob/master/python/servo/command_base.py#L247 is the source trying to locate gstreamer.

Actuall installing GStreamer set GSTREAMER_1_0_ROOT_X86_64=E:\gstreamer\1.0\x86_64\ for me, I just forgot to restart the shell (oopsie)

If I manage to install the msi's directly to .servo/msvc-dependencies then everything remaining is an easy fix. If not and we prompt the dialogs to the user and tell them to restart the shell, that should also work.

Edit: Note for further documentation/trouble shooting:
If GStreamer has already been installed, installing it to a different path does NOT work (not even installing -devel when -msvc has been installed).
Debug Logs by Appending /l*v logs.txt will show:

Action start 23:24:47: AppSearch.
MSI (c) (34:E4) [23:24:47:654]: PROPERTY CHANGE: Modifying INSTALLDIR property. Its current value is 'C:\Users\Marc\Documents\Coding\servo\.servo\msvc-dependencies\gstreamer'. Its new value: 'E:\gstreamer\'.
MSI (c) (34:E4) [23:24:47:657]: Note: 1: 1402 2: HKEY_LOCAL_MACHINE32\SOFTWARE\Microsoft\VisualStudio\10.0\Setup\VS 3: 2 
MSI (c) (34:E4) [23:24:47:659]: Note: 1: 1322 2:  
MSI (c) (34:E4) [23:24:47:659]: Note: 1: 1322 2:  
Action ended 23:24:47: AppSearch. Return value 1.

Edit2:
msiexec /i gstreamer-1.0-msvc-x86_64-1.16.0.msi /l*v logs.txt TARGETDIR="C:\Users\Marc\Documents\Coding\servo\.servo\msvc-dependencies" ADDLOCAL=ALL /qb
is the command to install the base gstreamer to the "correct" path (logging can be removed and this has to be transferred to python, I just drop this here so I still know it in a few days)

Edit3:
So that I remember mentioning it in the PR: My approach will only try to download and install GStreamer if the folder is present. Bumping the GStreamer Version OR cancelling the process somewhere inbetween would require a manual deletion of this folder, as at least for case one there would be no other elegant solution and case 2 would mean checking for individual files in that folder, which is also intermittent (depending on where the installation was interrupted).
Actually this already happens here:

elif os.path.exists(path.join(gst_default_path, "bin", "ffi-7.dll")):
I could also take this detection method.

@MeFisto94 MeFisto94 linked a pull request that will close this issue Dec 19, 2019
4 of 4 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

3 participants
You can’t perform that action at this time.