Skip to content

pressure-vessel: Improve handling of ~/.config, etc. being symbolic links

Simon McVittie requested to merge wip/task411 into main

steamrt/tasks#411

  • pv-wrap: Use a table of absolute paths that are shared like $HOME

    No functional change intended.

  • pv-wrap: Explicitly share ~/.config, etc. if sharing $HOME

    According to recent steamwebhelper issue reports, it's somewhat common for ~/.config to be a symbolic link to some other filesystem, in which case users will expect the target of the symlink to make it into the container.

    This commit only handles the case where an XDG environment variable is unset, resulting in us using its default. In fact we share the default directories unconditionally, because it's somewhat common for applications to ignore the environment variable and hard-code its default - so if we have XDG_CONFIG_HOME=$HOME/Config, it's safest for us to assume that both ~/Config and ~/.config are potentially needed.

    A separate commit will handle the case where the variable is set, which needs to happen in a different part of the codebase.

  • tests: Exercise ~/.config being a symlink

  • pv-wrap: Construct a SrtSysroot object for the real root

    No functional change intended.

  • pv-wrap: Stop using global state in pv_bind_and_propagate_from_environ()

    This will allow us to unit-test it.

    There is a very slight behaviour change here when running under FEX-Emu: previously we would test the existence of directories from the environment with g_file_test() (which looks in FEX-Emu's emulated root filesystem), but now we test for their existence in /proc/self/root. In practice we do not expect this to matter for any of the environment variables that are mentioned in pv_bind_and_propagate_from_environ().

  • wrap-setup test: Create and use a SrtSysroot

    No functional change intended.

  • wrap-setup test: Exercise pv_bind_and_propagate_from_environ()

  • pv-wrap: Explicitly share $XDG_CONFIG_HOME, etc. if sharing $HOME

    According to recent steamwebhelper issue reports, it's somewhat common for ~/.config to be a symbolic link to some other filesystem, in which case users will expect the target of the symlink to make it into the container.

    This commit only handles the case where an XDG environment variable is explicitly set. The case where it is unset (defaulting to ~/.config, etc.) was already handled in a previous commit.

    It is normal for $XDG_DATA_DIRS to contain /usr/local/share:/usr/share, and $XDG_CONFIG_DIRS might legitimately contain /usr paths too, so downgrade the usual warning about paths below /usr to a debug message for these particular variables.

  • wrap-setup test: Exercise environment variables that go along with $HOME

Edited by Simon McVittie

Merge request reports

Loading