Skip to content

Commit 39b1e1e

Browse files
committed
Update commands and logs in the AtCoder Installing X chapters
1 parent cd0abbd commit 39b1e1e

File tree

3 files changed

+65
-22
lines changed

3 files changed

+65
-22
lines changed

src/atcoder-env/installing-crate-path-builder.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,22 @@ $ sudo -i
1111
# whoami
1212
root
1313

14-
# export RUST_HOME=/usr/local/lib/rust
15-
# git clone https://github.com/rust-lang-ja/TBD.git ${RUST_HOME}/TBD ## TODO
16-
```
17-
18-
```console
19-
# whoami
20-
root
21-
22-
# cd ${RUST_HOME}/TBD ## TODO
23-
# cargo install
14+
# cargo install --git https://github.com/rust-lang-ja/atcorder-rustc-dep-option-generator.git
2415
```
2516

2617
```console
2718
## 一般ユーザで実行
2819
$ source /usr/local/lib/rust/cargo/env
2920

30-
$ TBD -V
21+
$ which gen-deps-compile-options
22+
/usr/local/lib/rust/cargo/bin/gen-deps-compile-options
23+
24+
$ export RUST_LIB=/usr/local/lib/rust/lib
25+
$ gen-deps-compile-options ${RUST_LIB}/Cargo.toml ${RUST_LIB}/target/release/deps
26+
...
27+
28+
## ↑ Errorの文字が表示されなければOK
29+
30+
$ echo $?
31+
0
3132
```

src/atcoder-env/installing-rust-crates.md

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22

33
# クレート(外部ライブラリ)のビルドとインストール
44

5-
**TODO**
5+
**TODO** このページは書きかけです。
66

77
- 対象となるクレートのソースコードを`/usr/local/lib/rust/lib`にダウンロードする
88
- クレートをビルドする。
9-
ビルド済みのクレート(rlibファイル)は`/usr/local/lib/rust/lib/target/release`に出力される
9+
ビルドの成果物(rlibファイル)は`/usr/local/lib/rust/lib/target/release`に出力される
10+
- インストール時にインターネット接続が必要
1011

1112
```console
1213
$ sudo -i
@@ -28,6 +29,23 @@ root
2829
ビルドに成功すると以下のように表示されます。
2930

3031
```console
31-
TODO
32+
# ./build.sh
33+
+ git submodule update --init
34+
+ cargo clean
35+
+ cargo update
36+
+ cargo build --release --frozen
37+
Compiling autocfg v0.1.4
38+
...(中略)...
39+
40+
Finished release [optimized] target(s) in 1m 39s
41+
$
42+
```
3243

44+
```console
45+
$ find target/release/deps/ -name '*.rlib' | wc -l
46+
58
47+
48+
$ ./target/release/main
49+
...
3350
```
51+

src/atcoder-env/installing-rust-toolchain.md

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,21 @@
55
**TODO** このページは書きかけです。
66

77
- Rustツールチェインを`/usr/local/lib/rust`配下にインストール
8-
- インストール時はインターネット接続が必要
8+
- インストール時にインターネット接続が必要
99

1010

1111
## 依存ソフトウェアのインストール
1212

1313
Rustツールチェインのインストールに先立って、Rustプログラムのリンクやクレートのビルドに必要なソフトウェアをインストールします。
1414

15-
- Rustツールチェインやクレートのダウンロードに必要なもの:curl, git-core
16-
- Rustプログラムのリンク時に必要なもの:gcc, binutils
17-
- 一部のRustクレートや関連ツールのビルドに必要なもの:libssl-dev, pkg-config
15+
- Rustツールチェインやクレートのダウンロードに必要なツール:curl, git-core
16+
- Rustプログラムのリンク時に必要なツール:gcc, binutils
17+
- 一部のRustクレートや関連ツールのビルドに必要なツール:make, pkg-config
18+
- 一部のRustクレートや関連ツールのビルドに必要なライブラリ:libssl-dev
1819

1920
```console
2021
$ sudo apt update
21-
$ sudo apt install -y curl git-core gcc binutils libssl-dev pkg-config
22+
$ sudo apt install -y curl git-core gcc binutils make pkg-config libssl-dev
2223
```
2324

2425

@@ -37,13 +38,31 @@ root
3738

3839
# mkdir -p ${RUST_HOME}
3940
# curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | \
40-
sh -s -- --default-toolchain "${RUST_TOOLCHAIN}" --no-modify-path
41+
sh -s -- -y --default-toolchain "${RUST_TOOLCHAIN}" --no-modify-path
4142
```
4243

44+
```console
45+
info: downloading installer
46+
info: syncing channel updates for '1.35.0-x86_64-unknown-linux-gnu'
47+
info: latest update on 2019-05-23, rust version 1.35.0 (3c235d560 2019-05-20)
48+
info: downloading component 'rustc'
49+
88.4 MiB / 88.4 MiB (100 %) 10.9 MiB/s in 10s ETA: 0s
50+
...(中略)...
51+
52+
1.35.0 installed - rustc 1.35.0 (3c235d560 2019-05-20)
53+
54+
55+
Rust is installed now. Great!
56+
57+
To get started you need Cargo's bin directory (/usr/local/lib/rust/cargo/bin)
58+
in your PATH environment variable.
59+
60+
To configure your current shell run source /usr/local/lib/rust/cargo/env
61+
```
4362

4463
## コマンド検索パスの設定
4564

46-
Rust使用させたいLinuxユーザのシェルの初期設定ファイル(例`.bashrc`)に以下のコマンドを追加します。
65+
Rustを使用させたいLinuxユーザのシェルの初期設定ファイル(例`.bashrc`)に以下のコマンドを追加します。
4766

4867
```bash
4968
source /usr/local/lib/rust/cargo/env
@@ -58,10 +77,15 @@ source /usr/local/lib/rust/cargo/env
5877
## 一般ユーザで実行
5978
$ source /usr/local/lib/rust/cargo/env
6079

80+
$ which rustc
81+
/usr/local/lib/rust/cargo/bin/rustc
82+
6183
$ rustc -V
84+
rustc 1.35.0 (3c235d560 2019-05-20)
6285

6386
$ cargo -V
87+
cargo 1.35.0 (6f3e9c367 2019-04-04)
6488

6589
$ rustup -V
66-
90+
rustup 1.18.3 (435397f48 2019-05-22)
6791
```

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy