-
Notifications
You must be signed in to change notification settings - Fork 715
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
Can't use ring on wasm32-unknown-unknown
due to a missing import (for Envoy Proxy)
#1453
Comments
wasm32-unknown-unknown
due to a due to a missing importwasm32-unknown-unknown
due to a missing import
What wasm runtime does Envoy use? Knowing this would help me make progress in diagnosing this. Could you try to reproduce this without Envoy, using just that wasm runtime, but without the Envoy-specific stuff? |
wasm32-unknown-unknown
due to a missing importwasm32-unknown-unknown
due to a missing import (for Envoy Proxy)
Envoy uses wee8/ Testing the above code with latest envoy from
The exact SHA used for wee8, https://github.com/envoyproxy/envoy/blob/79205cdde2dd07cd92f175b0d699b443b516fc5d/bazel/repository_locations.bzl#L889-L902 |
I'm also targeting The error I'm seeing is: Does anyone have any advice on a possible way forward? Thanks. |
It seems like maybe #1176 is relevant and perhaps would have addressed the error I'm seeing. There was a concern at the time around signing but I'm only interested in verifying when targeting Does anyone know anything more? |
I'm trying out the tip of |
Now running into "could not find |
Trying this: #918 (comment) |
This appears to have worked: codebase-labs@11aafb0 |
I spoke too soon. Everything built but I'm back to the
|
Actually I think it did work and I just ran into a stale lockfile issue. |
Nope, I think the stale lockfile was giving me the impression that things were working when they weren't. |
Trying this approach (env vars) next: #1483 (comment) I've had no need for |
I think the issue may be with I tried to summarize things here: https://users.rust-lang.org/t/extern-c-and-wasm/83579 |
The main branch of ring (pending 0.17 release) does not use wasm-bindgen at all, as we've switched to using |
I just tested this, and actually, I am not sure I'm going to be able to use the other working wasm targets; probably by registering my custom randomness source (that will always fail for my case) |
People will need to make their own assessment on the security implications of this but I figured I should at least share what I did in betrusted-io#2 to get a fork of |
I believe that ring 0.17 implements everything needed for this, except for a random number generator. @gagbo wrote:
The main question is, how are WeebAssembly plugins for Envoy supposed to get random bytes? When researching the answer to that question, I found proxy-wasm/proxy-wasm-rust-sdk#97 which indicates that you should use thw wasm32-wasi target instead of wasm32-unknown-unknown. That specifically will solve the random bytes issue and things will "just work." There is a PR #1568 that adds wasm32-wasi testing to ring's CI. I'm going to close this as "not planned" because I assume everybody wlll switch to the wasm32-wasi target. LMK if that's not possible for some reason. |
I'm not using "Envoy", so I wouldn't know, but our in-house (@fiberplane) plugin system gets its random bytes from the host runtime. We ship a wasmer runtime with custom bindings that allow access to a source of random bytes. And we didn't migrate to something that could target wasi as far as I know, so this wouldn't help. On the other hand, our issue with EDIT: and sorry for the delay in the response |
PR #1754 will allow you to use the However, in general I recommend people use a target that's not wasm32-unknown-unknown whenever practical so that such workarounds aren't necessary. (We should create |
Hello, I'm trying to use the ring's SHA and HMAC for
wasm32-unknown-unknown
target. I'm building the WASM plugin for the envoy proxy. The build procedure works, but I can't load the WASM file into envoy's. Here is the reproducible source:Cargo.toml:
src/lib.rs:
Example configuration for envoy:
After building via
cargo build --target=wasm32-unknown-unknown
and running envoy viaenvoy --config-path envoy.yaml --concurrency 0 -l info
I'm getting this error from the envoy side:There are a lot of libraries that depend on the ring, however, I can't use them because of the broken dependency...
The text was updated successfully, but these errors were encountered: