Skip to content

Look for vulkaninfo, wflinfo in SRT_HELPERS_PATH

Simon McVittie requested to merge wip/smcv/find-helpers-nearby into master

Part of https://phabricator.collabora.com/T17169, probably easiest to review commit-by-commit.

If there are issues with merging the whole branch, any prefix could be merged. In particular, the first two commits would make sense to cherry-pick even if the rest of the branch is stalled; please let me know.

/cc @denittis @jpwhiting


  • library: Use INTERNAL_ERROR for assertion failure

    CANNOT_LOAD is a misleading result for an invalid symbols file format.

  • graphics: Set CANNOT_DRAW if we cannot run check-vulkan

    Previously we used CANNOT_LOAD here, but that seems wrong. If we can run check-vulkan, but it immediately crashes, we would use CANNOT_DRAW; let's use the same result if we cannot run it.

  • _srt_get_helpers_path: Raise a GError

    This function initially always returned a non-NULL path even in error conditions, but having structured error handling in all callers lets us make it "failable".

  • _srt_get_helpers_path: Rename global variable

    This gets it out of the way of a future function that takes a helpers_path argument.

  • graphics: Reduce duplication

    The GLESv2 and GL cases for _argv_for_graphics_test() are essentially the same, so take advantage of that.

  • library, locale: Factor out _srt_get_helper

    Instead of using a single helper path, return an argv-style array to which the caller can append their own arguments. This will allow us to absorb support for prepending things like timeout(1).

  • _srt_get_helper: Add support for wrapping executable in timeout(1)

    This is basically the same as !46 (merged).

  • _srt_get_helper: Add support for searching the PATH

    We have two broad classes of helper:

    • Helpers from this source package, normally found in /usr/libexec/steam-runtime-tools-0
    • Tools we have repurposed from other source packages (wflinfo and vulkaninfo) found via the $PATH

    For the former class, our behaviour is unchanged.

    To support the latter class, a caller can now set the SEARCH_PATH flag.

  • architecture: Use _srt_get_helper

  • graphics: Use _srt_get_helper

  • _srt_get_helpers_path: Demote from internal to static

  • utils: Always look in helpers directory before PATH

    Previously, we always looked for vulkaninfo and wflinfo in the PATH. Now we look in the helpers directory, and only search the PATH if the necessary executable isn't there.

    This enables us to ship relative symlinks from the helpers directory /usr/libexec/steam-runtime-tools-0 to an adjacent /usr/bin directory, so that if the Steam Runtime is relocated to (for example) .../steam-runtime, we will find vulkaninfo and wflinfo in .../steam-runtime/usr/bin.

  • d/rules: Create symlinks for *-wflinfo, *-vulkaninfo in helpers path

    This will help us to locate those executables in the Steam Runtime usr/bin directory, even when run without that directory in PATH.

Edited by Simon McVittie

Merge request reports