Linux desktop: optimized release build, installer, Linux gaps
Build: split Dart debug info out of libapp.so (13.96 -> 11.27 MB, symbols kept in the cache) and fix icon tree shaking, which Flutter 3.44's Linux CMake backend silently disables by quoting the define; the build image patches its SDK copy (MaterialIcons 1.6 MB -> 25 KB). Impeller cannot be enabled in a Linux release build and was slower in a profile-build bench. Install: `./install --linux --install` installs the bundle into <prefix>/lib/app-linux with com.pipelines.app.desktop (the GTK/Wayland app id), its icon and a ~/.local/bin/pipelines-app link, through scripts/install-linux-app.sh. Linux gaps: notifications through the freedesktop daemon; HTML artifacts explain the missing web view instead of throwing; no Share for files; a GTK clipboard reader for pasting files and screenshots (Ctrl+V and Omarchy's Super+V); GTK header bar only on GNOME; window icon. Bench: native fixture frame log, wheel/mark steps and tool/perf/linux_desktop_bench.py (private Xvfb); results in app/notes/linux-desktop-optimized.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -190,6 +190,51 @@ class DesktopBuildTests(unittest.TestCase):
|
||||
run = next(c for c in self.runner.calls if c[:2] == ["docker", "run"])
|
||||
self.assertIn("--dart-define=PIPELINES_UPDATE_PUBLIC_KEY=abc", run)
|
||||
|
||||
def test_linux_archive_leaves_split_debug_symbols_in_the_cache(self):
|
||||
bundle, archive = self.build("linux")
|
||||
(bundle / ".debug-info").mkdir()
|
||||
(bundle / ".debug-info/app.linux-x64.symbols").write_bytes(b"symbols")
|
||||
archive.unlink()
|
||||
archive = desktop._linux_archive(bundle)
|
||||
with tarfile.open(archive) as package:
|
||||
self.assertFalse([n for n in package.getnames() if ".debug-info" in n])
|
||||
self.assertIn("pipelines-linux-x64/pipelines-app", package.getnames())
|
||||
|
||||
def test_linux_install_runs_the_user_installer_with_the_prefix(self):
|
||||
_, archive = self.build("linux", install=True, prefix=self.root / "prefix")
|
||||
command = self.runner.calls[-1]
|
||||
self.assertEqual(command[0], "sh")
|
||||
self.assertTrue(command[1].endswith("install-linux-app.sh"))
|
||||
self.assertEqual(command[2], str(archive))
|
||||
with self.assertRaisesRegex(ValueError, "Linux client only"):
|
||||
self.build("macos", install=True)
|
||||
|
||||
def test_linux_installer_installs_bundle_icon_and_desktop_entry(self):
|
||||
_, archive = self.build("linux")
|
||||
home = self.root / "home"
|
||||
icon = self.root / "icon-bundle"
|
||||
# A bundle with its icon, as the Linux CMake install lays it out.
|
||||
with tarfile.open(archive) as package:
|
||||
package.extractall(icon, filter="data")
|
||||
(icon / "pipelines-linux-x64/data/app_icon.png").write_bytes(b"png")
|
||||
with tarfile.open(archive, "w:gz") as package:
|
||||
package.add(icon / "pipelines-linux-x64", arcname="pipelines-linux-x64")
|
||||
environment = {"HOME": str(home), "XDG_DATA_HOME": str(home / ".local/share"),
|
||||
"PATH": "/usr/bin:/bin"}
|
||||
with patch.dict(desktop.os.environ, environment, clear=True):
|
||||
desktop.install_linux(archive, runner=subprocess.run, prefix=home / "prefix")
|
||||
desktop.install_linux(archive, runner=subprocess.run, prefix=home / "prefix")
|
||||
target = home / "prefix/lib/app-linux"
|
||||
self.assertEqual((target / "pipelines-app").read_bytes(), b"linux-client")
|
||||
self.assertTrue((home / "prefix/lib/app-linux.previous/pipelines-app").is_file())
|
||||
entry = (home / ".local/share/applications/com.pipelines.app.desktop").read_text()
|
||||
self.assertIn(f"Exec={target}/pipelines-app\n", entry)
|
||||
self.assertIn("Icon=com.pipelines.app\n", entry)
|
||||
self.assertIn("StartupWMClass=com.pipelines.app\n", entry)
|
||||
self.assertTrue((home / ".local/share/icons/hicolor/512x512/apps/com.pipelines.app.png").is_file())
|
||||
self.assertEqual((home / ".local/bin/pipelines-app").resolve(), (target / "pipelines-app").resolve())
|
||||
self.assertFalse(list((home / "prefix/lib").glob(".app-linux-install.*")))
|
||||
|
||||
def test_desktop_server_prefill_rejects_embedded_credentials(self):
|
||||
with self.assertRaisesRegex(ValueError, "embedded credentials"):
|
||||
self.build("linux", server_url="wss://secret@example.com/connect")
|
||||
|
||||
Reference in New Issue
Block a user