public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Yaakov Selkowitz <yselkowi@redhat.com>
To: git-commits@fedoraproject.org
Subject: [flatpaks/flatpak-runtime] f45: Enable dynamic ld.so.cache generation
Date: Fri, 11 Sep 2026 14:43:17 GMT	[thread overview]
Message-ID: <178913779720.1.10280298971481748480.flatpaks-flatpak-runtime-6ee92432cce0@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : flatpaks/flatpak-runtime
            Branch : f45
            Commit : 6ee92432cce0bab8b815b06175dacedc56407af0
            Author : Yaakov Selkowitz <yselkowi@redhat.com>
            Date   : 2026-03-02T21:12:38-05:00
            Stats  : +10/-2 in 2 file(s)
            URL    : https://src.fedoraproject.org/flatpaks/flatpak-runtime/c/6ee92432cce0bab8b815b06175dacedc56407af0?branch=f45

            Log:
            Enable dynamic ld.so.cache generation

Using LD_LIBRARY_PATH for adding to the default library search path is not
always reliable, as sometimes subprocesses may be launched without this
environment variable, which may cause it to fail if it needs libraries
outside of the runtime.

Instead, we should follow the lead of Flathub flatpaks, and use dynamic
ld.so.cache generation instead.  This automatically creates (or updates) a
cache file in ~/.var/app/$APP_ID/.ld.so/ based on the runtime, app, and any
extensions, and works even for subprocesses with a limited environment.

To implement this, in addition to the changes here, flatpak-runtime-config
includes a more extensive ld.so.conf.d snippet:

https://src.fedoraproject.org/rpms/flatpak-runtime-config/c/641ea400561c1c79405c4e88aa248c8add914e19?branch=f41

This is necessary because the feature requires ldconfig in /bin (where we
still have a separate /sbin), and the code is not designed to handle
/etc/ld.so.conf.d/*.conf.  This also allows %_sysconfdir/ld.so.conf.d to
work for both RPM builds and flatpak apps rather than having to defining
--env=LD_LIBRARY_PATH in the app too.

https://github.com/flatpak/flatpak/blob/1.15.12/common/flatpak-run.c#L2663
https://github.com/flatpak/flatpak/blob/1.15.12/common/flatpak-run.c#L3083

Fixes: rhbz#2272376

---
diff --git a/container-sdk.in.yaml b/container-sdk.in.yaml
index 9a9a943..6da6cd3 100644
--- a/container-sdk.in.yaml
+++ b/container-sdk.in.yaml
@@ -8,7 +8,6 @@ flatpak:
     finish-args: >
         --env=GI_TYPELIB_PATH=/app/lib64/girepository-1.0
         --env=GST_PLUGIN_SYSTEM_PATH=/app/lib64/gstreamer-1.0:/usr/lib64/gstreamer-1.0
-        --env=LD_LIBRARY_PATH=/app/lib64
         --env=LUA_PATH="/app/share/lua/5.4/?.lua;/app/share/lua/5.4/?/init.lua;/app/lib64/lua/5.4/?.lua;/app/lib64/lua/5.4/?/init.lua;;"
         --env=LUA_CPATH="/app/lib64/lua/5.4/?.so;;"
         --env=PATH=/app/sbin:/app/bin:/usr/sbin:/usr/bin
@@ -45,6 +44,11 @@ flatpak:
         mv -f /usr/bin/flatpak-xdg-email /usr/bin/xdg-email
         mv -f /usr/bin/flatpak-xdg-open /usr/bin/xdg-open
 
+        # enable dynamic ld.so.cache generation
+        [ -e /usr/bin/ldconfig ] || ln -s ../sbin/ldconfig /usr/bin/ldconfig
+        cat /etc/ld.so.conf.d/*.conf > /etc/ld.so.conf
+        rm -f /etc/ld.so.conf.d/*.conf
+
         # Create a directory for mounting extension points
         mkdir -p /usr/lib64/GL
         mkdir -p /usr/lib64/openh264

diff --git a/container.in.yaml b/container.in.yaml
index 487e896..cb7fcfe 100644
--- a/container.in.yaml
+++ b/container.in.yaml
@@ -8,7 +8,6 @@ flatpak:
     finish-args: >
         --env=GI_TYPELIB_PATH=/app/lib64/girepository-1.0
         --env=GST_PLUGIN_SYSTEM_PATH=/app/lib64/gstreamer-1.0:/usr/lib64/gstreamer-1.0
-        --env=LD_LIBRARY_PATH=/app/lib64
         --env=LUA_PATH="/app/share/lua/5.4/?.lua;/app/share/lua/5.4/?/init.lua;/app/lib64/lua/5.4/?.lua;/app/lib64/lua/5.4/?/init.lua;;"
         --env=LUA_CPATH="/app/lib64/lua/5.4/?.so;;"
         --env=PATH=/app/sbin:/app/bin:/usr/sbin:/usr/bin
@@ -46,6 +45,11 @@ flatpak:
 
         rm -rf /etc/flatpak-builder/
 
+        # enable dynamic ld.so.cache generation
+        [ -e /usr/bin/ldconfig ] || ln -s ../sbin/ldconfig /usr/bin/ldconfig
+        cat /etc/ld.so.conf.d/*.conf > /etc/ld.so.conf
+        rm -f /etc/ld.so.conf.d/*.conf
+
         # Create a directory for mounting extension points
         mkdir -p /usr/lib64/GL
         mkdir -p /usr/lib64/openh264

                 reply	other threads:[~2026-09-11 14:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178913779720.1.10280298971481748480.flatpaks-flatpak-runtime-6ee92432cce0@fedoraproject.org \
    --to=yselkowi@redhat.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox