pressure-vessel: Remap preloadable modules better
Compare changes
- Simon McVittie authored
This deals with several situations that were previously not well-handled. For ${LIB} and ${PLATFORM}, we try to load the library to find out where it is, and then ask pv-adverb to set up ${PLATFORM}-based symlinks in the container. This addresses the part of steam-runtime#435 reported by Github user `lukashoracek`. For ${ORIGIN} and other unsupported dynamic string tokens, we export the deepest directory "above" the dynamic string token, and leave the string in the environment variable unchanged. For libraries that are loaded by a bare basename, the right thing to do is not completely obvious: if the user is loading something designed to be a LD_PRELOAD module, like libMangoHud.so or libfakechroot.so, then we want to copy it from the host into the container and use it like that. However, if the user specifies something like LD_PRELOAD=libcurl.so.4, it seems likely that they meant the library from the container runtime, so we use the new if-not-in-container option to make that happen. Dependencies of a library specified by a plain basename are not currently loaded, so that LD_PRELOAD=libMangoHud.so and LD_PRELOAD=/usr/$LIB/libMangoHud.so will have consistent behaviour. Resolves: https://github.com/ValveSoftware/steam-runtime/issues/435 Signed-off-by:
Simon McVittie <smcv@collabora.com>
+ 28
− 0
@@ -292,6 +292,7 @@ G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC (RuntimeArchitecture,
@@ -3842,6 +3843,29 @@ collect_graphics_libraries_patterns (GPtrArray *patterns)
@@ -4664,6 +4688,7 @@ static gboolean
@@ -4919,6 +4944,7 @@ pv_runtime_use_provider_graphics_stack (PvRuntime *self,
@@ -5252,6 +5278,7 @@ pv_runtime_bind (PvRuntime *self,
@@ -5280,6 +5307,7 @@ pv_runtime_bind (PvRuntime *self,