From fc7c843180ee66016d898422969156ef62e54527 Mon Sep 17 00:00:00 2001
From: Simon McVittie <smcv@collabora.com>
Date: Thu, 18 Jul 2024 17:21:50 +0100
Subject: [PATCH] pv-runtime: Don't warn if library aliases are missing from
 secondary archs

Our older runtimes are symmetrical, so the vast majority of libraries
(and in particular, the ones that need aliases for an alternate SONAME)
are available for both x86_64 and i386.

However, in some of our newer runtimes like medic, we've started
dropping i386 libraries that don't strictly need to exist in order to
save some space. This means we can't necessarily assume that libraries
that need aliases will exist for every architecture, so we shouldn't
emit warnings if they turn out not to exist.

steamrt/tasks#367

Signed-off-by: Simon McVittie <smcv@collabora.com>
---
 pressure-vessel/runtime.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/pressure-vessel/runtime.c b/pressure-vessel/runtime.c
index bd119e12c..d08f39301 100644
--- a/pressure-vessel/runtime.c
+++ b/pressure-vessel/runtime.c
@@ -6375,11 +6375,21 @@ pv_runtime_handle_alias (PvRuntime *self,
       target = g_build_filename ("/lib", arch->details->tuple, soname, NULL);
       g_info ("Found %s in runtime's /lib: %s", soname, target);
     }
-  else
+  else if (arch->multiarch_index == PV_PRIMARY_ARCHITECTURE)
     {
       return glnx_throw (error, "The expected library %s is missing from both the runtime "
                          "and the \"overrides\" directory", soname);
     }
+  else
+    {
+      /* Not an error: for runtimes that only have full coverage of the
+       * primary architecture (in practice x86_64) and not secondary
+       * architectures (in practice i386), it's OK that e.g. libbz2.so.1.0
+       * only exists for the primary architecture */
+      g_debug ("%s not supported on secondary architecture %s by this runtime",
+               soname, arch->details->tuple);
+      return TRUE;
+    }
 
   target_base = glnx_basename (target);
 
-- 
GitLab