TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Conan does not evaluate joint compatibility of version requirements by design

1 点作者 duffsdevice超过 3 年前

1 comment

duffsdevice超过 3 年前
This is a surprising feature of the Conan C++ package manager: It allows to specify dependencies of packages, and also to specify ranges of dependencies, but it does not provide any way to automatically resolve them. The responsibility for the resolution is with the resulting application at the top of the graph, it has to provide version numbers or ranges for all conflicting dependencies, regardless how deep thy are in the dependency graph.<p>Here some more information:<p><a href="https:&#x2F;&#x2F;docs.conan.io&#x2F;en&#x2F;1.22&#x2F;versioning&#x2F;version_ranges.html?highlight=joint-compatibility" rel="nofollow">https:&#x2F;&#x2F;docs.conan.io&#x2F;en&#x2F;1.22&#x2F;versioning&#x2F;version_ranges.html...</a><p>See also:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;conan-io&#x2F;conan&#x2F;issues&#x2F;9547" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;conan-io&#x2F;conan&#x2F;issues&#x2F;9547</a><p>I think dependency resolution in systems of networked software is a tough problem, and I believe there is only one solution that will scale well enough: Requiring strict backward compatibility on every level.<p>If you think that there is another way, consider this:<p>Application A requires dependencies D1.0 and E1.0. Both D and E require a library L1.0 , thus we have a &quot;diamond dependency structure&quot;. And as it is C++, let&#x27;s assume that L is either dynamically linked, or has versioning requirements that are visible outside, for example data formats.<p>Now, L1.0 makes a breaking change, and, not following semantic versioning, labels the new version as L1.1. This could be a library like boost, which is used by many thousands of applications.<p>Now, let&#x27;s assume that D1.0 has an urgent security vulnerability (may be it is related to logging ?) and ships a new emergency release D1.1, which happens to use L1.1. And let&#x27;s assume that D is well tested with that. But the incompatible change in L1.1 happens to break E. And this means that application A cannot be upgraded, unless E is adapted to L1.1. And the net effect is that the breaking change in L1.1 causes a breaking change in D1.1, because the change in D breaks A. Nothing is achieved by shifting the blame for that to A that it uses such an old library L1, it is still the change in D that breaks A, so *D is not backwards compatible*.<p>The corollary is that <i>if your library D includes another library L as a dependency which introduces a breaking change, and that library is visible to the outside (that is, not statically linked and only internally used), then the breaking change in L causes a breaking change in your library D</i>. This means that being backwards incompatible is a transitive property - you only achieve backwards incompatibility in a system if every relevant part of it is backward compatible.