53175ddd / tasks

定形タスクの記録・管理用
0 stars 0 forks source link

Rust の環境をセットアップする #3

Closed 53175ddd closed 6 months ago

53175ddd commented 6 months ago
53175ddd commented 6 months ago

rustup done

53175ddd commented 6 months ago

クロスコンパイラ導入 done

53175ddd commented 6 months ago

cc 入れろと言われたので実行 多分ユーティリティインストール前にやったほうがいい

sudo apt install gcc -y
53175ddd commented 6 months ago
cargo install flip-link elf2uf2-rs probe-run
53175ddd commented 6 months ago

すべての作業の前にやるべきコマンド

sudo apt update && sudo apt upgrade -y
53175ddd commented 6 months ago
sudo apt install pkg-config -y
53175ddd commented 6 months ago

これをユーティリティインストール前にしたほうがよさそう

53175ddd commented 6 months ago
  thread 'main' panicked at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libudev-sys-0.1.4/build.rs:38:41:
  called `Result::unwrap()` on an `Err` value: "\npkg-config exited with status code 1\n> PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 pkg-config --libs --cflags libudev\n\nThe system library `libudev` required by crate `libudev-sys` was not found.\nThe file `libudev.pc` needs to be installed and the PKG_CONFIG_PATH environment variable must contain its parent directory.\nThe PKG_CONFIG_PATH environment variable is not set.\n\nHINT: if you have installed the library, try setting PKG_CONFIG_PATH to the directory containing `libudev.pc`.\n"
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: failed to compile `elf2uf2-rs v2.0.0`, intermediate artifacts can be found at `/tmp/cargo-installww3Md6`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
error: failed to compile `probe-run v0.3.11`, intermediate artifacts can be found at `/tmp/cargo-installr2YJ1X`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
     Summary Successfully installed flip-link! Failed to install elf2uf2-rs, probe-run (see error(s) above).
error: some crates failed to install
53175ddd commented 6 months ago

環境変数の設定

export ACLOCAL_PATH=/usr/local/share/aclocal/:$ACLOCAL_PATH
export PKG_CONFIG_PATH=/usr/lib/pkgconfig
53175ddd commented 6 months ago

上記,pkg-config インストール後に実行

53175ddd commented 6 months ago

この辺でパソコンを再起動

53175ddd commented 6 months ago

.bashrc に下記追記

export ACLOCAL_PATH=/usr/local/share/aclocal/:$ACLOCAL_PATH
export PKG_CONFIG_PATH=/usr/lib/pkgconfig
53175ddd commented 6 months ago

一時中断

53175ddd commented 6 months ago
sudo apt install libudev-dev
53175ddd commented 6 months ago

ここまでやってようやく通った

cargo install flip-link elf2uf2-rs probe-run
53175ddd commented 6 months ago

完了