olive-editor / olive

Free open-source non-linear video editor
https://olivevideoeditor.org/
GNU General Public License v3.0
8.01k stars 543 forks source link

[CRASH] Olive 0.2 Nightly's AppImage needs HarfBuzz >= 1.1.3 #1483

Closed ghost closed 3 years ago

ghost commented 3 years ago

Commit Hash 19eabf28

Platform Ubuntu 16.04

Summary

Can't run Olive on Ubuntu 16.04, it prints:

$ ./Olive-19eabf28-Linux-x86_64.AppImage
[WARNING] QApplication: invalid style override passed, ignoring it.
    Available styles: Windows, Fusion ((null):0)
[WARNING] Trying to use locale "en_US" but couldn't find a translation for it ((null):0)
[DEBUG] Extracting default OCIO config to "/home/user/.cache/olivevideoeditor.org/Olive/ocioconf" ((null):0)
[INFO] Using Qt version: 5.12.8 ((null):0)
./Olive-19eabf28-Linux-x86_64.AppImage: symbol lookup error: /tmp/.mount_Olive-IgGh7l/usr/bin/../lib/libQt5Gui.so.5: undefined symbol: hb_font_funcs_set_font_h_extents_func

I see hb_font_funcs_set_font_h_extents_func is a part of HarfBuzz 1.1.3 (they claim it's there since 1.1.2, but it's defined in the hb-font.h header only since 1.1.3):

https://github.com/harfbuzz/harfbuzz/blob/1.1.3/src/hb-font.h#L176

Ubuntu 16.04 system's libharfbuzz is at ancient version 1.0.1-1ubuntu0.1, so it has no hb_font_funcs_set_font_h_extents_func. (nm -D /usr/lib/x86_64-linux-gnu/libharfbuzz.so.0.10000.1 | grep hb_font_funcs_set_font_h_extents_func)

Currently investigating with ./Olive-19eabf28-Linux-x86_64.AppImage --appimage-extract

Steps to Reproduce

Backtrace




Additional Information

ghost commented 3 years ago
~/Downloads/harfbuzz-1.1.3 $ ./autogen.sh 
checking for ragel... You need to install ragel... See http://www.complang.org/ragel/

F

ghost commented 3 years ago

Simran-B commented 3 years ago

The AppImage includes the bare minimum of dependencies to make ldd happy under CentOS 7. I'm not sure why it ignores other seemingly optional dependencies. Linuxdeployqt is also pretty selective. I know that it doesn't include Qt's offscreen rendering library for instance, even though it is possible to force Olive into this mode.

Not directly related to this, but I'm also aware of some omissions in the dependencies that we compile ourselves for Linux. They didn't seem to be required, but we might need to revise transitive deps. Yet another rabbit role, or rather the typical Linux mess...

ghost commented 3 years ago

Got Olive running!

  1. Extracted files with ./Olive-19eabf28-Linux-x86_64.AppImage --appimage-extract
  2. Downloaded libharfbuzz0b_1.7.2-1ubuntu1_amd64.deb (sha256sum: fc5d6463384b30ff7c9b2108ae4dee1dea94d97d70c2710d85cbb66c707ad171) from: https://launchpad.net/ubuntu/bionic/amd64/libharfbuzz0b/1.7.2-1ubuntu1 (also attached to this comment, rename .zip to .deb)
  3. Manually extracted /usr/lib/x86_64-linux-gnu/libharfbuzz.so.0.10702.0 and /usr/lib/x86_64-linux-gnu/libharfbuzz.so.0 from libharfbuzz0b_1.7.2-1ubuntu1_amd64.deb (with file-roller) to Olive's extracted path squashfs-root/usr/lib/
  4. Run squashfs-root/AppRun

libharfbuzz0b_1.7.2-1ubuntu1_amd64.zip

ghost commented 3 years ago

I'm not sure why it ignores other seemingly optional dependencies.

Linux people.

ghost commented 3 years ago

Yet another rabbit role, or rather the typical Linux mess...

Yep.

rodlie commented 3 years ago

You (the maintainer, however that is) will need to fix your Qt depends in the bundle, they are flawed.

Several libraries Qt depend on is not included in the bundle, you can't assume that the system has the same version of the required library you built against. You also include several libraries you should not include as they may conflict with libraries on the system.

Also, don't use linuxdeployqt. It's crap.

Simran-B commented 3 years ago

We use the Qt build from ASWF, https://github.com/AcademySoftwareFoundation/aswf-docker. I did remove several packages from our own build container (which is derived from theirs), as they didn't seem to be necessary. Still unsure why ldd doesn't complain about missing deps should they actually be missing in the build environment.

What libraries are missing exactly and which shouldn't be included? What alternative do you suggest for linuxdeployqt? If it requires more effort than an evening then it's not going to happen before beta stage.

rodlie commented 3 years ago

Still unsure why ldd doesn't complain about missing deps should they actually be missing in the build environment.

ldd will not complain since it finds the libraries other places on the system.

What alternative do you suggest for linuxdeployqt?

Do it yourself, it just a matter of checking the result of ldd in the package script and copy over files that is needed.

What libraries are missing exactly and which shouldn't be included?

If you check the Qt libs with ldd or objdump you can see what libraries are missing.

Example of libs that should not be included:

Another example: you include libgmodule-2.0.so.0 that is part of glib, but you do not include glib, this will fail at some point.

libQt5Core.so.5:

libQt5Gui.so.5:

and probably more, don't have time to check.

Simran-B commented 3 years ago

Do it yourself

That seems to be the overarching motto of Linux. What a disaster. If there would at least be reliable and up-to-date information, but no, it's rabbit hole after rabbit hole.

it just a matter of checking the result of ldd in the package script and copy over files that is needed.

The thing is, there is no packaging script. Only a single call to linuxdeployqt, which is supposed to sort things out, to keep the maintenance burden of this alpha(!) software low. To get rid of it would would require a somewhat elaborate shell script and a squashfs utility to compress the files.

libs that should not be included

Well, that's on linuxdeployqt at the moment. Not sure if their exclusion list is just incomplete or if there is a reason why e.g. libgomp is included.

never include anything from gcc or glibc

What is the reason for that?

libz.so.1 missing libharfbuzz.so.0 missing libglib-2.0.so.0 missing libfreetype.so.6 missing (you should not depend on system freetype)

appimage.org states the exact opposite:

[...] exclusion of certain “base libraries” [...] like zlib or the GLib [...]

[...] libraries might even break the AppImage on the target system [...] libraries that are build and linked differently on different distributions (e.g., libharfbuzz.so.0 and libfreetype.so.6) [...]

The options seem to be to:

ghost commented 3 years ago

Statically link everything? Unlikely to work and a legal nightmare.

Linux people.

Remove nightly builds for Linux and let users compile on their own.

Linux people.

rodlie commented 3 years ago

Do whatever you want, I'm just giving advise on how to (properly) package for Linux.

Simran-B commented 3 years ago

Don't get me wrong, I would like to do it properly, but currently there's conflicting information and no clarity on the positive as well as negative effects to different distros. If you would be so kind to provide a full list of which libs should be included and which shouldn't, then we can give it a go and see if anyone complains. Otherwise it will probably remain unresolved for quite some time (beta phase).

FWIW linuxdeployqt has some options to override its defaults, but I'm unsure if they are sufficient, if some CMake can fix it or if it really takes Bash magic.