Skip to content

Draft: Optionally generate a single tarball with everything for the SteamLinuxRuntime_whatever depots

Simon McVittie requested to merge wip/task375 into main
  • populate-depot: Tidy up some weird nesting

  • populate-depot: Take depot ID as an optional parameter

  • populate-depot: Use PEP-526 (var: Type = value) syntax

    This was supported in Python 3.6, which is our minimum version, and we already used PEP-526 syntax in some places.

    The Python-3.5-compatible # type: Type comments result in "unused import" warnings with recent pyflakes versions, which are avoided by this change.

  • populate-depot: Optionally generate Steampipe upload configuration

    This makes the generated depot self-contained, without needing to rely on the depot being written to a directory named depot with a copy of subprojects/container-runtime/steampipe next to it.

  • populate-depot: Optionally generate an archive

  • scout-layered: Generate SteamLinuxRuntime.tar.xz

    This is a more direct form of what we want in the depot than steam-container-runtime.tar.gz.

  • tests: Generate a depot archive for sniper

  • populate-depot: Generate a script to unpack and launch SLR

    This allows for standalone use of SLR from a small number of files including a compressed tarball, which is more convenient in some use-cases (although less disk-space-efficient than Steampipe).

    Usage:

    • put SteamLinuxRuntime_sniper.sh in a directory
    • put SteamLinuxRuntime_sniper.tar.xz in the same directory
    • put SteamLinuxRuntime_sniper.VERSIONS.txt in the same directory
    • run, e.g., /path/to/SteamLinuxRuntime_sniper.sh -- xterm

    @RUNTIME@ is replaced by a string identifying the specific SLR version we are working with, which in practice would be SteamLinuxRuntime_sniper. Future runtime versions should switch to using SteamLinuxRuntime_4 or similar.

    Instead of requiring a sidecar file with a MD5 checksum of the archive like we do for scout and heavy, we now rely on the archive itself having reasonable detection of accidental modification (a CRC or similar), and use VERSIONS.txt as the check for whether our unpacked directory is the version we wanted to be using. MD5 is no longer considered to be a cryptographically strong hash, so it would not be sufficient for detecting malicious modification in any case.

    As an additional integrity check, if run with the --validate option, the wrapper script will run pv-verify. This is not particularly fast (around 20 seconds on HDD with a cold cache, around 3 seconds with warm cache).

    As an optimization, if the script is run with for example

      /path/to/SteamLinuxRuntime_sniper.sh \
          --try-runtime=/path/to/steamapps/common/SteamLinuxRuntime_sniper \
          -- xterm

    then it will check whether the path passed to --try-runtime has the desired version number (there is no validation beyond a simple comparison of VERSIONS.txt). If yes, it will use that instead of unpacking a new copy, saving around 700M in the case of sniper.

    Compared with the prototype provided in steamrt/tasks#375, this one is somewhat more defensively-coded, with "|| true" on commands where we can tolerate failure (inspecting compressed files, running zenity) in an attempt to make it maximally robust.

    Helps: steamrt/tasks#375, steamrt/tasks#376

Edited by Simon McVittie

Merge request reports