-
Notifications
You must be signed in to change notification settings - Fork 709
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
wasm32-wasi doesn't build #1043
Comments
I have the same issue (along with the wasm32-unknown-unknown target requiring web-sys). For the context, I'd need ring to work in wasm in a server side setting, so that I can use rustls there. I can provide help in testing solutions for this or even try to fix it in a few days |
related PR: #900 |
I'm happy to get WASI working. I think it is really simple to do now that What I'm missing is a recipe for testing it. I would love help getting the CI/CD running with a good, minimal-dependency, WASI runtime. |
We're using Fastly Lucet: https://www.fastly.com/blog/announcing-lucet-fastly-native-webassembly-compiler-runtime |
I think I'm fine using Lucet or whatever. What I'm hoping for is a small shell script that downloads the necessary thing to run the tests under wasi and then runs the test under wasi, so that I can copy/paste that into the ring CI/CD scripts. Even better would be a PR that modifies the CI/CD scripts to get it working. |
I had to switch from Travis CI to GitHub Actions. Please check out how the new GitHub Actions stuff in However, I think we can run the tests:
In particular, we should keep using |
PR #900 is a start at this. I asked for several changes to that PR. |
Hi, I'm also very much interested in this for an executable using ureq as a client http lib (and thus using ring via rustls) |
trying to compile libp2p |
from current rand
not sure why i cannot compile so. it seems has some support. |
I too would love if this gets resolved! |
I would very much appreciate somebody contributing a script that shows me how to run
Getting the test environment going in GitHub Actions is literally harder than the ~3 lines of code that are needed to get WASI working, but I can't write those 3 lines of code until somebody shares how to get the WASI test environment going. |
The old PR #900 was a good start at getting WASI working, but it sat for a long time, and I closed it due to inactivity and because it was bit-rotten. For the upcoming release, PR #1413 makes the incremental step of getting rid of the assumption that wasm32-unknown-unknown is a browser environment. This will allow us to add support for making wasm32-unknown-unknown work in WASI environments too. See that PR for details. My understanding is that |
@briansmith if you're still looking for someone to contribute here, I'd be happy to help! I have an immediate need to get ring working with WASM. For context, I'm migrating a fork of macaroon to ring for use in AssemblyLift. |
I was able to get a project using Ring to compile for
@ruslan-belinskyy |
Related: #1499 |
does that mean there is no wasi support? |
This works somewhat https://github.com/john-sharratt/ring/, but only things which are implemented only in Rust (Ring uses some C code) work in Wasi. It might be better to use Rust Crypto https://github.com/RustCrypto/ for Wasi projects, or Wasi-Crypto https://github.com/WebAssembly/wasi-crypto/ |
Just to stop the radio silence from my end: I do intend to expand the support for WASI and I am interested in working together with others on this. The most immediate need is to make the changes discussed in #1499. Specifically, I outlined three steps that ideally would be split into at least 3 separate PRs, where the first step is to get what currently works building and testing in CI; this doesn't require any crypto knowledge whatsoever. Then we can expand the set of functionality that is available for WASI (and other WebAssembly) targets incrementally at a fast pace. Just to reiterate, really no progress can be made until we have a CI solution, which again, we can model based on what getrandom already does. |
I created a PR #1568 that should fix the first point (wasm32-wasi support). I had to make sure to use a CI action that installs the rust toolchain with rustup, otherwise wasmtime couldn't run the tests. |
not solved still? facing same issue with |
@RazaGR Maybe use crates from RustCrypto instead? |
@rjzak I am not using |
+1, Did you find a way to get across this? |
We were running Steward in Enarx, and Enarx provides https for the Wasi application. But we also ripped out ring because of this very problem (lack of support, PRs not getting merged) and moved to Rust Crypto, since it's all pure Rust and works fine with Another option is to use Wasi-crypto, I have an example app. |
We at @wasmerio compiled ring to wasi/wasix and want to make it upstream @briansmith . @RazaGR @erikziyunchi @rjzak . You can check out our working fork. We're currently in the cleanup but it will work just fine. We also have |
I think the work #1568 is already there. No more forks are needed. |
@xxchan I tried building that fork: WASI_SDK_PATH=/(...)/wasi/wasi-sdk cargo build --target wasm32-wasi 1.71.0-nightly 2.90 4.88G 14:24:35 100%
Compiling ring v0.17.0-not-released-yet (/(...)/ring)
error: no rules expected the token `unsafe`
--> src/arithmetic/bigint/bn_mul_mont_fallback.rs:26:5
|
26 | unsafe fn bn_mul_mont(
| ^^^^^^ no rules expected this token in macro call
|
::: src/prefixed.rs:1:1
|
1 | macro_rules! prefixed_extern {
| ---------------------------- when calling this macro
|
note: while trying to match `fn`
--> src/prefixed.rs:6:22
|
6 | $vis:vis fn $name:ident ( $( $arg_pat:ident : $arg_ty:ty ),* $(,)? )
| ^^
warning: unused macro definition: `prefixed_export`
--> src/prefixed.rs:44:14
|
44 | macro_rules! prefixed_export {
| ^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_macros)]` on by default
warning: unused imports: `Limb`, `MODULUS_MAX_LIMBS`, `N0`, `limbs_from_mont_in_place`, `limbs_mul`
--> src/arithmetic/bigint/bn_mul_mont_fallback.rs:22:13
|
22 | use super::{limbs_from_mont_in_place, limbs_mul, Limb, MODULUS_MAX_LIMBS, N0};
| ^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^ ^^^^ ^^^^^^^^^^^^^^^^^ ^^
|
= note: `#[warn(unused_imports)]` on by default
warning: unused import: `crate::c`
--> src/arithmetic/bigint/bn_mul_mont_fallback.rs:23:5
|
23 | use crate::c;
| ^^^^^^^^
warning: `ring` (lib) generated 3 warnings
error: could not compile `ring` (lib) due to previous error; 3 warnings emitted |
Well, in this case maybe you should leave the review in that PR first :) I'm not sure which one works, but just want to say it's not friendly and efficient to ignore other people's existing work. |
Apologies for that @xxchan I tried both #1568 and #1499 first. |
There have been a few PRs for Wasi support that seem to go unmerged. It would be nice to get input from @briansmith on how to get Wasi support actually merged and supported. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
As described here, you have to set the environment variables accordingly.
|
It uses the latest Ring, which fixes an issue for compiling to wasm32-wasi Issue: briansmith/ring#1043
It uses the latest Ring, which fixes an issue for compiling to wasm32-wasi Issue: briansmith/ring#1043
It uses the latest Ring, which fixes an issue for compiling to wasm32-wasi Issue: briansmith/ring#1043
When building with:
Getting:
Cargo.toml
The text was updated successfully, but these errors were encountered: