You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The reason will be displayed to describe this comment to others. Learn more.
Hi, Debian package maintainer here.
Soname (the 2 in libfbclient.so.2) should be changed only if the ABI is not backwards compatible. That is, the new library would break binaries (e.g. flamerobin) compiled against the old library ABI. This is usually the case when a symbol (e.g. a function entry point) is removed or its arguments had changed.
Adding new entry points doesn't warrant changing the soname.
Changing the soname requires that all packages that link with libfbclient to be recompiled and updated together. Such transitions are a major burden for binary distributions like Debian and it would be nice to avoid them if possible.
Firebird used libfbclient.so.2 (soname) provided by libfbclient.so.2.0.x, 2.1.x, 2.5.x and 3.0.x (library file) without any problems for several years which was great!
The reason will be displayed to describe this comment to others. Learn more.
Changing the soname requires that all packages that link with libfbclient to be recompiled and updated together.
Is it really necessary if soft links with old numbers are provided?
The problem as I see it that new applications which require new API entries cannot be linked with libfbclient.so.2 and be sure that they shall run ok. They have to be linked with libfbclient.so.4 for that which ensure API v4 to be available for them.
Also good to read: https://semver.org
The reason will be displayed to describe this comment to others. Learn more.
Changing the soname requires that all packages that link with libfbclient to be recompiled and updated together.
Is it really necessary if soft links with old numbers are provided?
It is. Library packages are named after the soname of the library. So flamerobin (for example) compiled against libfbclient with soname libfbclient.so.2 depends on libfbclient2.deb. Changing the soname in fb3/4 would mean there is no more libfbclient2 package, breaking flamerobin.
The problem as I see it that new applications which require new API entries cannot be linked with libfbclient.so.2 and be sure that they shall run ok. They have to be linked with libfbclient.so.4 for that which ensure API v4 to be available for them.
My guess is that such applications need to check the provided API version (e.g. via #if directive).
These same applications would needlessly require rebuilding each time firebird is upgraded with changed libfbclient soname.
The reason will be displayed to describe this comment to others. Learn more.
I fully agree with Debian position. With one small addition - api version may be controlled in a way similar to one used by glibc . fbclient exports dummy symbols with names equal to supported versions, application imports required version. Should work for us too .
Sorry for being too brief, use mobile dev to reply.
Sent from MailDroid
The reason will be displayed to describe this comment to others. Learn more.
On 2020-07-30 00:31, Alexander Peshkov wrote:
I fully agree with Debian position. With one small addition - api
version may be controlled in a way similar to one used by glibc .
fbclient exports dummy symbols with names equal to supported versions,
application imports required version. Should work for us too .
Sorry for being too brief, use mobile dev to reply.
Mentioned API version control is implemented in weakVer branch. If one
tries to run (for example) isql build in this branch with wrong fbclient
(any fbclient except one from weakVer is wrong now) will get:
./isql: symbol lookup error: ./isql: undefined symbol: FB_API_VER_40
i.e. rather self-explaining error.
But this has drawbacks. Any inclusion of ibase.h causes arrival of
undefined symbol FB_API_VER_40, which is not good when one wants to
build plugin (which receives master interface pointer at startup and
need not be linked with fbclient) or wants to load fbclient dynamically.
Currently version control may be turned off by adding:
#define FB_API_VER 0
before including ibase.h, but must say I doubt - is it good and enough
for backward compatibility?
I want your opinion - is API version control needed at all? If yes - may
be only if it's turned on explicitly?
The reason will be displayed to describe this comment to others. Learn more.
As said, it is enough to provide set of softlinks with API versions included into name:
libfbclient.so.4 -> libfbclient.so
libfbclient.so.3 -> libfbclient.so
libfbclient.so.2 -> libfbclient.so
libfbclient.so.1 -> libfbclient.so
Developers won't be limited by currently installed/used ibase.h and cloose required Firebird client version freely at linking time. Loader and ldd will produce meaningful output as well.
The reason will be displayed to describe this comment to others. Learn more.
On 2020-08-21 12:06, Dimitry Sibiryakov wrote:
As said, it is enough to provide set of softlinks with API versions
included into name:
libfbclient.so.4 -> libfbclient.so
libfbclient.so.3 -> libfbclient.so
libfbclient.so.2 -> libfbclient.so
libfbclient.so.1 -> libfbclient.so
Developers won't be limited by currently installed/used ibase.h and
cloose required Firebird client version freely at linking time. Loader
and ldd will produce meaningful output as well.
This does not work. Loader always adds to dependencies list not library
name provided in command line but value of SONAME from it. Look here
(I've removed rest of libs not to be too long):
fbs3 /usr/home/firebird/HEAD/examples/interfaces # c++ -I
../../gen/Debug/firebird/include 01.create.cpp -lfbclient
fbs3 /usr/home/firebird/HEAD/examples/interfaces # ldd a.out
libfbclient.so.2 => /usr/lib64/libfbclient.so.2
(0x00007f4eb7fe1000)
fbs3 /usr/lib64 # ln -s libfbclient.so libfbclient3.so
fbs3 /usr/home/firebird/HEAD/examples/interfaces # c++ -I
../../gen/Debug/firebird/include 01.create.cpp -lfbclient3
fbs3 /usr/home/firebird/HEAD/examples/interfaces # ldd a.out
libfbclient.so.2 => /usr/lib64/libfbclient.so.2
(0x00007fe315a8b000)
because:
fbs3 /usr/home/firebird/HEAD/examples/interfaces # soname
/usr/lib64/libfbclient3.so
/usr/lib64/libfbclient3.so: SONAME libfbclient.so.2
Must say at once that changing SONAME in fbclient is bad idea - in this
aspect we must follow OS standard.
The reason will be displayed to describe this comment to others. Learn more.
On 2020-08-24 13:41, Dimitry Sibiryakov wrote:
I see. But if Linux loader is able to throw error "undefined symbol"
why it doesn't work for missing exported/imported functions?
See 'man dlopen' at any public place and pay attention on RTLD_LAZY flag.
Yes, in our case it's not dynamic loading but IMHO same code does the job.
PS. Can you provide a sample where distinguishing FB_API version is
really needed? May be I missed something during vacations.
The reason will be displayed to describe this comment to others. Learn more.
PS. Can you provide a sample where distinguishing FB_API version is
really needed?
As said: an application using Firebird 4 API with binary distribution. AFAIK now such app
would simply crash on an OS with previous client version installed.
The reason will be displayed to describe this comment to others. Learn more.
On 2020-08-24 14:12, Dimitry Sibiryakov wrote:
> PS. Can you provide a sample where distinguishing FB_API version is
> really needed?
As said: an application using Firebird 4 API with binary distribution.
AFAIK now such app
would simply crash on an OS with previous client version installed.
Crash? That's too pessimistic.
# c++ -I ../../gen/Debug/firebird/include 01.create.cpp -lfbclient
# ./a.out
Database fbtests.fdb created.... #certainly works
# export LD_LIBRARY_PATH=/opt/firebird.CS.2.5/lib
# ./a.out
./a.out: symbol lookup error: ./a.out: undefined symbol:
fb_get_master_interface
9aaf355
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Numbers in library names on Linux also must match API version.
9aaf355
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In v3 we do not have .so.3 library, it has only .so.2.
In master we have .so.2 and .so.4.0.0 (no .so.4 and no .so.3).
@AlexPeshkoff
9aaf355
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And this is a bug in v3 distribution.
9aaf355
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, Debian package maintainer here.
Soname (the 2 in libfbclient.so.2) should be changed only if the ABI is not backwards compatible. That is, the new library would break binaries (e.g. flamerobin) compiled against the old library ABI. This is usually the case when a symbol (e.g. a function entry point) is removed or its arguments had changed.
Adding new entry points doesn't warrant changing the soname.
Changing the soname requires that all packages that link with libfbclient to be recompiled and updated together. Such transitions are a major burden for binary distributions like Debian and it would be nice to avoid them if possible.
Affected packages include libreoffice, qt5, php, perl driver, opendbx driver, python driver.
Firebird used libfbclient.so.2 (soname) provided by libfbclient.so.2.0.x, 2.1.x, 2.5.x and 3.0.x (library file) without any problems for several years which was great!
9aaf355
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it really necessary if soft links with old numbers are provided?
The problem as I see it that new applications which require new API entries cannot be linked with libfbclient.so.2 and be sure that they shall run ok. They have to be linked with libfbclient.so.4 for that which ensure API v4 to be available for them.
Also good to read: https://semver.org
9aaf355
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is. Library packages are named after the soname of the library. So flamerobin (for example) compiled against libfbclient with soname libfbclient.so.2 depends on libfbclient2.deb. Changing the soname in fb3/4 would mean there is no more libfbclient2 package, breaking flamerobin.
My guess is that such applications need to check the provided API version (e.g. via #if directive).
These same applications would needlessly require rebuilding each time firebird is upgraded with changed libfbclient soname.
This actually confirms my suggestion for keeping the soname (major version) because there are no backward-incompatible API changes:
9aaf355
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is impossible during binary distribution.
9aaf355
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
9aaf355
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
9aaf355
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As said, it is enough to provide set of softlinks with API versions included into name:
libfbclient.so.4 -> libfbclient.so
libfbclient.so.3 -> libfbclient.so
libfbclient.so.2 -> libfbclient.so
libfbclient.so.1 -> libfbclient.so
Developers won't be limited by currently installed/used ibase.h and cloose required Firebird client version freely at linking time. Loader and ldd will produce meaningful output as well.
9aaf355
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
9aaf355
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. But if Linux loader is able to throw error "undefined symbol" why it doesn't work for missing exported/imported functions?
9aaf355
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
9aaf355
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
9aaf355
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
9aaf355
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.