MacPortsを2.2に更新してからbuild時にエラーが出るようになったときの対処
MacPorts 2.2.0に更新してから、ソースからのビルドでエラーが出るようになった。
% sudo port -ns build ruby20 ---> Computing dependencies for ruby20 ---> Extracting ruby20 Error: org.macports.extract for port ruby20 returned: command execution failed Please see the log file for port ruby20 for details: /opt/local/var/macports/logs/_Volumes_CHome_kimuraw_proj_macports_ports_lang_ruby20/ruby20/main.log To report a bug, follow the instructions in the guide: http://guide.macports.org/#project.tickets Error: Processing of port ruby20 failed % port log ruby20 /usr/bin/gnutar: Error exit delayed from previous errors Command failed: cd "/opt/local/var/macports/build/_Volumes_CHome_kimuraw_proj_macports_ports_lang_ruby20/ruby20/work" && /usr/bin/bzip2 -dc '/opt/local/var/macports/distfiles/ruby20/ruby-2.0.0-p247.tar.bz2' | /usr/bin/gnutar --no-same-owner -xf - Exit code: 2 Error: org.macports.extract for port ruby20 returned: command execution failed DEBUG: Error code: NONE DEBUG: Backtrace: command execution failed Warning: targets not executed for ruby20: org.macports.build org.macports.extract org.macports.patch org.macports.configure Please see the log file for port ruby20 for details:
これはMacPorts 2.2.0から導入されたsandbox機能(ビルドにsandbox-exec(1)を使う)の影響で、次のいずれかで対処できます。
- macports.confでprefixをシンボリックリンクを展開したものにする
- macports.confでportdbpathをシンボリックリンクを展開したものにする
- macports.confでsandbox_enable noの設定を追加する
- /opt/localでインストールし直す
個人的には2つめがおすすめ。わざわざ別の場所に置いてるのは理由があるだろうし、prefixをデフォルトから変更するとバイナリパッケージが使えなくなったりする(と書かれていた記憶があるんだけど見つからない…)からねえ。
ちなみに自分がシンボリックリンクにしてるのは、HFSXの別パーティションを使ってるから。大文字小文字区別するようにしたいのです。
チケット#39850にこの件の話題があがってます。