cargo-tree はプロジェクトの依存クレーをツリー表示してくれるやつらしい。
今回依存関係を調べたくて入れてみたので覚書。
インストール手順
環境
name |
version |
macOS |
10.12.5 |
homebrew |
1.2.4-61-g4ca2efb |
rustc |
rustc 1.20.0-nightly |
cargo |
cargo 0.21.0-nightly |
前提条件
バージョンは前述を参考に
- homebrew インストール済み
- rust の nightly がインストール済み
手順
- cmake を homebrew からインストールしておく
$ brew install cmake
$ cmake --version
cmake version 3.8.2
CMake suite maintained and supported by Kitware (kitware.com/cmake).
$ cargo install cargo-tree
$ cargo tree --version
cargo-tree 0.13.0
途中で起きた問題
- cargo-tree のインストール中に依存関係のビルドに必要な
cmake
がねぇよって怒られた
error: failed to run custom build command for `libgit2-sys v0.6.12`
process didn't exit successfully: `/var/folders/80/fmp4sy_d2jq8q_gv5q6gy42w0000gn/T/cargo-install.8xN8YVpcZ19O/release/build/libgit2-sys-edfed1ba91536559/build-script-build` (exit code: 101)
--- stdout
running: "cmake" "/Users/ahiru/.cargo/registry/src/github.com-1ecc6299db9ec823/libgit2-sys-0.6.12/libgit2" "-DBUILD_SHARED_LIBS=OFF" "-DBUILD_CLAR=OFF" "-DCMAKE_INSTALL_PREFIX=/var/folders/80/fmp4sy_d2jq8q_gv5q6gy42w0000gn/T/cargo-install.8xN8YVpcZ19O/release/build/libgit2-sys-f696556cc2dc8abe/out" "-DCMAKE_C_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_C_COMPILER=/usr/bin/gcc" "-DCMAKE_CXX_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_CXX_COMPILER=/usr/bin/c++" "-DCMAKE_BUILD_TYPE=Release"
--- stderr
fatal: Not a git repository (or any of the parent directories): .git
thread 'main' panicked at '
failed to execute command: No such file or directory (os error 2)
is `cmake` not installed?
build script failed, must exit now', /Users/ahiru/.cargo/registry/src/github.com-1ecc6299db9ec823/cmake-0.1.24/src/lib.rs:593:4
note: Run with `RUST_BACKTRACE=1` for a backtrace.
warning: build failed, waiting for other jobs to finish...
error: failed to compile `cargo-tree v0.13.0`, intermediate artifacts can be found at `/var/folders/80/fmp4sy_d2jq8q_gv5q6gy42w0000gn/T/cargo-install.8xN8YVpcZ19O`
Caused by:
build failed
homebrew で cmake インストールしてリトライしたら成功した。
- 依存関係の petgraph のコンパイル中に必ず以下のワーニングが出る
Compiling petgraph v0.4.5
warning[E0122]: trait bounds are not (yet) enforced in type definitions
--> /Users/ahiru/.cargo/registry/src/github.com-1ecc6299db9ec823/petgraph-0.4.5/src/algo/mod.rs:169:1
|
169 | type DfsSpaceType<G> where G: Visitable = DfsSpace<G::NodeId, G::Map>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
出ても先に進むしビルドに成功してしまう。
気が向いたらなんか情報出てないか調べよう。