Repository navigation
Add no_std and Zephyr support - #11
Merged
Merged
Conversation
Point the submodule at the matching QuickJS portability changes so clean checkouts include the Zephyr threading and atomics implementation.
WASI builds expose the Atomics API but cannot block the Wasmtime test thread. Keep compiling the test while skipping its runtime assertion on WASI targets.
Pick up the QuickJS cleanup that removes committed macOS metadata files and ignores future .DS_Store files.
Pick up the QuickJS example output that prints the evaluated JavaScript result before reporting success.
Point the submodule at the QuickJS master commit created when the Zephyr support PR was merged, replacing the feature-branch commit.
There was a problem hiding this comment.
🟡 Changes recommended
Mut::try_lock currently blocks under parallel + std, which can defeat non-blocking drop paths and risks deadlocks.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR extends rquickjs with portable no_std + alloc support and adds a Zephyr integration path (including header/toolchain handling), plus an embedded Zephyr/QEMU example and CI checks to validate no_std feature sets.
Changes:
- Introduces
full-nostdandzephyrfeature sets across the workspace (and adjusts dependency feature flags forno_stdcompatibility). - Updates runtime/context internals for
no_std+parallel(spin-based locking, alloc-compatible drop queue) and adds runtime configuration to allow blocking Atomics operations (Atomics.wait). - Adds a Zephyr example project and CI checks for minimal +
full-nostdbuilds.
File summaries
| File | Description |
|---|---|
| sys/Cargo.toml | Adds zephyr feature to enable bindgen-based Zephyr builds. |
| sys/build.rs | Adds Zephyr-specific include/define/toolchain wiring and generated header handling. |
| README.md | Documents no_std/Zephyr usage and updates supported platform matrix. |
| examples/zephyr/src/lib.rs | New no_std Zephyr example exercising threads, promises, SAB, Atomics. |
| examples/zephyr/README.md | Adds Zephyr build/run instructions for the example. |
| examples/zephyr/prj.conf | Zephyr Kconfig settings for Rust + memory/threading needs. |
| examples/zephyr/CMakeLists.txt | Minimal Zephyr CMake project using rust_cargo_application(). |
| examples/zephyr/Cargo.toml | Staticlib crate for the Zephyr Rust application. |
| examples/zephyr/app.overlay | Device-tree overlay tweaks for the selected QEMU board. |
| core/src/value/convert/from.rs | Gates chrono::Local conversions behind std. |
| core/src/safe_ref.rs | Switches parallel locking to std Mutex vs spin Mutex based on std. |
| core/src/runtime/raw.rs | Adds raw runtime set_can_block hook for blocking Atomics. |
| core/src/runtime/base.rs | Adds safe wrapper Runtime::set_can_block + test coverage. |
| core/src/runtime/async.rs | Replaces std mpsc drop queue with alloc-compatible shared queue; adds async set_can_block. |
| core/src/runtime.rs | Re-exports async drop pointer type for parallel futures builds. |
| core/src/context/owner.rs | Wraps raw context pointer to safely mark it Send/Sync under parallel. |
| core/src/context/async.rs | Switches async context drop deferral from channel to shared queue. |
| core/Cargo.toml | Adjusts dependencies/features for no_std, adds full-nostd + zephyr, introduces spin. |
| Cargo.toml | Adds top-level full-nostd + zephyr features and excludes Zephyr example from workspace. |
| .github/workflows/ci.yml | Adds CI cargo check coverage for minimal and full-nostd configurations. |
Review details
- Files reviewed: 21/21 changed files
- Comments generated: 3
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Use the standard mutex try_lock operation so context drop paths cannot block while the runtime is already locked. Export the Zephyr entry point explicitly and make the example build commands portable.
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.
Summary
full-nostdand Zephyr feature setsTesting
Atomics.waitmps2/an385QEMU boardfull-nostdconfigurations