Skip to content
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] shared libraries with version suffix, along with the symbolic link #2109

Merged
merged 7 commits into from
Apr 22, 2023

Conversation

lalitb
Copy link
Member

@lalitb lalitb commented Apr 21, 2023

Fixes #2100

Changes

Versioning policy is described here for debian - https://www.debian.org/doc/debian-policy/ch-sharedlibs.html. In general same is followed across other *nix distributions.

  • Added CMake option OTELCPP_VERSIONED_LIBS to enable generating versioned shared libs.
  • Currently using OPENTELEMETRY_ABI_VERSION_NO as SOVERSION, we can also use MAJOR version. But as per the recommendation, SOVERSION should change for any ABI breaking change.
  • The output is as below:
$ ls -ltr /usr/local/lib/libopentelemetry_*common*so*
-rw-r--r-- 1 root root 281640 Apr 20 21:59 /usr/local/lib/libopentelemetry_common.so.1.9.0
lrwxrwxrwx 1 root root     32 Apr 20 22:01 /usr/local/lib/libopentelemetry_common.so.1 -> libopentelemetry_common.so.1.9.0
lrwxrwxrwx 1 root root     28 Apr 20 22:01 /usr/local/lib/libopentelemetry_common.so -> libopentelemetry_common.so.1

$ objdump -p /usr/local/lib/libopentelemetry_common.so.1.9.0 | grep SONAME
  SONAME               libopentelemetry_common.so.1
$

For significant contributions please make sure you have completed the following items:

  • CHANGELOG.md updated for non-trivial changes
  • Unit tests have been added
  • Changes in public API reviewed

@lalitb lalitb requested a review from a team April 21, 2023 06:20
@lalitb lalitb changed the title Fix: #2100 https://github.com/open-telemetry/opentelemetry-cpp/issues/2100 Fix: #2100 Building shared libraries with version suffix, along with the symbolic link Apr 21, 2023
@codecov
Copy link

codecov bot commented Apr 21, 2023

Codecov Report

Merging #2109 (7f306a8) into main (7ee86a9) will decrease coverage by 0.02%.
The diff coverage is n/a.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2109      +/-   ##
==========================================
- Coverage   87.19%   87.17%   -0.02%     
==========================================
  Files         166      166              
  Lines        4784     4784              
==========================================
- Hits         4171     4170       -1     
- Misses        613      614       +1     

see 1 file with indirect coverage changes

Copy link
Member

@marcalff marcalff left a comment

Choose a reason for hiding this comment

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

Using OPENTELEMETRY_ABI_VERSION_NO as SOVERSION looks like the correct choice.

See minor comment on dependent options.

CMakeLists.txt Show resolved Hide resolved
Copy link
Member

@marcalff marcalff left a comment

Choose a reason for hiding this comment

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

LGTM.

To clarify, I don't think opentelemetry-cpp is ready to use shared libraries yet.

We need to make sure the proper symbol is part of the proper library, see issue #1429.

This is however a different issue, which should not prevent this part to go in the main branch.

Ok to merge.

@marcalff marcalff merged commit 22d0448 into open-telemetry:main Apr 22, 2023
@marcalff marcalff changed the title Fix: #2100 Building shared libraries with version suffix, along with the symbolic link [BUILD] shared libraries with version suffix, along with the symbolic link May 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Build] Building shared libraries with version suffix, along with the symbolic link
3 participants