Skip to content

Add no_std and Zephyr support - #11

Merged
yorkie merged 8 commits into
masterfrom
codex/rquickjs-zephyr
Sep 7, 2026
Merged

yorkie merged 8 commits into
masterfrom
codex/rquickjs-zephyr

Conversation

@yorkie

@yorkie yorkie commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add portable full-nostd and Zephyr feature sets
  • Support Zephyr-generated headers and toolchain configuration
  • Replace std-only synchronization and drop queues with alloc-compatible implementations
  • Add runtime configuration for blocking Atomics operations
  • Add a Zephyr QEMU example covering threads, promises, SharedArrayBuffer, and Atomics
  • Validate no_std feature sets in CI

Testing

  • Added runtime coverage for enabling Atomics.wait
  • Zephyr example validated on the mps2/an385 QEMU board
  • CI now checks minimal and full-nostd configurations

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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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-nostd and zephyr feature sets across the workspace (and adjusts dependency feature flags for no_std compatibility).
  • 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-nostd builds.
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.

Comment thread core/src/safe_ref.rs
Comment thread examples/zephyr/src/lib.rs
Comment thread examples/zephyr/README.md Outdated
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.
@yorkie
yorkie merged commit 816d59c into master Sep 7, 2026
37 checks passed
@yorkie
yorkie deleted the codex/rquickjs-zephyr branch September 7, 2026 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants