Bug 1476905 - Fix bundling of libostree
Fix bundling of libostree
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: flatpak (Show other bugs)
7.4
Unspecified Unspecified
high Severity high
: rc
: ---
Assigned To: David King
Desktop QE
Tomas Capek
: ZStream
: 1484845 (view as bug list)
Depends On:
Blocks: 1499665
  Show dependency treegraph
 
Reported: 2017-07-31 14:48 EDT by Colin Walters
Modified: 2018-04-10 08:54 EDT (History)
12 users (show)

See Also:
Fixed In Version: flatpak-0.8.8-2.el7
Doc Type: Known Issue
Doc Text:
Incorrect dependency in _flatpak_ Due to a wrong dependency in the _flatpak_ package, the user can encounter the following error: flatpak: error while loading shared libraries: libostree-1.so.1: cannot open shared object file: No such file or directory To work around this problem, install the _flatpak-libs_ package. Alternatively, instead of initially installing just _flatpak_, install both of the packages by running: sudo yum -y install flatpak flatpak-libs
Story Points: ---
Clone Of:
: 1499665 (view as bug list)
Environment:
Last Closed: 2018-04-10 08:54:31 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
flatpak-bundling-7.4.patch (5.66 KB, patch)
2017-07-31 21:12 EDT, Colin Walters
no flags Details | Diff


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:0767 None None None 2018-04-10 08:54 EDT

  None (edit)
Description Colin Walters 2017-07-31 14:48:17 EDT
Right now flatpak carries
/usr/lib64/libostree-1.so.1 -> /usr/lib64/libostree-flatpak-1.so.1.0.0
which is going to break if the Extras repo is enabled.

Another consequence of this is that flatpak both Provides and Requires libostree-1.so.1(LIBOSTREE_2017.2)(64bit) etc.

We need to fix this by moving it into /usr/lib64/flatpak, set up the -rpath to point there, and using RPM provides filtering to ensure we don't provide it.  Compare with what rpm-ostree does for libdnf.
Comment 2 Colin Walters 2017-07-31 15:11:36 EDT
For anyone hitting this:

flatpak: error while loading shared libraries: libostree-1.so.1: cannot open shared object file: No such file or directory

The workaround is to:

yum -y install flatpak-libs

Or alternatively, everywhere you want to install flatpak, do instead:

sudo yum -y install flatpak flatpak-libs

I reproduced this on a Workstation install by doing:

$ sudo yum -y remove flatpak{,-libs}
$ ldconfig
$ sudo yum -y install flatpak
$ flatpak --help
flatpak: error while loading shared libraries: libostree-1.so.1: cannot open shared object file: No such file or directory
$ sudo yum -y install flatpak-libs
$ flatpak --help
  (works)

(The need to run `ldconfig` after removing it to reproduce things took
 me a while to understand, and only adds extra confusion here)
Comment 3 Colin Walters 2017-07-31 21:12 EDT
Created attachment 1307322 [details]
flatpak-bundling-7.4.patch

There are two patches here; one to work around an RPM build bug around versioned docdir.

The second is all of the fixes for bundling libostree.  I verified that things work both with and without ostree from Extras, and that `yum install flatpak` pulls in flatpak-libs.  I was a bit surprised to learn that /usr/bin/flatpak doesn't link against libflatpak.
Comment 5 Kalev Lember 2017-08-02 05:28:13 EDT
The patch look good to me. Thanks for the fixes, Colin! Also +1 from Alex (we're at GUADEC) who was the one who set up the libostree bundling in flatpak.

Will you take care of the builds too?
Comment 6 Jiri Koten 2017-08-25 08:36:12 EDT
*** Bug 1484845 has been marked as a duplicate of this bug. ***
Comment 10 Jeff MAURY 2017-10-23 08:47:08 EDT
It seems not be enough.
Adding flatpak-libs fixes the flatpak or flatpak --help
But I tried to run the following command:

sudo flatpak remote-add --if-not-exists eclipse https://fedorapeople.org/~mbooth/flatpak/eclipse.flatpakrepo

and got the response:
flatpak: symbol lookup error: flatpak: undefined symbol: g_strv_contains
Comment 11 Jiri Koten 2017-10-23 08:58:55 EDT
(In reply to Jeff MAURY from comment #10)
> It seems not be enough.
> Adding flatpak-libs fixes the flatpak or flatpak --help
> But I tried to run the following command:
> 
> sudo flatpak remote-add --if-not-exists eclipse
> https://fedorapeople.org/~mbooth/flatpak/eclipse.flatpakrepo
> 
> and got the response:
> flatpak: symbol lookup error: flatpak: undefined symbol: g_strv_contains

Can you please provide pkg version you have installed? The fix for bundled libsotree is in flatpak-0.8.7-2.el7_4 for rhel-7.4 ZStream and in flatpak-0.8.7-3.el7 for upcoming rhel-7.5.
Comment 12 Jeff MAURY 2017-10-23 09:26:40 EDT
I'm on RHEL 7.2 so flatpak is 0.8.7-1.el7
Comment 13 Jiri Koten 2017-10-23 09:33:21 EDT
(In reply to Jeff MAURY from comment #12)
> I'm on RHEL 7.2 so flatpak is 0.8.7-1.el7

That's strange, flatpak was a new pkg in rhel-7.4, so I'd guess that's actually the release you are using. Anyway you can wait for the ZStream update (due 2017-Nov-30) or install any of the pkgs mentioned in c#11.

To be clear there is more to the fix, than just adding hard deps. on flatpak-libs.
Comment 14 Jeff MAURY 2017-10-23 09:43:19 EDT
Only 0.8.7-1.el7 is available through rhel-7-server-rpms/7Server/x86_64
Comment 20 errata-xmlrpc 2018-04-10 08:54:31 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:0767

Note You need to log in before you can comment on or make changes to this bug.