Skip to content

Commit

Permalink
Fixed CORE-6368 - Increase FB_API_VER to 40.
Browse files Browse the repository at this point in the history
  • Loading branch information
asfernandes committed Jul 23, 2020
1 parent 0b96286 commit 9aaf355
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/include/ibase.h
Expand Up @@ -44,7 +44,7 @@
#ifndef FIREBIRD_IBASE_H
#define FIREBIRD_IBASE_H

#define FB_API_VER 30
#define FB_API_VER 40
#define isc_version4

#define ISC_TRUE 1
Expand Down

16 comments on commit 9aaf355

@aafemt
Copy link
Contributor

@aafemt aafemt commented on 9aaf355 Jul 28, 2020

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.

@asfernandes
Copy link
Member Author

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

@aafemt
Copy link
Contributor

@aafemt aafemt commented on 9aaf355 Jul 28, 2020

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.

And this is a bug in v3 distribution.

@real-dam
Copy link
Contributor

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!

@aafemt
Copy link
Contributor

@aafemt aafemt commented on 9aaf355 Jul 28, 2020

Choose a reason for hiding this comment

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

@real-dam
Copy link
Contributor

Choose a reason for hiding this comment

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.

Also good to read: https://semver.org

This actually confirms my suggestion for keeping the soname (major version) because there are no backward-incompatible API changes:

Given a version number MAJOR.MINOR.PATCH, increment the:

  1. MAJOR version when you make incompatible API changes,
  2. MINOR version when you add functionality in a backwards compatible manner, and
  3. PATCH version when you make backwards compatible bug fixes.

@aafemt
Copy link
Contributor

@aafemt aafemt commented on 9aaf355 Jul 29, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My guess is that such applications need to check the provided API version (e.g. via #if directive).

It is impossible during binary distribution.

@AlexPeshkoff
Copy link
Member

@AlexPeshkoff AlexPeshkoff commented on 9aaf355 Jul 29, 2020 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AlexPeshkoff
Copy link
Member

@AlexPeshkoff AlexPeshkoff commented on 9aaf355 Aug 19, 2020 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aafemt
Copy link
Contributor

@aafemt aafemt commented on 9aaf355 Aug 21, 2020

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.

@AlexPeshkoff
Copy link
Member

@AlexPeshkoff AlexPeshkoff commented on 9aaf355 Aug 24, 2020 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aafemt
Copy link
Contributor

@aafemt aafemt commented on 9aaf355 Aug 24, 2020

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?

@AlexPeshkoff
Copy link
Member

@AlexPeshkoff AlexPeshkoff commented on 9aaf355 Aug 24, 2020 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aafemt
Copy link
Contributor

@aafemt aafemt commented on 9aaf355 Aug 24, 2020 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AlexPeshkoff
Copy link
Member

@AlexPeshkoff AlexPeshkoff commented on 9aaf355 Aug 24, 2020 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aafemt
Copy link
Contributor

@aafemt aafemt commented on 9aaf355 Aug 24, 2020 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.