flatpak / freedesktop-sdk-base

Yocto layer and build script for flatpak runtime base
8 stars 12 forks source link

Python compiled with UCS2 while UCS4 is used in virtually every Linux distro #18

Open aruiz opened 6 years ago

aruiz commented 6 years ago

UCS4 is a requirement for some 3rd party apps and I came across with the fact that the freedesktop runtime is built with UCS2 (the default in the Python sources)

Given that this is an ABI incompatible change I tried to investigate if there where any Flatpaks with CPython 2 modules that referred to UCS2 symbols, I'm attaching a list of those for the flathub and gnome repos.

I'm attaching the list of ELF objects linking to UCS2. I guess the only other risk here is an app dlopening and accessing those symbols manually, though chances are slim that's happening for this symbol family inside CPython specifically.

flathub.ucs2.txt gnome.ucs2.txt

aruiz commented 6 years ago

Summarizing from earlier, the apps affected are:

MyPaint (flathub)
Inkscape (flathub)
Flowblade (flathub)
Picard (flathub)
Digital (flathub)
d-feet (gnome)

And the runtimes shipping Python2.7 with UCS2 (all in flathub):

org.kde.Platform
org.freedesktop.Platform
org.freedesktop.Platform.Compat32
org.freedesktop.BasePlatform
org.gnome.Platform
org.gnome.Sdk
org.kde.Sdk
org.freedesktop.Sdk
org.freedesktop.BaseSdk
aruiz commented 6 years ago

For reference in case I compiled the list wrong, these are the scripts I ran to generate the list ( basically find ELF files in all flatpaks/runtimes & objdump), I ran this after installing all apps for both flathub and gnome repos on the flatpak dir:

for i in `find . -name active` ; do find $i/ -type f -exec file {} + | grep -i ELF | cut -d ":" -f 1 ; done > /tmp/actives.gnome
for i in `cat /tmp/actives.gnome` ; do if Foo=`ldd $i | tr "\n" " " | grep libpython2` ; then echo $i ; fi ; done > /tmp/actives.gnome.py2
for i in `cat /tmp/actives.gnome`; do if Foo=`objdump -T $i | grep UCS2` ; then echo $i ; objdump -T $i | grep UCS ; fi;done > /tmp/actives.gnome.py2.ucs2
alexlarsson commented 6 years ago

I believe these are all at least queued for building now.

aruiz commented 6 years ago

It seems to me like d-feet was not rebuilt, I don't see an update avaialable on my system at least though the runtime is new so it's broke atm.

TingPing commented 6 years ago

@aruiz Assuming you meant d-feet on flathub I just triggered a rebuild.

aruiz commented 6 years ago

yep!