Merged
Conversation
824f6f2 to
ace24fe
Compare
dad963c to
a8fcea2
Compare
37c4069 to
923672f
Compare
- Through `no_std` support, we now also support `wasm32v1-none`.
- Introduced a new `std` crate feature that is enabled by default. Without it `#[no_std]` is enabled, but only on Web! This allows Web target to build without std, which is now supported by `wasm-bindgen` as well.
Additionally, various changes had to be done to support `no_std`:
- `no_std` does not support `thread_local!`, we use `once_cell` to polyfill this gap. `once_cell` is not a new dependency, it is already a dependency of `wasm-bindgen`.
- With `feature = "std"`, we use `thread_local!` as before.
- Without std and without `target_feature = "atomics"`, we use a `static mut` with `once_cell::unsync::Lazy`.
- Without std and with atomics, we use [`#[thread_local]`](https://doc.rust-lang.org/1.83.0/unstable-book/language-features/thread-local.html?highlight=thread_l#thread_local) with `once_cell::unsync::Lazy`.
- Some `f64` instructions are not available on `no_std` and had to be polyfilled. For this code from [`libm`](https://crates.io/crates/libm) was copied. Which is used by std as well.
- `SystemTimeError` now only implements `Error` with `feature = "std"`.
- `no_std` testing requires to refrain from using the default test harness. The problem was that native tests still needed to use the default test harness. To solve this, integration tests were removed from root crate and two workspace members added, that manually define all integration tests as test targets. The `tests-web` crate has `harness = false` on all tests, while `tests-native` functions regularly. This allow us to use the default test harness for native tests while disabling it for Web.
Additionally, every test target requires the `run` crate feature, which are enabled by default depending on the target by the root crate. This way regular testing can function correctly for each target as long as `--all-features` is not used. E.g. `cargo test --workspace` and `cargo test --workspace --target wasm32-unknown-unknown` will work correctly.
The `tests-web` library is used to implement the `panic_handler`, `global_allocator` and `critical_section`. It is always imported to reduce code duplication in all tests.
- Used [`serde-json-core`](https://crates.io/crates/serde-json-core) to cover tests with `no_std` as well.
- All links to std documentation had to be supplemented with manual link when `std` is not present.
- Improvements to CI:
- Refactored all matrices for simplification and covering `--no-default-features`.
- Split regular and minimal versions building off tests.
- Split doctests from regular tests.
- Update Rust toolchain when testing `cargo publish`.
- Test coverage improvements:
- The new `wasm-bindgen` update allows us to refrain from having to pass `cfg` flags to the `wasm-bindgen` proc-macros.
- Use Rust `llvm-tools` instead of the official LLVM package.
- Remove invalid `script` tag from coverage report.
- Retain coverage artifact instead of limiting it to one day.
- Refactor large environment variables into global level ones.
- Small fixes that were stumbled upon:
- Expose `web_time::web` with `cfg(docsrs)` on native as well.
- `Serialize` and `Deserialize` implementation are now marked with `doc(cfg(feature = "serde"))`.
- Std docs.rs link unnecessarily including `stable`.
- Recommendation for `-Ctarget-feature=+nontrapping-fptoint` was moved from the top-level to the "Usage" section.
- The minimal version of Serde is now fully specified as v1.0.0.
- Fix some typos in internal documentation.
This comment has been minimized.
This comment has been minimized.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Through
no_stdsupport, we now also supportwasm32v1-none.Introduced a new
stdcrate feature that is enabled by default. Without it#[no_std]is enabled, but only on Web! This allows Web target to build without std, which is now supported bywasm-bindgenas well.Additionally, various changes had to be done to support
no_std:no_stddoes not supportthread_local!, we useonce_cellto polyfill this gap.once_cellis not a new dependency, it is already a dependency ofwasm-bindgen.feature = "std", we usethread_local!as before.target_feature = "atomics", we use astatic mutwithonce_cell::unsync::Lazy.#[thread_local]withonce_cell::unsync::Lazy.Some
f64instructions are not available onno_stdand had to be polyfilled. For this code fromlibmwas copied. Which is used by std as well.SystemTimeErrornow only implementsErrorwithfeature = "std".no_stdtesting requires to refrain from using the default test harness. The problem was that native tests still needed to use the default test harness. To solve this, integration tests were removed from root crate and two workspace members added, that manually define all integration tests as test targets. Thetests-webcrate hasharness = falseon all tests, whiletests-nativefunctions regularly. This allow us to use the default test harness for native tests while disabling it for Web.Additionally, every test target requires the
runcrate feature, which are enabled by default depending on the target by the root crate. This way regular testing can function correctly for each target as long as--all-featuresis not used. E.g.cargo test --workspaceandcargo test --workspace --target wasm32-unknown-unknownwill work correctly.The
tests-weblibrary is used to implement thepanic_handler,global_allocatorandcritical_section. It is always imported to reduce code duplication in all tests.Used
serde-json-coreto cover tests withno_stdas well.All links to std documentation had to be supplemented with manual link when
stdis not present.Improvements to CI:
--no-default-features.cargo publish.wasm-bindgenupdate allows us to refrain from having to passcfgflags to thewasm-bindgenproc-macros.llvm-toolsinstead of the official LLVM package.scripttag from coverage report.Small fixes that were stumbled upon:
web_time::webwithcfg(docsrs)on native as well.SerializeandDeserializeimplementation are now marked withdoc(cfg(feature = "serde")).stable.-Ctarget-feature=+nontrapping-fptointwas moved from the top-level to the "Usage" section.no_stdsupport forserde_test: serde-deprecated/test#36no_stdsupport forgetrandom: rust-random/getrandom#541.no_stdWasmf64instructions: rust-lang/stdarch#1677