Skip to content
Snippets Groups Projects
Commit c1730a36 authored by Simon McVittie's avatar Simon McVittie
Browse files

scout-on-soldier: Do our own pinning instead of running setup.sh


Because scout and soldier are relatively fixed targets, and we know that
soldier is strictly newer than scout, we don't need to go to all this
effort to figure out which libraries are newer if they exist in both
scout and soldier: the answer is always "the one in soldier".

This means the only library we need to pin is the single library that
is hard-coded to be pinned, namely libcurl.so.4, for which the ABI broke
between scout and soldier.

Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
parent b4bccb11
No related branches found
No related tags found
1 merge request!55populate-depot: Fix and test layered runtime
...@@ -131,8 +131,11 @@ main () { ...@@ -131,8 +131,11 @@ main () {
[ -z "$verbose" ] || log "Using default scout runtime ${src}" [ -z "$verbose" ] || log "Using default scout runtime ${src}"
fi fi
# Note that this only works because setup.sh and run.sh do not take # Note that this only works because run.sh does not take the
# the $(realpath) of their $0. # $(realpath) of its $0, and because we are no longer using setup.sh,
# which uses the equivalent of $(find ${top} -type l -name '*.so*')
# to list the libraries in the runtime (which wouldn't recurse into
# the subdirectories of var/steam-runtime in our case).
runtime="${here}/var/steam-runtime" runtime="${here}/var/steam-runtime"
mkdir -p "$runtime" mkdir -p "$runtime"
...@@ -146,8 +149,6 @@ main () { ...@@ -146,8 +149,6 @@ main () {
if [ "$ours" != "$theirs" ]; then if [ "$ours" != "$theirs" ]; then
[ -z "$verbose" ] || log "scout runtime switched from '$ours' to '$theirs'" [ -z "$verbose" ] || log "scout runtime switched from '$ours' to '$theirs'"
rm -fr "$runtime"
mkdir -p "$runtime"
printf '%s\n' "$theirs" > "$runtime/version.txt" printf '%s\n' "$theirs" > "$runtime/version.txt"
else else
[ -z "$verbose" ] || log "scout runtime version '$ours'" [ -z "$verbose" ] || log "scout runtime version '$ours'"
...@@ -159,21 +160,54 @@ main () { ...@@ -159,21 +160,54 @@ main () {
ln -fns "$src/run.sh" "$runtime/" ln -fns "$src/run.sh" "$runtime/"
ln -fns "$src/setup.sh" "$runtime/" ln -fns "$src/setup.sh" "$runtime/"
ln -fns "$src/usr" "$runtime/" ln -fns "$src/usr" "$runtime/"
mkdir -p "$runtime/pinned_libs_32"
# Make sure pinning is up to date mkdir -p "$runtime/pinned_libs_64"
error=0
[ -z "$verbose" ] || log "$runtime/setup.sh..." # We know exactly what's in the soldier and scout runtimes, and we
# know soldier is strictly newer in all cases, so the only libraries
if [ -n "$verbose" ]; then # we need to pin are those that we have hard-coded to be pinned;
"$runtime/setup.sh" >&2 || error="$?" # so we don't need to run setup.sh, and can do something more
else # abbreviated.
"$runtime/setup.sh" > /dev/null || error="$?"
fi # libcurl in the Steam Runtime is internally identified
# as libcurl.so.4, but with a symlink at libcurl.so.3
if [ "$error" != 0 ]; then # as a result of some unfortunate ABI weirdness back in
log "Error: setup.sh failed with exit status $error" # 2007. It also has Debian-specific symbol versioning as a
exit "$error" # result of the versioned symbols introduced as a
fi # Debian-specific change in 2005-2006, which were preserved
# across the rename from libcurl.so.3 to libcurl.so.4, not
# matching the versioned symbols that upstream subsequently
# added to libcurl.so.4; as a result, a system libcurl.so.4
# probably isn't going to be a drop-in replacement for our
# libcurl.
#
# Debian/Ubuntu subsequently (in 2018) switched to a SONAME
# and versioning that match upstream, but the Steam Runtime
# is based on a version that is older than that, so anything
# built against the Steam Runtime will expect the old SONAME
# and versioned symbols; make sure we use the Steam Runtime
# version.
ln -fns "$src/usr/lib/x86_64-linux-gnu/libcurl.so.4" \
"$runtime/pinned_libs_64/libcurl.so.4"
ln -fns "$src/usr/lib/i386-linux-gnu/libcurl.so.4" \
"$runtime/pinned_libs_32/libcurl.so.4"
# The version of libcurl.so.4 in the Steam Runtime is actually
# binary-compatible with the older libcurl.so.3 in Debian/Ubuntu,
# so pin it under both names.
ln -fns "$src/usr/lib/x86_64-linux-gnu/libcurl.so.4" \
"$runtime/pinned_libs_64/libcurl.so.3"
ln -fns "$src/usr/lib/i386-linux-gnu/libcurl.so.4" \
"$runtime/pinned_libs_32/libcurl.so.3"
# Deliberately not pinning libcurl-gnutls.so.[34]: soldier has a
# newer version of those, which is believed to be compatible with the
# ones in scout.
# Deliberately not pinning 32-bit libgtk-x11-2.0.so.0,
# libdbusmenu-gtk.so.4, libdbusmenu-glib.so.4, libdbus-1.so.3:
# in the normal scout runtime those are pinned for the benefit of the
# Steam client itself, but let's try keeping 32-bit games consistent
# with 64-bit games.
if [ -n "$saved_ld_preload" ]; then if [ -n "$saved_ld_preload" ]; then
case "$1" in case "$1" in
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment