derrickaw opened a new pull request, #41449: URL: https://github.com/apache/beam/pull/41449
Note: this PR was auto-generated by tooling. Before moving it out of draft, the author has done a full review of the PR, specifically evaluating it on the following criteria: - The PR remediates a confirmed, live vulnerability on `master` that Dependabot is not already addressing - The version update is minimal, respects Beam's compatibility bounds, and avoids unrelated dependency churn - Relevant lockfiles, package constraints, and tests have been verified If you have concerns with the PR or with the underlying methodology used to generate this, please comment below - they will be addressed by the author not the tooling :) ## Summary Removes the unmaintained `wee_alloc` (`0.4.5`) dependency from `sdks/go/examples/wasm` to resolve `GHSA-rc23-xxgq-x27g` (`RUSTSEC-2022-0054`, Critical), using Rust's built-in `wasm32-unknown-unknown` standard-library allocator (`dlmalloc`) instead: - **`sdks/go/examples/wasm/Cargo.toml`**: Removes `wee_alloc = "0.4.5"` (leaving zero external crate dependencies) and sets `strip = "symbols"` under `[profile.release]` (`greet.wasm` size drops from `62.5 KB` to `15.6 KB`). - **`sdks/go/examples/wasm/greet.rs`**: Drops `extern crate wee_alloc` and `#[global_allocator] static ALLOC`, ensures `allocate(size)` allocates a `size`-length `Box<[MaybeUninit<u8>]>` matching `deallocate(ptr, size)`'s layout capacity (consistent with upstream `tetratelabs/wazero` `examples/allocation/rust`), and calls `shrink_to_fit()` on leaked `greeting` strings so `capacity == len` matches the `resultSize` passed back to `deallocate`. - **`sdks/go/examples/wasm/greet.wasm`**: Recompiled with `cargo build --release --target wasm32-unknown-unknown`. - **`sdks/go/examples/wasm/wasm_test.go`**: Adds a unit test (`TestEmbeddedWasmFn`) exercising `embeddedWasmFn` across empty, ASCII, accented UTF-8, and multi-byte emoji strings. ## Verification - Verified `cargo build --release --target wasm32-unknown-unknown` succeeds with zero external dependencies. - Verified `go run ./go/examples/wasm --output=...` produces identical output to baseline. - Verified `go test -v ./go/examples/wasm/...` passes (`TestEmbeddedWasmFn`) and stress-tested 1,000 `allocate`/`greeting`/`deallocate` cycles via `wazero`. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
