【发布时间】:2016-10-23 17:12:27
【问题描述】:
由于各种特定于项目的原因,我已将我的 boost(和 boost-python)Homebrew 安装从 boost 降级为 boost159(在撰写本问题时也称为 Boost 1.62.0)。 homebrew/versions/boost159 和 boost-python159 公式是keg-only,因此我必须手动链接它们:
brew tap homebrew/versions
brew remove --force boost
brew remove --force boost-python
brew install boost159
brew link --force --overwrite boost159
brew install boost-python159
brew link --force --overwrite boost-python159
到目前为止一切顺利。但是,当我想安装一些依赖于boost 的不相关 Homebrew 公式时,Homebrew 会尝试 brew install boost (Boost 1.62.0) 并且无法链接它:
[34m==>[0m [1mPouring boost-1.62.0.el_capitan.bottle.tar.gz[0m
[31mError:[0m The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink include/boost/accumulators/accumulators.hpp
Target /usr/local/include/boost/accumulators/accumulators.hpp
is a symlink belonging to boost159. You can unlink it:
brew unlink boost159
To force the link and overwrite all conflicting files:
brew link --overwrite boost
To list all files that would be deleted:
brew link --overwrite --dry-run boost
Possible conflicting files are:
/usr/local/include/boost/accumulators/accumulators.hpp -> /usr/local/Cellar/boost159/1.59.0/include/boost/accumulators/accumulators.hpp
[...]
有没有办法让其他公式使用 boost159 而不是 boost ?请注意boost159 必须链接到项目的其他部分(不在我的控制范围内)才能工作。也就是说,我不能让它取消链接并设置构建变量。
PS。这实际上都是在 CI 构建中发生的,这使得错误更具破坏性。
参考文献
【问题讨论】:
标签: boost dependencies homebrew versioning downgrade