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ならビルドできるらしい。
- https://github.com/denoland/deno/issues/2295https://github.com/denoland/deno/issues/2295
- https://akkiesoft.hatenablog.jp/entry/20200509/1589030613
そのために/boot/config.txt
を以下のように編集しろ、とある。
arm_64bit=1
でもこれをやったら32bitなアプリが動作しなくなるのでは? クラッシュとかしたらヤダな。怖いからやりたくない。これまで数々のクラッシュを経験してきたので、まったく信用できない。というわけで、試さなかった。
参考
- https://qiita.com/gebriel_kuni/items/b7c090b28b27e00009c3
- https://qiita.com/access3151fq/items/53d5c37f19be290a03ad
所感
rustのソフトウェアって時間かけてビルドしたけどエラーになるパターンをよく経験する。やめてくんない? 役立たずなんですけど。せめて事前にエラーになるって言ってよ。
対象環境
- Raspbierry pi 4 Model B
- Raspberry Pi OS buster 10.0 2020-08-20 ※
- bash 5.0.3(1)-release
$ uname -a Linux raspberrypi 5.10.63-v7l+ #1496 SMP Wed Dec 1 15:58:56 GMT 2021 armv7l GNU/Linux