やってみる

アウトプットすべく己を導くためのブログ。その試行錯誤すらたれ流す。

ラズパイ4にDenoをインストールする(失敗)

 DenoはNode.jsの後継版。

手順

 システム更新。

sudo apt -y update
sudo apt -y upgrade

 Rustインストール。

curl https://sh.rustup.rs -sSf | sh

 必要ツールのインストール。

sudo apt install -y libssl-dev
cargo install cargo-edit
git clone https://github.com/sagiegurari/cargo-make.git
cd cargo-make
cargo install --force cargo-make

 ビルド。

git clone --recurse-submodules https://github.com/denoland/deno.git
rustup target add wasm32-unknown-unknown
rustup target add wasm32-wasi
cargo install deno --locked

 最後でつまづいた。

cargo install deno --locked
   Compiling swc_macros_common v0.3.3
error: failed to add native library /tmp/cargo-installsOZF9G/release/gn_out/obj/librusty_v8.a: file too small to be an archive

error: could not compile `v8` due to previous error
warning: build failed, waiting for other jobs to finish...
error: failed to compile `deno v1.18.1`, intermediate artifacts can be found at `/tmp/cargo-installsOZF9G`

Caused by:
  build failed

 サンプル実行、したかった……。

deno run https://deno.land/std/examples/welcome.ts

 ググってみるとDenoはARM64bitならビルドできるらしい。

 そのために/boot/config.txtを以下のように編集しろ、とある。

arm_64bit=1

 でもこれをやったら32bitなアプリが動作しなくなるのでは? クラッシュとかしたらヤダな。怖いからやりたくない。これまで数々のクラッシュを経験してきたので、まったく信用できない。というわけで、試さなかった。

参考

所感

 rustのソフトウェアって時間かけてビルドしたけどエラーになるパターンをよく経験する。やめてくんない? 役立たずなんですけど。せめて事前にエラーになるって言ってよ。

対象環境

$ uname -a
Linux raspberrypi 5.10.63-v7l+ #1496 SMP Wed Dec 1 15:58:56 GMT 2021 armv7l GNU/Linux