-
-
Notifications
You must be signed in to change notification settings - Fork 57
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
Add version_suffix_components setting #352
Conversation
Haven't looked at the code, but the specification in the description sounds great. 👍 |
src/build.rs
Outdated
Some(1) => format!("{major}"), | ||
Some(2) => format!("{major}.{minor}"), | ||
Some(3) => format!("{major}.{minor}.{patch}"), | ||
Some(num) => anyhow::bail!("Unexpected number of suffix components: {num}"), |
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.
If you want to go the extra mile, you should put the validation when parsing the value instead.
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.
Good idea, done!
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.
Overall it looks good, there is only a nit I'd like to have addressed, if you do not have time I can do that myself later though.
Thank you a lot for the patch :)
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.
Thank you a lot!
Related to #345 (this patch is based on my comment there) and rustls/rustls-ffi/pull/274.
This adds a setting to disable automatic semver SONAMEs and to pick an arbitrary number of components from the version string for the SONAME.
This feature allows two additional use-cases for library developers to pick from:
.so.0
,.so.1
,.so.2
, ...For a C-style breaking-change counter use a config like this:
Increase the major version for every time the ABI is broken:
This pattern is already supported, but one has to start at
.so.1
because it's currently not possible to configure.so.0
.Doing this does not interfer with pkg-config metadata:
Opt-out of a stable ABI
To read the version from
[package.version]
but opt-out of a stable ABI:"Why not do static linking at this point?" - doing it like this has 3 effects:
Another way of opting out of a stable ABI is "use 0.1.0 and only ever bump the minor version". cargo-c default settings would then make sure every release is in it's own
libfoo.so.0.1
,libfoo.so.0.2
SONAME namespace, until comfortable with making ABI compatible0.X.{patch}
releases that still provide the first two effects, but do not require a rebuild of consuming executables.I originally named this setting
suffix_components
but I'm indecisive which name is better.As far as I can tell this is the last feature needed to close #345 as completed.
cc: @lu-zero @cpu @kornelski @kyrias