Merge remote-tracking branch 'droiddeck/main' into HEAD

# Conflicts:
#	tools/linuxfs/overlay/usr/local/bin/droiddeck-fex
#	tools/tests/test_droiddeck_fex.py
This commit is contained in:
maxjivi05 committed 2026-11-15 10:38:06 -05:00
commit b36e5425d7
227 files changed
+12088 -1987

No files matched your search

+69 -4
View File
@@ -5,6 +5,7 @@ import json
import os
import runpy
import shutil
import stat
import struct
import subprocess
import sys
@@ -473,7 +474,6 @@ class PrepareTest(FexTestCase):
for name in names:
library = root / "lib" / arch / name
expected = sniper if name == "libwayland-cursor.so.0" else provider
self.assertEqual(library.resolve(), (expected / "files/lib" / arch / name).resolve())
self.assertEqual(library.read_bytes(), b"old ABI" if expected == sniper else b"new ABI " + name.encode())
self.assertEqual((root / "lib" / arch / "libffi.so.7").read_bytes(), b"old ffi")
self.assertEqual((sniper / "files/lib/x86_64-linux-gnu/libwayland-client.so.0").read_bytes(), b"old ABI")
@@ -591,8 +591,7 @@ class PrepareTest(FexTestCase):
fex, _ = self.quiet(FEX["prepare"])
for arch in ("x86_64-linux-gnu", "i386-linux-gnu"):
for name in names:
self.assertEqual((Path(fex["rootfs"]) / "lib" / arch / name).resolve(),
provider / "files/lib" / arch / name)
self.assertEqual((Path(fex["rootfs"]) / "lib" / arch / name).read_bytes(), b"new")
self.assertEqual((sniper / "files/lib" / arch / name).read_bytes(), b"base")
@unittest.skipUnless(shutil.which("cc"), "C compiler unavailable")
@@ -644,7 +643,7 @@ class PrepareTest(FexTestCase):
self.graphics(sniper)
base = self.write(sniper / "files/lib/x86_64-linux-gnu/libwayland-client.so.0", b"base wayland")
fex, _ = self.quiet(FEX["prepare"])
self.assertEqual((Path(fex["rootfs"]) / "lib/x86_64-linux-gnu/libwayland-client.so.0").resolve(), base)
self.assertEqual((Path(fex["rootfs"]) / "lib/x86_64-linux-gnu/libwayland-client.so.0").read_bytes(), b"base wayland")
def test_provider_symlinks_require_existing_targets_on_both_architectures(self):
self.fex_tool()
@@ -778,6 +777,72 @@ class PrepareTest(FexTestCase):
self.assertIn("built the x86 runtime", said)
self.assertNotIn("built the x86 runtime", self.quiet(FEX["prepare"])[1])
def test_the_built_x86_runtime_holds_nothing_that_leaves_it(self):
self.fex_tool()
sniper = self.runtime()
FEX["materialize"](str(sniper))
self.graphics(sniper)
os.chmod(sniper / "files/share/ca", 0o750)
self.quiet(FEX["prepare"])
root = (self.home / ".local/share/droiddeck-fex/rootfs").resolve()
self.assertEqual(stat.S_IMODE(os.stat(root / "share/ca").st_mode), 0o750)
entries = 0
for directory, dirs, files in os.walk(root):
for name in dirs + files:
path = Path(directory) / name
entries += 1
if path.is_symlink():
self.assertFalse(os.path.isabs(os.readlink(path)), path)
self.assertTrue(path.resolve().is_relative_to(root), path)
self.assertGreater(entries, 10)
self.assertEqual((root / "bin/[").read_bytes(), b"blob")
self.assertEqual((root / "share/ca/real.crt").read_bytes(), b"cert")
self.assertFalse(os.path.lexists(root / "ab"))
def test_guest_writes_do_not_mutate_runtime_blob_files(self):
self.fex_tool()
sniper = self.runtime()
FEX["materialize"](str(sniper))
self.graphics(sniper)
self.quiet(FEX["prepare"])
root = self.home / ".local/share/droiddeck-fex/rootfs"
marker = root / ".droiddeck-fex"
stamp = marker.read_text()
marker.write_text("3\n" + stamp.partition("\n")[2])
source = sniper / "files/ab/cdef-1.bin"
guest = root / "bin/["
guest.unlink()
os.link(source, guest)
self.assertEqual(os.stat(source).st_ino, os.stat(guest).st_ino)
self.assertIn("built the x86 runtime", self.quiet(FEX["prepare"])[1])
self.assertNotEqual(os.stat(source).st_ino, os.stat(guest).st_ino)
guest.write_bytes(b"guest mutation")
self.assertEqual(source.read_bytes(), b"blob")
self.assertEqual(guest.read_bytes(), b"guest mutation")
def test_a_rebuilt_x86_runtime_refreshes_the_steam_client_links_and_drops_read_only_trees(self):
self.fex_tool()
sniper = self.runtime()
FEX["materialize"](str(sniper))
self.graphics(sniper)
base = sniper / "files"
(base / str(self.home).lstrip("/") / ".steam").mkdir(parents=True)
os.symlink(self.steam / "linuxarm64", base / str(self.home).lstrip("/") / ".steam/sdk64")
self.write(self.steam / "linuxarm64/steamclient.so", elf(183))
os.chmod(base / "share/ca", 0o500)
self.addCleanup(os.chmod, base / "share/ca", 0o700)
self.quiet(FEX["prepare"])
rootfs = self.home / ".local/share/droiddeck-fex/rootfs"
os.chmod(rootfs / "share/ca", 0o000)
self.write(self.steam / "linux64/steamclient.so", elf(62))
self.write(self.steam / "linux32/steamclient.so", elf(3))
os.utime(self.steam / "steamapps/common/SteamLinuxRuntime_4/steamrt4_platform_4.0.20260928.262390/usr-mtree.txt.gz", ns=(1, 1))
self.assertIn("built the x86 runtime", self.quiet(FEX["prepare"])[1])
guest = rootfs / str(self.home).lstrip("/") / ".steam"
self.assertEqual(os.readlink(guest / "sdk64"), str(self.steam / "linux64"))
self.assertEqual(os.readlink(guest / "sdk32"), str(self.steam / "linux32"))
self.assertEqual(sorted(os.listdir(rootfs.parent)), ["config", "lock", "rootfs", "status.json"])
def test_a_runtime_that_is_not_newer_is_left_out(self):
self.fex_tool()
sniper = self.runtime()