Add support for wasm32-wasi.
[The files changed in this commit were part of the original PR. The original PR also changed other files, but those changes were removed.]
This commit is contained in:
parent
da23dc037e
commit
2019d8482f
@ -183,10 +183,10 @@ libc = { version = "0.2.148", default-features = false }
|
||||
[target.'cfg(all(target_arch = "aarch64", target_os = "windows"))'.dependencies]
|
||||
windows-sys = { version = "0.48", features = ["Win32_Foundation", "Win32_System_Threading"] }
|
||||
|
||||
[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
|
||||
[target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dev-dependencies]
|
||||
wasm-bindgen-test = { version = "0.3.37", default-features = false }
|
||||
|
||||
[target.'cfg(any(unix, windows))'.dev-dependencies]
|
||||
[target.'cfg(any(unix, windows, target_os = "wasi"))'.dev-dependencies]
|
||||
libc = { version = "0.2.148", default-features = false }
|
||||
|
||||
[build-dependencies]
|
||||
|
@ -177,6 +177,12 @@ case $target in
|
||||
export CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_RUNNER=wasm-bindgen-test-runner
|
||||
export WASM_BINDGEN_TEST_TIMEOUT=60
|
||||
;;
|
||||
wasm32-wasi)
|
||||
# The first two are only needed for when the "wasm_c" feature is enabled.
|
||||
export CC_wasm32_wasi=$WASI_SDK_PATH/bin/clang
|
||||
export AR_wasm32_wasi=$WASI_SDK_PATH/bin/llvm-ar
|
||||
export CARGO_TARGET_WASM32_WASI_RUNNER=wasmtime
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
@ -140,6 +140,7 @@ impl crate::sealed::Sealed for SystemRandom {}
|
||||
target_os = "solaris",
|
||||
target_os = "windows",
|
||||
target_os = "vita",
|
||||
target_os = "wasi",
|
||||
all(
|
||||
feature = "wasm32_unknown_unknown_js",
|
||||
target_arch = "wasm32",
|
||||
|
@ -12,10 +12,10 @@
|
||||
// OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||
// CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
|
||||
use wasm_bindgen_test::{wasm_bindgen_test as test, wasm_bindgen_test_configure};
|
||||
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
|
||||
wasm_bindgen_test_configure!(run_in_browser);
|
||||
|
||||
use core::ops::RangeFrom;
|
||||
|
@ -14,10 +14,10 @@
|
||||
|
||||
use ring::{constant_time, error, rand};
|
||||
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
|
||||
use wasm_bindgen_test::{wasm_bindgen_test as test, wasm_bindgen_test_configure};
|
||||
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
|
||||
wasm_bindgen_test_configure!(run_in_browser);
|
||||
|
||||
// This logic is loosly based on BoringSSL's `TEST(ConstantTimeTest, MemCmp)`.
|
||||
|
@ -14,10 +14,10 @@
|
||||
|
||||
use ring::{digest, test, test_file};
|
||||
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
|
||||
use wasm_bindgen_test::{wasm_bindgen_test as test, wasm_bindgen_test_configure};
|
||||
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
|
||||
wasm_bindgen_test_configure!(run_in_browser);
|
||||
|
||||
/// Test vectors from BoringSSL, Go, and other sources.
|
||||
@ -79,7 +79,7 @@ mod digest_shavs {
|
||||
use super::{run_known_answer_test, run_monte_carlo_test};
|
||||
use ring::{digest, test_file};
|
||||
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
|
||||
use wasm_bindgen_test::wasm_bindgen_test as test;
|
||||
|
||||
#[test]
|
||||
|
@ -18,10 +18,10 @@ use ring::{
|
||||
test, test_file,
|
||||
};
|
||||
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
|
||||
use wasm_bindgen_test::{wasm_bindgen_test as test, wasm_bindgen_test_configure};
|
||||
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
|
||||
wasm_bindgen_test_configure!(run_in_browser);
|
||||
|
||||
/// Test vectors from BoringSSL.
|
||||
|
@ -14,10 +14,10 @@
|
||||
|
||||
use ring::{digest, error, hkdf, test, test_file};
|
||||
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
|
||||
use wasm_bindgen_test::{wasm_bindgen_test as test, wasm_bindgen_test_configure};
|
||||
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
|
||||
wasm_bindgen_test_configure!(run_in_browser);
|
||||
|
||||
#[test]
|
||||
|
@ -14,10 +14,10 @@
|
||||
|
||||
use ring::{digest, hmac, test, test_file};
|
||||
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
|
||||
use wasm_bindgen_test::{wasm_bindgen_test as test, wasm_bindgen_test_configure};
|
||||
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
|
||||
wasm_bindgen_test_configure!(run_in_browser);
|
||||
|
||||
#[test]
|
||||
|
@ -15,10 +15,10 @@
|
||||
use core::num::NonZeroU32;
|
||||
use ring::{digest, error, pbkdf2, test, test_file};
|
||||
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
|
||||
use wasm_bindgen_test::{wasm_bindgen_test as test, wasm_bindgen_test_configure};
|
||||
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
|
||||
wasm_bindgen_test_configure!(run_in_browser);
|
||||
|
||||
/// Test vectors from BoringSSL, Go, and other sources.
|
||||
|
@ -17,10 +17,10 @@ use ring::{
|
||||
test,
|
||||
};
|
||||
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
|
||||
use wasm_bindgen_test::{wasm_bindgen_test as test, wasm_bindgen_test_configure};
|
||||
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
|
||||
wasm_bindgen_test_configure!(run_in_browser);
|
||||
|
||||
#[test]
|
||||
|
@ -22,10 +22,10 @@ use ring::{
|
||||
test, test_file,
|
||||
};
|
||||
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
|
||||
use wasm_bindgen_test::{wasm_bindgen_test as test, wasm_bindgen_test_configure};
|
||||
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
|
||||
wasm_bindgen_test_configure!(run_in_browser);
|
||||
|
||||
#[test]
|
||||
|
@ -1,9 +1,9 @@
|
||||
use ring::{signature, test};
|
||||
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
|
||||
use wasm_bindgen_test::{wasm_bindgen_test as test, wasm_bindgen_test_configure};
|
||||
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
|
||||
wasm_bindgen_test_configure!(run_in_browser);
|
||||
|
||||
#[test]
|
||||
|
Loading…
x
Reference in New Issue
Block a user