Skip to content

Commit 8f6f2cd

Browse files
authored
Merge branch 'main' into wasip1
2 parents 00e1e90 + 7266794 commit 8f6f2cd

23 files changed

+219
-1095
lines changed

.bazelversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.2.1
1+
7.4.0

.github/workflows/rust.yml

Lines changed: 126 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ jobs:
3838
with:
3939
go-version: '^1.16'
4040

41+
- name: Cache
42+
if: ${{ env.ACT }}
43+
uses: actions/cache@v2
44+
with:
45+
path: |
46+
~/go/pkg/mod
47+
key: licenses-${{ hashFiles('.github/workflows/rust.yml') }}
48+
4149
- name: Check licenses
4250
run: |
4351
go install github.com/google/addlicense@latest
@@ -53,11 +61,6 @@ jobs:
5361
with:
5462
go-version: '^1.16'
5563

56-
- name: Install dependencies
57-
if: ${{ env.ACT }}
58-
run: |
59-
go install github.com/bazelbuild/[email protected]
60-
6164
- name: Cache
6265
uses: actions/cache@v2
6366
with:
@@ -66,9 +69,16 @@ jobs:
6669
~/.cache/bazelisk
6770
~/.cargo/.crates.toml
6871
~/.cargo/.crates2.json
72+
~/.cargo/advisory-db
6973
~/.cargo/bin
7074
~/.cargo/registry
71-
key: ${{ hashFiles('WORKSPACE', '.bazelrc', '.bazelversion', 'bazel/cargo/Cargo.Bazel.lock', 'bazel/dependencies.bzl', 'bazel/repositories.bzl') }}
75+
~/go/pkg/mod
76+
key: bazel-${{ hashFiles('BUILD', 'WORKSPACE', '.bazelrc', '.bazelversion', 'bazel/cargo/Cargo.Bazel.lock', 'bazel/dependencies.bzl', 'bazel/repositories.bzl') }}
77+
78+
- name: Install dependencies
79+
if: ${{ env.ACT }}
80+
run: |
81+
go install github.com/bazelbuild/[email protected]
7282
7383
- name: Build (wasm32-unknown-unknown)
7484
run: bazelisk --noworkspace_rc build --noenable_bzlmod --platforms=@rules_rust//rust/platform:wasm //...
@@ -80,8 +90,7 @@ jobs:
8090
run: |
8191
go install github.com/bazelbuild/buildtools/buildifier@latest
8292
export PATH=$PATH:$(go env GOPATH)/bin
83-
buildifier -mode=check WORKSPACE
84-
buildifier -mode=check BUILD
93+
buildifier -mode=check -r .
8594
8695
- name: Format (rules_rust)
8796
run: |
@@ -97,6 +106,20 @@ jobs:
97106
steps:
98107
- uses: actions/checkout@v2
99108

109+
- name: Cache
110+
if: ${{ env.ACT }}
111+
uses: actions/cache@v2
112+
with:
113+
path: |
114+
~/.cargo/.crates.toml
115+
~/.cargo/.crates2.json
116+
~/.cargo/advisory-db
117+
~/.cargo/bin
118+
~/.cargo/registry
119+
~/.rustup
120+
**/target
121+
key: msrv-${{ hashFiles('Cargo.toml') }}
122+
100123
- name: Install dependencies
101124
if: ${{ env.ACT }}
102125
run: |
@@ -146,6 +169,20 @@ jobs:
146169
steps:
147170
- uses: actions/checkout@v2
148171

172+
- name: Cache
173+
if: ${{ env.ACT }}
174+
uses: actions/cache@v2
175+
with:
176+
path: |
177+
~/.cargo/.crates.toml
178+
~/.cargo/.crates2.json
179+
~/.cargo/advisory-db
180+
~/.cargo/bin
181+
~/.cargo/registry
182+
~/.rustup
183+
**/target
184+
key: stable-${{ hashFiles('Cargo.toml') }}
185+
149186
- name: Install dependencies
150187
if: ${{ env.ACT }}
151188
run: |
@@ -194,6 +231,20 @@ jobs:
194231
steps:
195232
- uses: actions/checkout@v2
196233

