Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use wasm32-wasip1 target. #277

Merged
merged 3 commits into from
Oct 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 24 additions & 24 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:
- name: Build (wasm32-unknown-unknown)
run: bazelisk --noworkspace_rc build --noenable_bzlmod --platforms=@rules_rust//rust/platform:wasm //...

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

- name: Format (buildifier)
Expand Down Expand Up @@ -196,19 +196,19 @@ jobs:
run: |
rustup toolchain install stable --component clippy --component rustfmt
rustup target add wasm32-unknown-unknown
rustup target add wasm32-wasi
rustup target add wasm32-wasip1

- name: Build (wasm32-unknown-unknown)
run: cargo build --release --all-targets --target=wasm32-unknown-unknown

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

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

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

- name: Format (rustfmt)
run: cargo fmt -- --check
Expand Down Expand Up @@ -259,19 +259,19 @@ jobs:
rustup toolchain install nightly --component clippy --component rustfmt
rustup default nightly
rustup target add wasm32-unknown-unknown
rustup target add wasm32-wasi
rustup target add wasm32-wasip1

- name: Build (wasm32-unknown-unknown)
run: cargo build --release --all-targets --target=wasm32-unknown-unknown

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

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

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

- name: Format (rustfmt)
run: cargo fmt -- --check
Expand Down Expand Up @@ -402,13 +402,13 @@ jobs:
- name: Update Rust
run: |
rustup toolchain install stable --component clippy --component rustfmt
rustup target add wasm32-wasi
rustup target add wasm32-wasip1

- name: Build (wasm32-wasi)
run: cargo build --release --target=wasm32-wasi
- name: Build (wasm32-wasip1)
run: cargo build --release --target=wasm32-wasip1

- name: Clippy (wasm32-wasi)
run: cargo clippy --release --target=wasm32-wasi
- name: Clippy (wasm32-wasip1)
run: cargo clippy --release --target=wasm32-wasip1

- name: Format (rustfmt)
run: cargo fmt -- --check
Expand All @@ -428,7 +428,7 @@ jobs:
run: |
docker run --rm \
-v $(pwd)/envoy.yaml:/envoy.yaml \
-v $(pwd)/target/wasm32-wasi/release:/etc/envoy/proxy-wasm-plugins \
-v $(pwd)/target/wasm32-wasip1/release:/etc/envoy/proxy-wasm-plugins \
envoyproxy/envoy:v1.31-latest \
--mode validate \
-c envoy.yaml
Expand Down Expand Up @@ -482,20 +482,20 @@ jobs:
- name: Update Rust
run: |
rustup toolchain install nightly --component clippy --component rustfmt
rustup +nightly target add wasm32-wasi
rustup default nightly
rustup target add wasm32-wasip1

- name: Change crate type from library to binary
run: |
grep -v '^\[lib\]' Cargo.toml > Cargo.tmp
grep -v '^crate-type' Cargo.tmp > Cargo.toml
mv src/lib.rs src/main.rs

- name: Build (wasm32-wasi)
run: cargo build --release --target=wasm32-wasi
- name: Build (wasm32-wasip1)
run: cargo build --release --target=wasm32-wasip1

- name: Clippy (wasm32-wasi)
run: cargo clippy --release --target=wasm32-wasi
- name: Clippy (wasm32-wasip1)
run: cargo clippy --release --target=wasm32-wasip1

- name: Format (rustfmt)
run: cargo fmt -- --check
Expand All @@ -515,7 +515,7 @@ jobs:

- name: Rename .wasm to match expected filename
run: |
cd target/wasm32-wasi/release
cd target/wasm32-wasip1/release
for file in $(ls -1 *.wasm); do \
mv $file $(echo $file | sed 's/-/_/g'); \
done
Expand All @@ -524,7 +524,7 @@ jobs:
run: |
docker run --rm \
-v $(pwd)/envoy.yaml:/envoy.yaml \
-v $(pwd)/target/wasm32-wasi/release:/etc/envoy/proxy-wasm-plugins \
-v $(pwd)/target/wasm32-wasip1/release:/etc/envoy/proxy-wasm-plugins \
envoyproxy/envoy:v1.31-latest \
--mode validate \
-c envoy.yaml
2 changes: 1 addition & 1 deletion examples/grpc_auth_random/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Proxy-Wasm plugin that grants access based on a result of gRPC callout.
### Building

