LoginSignup
10
6

More than 5 years have passed since last update.

Rust製のエディタをビルドするのに1時間ぐらいハマったのでメモしておく

Posted at

Rust製のエディタにSodiumがあります。
これをビルドして勉強しようと思ったのですが、思った以上に手間取ったのでメモを残して置きます。

環境

macOS 10.13.6 (17G65)
Homebrew 1.7.4-65-g2d8d412
cargo 1.29.0 (524a578d7 2018-08-05)

問題点

cargo buildでコケる。

エラーメッセージ

% > cargo build                                                                                                                                                                
   Compiling orbclient v0.3.17
error[E0554]: #![feature] may not be used on the stable release channel
 --> /Users/xxx/.cargo/registry/src/github.com-1ecc6299db9ec823/orbclient-0.3.17/src/lib.rs:3:1
  |
3 | #![feature(alloc)]
  | ^^^^^^^^^^^^^^^^^^

error[E0554]: #![feature] may not be used on the stable release channel
 --> /Users/xxx/.cargo/registry/src/github.com-1ecc6299db9ec823/orbclient-0.3.17/src/lib.rs:4:1
  |
4 | #![feature(asm)]
  | ^^^^^^^^^^^^^^^^

error[E0554]: #![feature] may not be used on the stable release channel
 --> /Users/xxx/.cargo/registry/src/github.com-1ecc6299db9ec823/orbclient-0.3.17/src/lib.rs:5:1
  |
5 | #![feature(const_fn)]
  | ^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 3 previous errors

For more information about this error, try `rustc --explain E0554`.
error: Could not compile `orbclient`.

解決方法

sdl2をインストール、cargoのバージョンをnightlyに変更。私はこれでbuildが通るようになりました。

> brew install sdl2
> rustup update
> rustup override set nightly
> rustup update nightly

この時点でcargoのバージョンは以下のようになっています。

> cargo -V
cargo 1.30.0-nightly (a5d829494 2018-09-13)
10
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
10
6