On Fri, 18 Jan 2019 at 11:25:12 +0000, Simon McVittie wrote:
> On Fri, 18 Jan 2019 at 00:31:33 -0500, Michael Gilbert wrote:
> > so I don't see the value of the links Valve dumps in ~/.steam.
> 
> My understanding is that they are mostly a "filesystem API" that the
> Steamworks API (the part of Steam that gets copied into individual games)
> uses to locate the Steam installation.

I've checked on this and the answer is: yes, the symlinks in ~/.steam
(and its accompanying ~/.steampath and ~/.steampid) are a filesystem API
that external components rely on, so those unfortunately aren't going
away any time soon.

> > The two viable solutions I see are.  One, use a debian specific dir in
> > ~/.steam.
> 
> This would be a straightforward
> change after fixing #919467: the "# This is a new installation" code path
> currently says STEAMDIR="$HOME/.steam", and the patch on #916303 changes
> it to STEAMDIR="$XDG_DATA_HOME/.steam", but instead we could change it
> to STEAMDIR="$HOME/.steam/debian-installation-path" or something like
> that.

Valve developers say this would be OK, but we should use a directory
that they won't accidentally use for something else at some point in the
future (so not "install" or "data" or similar). Something like
~/.steam/debian-installation seems most appropriate.

I've updated https://salsa.debian.org/games-team/steam/merge_requests/1
to implement that (not tested yet); corresponding patch attached.
I hope that seems OK to you?

Before merging I'll make sure it does the right thing in a user account
that previously had the ~/.local/share/Steam setup, a user account that
previously had the ~/.steam setup, and a new user account.

> > Two, Valve moves completely to XDG_DATA_HOME.
> 
> I'll ask Valve developers to confirm whether the second is feasible.
> That seems like the ideal solution, but I suspect it isn't going to be
> possible, because of the pre-existing use of ~/.steam as a filesystem
> API/rendezvous point.

I asked, but this is not going to happen in the near future.

    smcv
>From fbd9db6e3cab81998b6b32ea7e56a9f71db8b5d8 Mon Sep 17 00:00:00 2001
From: Simon McVittie <s...@collabora.com>
Date: Wed, 16 Jan 2019 11:08:37 +0000
Subject: [PATCH] Install to a subdirectory of ~/.steam for new installations

As discussed on #916303, conflating $STEAMCONFIG with $STEAMDIR
breaks intended functionality, because $STEAMCONFIG/steam and
$STEAMDIR/steam are intended to have different purposes, and cannot
both work as intended if they collide.

Closes: #916303
Signed-off-by: Simon McVittie <s...@collabora.com>
---
 debian/scripts/steam | 26 ++++++++++++++------------
 1 file changed, 14 insertions(+), 12 deletions(-)

diff --git a/debian/scripts/steam b/debian/scripts/steam
index eaf08ee..81aec46 100644
--- a/debian/scripts/steam
+++ b/debian/scripts/steam
@@ -4,8 +4,8 @@
 
 # According to Valve, ~/.steam is intended to be a control directory containing
 # symbolic links pointing to the currently-running or most-recently-run Steam
-# installation, so that users can swap between multiple installations of the
-# Steam client by running /path/to/steam.sh.
+# installation. This is part of Steam's API, and is relied on by external
+# components.
 #
 # The shell variable name STEAMCONFIG matches what's used in Valve's
 # /usr/bin/steam (available at $STEAMDIR/bin_steam.sh in a Steam
@@ -23,12 +23,8 @@ if [ -L "$STEAMCONFIG/root" ] && ! [ -e "$STEAMCONFIG/root" ]; then
 fi
 
 # STEAMDIR points to the actual installation root: the equivalent of
-# C:\Program Files\Steam in the Windows Steam client. In Valve's setup
-# this is distinct from ~/.steam, usually ~/.local/share/Steam.
-#
-# The historical Debian behaviour has been to use ~/.steam as the installation
-# directory in addition to using it as the control directory, in an attempt
-# to reduce clutter in the home directory.
+# C:\Program Files\Steam in the Windows Steam client. To avoid filename
+# collisions this should be distinct from ~/.steam.
 #
 # The shell variable name STEAMDIR matches what's used in Valve's
 # /usr/bin/steam.
@@ -37,12 +33,18 @@ if [ -L "$STEAMCONFIG/steam" ]; then
 elif [ -L "$STEAMCONFIG/root" ]; then
     STEAMDIR="$(readlink -e -q "$STEAMCONFIG/root")"
 elif [ -d "$STEAMCONFIG/steam" ] && ! [ -L "$STEAMCONFIG/steam" ]; then
+    # The historical Debian behaviour has been to use ~/.steam as the
+    # installation directory in addition to using it as the control
+    # directory.This causes some file collisions, so we've moved away
+    # from that, but we can't easily disentangle this in existing
+    # installations.
     STEAMDIR="$HOME/.steam"
 else
-    # This is a new installation. We could either use $HOME/.steam or
-    # $XDG_DATA_HOME/Steam; see #916303 for discussion. For now behave
-    # as we historically did.
-    STEAMDIR="$HOME/.steam"
+    # This is a new installation, so use a distinct directory to avoid
+    # file collisions. Valve would use $XDG_DATA_HOME/Steam here.
+    # Debian uses a subdirectory of ~/.steam, to avoid having a mixture
+    # of XDG basedirs and traditional dotfiles in the same application.
+    STEAMDIR="$HOME/.steam/debian-installation"
 fi
 
 ubuntu32="$STEAMDIR/ubuntu12_32"
-- 
2.20.1

Reply via email to