termux / termux-packages

A package build system for Termux.
https://termux.dev
Other
13.09k stars 3k forks source link

[Bug]: auto-updater script should compare soversion of old and newly-built libs #18024

Open twaik opened 1 year ago

twaik commented 1 year ago

Problem description

Currently auto-updater bot simply check if the build succeeds, but in the case if library changes it's soversion reverse dependencies will be broken.

What steps will reproduce the bug?

Nothing, auto-updater bot does it on its own.

What is the expected behavior?

No response

System information

No response

Grimler91 commented 1 year ago

This would indeed be a good improvement

twaik commented 1 year ago

Also it will allow us to avoid writing SOVERSION guards like this.

twaik commented 1 year ago

@Grimler91 Can we cache and save somewhere build folder? I think it will be usable to make something like make test for reverse dependencies of packages to make sure them really work with updated packages and there are no undefined reference to errors or segmentation faults after packages upgrades. Maybe we can create something like additional apt repo only for CI with these saved packages caches.

licy183 commented 1 year ago

It is hard to implement it. There is no common way to get SOVERSION for a package. Maybe it is possible to implement a function named termux_step_check_soversion, and make this function overridable. Maintainers should write a function to get and check it.

By the way, only a little packages enable SOVERSION in their soname, to get rid of the conflict with system libraries, such as libglvnd and libxml2. cmake and other configure tools disable it to let some other tools (such as Android Studio) find them, because only files with suffix .so will be packaged in APK. We don't package libraries in APK, so I think it is possible for us to enable SOVERSION for every libraries.

twaik commented 1 year ago

It is hard to implement it.

Actually it is pretty easy. Auto-updater script can download old package and compare libraries with SOVERSION in $PREFIX/lib with current build environment.

It will not affect libraries that do not support SOVERSION.

licy183 commented 1 year ago

I still don't think it is necessary to do this. Only a little packages enable SOVERSION in their soname. You can list them with apt-file. As the auto updater always try to build a package before committing, adding SOVERSION check in termux_step_pre_configure will do the same thing.

```bash $ apt-file search ".so." | cut -d: -f1 | sort | uniq aalib ardour argon2 aspell aubio audacious audacity-ffmpeg binutils-cross binutils-libs busybox calc chicken coinor-clp cryptopp cups eglinfo-system electric-fence emscripten-llvm ffmpeg ffplay florence fltk freeimage gauche ghostscript giflib glew glpk gpac gstreamer gtk3-nocsd guile18 hoedown htslib ipv6calc krb5 libart-lgpl libasm libburn libbz2 libcaca libcanberra libcap libcdk libcoinor-osi libcoinor-utils libczmq libdebuginfod libdw libelf libexpat libfreexl libgfshare libglade libglvnd libgnomecanvas libgnustep-base libheif libicu libimagequant libiniparser libisoburn libisofs libjpeg-turbo liblqr liblua51 liblua52 liblua53 liblua54 libluajit liblz4 liblzma libmad libmcrypt libmhash libmp3splt libnettle libnewt liboggz libotr libpcap libraptor2 librasqal librav1e libsoldout libsophia libspatialite libspice-server libstemmer libtalloc libtdb libtheora libthread-db libtreesitter libvo-amrwbenc libvpx libx11 libx264 libxdrfile libxml2 libxrender libxtst libzita-convolver lowdown ltrace lzlib menu-cache mesa mimetic natpmpc ncurses ncurses-ui-libs netpbm notmuch ocl-icd oorexx openssl openssl-1.1 ossp-uuid panda3d plotutils portaudio postgresql pulseaudio python python2 qcustomplot qscintilla qt-creator qt5-qtbase qt5-qtdeclarative qt5-qtlocation qt5-qtmultimedia qt5-qtquickcontrols2 qt5-qtscript qt5-qtsensors qt5-qtserialport qt5-qtsvg qt5-qttools qt5-qtwebchannel qt5-qtwebengine qt5-qtwebsockets qt5-qtx11extras qt5-qtxmlpatterns qt5ct radare2 readline rhash rtmpdump ruby samba sdl-image sdl-mixer sdl-net sdl-ttf sdl2-gfx sdl2-image sdl2-mixer sdl2-net sdl2-ttf slang sox startup-notification stfl ta-lib tsocks utf8proc vamp-plugin-sdk vulkan-loader-android vulkan-loader-generic wasmer wkhtmltopdf wxwidgets xcb-util-keysyms xcb-util-renderutil xcb-util-wm xdotool xvidcore xxhash zlib zstd ```