Skip to content

Make pressure-vessel responsible for unpacking runtimes

Simon McVittie requested to merge wip/unpack-runtimes into master

At the moment SteamLinuxRuntime is responsible for unpacking runtimes. I want to move this into pressure-vessel C code, so that we have better error-handling, more comprehensible locking, and fewer shell scripts.

steamlinuxruntime!32 (merged) is the other side of this.

I've done some brief testing, but additional testing is always welcome!


  • wrap: Generalize --copy-runtime-into into --variable-dir

    At the moment the only use for the variable directory is for --copy-runtime-into, but in future we will also use it to unpack temporary runtime archives.

  • tests: Exercise --copy-runtime instead of --copy-runtime-into

  • runtime: Fix locking behaviour in variable directory

    We need to hold an exclusive lock while carrying out GC, because any number of processes could be trying to create temporary copies there at the same time, and if that's happening then it's unsafe for the GC pass to be looking at the temporary copies concurrently. Only do the GC pass opportunistically, if we can get an exclusive lock without waiting.

    Conversely, while we're creating the temporary copies, we continue to take out a non-exclusive lock; but if another process is in the middle of a GC pass, we want to wait for it instead of just failing.

  • pressure-vessel: Drop redundant checks for variable directory

    pv_runtime_init_variable_dir() creates it if it doesn't already exist, so we don't need to check that it already exists, which in turn means we don't need to pre-create it in main().

  • pressure-vessel: Add support for unpacking runtimes from an archive

    Previously, this was done by the deploy-runtime script in SteamLinuxRuntime. Moving it into C code gives us better error handling and more reliable locking.

  • tests: Add coverage for unpacking runtimes from archives

  • runtime: Automatically derive runtime ID from -buildid.txt

  • pressure-vessel-test-ui: List archives as possible runtimes

  • runtime: Delay garbage-collection a bit

    If we want to delete outdated temporary deployment directories such as deploy-soldier_x.y.z, then we have to wait until we have decided which one is current, so we can avoid deleting that one.

  • runtime: Garbage-collect old deployment directories

  • tests: Exercise GC of old deployment directories

  • runtime: Factor out pv_runtime_maybe_garbage_collect_subdir

  • pv-wrap: Implement garbage collection for paths used by the shell scripts

    This is opt-in: the idea is that the shell scripts will enable this option when they switch from doing deployment themselves to letting the C code do it.

    The soldier and scout names are hard-coded, because those are the only legacy runtimes that have ever had public releases.

  • tests: Avoid shadowing a variable of a different type

    We used 'var' to mean both the path to the ./var directory, and an object representing an environment variable.

  • tests: Exercise garbage-collection of legacy runtimes

  • wrap: Automatically enable --copy-runtime if running under Flatpak

  • runtime: Clean up dangling symlinks to scout or soldier

  • tests: Assert that no file descriptors are leaked

  • runtime: Unpack detached debug symbols if they accompany a runtime archive

  • runtime: If verbose, tell tar to be verbose while unpacking

Edited by Simon McVittie

Merge request reports