-
Notifications
You must be signed in to change notification settings - Fork 562
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
Mangle hardware library builtin paths, in libs bundled into AppImage builds #3321
Conversation
Bit-hack is bad decision. No better workarounds? |
There really aren't. The paths are compiled into the libraries, which we need because they're linked with other libraries in use, but we also need them to not try to access those paths on the host system. Short of a fully-virtualized container that restricts access to the filesystem beyond the sandbox, monkeypatching the hardcoded paths is the best solution anyone's come up with. It's actually a time-honored technique that goes back decades. Someday it may stop working (like, when library objects are signed and authenticated), but that day isn't anywhere in sight for enduser, non-hardened Linux systems generally. The only other option would be to build our own custom versions of the libs from patched sources, and there are plenty of downsides to that approach as well. |
I wrote the expressions as safely as possible, out of an abundance of caution, and Like, for this replacement: openshot-qt/installer/mangle-hw-libs.sh Lines 32 to 35 in 7613425
That could be written as |
(Although, come to think of it all that backslash-escaping on the periods in the replacement strings really is totally unnecessary, and sure makes it harder to read.) |
Madness. I think, that AppImage usage ups hype and decreasing reputation. |
Yeah, I'm not particularly a fan either. My issue is that, no matter how well-designed the AppImage format/tools are, they're based on a faulty premise: That it's possible to create distribution-agnostic Linux binary packages. I think that's been pretty handily disproven. Their punt has been, "Build them for the oldest system available" on the theory that they should then be forwards-compatible on newer systems. That's fine for simple software applications, but the moment you mix in any sort of hardware drivers or APIs it totally breaks down. Not to mention, it forces the use of outdated and feature-limited APIs even when they are compatible. I'm constantly feeling held back by the need to ensure that new code we write is still compatible with 3-year-old Ubuntu releases. ...Why? If people insist on running 3-year-old Ubuntu releases, they should stick to running 3-year-old OpenShot releases. Otherwise, keep up! Aaanyway. Merging this, since disabling hardware acceleration across the board in AppImage-land seems to be the safest course of action. |
This PR adds a script (
installer/mangle-hw-libs.sh
) which usessed
to modify the contents oflibvdpau.so.1
andlibva.so.1
, replacing the hardcoded driver paths they contain with modified ones that point into the AppImage, instead of at the system drivers.Since we don't bundle hardware driver libs, this will have the effect of disabling those libraries' access to the hardware drivers, preventing crashes due to mismatched driver versions on many systems.
See the extensive discussion in #3210 for rationale and details.
Fixes #3210, possibly others (though not any Windows crash-on-opening-Preferences issues)