Skip to content

pressure-vessel: Avoid sitting on original stdout file descriptor

Simon McVittie requested to merge wip/divert-stdout into main

See https://github.com/ValveSoftware/steam-runtime/issues/593 for bug report.


  • pv-adverb: Use an autofreed array to implement pass_fds

    The code gets simpler if we always allocate and free this, with it owning the fds directly.

  • pv-adverb: Add --assign-fd

    We'll use this in pv-wrap in a subsequent commit.

  • pv-wrap: Let pv-adverb restore our original stdout/stderr

    This allows us to pass a harmless stdout/stderr to bwrap, which will hold them open in its supervisor process, preventing processes inside the container from signalling EOF on those file descriptors.

    In particular, this lets a caller use

      pv-wrap --launcher -- --info-fd=1 --bus-name=...

    and read from fd 1 until EOF to detect that launcher-service is ready, without bwrap holding the fd open and therefore preventing EOF detection.

    A side benefit of this is that if we opened a structured logging file descriptor as our stdout/stderr, then pv-wrap (and not the game itself) will be "blamed" for any messages that bubblewrap emits from its stdout/stderr - which seems reasonable, since pv-wrap is using bubblewrap as an implementation detail.

    Solution for https://github.com/ValveSoftware/steam-runtime/issues/593

    Helps: https://github.com/Matoking/protontricks/issues/231

Merge request reports