[MDEV-26265] bintars depend on dynamic libraries Created: 2021-07-28 Updated: 2024-02-07 Resolved: 2023-09-20 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Packaging |
| Affects Version/s: | 10.5, 10.6 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Sergei Golubchik | Assignee: | Daniel Bartholomew |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
|
bintars depend on dynamic libraries. This is unavoidable, but generally it should have as few dependencies as possible. Avoidable dependencies seem to be
We should try to link them statically if possible. In particular the last one, it's a new dependency that 10.5 doesn't have. Also, lz4 could be statically compiled, so that we would have lz4-enabled bintars, to match the feature set of rpm and deb packages. |
| Comments |
| Comment by Sergei Golubchik [ 2021-07-28 ] | ||||||||||||
|
let's only do it in 10.5 and 10.6, as older bintars are already huge | ||||||||||||
| Comment by Hartmut Holzgraefe [ 2021-09-07 ] | ||||||||||||
|
This is not yet that much of a problem with Debian "bullseye" and Ubuntu "Focal" LTS, which switched to ncurses v6 as default, but still provide ncurses v5 shared libraries for backwards compatibility. On RHEL 8 / CentOS 8 on the other hand, ncurses v6 is now the default, and there are no backwards compatibility packages (at least not in the default repositories AFAICT) that would provide the v5 shared libraries. So on RHEL 8 / CentOS 8 it is not possible to use the command line client from the binary tarballs unless you manually copy over libncurses.5.so and libtinfo.5.so from a RHEL7/CentOS7 installation manually. | ||||||||||||
| Comment by Alexey Bychko (Inactive) [ 2021-09-10 ] | ||||||||||||
|
what we have to do if some platforms provide only dynamic libraries? compile custom ones or link dynamically? | ||||||||||||
| Comment by Alexey Bychko (Inactive) [ 2021-09-14 ] | ||||||||||||
|
checked ES 10.5, built AIO statically. preparing a patch | ||||||||||||
| Comment by Alexey Bychko (Inactive) [ 2021-09-14 ] | ||||||||||||
|
it will take time because different systems ship different libraries. what are the options:
| ||||||||||||
| Comment by Alexey Bychko (Inactive) [ 2021-09-15 ] | ||||||||||||
|
tested static libtinfo on centos-7 because of request from hholzgra 1 - it refuses to link with libtinfo.a from distribution, probably because of
and asking to recompile ncurses with -fPIC. 2 - client links just fine with recompiled ncurses, but it leads to following: seems aio and compression libraries may be linked statically without any negative side-effects | ||||||||||||
| Comment by Alexey Bychko (Inactive) [ 2021-09-17 ] | ||||||||||||
|
a macro + static AIO is here https://github.com/MariaDB/server/commit/4b622011127825f541eaceb3ee1c5ae25d022f42 | ||||||||||||
| Comment by Sergei Golubchik [ 2021-09-17 ] | ||||||||||||
|
I don't understand what you're doing. You can just build static versions of these libraries and put them where cmake can find them. It doesn't need any changes in cmake files. | ||||||||||||
| Comment by Alexey Bychko (Inactive) [ 2021-09-17 ] | ||||||||||||
|
unfortunately build ignores available static libraries. | ||||||||||||
| Comment by Alexey Bychko (Inactive) [ 2021-09-17 ] | ||||||||||||
|
as I realized after short discussion with Sergei - this ticket is not about static tarballs. | ||||||||||||
| Comment by Daniel Black [ 2021-09-17 ] | ||||||||||||
|
Can you also check mariadb-test isn't dynamicly linked against PCRE? | ||||||||||||
| Comment by Sergei Golubchik [ 2021-09-18 ] | ||||||||||||
|
no, that's unrelated. our bintars link with PCRE statically. The user clearly said that he installed mariadb-server-10.5 from out APT repo. There must be something strange with his prce2 library, looks like it's a non-debian build. | ||||||||||||
| Comment by Daniel Bartholomew [ 2021-09-22 ] | ||||||||||||
|
Updated the kvm-bintar-centos74-amd64 builder with the packages alexey prepared for installation under $HOME/local and ran a test build in buildbot. The static libaio did appear to work with `ldd mariadbd` no longer listing libaio as a dynamically loaded lib. But liblzma and liblz4 still appear to be dynamically linked in the `mariadbd` binary. In the build log there is output that says "Could NOT find LZ4", but it does at one point say it found lzma.h, but I'm guessing in that case it found the wrong one. The static ncurses also didn't work as the `mariadb` binary still reports it is dynamically linked to the system libncurses lib. Next I can try installing the libs under /usr/local instead of them being under $HOME/local and see if that helps. | ||||||||||||
| Comment by Daniel Bartholomew [ 2021-09-23 ] | ||||||||||||
|
I haven't been able to build a static ncurses that actually works. | ||||||||||||
| Comment by Sergei Golubchik [ 2021-10-08 ] | ||||||||||||
|
whoever installed liblz4.a on the centos7 bintar builder did it incorrectly. Now 10.7 bintar builds fail with
For MariaDB even static libraries have to be build with -fPIC, because they're linked into shared libraries. | ||||||||||||
| Comment by Daniel Bartholomew [ 2021-10-08 ] | ||||||||||||
|
The lz4 tarball I received from alexey didn't have a README, so I'm not sure how it was compiled. I've compiled a new static lz4 and uploaded it (and an associated README file) to hasky:/ds1819/vms-customizations/2021-09-17-centos7-amd64-misc-libs/ After updating the centos74 bintar build vm I kicked off a couple rebuilds of builds that had failed before and this time compiling was successful: | ||||||||||||
| Comment by Daniel Black [ 2021-10-13 ] | ||||||||||||
|
Is a static zstd possible for rocksdb (zstd >=1.1.3)?
This would resolve MDEV-13281 | ||||||||||||
| Comment by Daniel Bartholomew [ 2023-09-20 ] | ||||||||||||
|
I'm going to close this as 'done' for now. We can revisit and reopen, or create a new issue, later if necessary. | ||||||||||||
| Comment by Edward Stoever [ 2023-11-24 ] | ||||||||||||
|
I ran into this in a support ticket regarding Ubuntu. Recent releases do not include libncurses5 and libtinfo5. Solution tested on Ubuntu 20.04.6 LTS (Focal Fossa):
| ||||||||||||
| Comment by Dirk Hillbrecht [ 2024-02-07 ] | ||||||||||||
|
Please consider reopening this issue. Ubuntu 23.10 (and, as I understand, Debian newer than "Bookworm") does NOT include libncurses5 any more, so the MariaDB binary distribution becomes uninstallable out of the box on this distribution - and supposedly also on Ubuntu 24.04 LTS. You CAN circumvent the problem by installing libncurses5 from an older Ubuntu distribution as described in the comment above, but that's surely not sustainable. | ||||||||||||
| Comment by Daniel Black [ 2024-02-07 ] | ||||||||||||
|
Yes, with Or use containers. |