Add wasm32-unknown-unknown support #1769
Conversation
#[cfg(all(feature = "wasm_js", target_arch = "wasm32", target_os = "unknown"))]
use wasm_bindgen_test::wasm_bindgen_test as test;doesn't work (instead of |
it requires adding this line of configuration to every test mod, which may not be the most convenient approach. |
% rg -F 'mod test' | wc -l
41vs % rg -F '#[test]' | wc -l
275We don't have to think about wasm each time we add a test function (only when we add a test module)... |
done |
|
hmm, |
Yep, you can ignore it. |
#[cfg(not(all(target_family = "wasm", target_os = "unknown")))]
#[deprecated(since = "0.33.0", note = "use trace_v2 instead")]
pub fn trace(&mut self, trace_fn: Option<fn(&str)>) {}
#[cfg(not(all(target_family = "wasm", target_os = "unknown")))]
#[deprecated(since = "0.33.0", note = "use trace_v2 instead")]
pub fn profile(&mut self, profile_fn: Option<fn(&str, Duration)> {}
|
|
Almost 5 years later |
Follows cherry-pick of upstream PR rusqlite#1769 (wasm32-unknown-unknown support). Two adjustments on top of that PR for a minimal-diff 0.37-based fork: - sqlite-wasm-rs bumped down to 0.4.0 (with the `precompiled` feature) because 0.5.x demands newer js-sys/hashbrown than the consuming librustzcash-ycash workspace can accept without a larger rebase. 0.4.0 is compatible with the wasm-bindgen 0.2.100 pin. - Reverted libsqlite3-sys cc/syn bumps the upstream PR pulled in (1.2.27 -> 1.1.6, syn 2.0.87 -> 2.0.72). Those bumps are only for the PR's own CI/bindings regen, not needed for the wasm backend, and they conflict with librustzcash-ycash's locked toolchain deps.
The main diff is to replace
libsqlite3-syswithsqlite-wasm-rson the wasm platform, while keeping everything else unchanged.Previous PR: #1643
resolves #488
resolves #827
resolves #1010