Skip to content

Commit e80af3e

Browse files
refactor(lang/rust): rust language guide
This commit heavily refactors the rust language guide, accomplishing a few goals: - Moving from `cargo component` to native rust toolchain - Removing sections with advanced funtionality
1 parent a3ac832 commit e80af3e

File tree

15 files changed

+650
-539
lines changed

15 files changed

+650
-539
lines changed

.gitattributes

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@
44
# Ensure binary files aren't considered as text
55
*.wasm binary
66

7-
# Genrated code from cargo-component
8-
component-model/examples/tutorial/*/src/bindings.rs linguist-generated
9-
107
# Generated code from JS tutorial
118
component-model/examples/tutorial/jco/package-lock.json linguist-generated
129

13-
Cargo-component.lock linguist-language=toml
14-

.github/workflows/rust.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,22 +35,20 @@ jobs:
3535
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3636

3737
- name: Install Rust
38-
run: rustup update stable --no-self-update
39-
40-
- uses: taiki-e/cache-cargo-install-action@5c9abe9a3f79d831011df7c47177debbeb320405 # v2.1.2
41-
with:
42-
tool: cargo-component
38+
run: |
39+
rustup update stable --no-self-update
40+
rustup target add wasm32-wasip2
4341
4442
- uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 # v2.7.8
4543
with:
4644
shared-key: ${{ hashFiles('${{ matrix.projects.folder }}/Cargo.lock') }}
4745

48-
- name: Cargo bulid the package
46+
- name: Cargo build the package
4947
working-directory: ${{ matrix.projects.folder }}
5048
if: ${{ matrix.projects.type != 'component' }}
5149
run: cargo build
5250

53-
- name: Cargo component build
51+
- name: Cargo build
5452
working-directory: ${{ matrix.projects.folder }}
5553
if: ${{ matrix.projects.type == 'component' }}
56-
run: cargo component build
54+
run: cargo build

component-model/examples/tutorial/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ To expand the exercise to add more components, add another operator world, expan
4242

4343
## Building and running the example
4444

45-
Use [`cargo-component`](https://github.com/bytecodealliance/cargo-component) and [`wac`](https://github.com/bytecodealliance/wac) to build and compose the calculator component.
45+
Use [`wac`](https://github.com/bytecodealliance/wac) to build and compose the calculator component.
4646

4747
```sh
48-
(cd calculator && cargo component build --release)
49-
(cd adder && cargo component build --release)
50-
(cd command && cargo component build --release)
48+
(cd calculator && cargo build --release)
49+
(cd adder && cargo build --release)
50+
(cd command && cargo build --release)
5151
wac plug calculator/target/wasm32-wasip1/release/calculator.wasm --plug adder/target/wasm32-wasip1/release/adder.wasm -o composed.wasm
5252
wac plug command/target/wasm32-wasip1/release/command.wasm --plug composed.wasm -o final.wasm
5353
```
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[build]
2+
target = "wasm32-wasip2"

0 commit comments

Comments
 (0)