From d7f4ef89b50861696a6fc2d74d29aabbed8c391b Mon Sep 17 00:00:00 2001 From: SulfurNitride Date: Mon, 16 Mar 2026 08:43:40 -0500 Subject: Fix stale symlink check in ensureBundledPluginsLinked for /var/home distros On Bazzite (and other Fedora immutable distros), /home/ is a symlink to /var/home/. This caused the symlink staleness check to always fail when desktop mode and game mode resolved $HOME differently, deleting and re-creating plugin symlinks on every game-mode launch. If re-creation failed (e.g. race or gamescope restriction), libbasic_games.so would be missing from the per-instance plugin dir, producing the "game plugin 'Oblivion Remastered' doesn't exist" (PluginGone) error. Fix: use canonicalFilePath() on both sides of the comparison so paths that differ only by symlink component (/home/ vs /var/home/) compare equal. Co-Authored-By: Claude Sonnet 4.6 --- src/src/plugincontainer.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/src/plugincontainer.cpp b/src/src/plugincontainer.cpp index aa11f6c..c7e39e9 100644 --- a/src/src/plugincontainer.cpp +++ b/src/src/plugincontainer.cpp @@ -40,7 +40,13 @@ static void ensureBundledPluginsLinked(const QString& bundledDir, if (targetInfo.isSymLink()) { // Already a symlink — check if it points to the right place. - if (targetInfo.symLinkTarget() == QFileInfo(it.filePath()).absoluteFilePath()) { + // Use canonicalFilePath() on both sides so /home/ ↔ /var/home/ symlinks + // (Bazzite/Fedora immutable distros) don't cause false stale-symlink + // replacements that can delete the .so before re-linking it. + const QString existingTarget = + QFileInfo(targetInfo.symLinkTarget()).canonicalFilePath(); + const QString expectedTarget = QFileInfo(it.filePath()).canonicalFilePath(); + if (!expectedTarget.isEmpty() && existingTarget == expectedTarget) { continue; // correct symlink, nothing to do } // Stale symlink pointing elsewhere — replace it. -- cgit v1.3.1