Skip to content

Conversation

@jsmaxi
Copy link
Contributor

@jsmaxi jsmaxi commented Oct 12, 2025

Fixes #367

Migrate target from wasm32-unkown-unkown to wasmv1-none.

This change migrates to wasm32v1-none target by mainly updating test-utils packages (default-impl-macro-test and event-assertion) to handle no_std environments.

Changes:

  • Applied #![cfg_attr(target_family = "wasm", no_std)] to prevent Cargo from injecting std::prelude into empty crates when building for wasm targets that don't support std (like wasm32v1-none). Added required panic handler for no_std wasm environments.

  • Constrained dependencies to non-wasm targets:

[target.'cfg(not(target_family = "wasm"))'.dependencies]
[target.'cfg(not(target_family = "wasm"))'.dev-dependencies]
  • Wrapped event-assertion std implementation in conditional compilation:
#[cfg(not(target_family = "wasm"))]
mod implementation {
    /* ... */ 
}
// Re-export for non-wasm targets
#[cfg(not(target_family = "wasm"))]
pub use implementation::*;
  • Updated readme, architecture, and toolchain information.

The test and build commands continue to function correctly, with the new wasm32v1-none target.

PR Checklist

  • Tests
  • Documentation

@netlify
Copy link

netlify bot commented Oct 12, 2025

Deploy Preview for delightful-dieffenbachia-2097e0 canceled.

Name Link
🔨 Latest commit 5d948e9
🔍 Latest deploy log https://app.netlify.com/projects/delightful-dieffenbachia-2097e0/deploys/68f20ea4616c430008a284a2

@jsmaxi
Copy link
Contributor Author

jsmaxi commented Oct 12, 2025

Not sure what the backwards compatibility strategy is for previous target wasm32-unknown-unknown.

@jsmaxi
Copy link
Contributor Author

jsmaxi commented Oct 12, 2025

NOTE: CI is failing on clippy warning in rwa package (unrelated to these wasm target changes).

The issue is the lint rule for document enums, where all variants share the same prefix:

  • DocumentError - all variants start with "Document"
  • DocumentStorageKey - all variants start with "Document"

This issue should be addressed in a separate PR.

@ozgunozerk
Copy link
Collaborator

@jsmaxi thanks a lot!
We are dealing with the last part of the audit, and will check this as soon as possible.

🥳

@ozgunozerk ozgunozerk requested review from brozorec and ozgunozerk and removed request for ozgunozerk October 15, 2025 15:59
@brozorec
Copy link
Collaborator

LGTM
Let's include this in the stable release @ozgunozerk

@jsmaxi will the change in this PR affect your work here?

@ozgunozerk
Copy link
Collaborator

I agree, ill check it once more today, and hopefully we can merge it

@jsmaxi
Copy link
Contributor Author

jsmaxi commented Oct 17, 2025

@brozorec Removal of "cdylib" shouldn't cause any issues and can be merged together

@brozorec
Copy link
Collaborator

@brozorec Removal of "cdylib" shouldn't cause any issues and can be merged together

I was wondering if it could simplify somehow your work.

@jsmaxi
Copy link
Contributor Author

jsmaxi commented Oct 17, 2025

@brozorec Actually good point, after removal, the panic handler becomes unnecessary. I can update the PR

@ozgunozerk
Copy link
Collaborator

@jsmaxi is it ready to merge? If so, we can merge it 👍

@jsmaxi
Copy link
Contributor Author

jsmaxi commented Oct 17, 2025

Please do 👍

@ozgunozerk ozgunozerk merged commit 34e3dfc into OpenZeppelin:main Oct 17, 2025
6 checks passed
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.

Migrate to wasmv1-none from wasm32-unkown-unkown

3 participants