```sh
$ cargo build --target wasm32-wasi --release
$ cargo build --target wasm32-wasip1 --release
```

### Using in Envoy
Expand Down
2 changes: 1 addition & 1 deletion examples/grpc_auth_random/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ services:
- "10000:10000"
volumes:
- ./envoy.yaml:/etc/envoy/envoy.yaml
- ./target/wasm32-wasi/release:/etc/envoy/proxy-wasm-plugins
- ./target/wasm32-wasip1/release:/etc/envoy/proxy-wasm-plugins
networks:
- envoymesh
depends_on:
Expand Down
2 changes: 1 addition & 1 deletion examples/hello_world/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Proxy-Wasm background service plugin that logs time and random numbers.
### Building

```sh
$ cargo build --target wasm32-wasi --release
$ cargo build --target wasm32-wasip1 --release
```

### Using in Envoy
Expand Down
2 changes: 1 addition & 1 deletion examples/hello_world/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ services:
- "10000:10000"
volumes:
- ./envoy.yaml:/etc/envoy/envoy.yaml
- ./target/wasm32-wasi/release:/etc/envoy/proxy-wasm-plugins
- ./target/wasm32-wasip1/release:/etc/envoy/proxy-wasm-plugins
networks:
- envoymesh
networks:
Expand Down
2 changes: 1 addition & 1 deletion examples/http_auth_random/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Proxy-Wasm plugin that grants access based on a result of HTTP callout.
### Building

```sh
$ cargo build --target wasm32-wasi --release
$ cargo build --target wasm32-wasip1 --release
```

### Using in Envoy
Expand Down
2 changes: 1 addition & 1 deletion examples/http_auth_random/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ services:
- "10000:10000"
volumes:
- ./envoy.yaml:/etc/envoy/envoy.yaml
- ./target/wasm32-wasi/release:/etc/envoy/proxy-wasm-plugins
- ./target/wasm32-wasip1/release:/etc/envoy/proxy-wasm-plugins
networks:
- envoymesh
depends_on:
Expand Down
2 changes: 1 addition & 1 deletion examples/http_body/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Proxy-Wasm plugin that redacts sensitive HTTP responses.
### Building

```sh
$ cargo build --target wasm32-wasi --release
$ cargo build --target wasm32-wasip1 --release
```

### Using in Envoy
Expand Down
2 changes: 1 addition & 1 deletion examples/http_body/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ services:
- "10000:10000"
volumes:
- ./envoy.yaml:/etc/envoy/envoy.yaml
- ./target/wasm32-wasi/release:/etc/envoy/proxy-wasm-plugins
- ./target/wasm32-wasip1/release:/etc/envoy/proxy-wasm-plugins
networks:
- envoymesh
networks:
Expand Down
2 changes: 1 addition & 1 deletion examples/http_config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Proxy-Wasm plugin that injects HTTP response header with a value from Envoy conf
### Building

```sh
$ cargo build --target wasm32-wasi --release
$ cargo build --target wasm32-wasip1 --release
```

### Using in Envoy
Expand Down
2 changes: 1 addition & 1 deletion examples/http_config/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ services:
- "10000:10000"
volumes:
- ./envoy.yaml:/etc/envoy/envoy.yaml
- ./target/wasm32-wasi/release:/etc/envoy/proxy-wasm-plugins
- ./target/wasm32-wasip1/release:/etc/envoy/proxy-wasm-plugins
networks:
- envoymesh
networks:
Expand Down
2 changes: 1 addition & 1 deletion examples/http_headers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Proxy-Wasm plugin that logs HTTP request/response headers.
### Building

```sh
$ cargo build --target wasm32-wasi --release
$ cargo build --target wasm32-wasip1 --release
```

### Using in Envoy
Expand Down
2 changes: 1 addition & 1 deletion examples/http_headers/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ services:
- "10000:10000"
volumes:
- ./envoy.yaml:/etc/envoy/envoy.yaml
- ./target/wasm32-wasi/release:/etc/envoy/proxy-wasm-plugins
- ./target/wasm32-wasip1/release:/etc/envoy/proxy-wasm-plugins
networks:
- envoymesh
networks:
Expand Down
Loading