234+
- name: Cache
235+
if: ${{ env.ACT }}
236+
uses: actions/cache@v2
237+
with:
238+
path: |
239+
~/.cargo/.crates.toml
240+
~/.cargo/.crates2.json
241+
~/.cargo/advisory-db
242+
~/.cargo/bin
243+
~/.cargo/registry
244+
~/.rustup
245+
**/target
246+
key: nightly-${{ hashFiles('Cargo.toml') }}
247+
197248
- name: Install dependencies
198249
if: ${{ env.ACT }}
199250
run: |
@@ -240,6 +291,19 @@ jobs:
240291
steps:
241292
- uses: actions/checkout@v2
242293

294+
- name: Cache
295+
if: ${{ env.ACT }}
296+
uses: actions/cache@v2
297+
with:
298+
path: |
299+
~/.cargo/.crates.toml
300+
~/.cargo/.crates2.json
301+
~/.cargo/advisory-db
302+
~/.cargo/bin
303+
~/.cargo/registry
304+
~/.rustup
305+
key: outdated-${{ hashFiles('Cargo.toml') }}
306+
243307
- name: Install dependencies
244308
if: ${{ env.ACT }}
245309
run: |
@@ -260,6 +324,19 @@ jobs:
260324
steps:
261325
- uses: actions/checkout@v2
262326

327+
- name: Cache
328+
if: ${{ env.ACT }}
329+
uses: actions/cache@v2
330+
with:
331+
path: |
332+
~/.cargo/.crates.toml
333+
~/.cargo/.crates2.json
334+
~/.cargo/advisory-db
335+
~/.cargo/bin
336+
~/.cargo/registry
337+
~/.rustup
338+
key: audit-${{ hashFiles('Cargo.toml') }}
339+
263340
- name: Install dependencies
264341
if: ${{ env.ACT }}
265342
run: |
@@ -276,7 +353,7 @@ jobs:
276353
cp -p bazel/cargo/Cargo.Bazel.lock Cargo.lock
277354
cargo audit
278355
279-
example:
356+
examples:
280357
runs-on: ubuntu-latest
281358

282359
strategy:
@@ -299,6 +376,20 @@ jobs:
299376
steps:
300377
- uses: actions/checkout@v2
301378

379+
- name: Cache
380+
if: ${{ env.ACT }}
381+
uses: actions/cache@v2
382+
with:
383+
path: |
384+
~/.cargo/.crates.toml
385+
~/.cargo/.crates2.json
386+
~/.cargo/advisory-db
387+
~/.cargo/bin
388+
~/.cargo/registry
389+
~/.rustup
390+
**/target
391+
key: example-${{ matrix.example }}-${{ hashFiles('Cargo.toml') }}
392+
302393
- name: Install dependencies
303394
if: ${{ env.ACT }}
304395
run: |
@@ -326,9 +417,11 @@ jobs:
326417
run: cargo verify-project
327418

328419
- name: Run cargo audit
420+
if: ${{ !env.ACT }}
329421
run: cargo audit
330422

331423
- name: Run cargo outdated
424+
if: ${{ !env.ACT }}
332425
run: cargo outdated --root-deps-only --exit-code 1
333426

334427
- name: Validate Envoy config
@@ -340,7 +433,7 @@ jobs:
340433
--mode validate \
341434
-c envoy.yaml
342435
343-
reactor:
436+
reactors:
344437
runs-on: ubuntu-latest
345438

346439
strategy:
@@ -363,12 +456,26 @@ jobs:
363456
steps:
364457
- uses: actions/checkout@v2
365458

