fix(fex): keep Wayland cursor with its provider client

This commit is contained in:
maxjivi05 committed 2026-11-11 05:25:58 -05:00
1 parent 9f980d4363
commit 8645e0f924
2 files changed
+33 -6

No files matched your search

@@ -37,7 +37,7 @@ RUNTIMES = {SNIPER_APPID: ("sniper_platform_", "Steam Linux Runtime 3.0 (sniper"
SLR4_APPID: ("steamrt4_platform_", "Steam Linux Runtime 4.0 (steamrt4")}
MARKER = ".droiddeck-fex"
LAYOUT = 1
ROOTFS_LAYOUT = 6
ROOTFS_LAYOUT = 7
ARCH_DIRS = ("x86_64-linux-gnu", "i386-linux-gnu")
INTERPRETERS = ("ld-linux-x86-64.so.2", "ld-linux.so.2")
PROVIDED = frozenset((
@@ -313,9 +313,10 @@ def provides_newer(base, provider):
def mirror(source, provider, name, target):
wayland_needs_ffi = name in ("libwayland-client.so.0", "libwayland-server.so.0")
wayland_needs_ffi = name in ("libwayland-client.so.0", "libwayland-server.so.0", "libwayland-cursor.so.0")
usable_provider = provider and os.path.exists(os.path.join(provider, name)) and (
not wayland_needs_ffi or os.path.exists(os.path.join(provider, "libffi.so.8")))
not wayland_needs_ffi or os.path.exists(os.path.join(provider, "libffi.so.8"))) and (
name != "libwayland-cursor.so.0" or os.path.exists(os.path.join(provider, "libwayland-client.so.0")))
if name in PROVIDED and usable_provider:
os.symlink(os.path.realpath(os.path.join(provider, name)), os.path.join(target, name))
return
+29 -3
View File
@@ -609,7 +609,7 @@ class PrepareTest(FexTestCase):
for arch in ("x86_64-linux-gnu", "i386-linux-gnu"):
base = sniper / "files/lib" / arch
newer = provider / "files/lib" / arch
for name in ("libwayland-client.so.0", "libwayland-server.so.0"):
for name in ("libwayland-client.so.0", "libwayland-server.so.0", "libwayland-cursor.so.0"):
self.write(base / name, b"base")
self.write(newer / name, b"provider")
if ffi_state == "dangling":
@@ -620,16 +620,42 @@ class PrepareTest(FexTestCase):
fex, _ = self.quiet(FEX["prepare"])
for arch in ("x86_64-linux-gnu", "i386-linux-gnu"):
root = Path(fex["rootfs"]) / "lib" / arch
for name in ("libwayland-client.so.0", "libwayland-server.so.0"):
for name in ("libwayland-client.so.0", "libwayland-server.so.0", "libwayland-cursor.so.0"):
self.assertEqual((root / name).read_bytes(), b"base")
self.assertFalse(os.path.lexists(root / "libffi.so.8"))
def test_wayland_cursor_requires_usable_provider_client_on_both_architectures(self):
self.fex_tool()
sniper = self.runtime()
FEX["materialize"](str(sniper))
provider = self.graphics(sniper)
for client_state in ("missing", "dangling"):
with self.subTest(client_state=client_state):
for arch in ("x86_64-linux-gnu", "i386-linux-gnu"):
base = sniper / "files/lib" / arch
newer = provider / "files/lib" / arch
self.write(base / "libwayland-client.so.0", b"base client")
self.write(base / "libwayland-cursor.so.0", b"base cursor")
self.write(newer / "libwayland-cursor.so.0", b"provider cursor")
self.write(newer / "libffi.so.8", b"provider ffi")
if client_state == "dangling":
os.symlink("missing-client.so", newer / "libwayland-client.so.0")
marker = self.home / ".local/share/droiddeck-fex/rootfs/.droiddeck-fex"
if marker.exists():
marker.unlink()
fex, _ = self.quiet(FEX["prepare"])
for arch in ("x86_64-linux-gnu", "i386-linux-gnu"):
root = Path(fex["rootfs"]) / "lib" / arch
self.assertEqual((root / "libwayland-client.so.0").read_bytes(), b"base client")
self.assertEqual((root / "libwayland-cursor.so.0").read_bytes(), b"base cursor")
self.assertEqual((root / "libffi.so.8").read_bytes(), b"provider ffi")
def test_the_old_rootfs_layout_is_rebuilt(self):
self.fex_tool()
sniper = self.runtime()
FEX["materialize"](str(sniper))
self.graphics(sniper)
with mock.patch.dict(G, {"ROOTFS_LAYOUT": 5}):
with mock.patch.dict(G, {"ROOTFS_LAYOUT": 6}):
self.quiet(FEX["prepare"])
_, said = self.quiet(FEX["prepare"])
self.assertIn("built the x86 runtime", said)