Mac OS Xでbrew upgradeしたらROS2が動かなくなった話

投稿者: | 2019年9月7日

ROS 2 Dashing Diademata – Patch Release 2のバイナリパッケージをMacで使っていたのですが、久々にbrew upgradeしたら依存関係が壊れてしまいました。

Homebrewの特定のパッケージのバージョンを戻す方法を記載しておきます。
(イケてないけどソースからのビルドもかなり面倒なので・・・)

Contents

tinyxml2

find /usr/local -name tinyxml2.rb
cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula
git log tinyxml2.rb

brew uninstall --force tinyxml2

# change version of tinyxml2 to 7.0.1
git checkout cf0ae2997643a562804dc26e14bf3813b13ae1b3 tinyxml2.rb

brew install tinyxml2

poco

find /usr/local -name poco.rb
cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/
git log poco.rb

brew uninstall --force poco

# change version of poco to 1.9.2
git checkout 80e1d8fee2e976d9b09594c97e19f0670bb0b05b poco.rb

brew install poco

Python3

Python.hが見つからないと言われたら下記コマンドで対応

cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula
brew unlink python
git checkout 48aba7218e7506ca6d46c9c058c67d752072e89a python.rb
HOMEBREW_NO_AUTO_UPDATE=1 brew install python

おまけ

公式のソースビルドの手順に従ってソースからインストールしようとしていたのだが、ハマった点があったため、こちらも忘備録として書いておきます。

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

...(中略)...

'Availability.h' file not found

のようなエラーメッセージが出てきた場合、以下のコマンドを実行すれば良い。

sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
カテゴリー: OS X

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です