459+
- name: Cache
460+
if: ${{ env.ACT }}
461+
uses: actions/cache@v2
462+
with:
463+
path: |
464+
~/.cargo/.crates.toml
465+
~/.cargo/.crates2.json
466+
~/.cargo/advisory-db
467+
~/.cargo/bin
468+
~/.cargo/registry
469+
~/.rustup
470+
**/target
471+
key: reactor-${{ matrix.example }}-${{ hashFiles('Cargo.toml') }}
472+
366473
- name: Install dependencies
367474
if: ${{ env.ACT }}
368475
run: |
369476
curl -OL https://static.rust-lang.org/rustup/rustup-init.sh
370477
chmod +x ./rustup-init.sh
371-
./rustup-init.sh -y
478+
./rustup-init.sh -y --default-toolchain nightly
372479
rm rustup-init.sh
373480
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
374481
@@ -396,11 +503,15 @@ jobs:
396503
- name: Format (manifest)
397504
run: cargo verify-project
398505

399-
- name: Run cargo audit
400-
run: cargo audit
506+
# TODO: Re-enable once cargo audit supports Cargo lockfile v4.
507+
#- name: Run cargo audit
508+
# if: ${{ !env.ACT }}
509+
# run: cargo audit
401510

402-
- name: Run cargo outdated
403-
run: cargo outdated --root-deps-only --exit-code 1
511+
# TODO: Re-enable once cargo outdated supports Cargo lockfile v4.
512+
#- name: Run cargo outdated
513+
# if: ${{ !env.ACT }}
514+
# run: cargo outdated --root-deps-only --exit-code 1
404515

405516
- name: Rename .wasm to match expected filename
406517
run: |

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "proxy-wasm"
3-
version = "0.2.2"
3+
version = "0.2.3-dev"
44
authors = ["Piotr Sikora <[email protected]>"]
55
rust-version = "1.64"
66
description = "WebAssembly for Proxies"
@@ -11,7 +11,7 @@ edition = "2018"
1111
build = "build.rs"
1212

1313
[dependencies]
14-
hashbrown = "0.14"
14+
hashbrown = "0.15"
1515
log = "0.4"
1616

1717
[profile.release]

DEVELOPMENT.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Development
2+
3+
## Testing
4+
5+
GitHub Actions can be executed locally using the [`act`] tool.
6+
7+
All tests can be executed using:
8+
9+
act
10+
11+
Individual tests can be executed using `-j` and `--matrix` parameters, e.g.:
12+
13+
act -j bazel
14+
act -j stable
15+
act -j nightly
16+
act -j examples --matrix example:http_auth_random
17+
18+
By default, all jobs are cached in `~/.cache/actcache`. This can be disabled
19+
using the `--no-cache-server` parameter.
20+
21+
## Updating Bazel dependencies
22+
23+
When adding or updating Cargo dependencies, the existing Bazel `BUILD` files
24+
must be regenerated using the [`bazelisk`] tool:
25+
26+
```sh
27+
bazelisk run //bazel/cargo:crates_vendor -- --repin all
28+
```
29+
30+
31+
[`act`]: https://github.com/nektos/act
32+
[`bazelisk`]: https://github.com/bazelbuild/bazelisk

README.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,6 @@
2828
- [Extending Envoy with WASM and Rust](https://antweiss.com/blog/extending-envoy-with-wasm-and-rust/)
2929
- [Writing Envoy filters in Rust with WebAssembly](https://content.red-badger.com/resources/extending-istio-with-rust-and-webassembly)
3030

31-
## Updating dependencies
31+
## Contributing changes
3232

33-
When updating dependencies, you need to regenerate Bazel `BUILD` files to match updated `Cargo.toml`:
34-
35-
```sh
36-
bazel run //bazel/cargo:crates_vendor -- --repin all
37-
```
33+
See [CONTRIBUTING.md](./CONTRIBUTING.md) and [DEVELOPMENT.md](./DEVELOPMENT.md) files.

bazel/BUILD

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,3 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-

0 commit comments

Comments
 (0)