Skip to content

Commit 6d88ed5

Browse files
authored
Use wasm32-wasip1 target. (#277)
Note that @rules_rust//rust/platform:wasi still evaluates to wasm32-wasi, and there is no @platforms//os defined for wasip1, so this doesn't change anything for Bazel builds. Signed-off-by: Piotr Sikora <[email protected]>
1 parent 7266794 commit 6d88ed5

File tree

13 files changed

+36
-36
lines changed

13 files changed

+36
-36
lines changed

.github/workflows/rust.yml

+24-24
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ jobs:
8383
- name: Build (wasm32-unknown-unknown)
8484
run: bazelisk --noworkspace_rc build --noenable_bzlmod --platforms=@rules_rust//rust/platform:wasm //...
8585

86-
- name: Build (wasm32-wasi)
86+
- name: Build (wasm32-wasip1)
8787
run: bazelisk --noworkspace_rc build --noenable_bzlmod --platforms=@rules_rust//rust/platform:wasi //...
8888

8989
- name: Format (buildifier)
@@ -196,19 +196,19 @@ jobs:
196196
run: |
197197
rustup toolchain install stable --component clippy --component rustfmt
198198
rustup target add wasm32-unknown-unknown
199-
rustup target add wasm32-wasi
199+
rustup target add wasm32-wasip1
200200
201201
- name: Build (wasm32-unknown-unknown)
202202
run: cargo build --release --all-targets --target=wasm32-unknown-unknown
203203

204204
- name: Clippy (wasm32-unknown-unknown)
205205
run: cargo clippy --release --all-targets --target=wasm32-unknown-unknown
206206

207-
- name: Build (wasm32-wasi)
208-
run: cargo build --release --all-targets --target=wasm32-wasi
207+
- name: Build (wasm32-wasip1)
208+
run: cargo build --release --all-targets --target=wasm32-wasip1
209209

210-
- name: Clippy (wasm32-wasi)
211-
run: cargo clippy --release --all-targets --target=wasm32-wasi
210+
- name: Clippy (wasm32-wasip1)
211+
run: cargo clippy --release --all-targets --target=wasm32-wasip1
212212

213213
- name: Format (rustfmt)
214214
run: cargo fmt -- --check
@@ -259,19 +259,19 @@ jobs:
259259
rustup toolchain install nightly --component clippy --component rustfmt
260260
rustup default nightly
261261
rustup target add wasm32-unknown-unknown
262-
rustup target add wasm32-wasi
262+
rustup target add wasm32-wasip1
263263
264264
- name: Build (wasm32-unknown-unknown)
265265
run: cargo build --release --all-targets --target=wasm32-unknown-unknown
266266

267267
- name: Clippy (wasm32-unknown-unknown)
268268
run: cargo clippy --release --all-targets --target=wasm32-unknown-unknown
269269

270-
- name: Build (wasm32-wasi)
271-
run: cargo build --release --all-targets --target=wasm32-wasi
270+
- name: Build (wasm32-wasip1)
271+
run: cargo build --release --all-targets --target=wasm32-wasip1
272272

273-
- name: Clippy (wasm32-wasi)
274-
run: cargo clippy --release --all-targets --target=wasm32-wasi
273+
- name: Clippy (wasm32-wasip1)
274+
run: cargo clippy --release --all-targets --target=wasm32-wasip1
275275

276276
- name: Format (rustfmt)
277277
run: cargo fmt -- --check
@@ -402,13 +402,13 @@ jobs:
402402
- name: Update Rust
403403
run: |
404404
rustup toolchain install stable --component clippy --component rustfmt
405-
rustup target add wasm32-wasi
405+
rustup target add wasm32-wasip1
406406
407-
- name: Build (wasm32-wasi)
408-
run: cargo build --release --target=wasm32-wasi
407+
- name: Build (wasm32-wasip1)
408+
run: cargo build --release --target=wasm32-wasip1
409409

410-
- name: Clippy (wasm32-wasi)
411-
run: cargo clippy --release --target=wasm32-wasi
410+
- name: Clippy (wasm32-wasip1)
411+
run: cargo clippy --release --target=wasm32-wasip1
412412

413413
- name: Format (rustfmt)
414414
run: cargo fmt -- --check
@@ -428,7 +428,7 @@ jobs:
428428
run: |
429429
docker run --rm \
430430
-v $(pwd)/envoy.yaml:/envoy.yaml \
431-
-v $(pwd)/target/wasm32-wasi/release:/etc/envoy/proxy-wasm-plugins \
431+
-v $(pwd)/target/wasm32-wasip1/release:/etc/envoy/proxy-wasm-plugins \
432432
envoyproxy/envoy:v1.31-latest \
433433
--mode validate \
434434
-c envoy.yaml
@@ -482,20 +482,20 @@ jobs:
482482
- name: Update Rust
483483
run: |
484484
rustup toolchain install nightly --component clippy --component rustfmt
485-
rustup +nightly target add wasm32-wasi
486485
rustup default nightly
486+
rustup target add wasm32-wasip1
487487
488488
- name: Change crate type from library to binary
489489
run: |
490490
grep -v '^\[lib\]' Cargo.toml > Cargo.tmp
491491
grep -v '^crate-type' Cargo.tmp > Cargo.toml
492492
mv src/lib.rs src/main.rs
493493
494-
- name: Build (wasm32-wasi)
495-
run: cargo build --release --target=wasm32-wasi
494+
- name: Build (wasm32-wasip1)
495+
run: cargo build --release --target=wasm32-wasip1
496496

497-
- name: Clippy (wasm32-wasi)
498-
run: cargo clippy --release --target=wasm32-wasi
497+
- name: Clippy (wasm32-wasip1)
498+
run: cargo clippy --release --target=wasm32-wasip1
499499

500500
- name: Format (rustfmt)
501501
run: cargo fmt -- --check
@@ -515,7 +515,7 @@ jobs:
515515

516516
- name: Rename .wasm to match expected filename
517517
run: |
518-
cd target/wasm32-wasi/release
518+
cd target/wasm32-wasip1/release
519519
for file in $(ls -1 *.wasm); do \
520520
mv $file $(echo $file | sed 's/-/_/g'); \
521521
done
@@ -524,7 +524,7 @@ jobs:
524524
run: |
525525
docker run --rm \
526526
-v $(pwd)/envoy.yaml:/envoy.yaml \
527-
-v $(pwd)/target/wasm32-wasi/release:/etc/envoy/proxy-wasm-plugins \
527+
-v $(pwd)/target/wasm32-wasip1/release:/etc/envoy/proxy-wasm-plugins \
528528
envoyproxy/envoy:v1.31-latest \
529529
--mode validate \
530530
-c envoy.yaml

examples/grpc_auth_random/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Proxy-Wasm plugin that grants access based on a result of gRPC callout.
55
### Building
66

77
```sh
8-
$ cargo build --target wasm32-wasi --release
8+
$ cargo build --target wasm32-wasip1 --release
99
```
1010

1111
### Using in Envoy

examples/grpc_auth_random/docker-compose.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ services:
2020
- "10000:10000"
2121
volumes:
2222
- ./envoy.yaml:/etc/envoy/envoy.yaml
23-
- ./target/wasm32-wasi/release:/etc/envoy/proxy-wasm-plugins
23+
- ./target/wasm32-wasip1/release:/etc/envoy/proxy-wasm-plugins
2424
networks:
2525
- envoymesh
2626
depends_on:

examples/hello_world/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Proxy-Wasm background service plugin that logs time and random numbers.
55
### Building
66

77
```sh
8-
$ cargo build --target wasm32-wasi --release
8+
$ cargo build --target wasm32-wasip1 --release
99
```
1010

1111
### Using in Envoy

examples/hello_world/docker-compose.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ services:
2020
- "10000:10000"
2121
volumes:
2222
- ./envoy.yaml:/etc/envoy/envoy.yaml
23-
- ./target/wasm32-wasi/release:/etc/envoy/proxy-wasm-plugins
23+
- ./target/wasm32-wasip1/release:/etc/envoy/proxy-wasm-plugins
2424
networks:
2525
- envoymesh
2626
networks:

examples/http_auth_random/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Proxy-Wasm plugin that grants access based on a result of HTTP callout.
55
### Building
66

77
```sh
8-
$ cargo build --target wasm32-wasi --release
8+
$ cargo build --target wasm32-wasip1 --release
99
```
1010

1111
### Using in Envoy

examples/http_auth_random/docker-compose.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ services:
2020
- "10000:10000"
2121
volumes:
2222
- ./envoy.yaml:/etc/envoy/envoy.yaml
23-
- ./target/wasm32-wasi/release:/etc/envoy/proxy-wasm-plugins
23+
- ./target/wasm32-wasip1/release:/etc/envoy/proxy-wasm-plugins
2424
networks:
2525
- envoymesh
2626
depends_on:

examples/http_body/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Proxy-Wasm plugin that redacts sensitive HTTP responses.
55
### Building
66

77
```sh
8-
$ cargo build --target wasm32-wasi --release
8+
$ cargo build --target wasm32-wasip1 --release
99
```
1010

1111
### Using in Envoy

examples/http_body/docker-compose.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ services:
2020
- "10000:10000"
2121
volumes:
2222
- ./envoy.yaml:/etc/envoy/envoy.yaml
23-
- ./target/wasm32-wasi/release:/etc/envoy/proxy-wasm-plugins
23+
- ./target/wasm32-wasip1/release:/etc/envoy/proxy-wasm-plugins
2424
networks:
2525
- envoymesh
2626
networks:

examples/http_config/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Proxy-Wasm plugin that injects HTTP response header with a value from Envoy conf
55
### Building
66

77
```sh
8-
$ cargo build --target wasm32-wasi --release
8+
$ cargo build --target wasm32-wasip1 --release
99
```
1010

1111
### Using in Envoy

examples/http_config/docker-compose.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ services:
2020
- "10000:10000"
2121
volumes:
2222
- ./envoy.yaml:/etc/envoy/envoy.yaml
23-
- ./target/wasm32-wasi/release:/etc/envoy/proxy-wasm-plugins
23+
- ./target/wasm32-wasip1/release:/etc/envoy/proxy-wasm-plugins
2424
networks:
2525
- envoymesh
2626
networks:

examples/http_headers/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Proxy-Wasm plugin that logs HTTP request/response headers.
55
### Building
66

77
```sh
8-
$ cargo build --target wasm32-wasi --release
8+
$ cargo build --target wasm32-wasip1 --release
99
```
1010

1111
### Using in Envoy

examples/http_headers/docker-compose.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ services:
2020
- "10000:10000"
2121
volumes:
2222
- ./envoy.yaml:/etc/envoy/envoy.yaml
23-
- ./target/wasm32-wasi/release:/etc/envoy/proxy-wasm-plugins
23+
- ./target/wasm32-wasip1/release:/etc/envoy/proxy-wasm-plugins
2424
networks:
2525
- envoymesh
2626
networks:

0 commit comments

Comments
 (0)