简体   繁体   English

依赖于其他库的库的Libtool版本控制

[英]Libtool versioning of a library that depends on other libraries

I have a framework that uses Boost and CgiCC in the core application and in its interface. 我有一个在核心应用程序及其接口中使用Boost和CgiCC的框架

How should I version the library binary interface (aka libtool -version-info )? 我应该如何对库二进制接口(又名libtool -version-info )进行版本控制?

I have no problems tracking the changes in library itself when I make various changes. 进行各种更改时,跟踪库本身的更改没有问题。 As it is clear for me how should I version. 对我来说很明显我应该如何版本化。

But... 但...

Both Boost and CgiCC libraries do not provide any backward compatible API/ABI and my library may be linked with quite arbitrary versions Boost and CgiCC so I can't provide any promise about the interfaces, so I can't really specify -version-info because even the same library compiled against different versions of Boost and CgiCC would not be compatible. Boost和CgiCC库均不提供任何向后兼容的API / ABI,并且我的库可能与任意版本的Boost和CgiCC链接,因此我无法提供有关接口的任何保证,因此我无法真正指定-version-info因为即使针对不同版本的Boost和CgiCC编译的同一个库也不兼容。

So... What should I do? 所以我该怎么做? How should I version library? 我应该如何版本库?

I know that I should not depend on Boost and CgiCC interfaces in first place, but this is what I get so far for existing stable version. 我知道我不应该一开始就依赖Boost和CgiCC接口,但是到目前为止,这是现有稳定版本的结果。 This issue is addressed in next major release but I still have and want to maintain current release as it is very valuable. 下一个主要版本中已解决此问题,但我仍然要保留当前版本,因为它非常有价值。

Consider adopting a versioning scheme like: 考虑采用类似以下的版本控制方案:

http://apr.apache.org/versioning.html http://apr.apache.org/versioning.html

If you expose a dependant libraries API through yours then your must increment your major version number if the dependant library's api changes in a non-backward compatible way. 如果您通过自己的库公开了从属库API,那么如果从属库的api以非向后兼容的方式更改,则必须增加主版本号。 A better strategy is to not expose the internal dependant library at all. 更好的策略是完全不公开内部依赖库。 If you do need to expose some sort of API then wrap it and abstract away the unstable dependant library. 如果确实需要公开某种API,则将其包装并抽象出不稳定的依赖库。

-version-info不会直截了当地编排一些主要的次要补丁版本(这是-release目的),但是必须遵守http://www.gnu.org/software/libtool中描述的编号方案/manual/html_node/Versioning.html (整章)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM