[MDEV-16525] MyRocks linking fails with: Undefined reference to `ZDICT_trainFromBuffer' Created: 2018-06-19 Updated: 2022-03-25 Resolved: 2018-06-20 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Compiling, Storage Engine - RocksDB |
| Affects Version/s: | 10.2, 10.3 |
| Fix Version/s: | 10.2.16 |
| Type: | Bug | Priority: | Blocker |
| Reporter: | Sergei Petrunia | Assignee: | Vicențiu Ciorbaru |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | None | ||
| Environment: |
Debian Stretch |
||
| Issue Links: |
|
||||||||
| Description |
|
It actually attempts to link with libzstd:
but fails for some reason |
| Comments |
| Comment by Sergei Petrunia [ 2018-06-19 ] | |||||||||||||
|
On my machine (Ubuntu Vivid, ZStandard is not available as package and so it is manually installed into /usr/local) , a similar linking command succeeds:
| |||||||||||||
| Comment by Sergei Petrunia [ 2018-06-19 ] | |||||||||||||
|
Went through CMakeLists.txt files with wlad and checked that ZStandard is added correctly as a library:
...
...
| |||||||||||||
| Comment by Sergei Petrunia [ 2018-06-19 ] | |||||||||||||
|
An interesting observation: ZDICT_trainFromBuffer is not present in libzstd.so on Debian Stretch:
It is present in the static library:
It is also present in /usr/include. | |||||||||||||
| Comment by Sergei Petrunia [ 2018-06-19 ] | |||||||||||||
|
On my machine, ZDICT_trainFromBuffer IS present in the .so file:
| |||||||||||||
| Comment by Sergei Petrunia [ 2018-06-19 ] | |||||||||||||
|
To check if this is a peculiarity of our Build Host, I've spun up an EC2 instance from {{debian-stretch-hvm-x86_64-gp2-2017-06-21-52542 }}.
Not present in .so
Present in .a. | |||||||||||||
| Comment by Sergei Petrunia [ 2018-06-19 ] | |||||||||||||
|
I don't see any bugs about this against the debian package: https://bugs.debian.org/cgi-bin/pkgreport.cgi?package=zstd. To check further, I've tried installing a newer RocksDB from stretch-backports as described here: https://backports.debian.org/Instructions/
and after that both .a and .so have the function:
| |||||||||||||
| Comment by Sergei Petrunia [ 2018-06-19 ] | |||||||||||||
|
cvicentiu otto any thoughts? Should this be reported as a bug against Debian? The only solution that I see right now is:
How do we achieve the above? Remove the libzstd-dev package from the Debian Stretch builder? | |||||||||||||
| Comment by Sergei Petrunia [ 2018-06-19 ] | |||||||||||||
|
Thanks to wlad for taking part in the above investigation | |||||||||||||
| Comment by Otto Kekäläinen [ 2018-06-19 ] | |||||||||||||
|
You can file a bug against Debian and try to persuade the maintainer/release manager to push this backported version into a stable release update. In the mean time probably needs to be disabled for Debian Stretch in debian/autobake-deb.sh that checks if version 1.3.3 or newer is available and if not, it will simply sed out the library from debian/control. | |||||||||||||
| Comment by Sergei Golubchik [ 2018-06-19 ] | |||||||||||||
|
Right. It turns out that stretch has libzstd1-1.1.2-1. And the visibility of ZDICT_trainFromBuffer was changed in this commit — note how it changed
to
And that commit is present in tags starting from v1.1.3. The proper fix our side is to only use libzstd if it's usable, where "usable" in this context means "exports ZDICT_trainFromBuffer function" |