Comments (9)
Fixed in 076b491
from libcbor.
Shouldn't this have been something like:
-set_target_properties(cbor_shared PROPERTIES OUTPUT_NAME cbor VERSION "0.0.0" SOVERSION 0)
+set_target_properties(cbor_shared PROPERTIES OUTPUT_NAME cbor VERSION ${CBOR_VERSION} SOVERSION 0)
Or perhaps (just picking a number, 6 looked related)
-set_target_properties(cbor_shared PROPERTIES OUTPUT_NAME cbor VERSION "0.0.0" SOVERSION 0)
+set_target_properties(cbor_shared PROPERTIES OUTPUT_NAME cbor VERSION ${CBOR_VERSION} SOVERSION 6)
Or did you really mean to make the soname the full 0.6.0
?
$ objdump -x /usr/lib/x86_64-linux-gnu/libcbor.so.0.6.0 |grep SONAME
SONAME libcbor.so.0.6.0
from libcbor.
Sorry, looks like I guessed wrong how set_target_properties()
works, but I hope you understood what I meant.
Usually the SONAME would be something like libcbor.so.<number>
, and that is a symlink to the actual library. The only cases where the SONAME uses the full version is if there is no promise of compatibility between even minor version updates.
Since you have the SONAME set to libcbor.so.0.6.0
, that means when 0.6.1
comes out, all dependent source code will have to be rebuilt.
from libcbor.
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -14,7 +14,7 @@ endif()
add_library(cbor STATIC ${SOURCES})
add_library(cbor_shared SHARED ${SOURCES})
-set_target_properties(cbor_shared PROPERTIES OUTPUT_NAME cbor VERSION ${CBOR_VERSION} SOVERSION ${CBOR_VERSION})
+set_target_properties(cbor_shared PROPERTIES OUTPUT_NAME cbor VERSION ${CBOR_VERSION} SOVERSION 6)
configure_file(libcbor.pc.in libcbor.pc @ONLY)
The above produces:
obj-x86_64-linux-gnu/src/libcbor.so -> libcbor.so.6
obj-x86_64-linux-gnu/src/libcbor.so.0.6.0
obj-x86_64-linux-gnu/src/libcbor.so.6 -> libcbor.so.0.6.0
And we have:
$ objdump -x obj-x86_64-linux-gnu/src/libcbor.so.0.6.0 | grep SONAME
SONAME libcbor.so.6
That's more inline with what I would expect sonames to be like.
from libcbor.
Thanks for bringing this up @panlinux, I didn't think that through.
My first hunch is that if we live in a semver world, the current behavior is correct because there are no compatibility guarantees for the 0.x version.
In practice, minor versions have been breaking and patches should still be backwards compatible to keep things sane (filed #130 to track). My proposal is to set the the SOVERSION to ${CBOR_VERSION_MAJOR}.${CBOR_VERSION_MINOR} until for we reach 1.0.0 (which should happen soon given the age of the project and the growing amount of dependent code) to make sure breaking changes are correctly tracked by minor versions. This is far from perfect, minor releases will still break clients, but it does ensure correctness and eases the pain at least a bit.
When we reach 1.0.0, SOVERSION should be just CBOR_VERSION_MAJOR and the world will be all sunshine again.
An alternative would be to manually track the ABI compatibility in a separate version label, which would give us idiomatic shared lib version numbers immediately, but I would like to avoid the SOVERSION drifting away from CBOR_VERSION_MAJOR to prevent confusion.
WDYT, is that reasonable? Or am I thinking about it in a wrong way?
from libcbor.
Ok, that patch gives us this:
libcbor.so -> libcbor.so.0.6
libcbor.so.0.6 -> libcbor.so.0.6.0
libcbor.so.0.6.0
And:
$ objdump -x libcbor.so.0.6.0 | grep SONAME
SONAME libcbor.so.0.6
Patch releases (0.6.1, 0.6.2, etc) would keep the above, and not break clients? I'm assuming:
CBOR_VERSION_MAJOR = 0
CBOR_VERSION_MINOR = 6
CBOR_VERSION_PATCH = 0 (for the current 0.6.0 release)
from libcbor.
Patch releases (0.6.1, 0.6.2, etc) would keep the above, and not break clients? I'm assuming:
Yes, seems like the cleanest way out of this.
from libcbor.
Patch releases (0.6.1, 0.6.2, etc) would keep the above, and not break clients? I'm assuming:
Yes, seems like the cleanest way out of this.
That sounds good. I applied this patch to the ubuntu libcbor package and it's going through review. We would however be releasing a libcbor 0.6.0 package with this patch, which makes it quite different from what you released as 0.6.0. I'm not sure if this warrants a new upstream release, or if you are ok with us having a 0.6.0 package that differs in its soname from your upstream tarball.
from libcbor.
I'm not sure if this warrants a new upstream release, or if you are ok with us having a 0.6.0 package that differs in its soname from your upstream tarball.
My guess would be that people who build from source would link statically, so I don't see it as a major issue. FWIW, I can also release a "0.6.1" patch to conceal the tracks
from libcbor.
Related Issues (20)
- Hi @mghicho, not really, but the current encoders can be used to encode e.g. an array or a map in a streaming manner by calling e.g. `cbor_encode_indef_array_start` and then encoding individual items and terminating, flushing buffers as needed. What would the API you have in mind look like?
- precision with embedded type in cbor_encode_indef_array_start HOT 1
- AArch32 compatiblity issues HOT 5
- Improve Bazel support HOT 2
- BUG: CBOR Key/Value Arrays are interpreted correctly but do not deallocate correctly. HOT 7
- Improve documentation on memory management
- Travis CI broken
- half-precision float NaN loss of information (nitpicky) HOT 1
- Migrate Windows CI to Circle HOT 2
- Make cbor_encode_half respect NaN data bits
- Improve streaming parser documentation, especially for error state handling
- Improve test coverage of cbor_bytestring_add_chunk failure scenarios
- Add [[nodiscard]] attribute
- Broken encoding of empty byte strings in 0.10.0 HOT 1
- FR: Vectorization HOT 1
- test_serialize_4b_bytestring / test_serialize_8b_bytestring tests fail on 32-bit systems (size_t overflow) HOT 2
- Better documentation for memory management
- Documentation references RFC 7049, which has been replaced by RFC 8949 (STD94).
- Testing for musl HOT 3
- Signaling NaN encoding broken on Windows
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libcbor.