由于各种项目特定的原因,我已将 boost
(和 boost-python
)Homebrew安装从 boost
降级为 boost159
(在编写此问题时也称为Boost 1.62.0
) . homebrew/versions/boost159
和 boost-python159
公式只是keg,因此我必须手动链接它们:
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构建中发生的,这使得错误更具破坏性 .
References
1 回答
可能你只需要patch your local formulas . 在我看来,brew中的整个版本支持是一个邪恶的黑客,也是我不使用brew构建时开发依赖的原因之一 .