[neon/snap-packaging/plasma-core-desktop] /: Setting SNAP to "" isn't enough, so nuke it in the systemd env

Kevin Ottens null at kde.org
Wed May 29 14:20:38 BST 2024


Git commit 0bc93aec7da9ff3af38769240d37ed4a5ff7110c by Kevin Ottens.
Committed on 29/05/2024 at 11:51.
Pushed by ervin into branch 'master'.

Setting SNAP to "" isn't enough, so nuke it in the systemd env

If it is set, even if empty, Qt will attempt to load the
xdg-desktop-portal platform theme plugin. This is definitely not what we
want... especially for KWin where this would lead to a dead lock.

M  +1    -1    hooks/006-zzz-add-plasma-session.chroot
A  +27   -0    static/usr/bin/cleanup-activation-environment.sh

https://invent.kde.org/neon/snap-packaging/plasma-core-desktop/-/commit/0bc93aec7da9ff3af38769240d37ed4a5ff7110c

diff --git a/hooks/006-zzz-add-plasma-session.chroot b/hooks/006-zzz-add-plasma-session.chroot
index ffd5cae..861b782 100755
--- a/hooks/006-zzz-add-plasma-session.chroot
+++ b/hooks/006-zzz-add-plasma-session.chroot
@@ -76,7 +76,7 @@ PartOf=graphical-session.target
 Before=plasma-kwin_wayland.service
 
 [Service]
-ExecStart=dbus-update-activation-environment --systemd SNAP="" _KDE_APPLICATIONS_AS_FORKING=1
+ExecStart=/usr/bin/cleanup-activation-environment.sh
 Type=oneshot
 Slice=session.slice
 EOF
diff --git a/static/usr/bin/cleanup-activation-environment.sh b/static/usr/bin/cleanup-activation-environment.sh
new file mode 100755
index 0000000..8978473
--- /dev/null
+++ b/static/usr/bin/cleanup-activation-environment.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+
+set -x
+
+dbus-update-activation-environment --systemd SNAP="" _KDE_APPLICATIONS_AS_FORKING=1
+
+systemctl --user unset-environment \
+    SNAP \
+    SNAP_ARCH \
+    SNAP_COMMON \
+    SNAP_CONTEXT \
+    SNAP_COOKIE \
+    SNAP_DATA \
+    SNAP_EUID \
+    SNAP_INSTANCE_KEY \
+    SNAP_INSTANCE_NAME \
+    SNAP_LIBRARY_PATH \
+    SNAP_NAME \
+    SNAP_REAL_HOME \
+    SNAP_REEXEC \
+    SNAP_REVISION \
+    SNAP_SAVE_DATA \
+    SNAP_UID \
+    SNAP_USER_COMMON \
+    SNAP_USER_DATA \
+    SNAP_VERSION
+


More information about the Neon-commits mailing list