-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build: add soname to shared libraries #2521
base: master
Are you sure you want to change the base?
Conversation
At present the version is defined in the CMakeLists.txt file. It could be defined elsewhere |
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'd use SEASTAR_API_LEVEL
for the SO version.
Please explain in the patch changelog why we're making this change. |
3b1a5a4
to
cd7be4b
Compare
Done. |
cd7be4b
to
d46ec1d
Compare
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.
modulo a nit, lgtm
@bkmgit hi Benson, just out of curiosity, do you really plan to package seastar for a distro like fedora? |
d46ec1d
to
60bbb7e
Compare
@@ -780,6 +780,11 @@ add_library (seastar | |||
src/websocket/server.cc | |||
) | |||
|
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.
Use API level as soname to enable applications to select
and link agains shared libraries based on their SO versions.
Actually a neat idea. But note, API levels are only about source-level compatibility. It's possible for a function signature to change without change the API level.
Example: if we add a trailing default parameters to a function, it's still source compatible, but links against an older .so will fail.
Given this, is this still helpful for you?
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.
Am happy to follow up with another change. It would be nice not to carry patches, but yes ideally soname would reflect ABI compatibility, not API compatibility. Still learning about Seastar, so not sure how often ABI is broken in a backwards incompatible manner. If the release year and month is used, then this would always increment the soname, and it would be assumed that typically ABI is broken on each update.
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.
One could run a tool such as libabigail when doing a release and then automatically bump the soname if there is an ABI change.
https://bugzilla.redhat.com/show_bug.cgi?id=2321986 DPDK is already there, but need to see if changes allow it to be used. |
60bbb7e
to
f31f8ce
Compare
thanks . i see. regarding DPDK, one thing i can think about is Avi's comment about SO versioning makes a lot of sense. I hadn't considered that perspective before. we even sometimes unintentionally change APIs over time, as seen in #2410 (comment) . and AFAICT, we don't have a release schedule (yet). so probably it's best to encode date in the version number to be on the safe side, or just starts with "1" and increment it every time a new release is created, and the ABI is changed across the builds. sorry for the bike shedding. BTW, if we want to use date as the version number, probably should include the month in it. and we probably can set the version in the command line, like |
As the version is currently 1, it seems ok to use that as the soname, but use the date as the software version number since that is the tag that is used in GitHub. Perhaps we can automate this to be updated whenever a release is made rather than manually setting a CMake variable. It will be less prone to error. Will update the pull request with this. |
Use PROJECT_VERSION.API_LEVEL.RELEASE_DATE as soname to enable applications to select and link against shared libraries based on their SO versions.
f31f8ce
to
caac782
Compare
Have used a versioning scheme of If this is ok, can add tooling that would update this automatically whenever a release is made by checking for ABI changes. If someone is using a commit that is different from a release, it would be upto them to check ABI compatibility. Tooling can be done in a follow up pull request. |
PROJECT_VERSION is currently 1, so can keep that. |
Note, ScyllaDB releases use a fork of Seastar in https://github.com/scylladb/scylla-seastar.git. The fork is created on-demand (if we need to backport a Seastar commit), so not all releases reference it. See scylladb/scylladb@6d779f5 (branch-5.4) and following submodule updates for an example. It's really geared towards bundling, not independently moving versions. |
Thanks. Will bundle when packaging Scylladb. Having other consumers of seastar would improve testing. Bundling multiple times is not great and it is already used in a number of projects Packages make deployments easier, though usually with a performance tradeoff. However, understand if it is too much extra effort unrelated to the main project goals to support a soname. |
STRING | ||
"Last release date") | ||
|
||
set_property (CACHE Seastar_RELEASE_DATE |
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.
why do we need a property for the release date?
@@ -780,6 +790,15 @@ add_library (seastar | |||
src/websocket/server.cc | |||
) | |||
|
|||
# Shared library soname | |||
set_target_properties(seastar PROPERTIES | |||
VERSION ${PROJECT_VERSION}.${Seastar_API_LEVEL}.${Seastar_RELEASE_DATE} |
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 semantic versioning (semver), a version number consists of three components: MAJOR.MINOR.PATCH. The major version number changes least frequently and indicates incompatible API changes. The minor version is incremented more often for backward-compatible feature additions, while the patch version is used for backward-compatible bug fixes.
The Seastar_API_LEVEL
changes less frequently than the ABI version, as it is only incremented for significant API changes rather than ABI-breaking modifications.
PROJECT_VERSION
is also composed of multiple component. see https://cmake.org/cmake/help/latest/variable/PROJECT_VERSION.html.
Based on the discussion above, I suggest:
PROJECT_VERSION
should be treated as a versioning string with multiple components (major.minor.patch) rather than a single number.- Although
Seastar_API_LEVEL
is crucial for API versioning, it may not belong in the libraries' version numbers since we make ABI changes within the sameSeastar_API_LEVEL
. - Including the release date in the version number makes sense given our flexible release schedule.
|
||
# We disable _FORTIFY_SOURCE because it generates false positives with longjmp() (src/core/thread.cc) | ||
set_source_files_properties(src/core/thread.cc | ||
PROPERTIES COMPILE_FLAGS -U_FORTIFY_SOURCE) |
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.
you are partially reverting c96444f. probably want to drop this change?
Thanks for the suggestions. |
Closes #2520