wasm-tools icon indicating copy to clipboard operation
wasm-tools copied to clipboard

Make wasmparser compile for #![no_std]

Open tomaka opened this issue 4 years ago • 2 comments

This make makes the wasmparser crate successfully compile for no-std platforms. The PR was very mechanical, but feel free to reject if this is out of scope of the repository.

I've added an std feature just because of a single impl std::error::Error for ... {}. My personal opinion would be to ditch this impl and the std feature entirely, but I went for the non-breaking option. Let me know if I should do this.

tomaka avatar Jan 03 '21 15:01 tomaka

I left a comment on a similar PR as well for Wasmtime, and I'd personally prefer to resolve it there first before figuring out whether or not to merge this.

alexcrichton avatar Jan 04 '21 16:01 alexcrichton

@tomaka FYI I published a no_std compatible wasmparser crate here: https://crates.io/crates/wasmparser-nostd (in case you still need this)

It also switches out Hash{Map,Set} with BTree{Map,Set} internally so that the implementation is not attackable in no_std environment. Enable no_std by disabling default features (--no-default-features) as usual.

Robbepop avatar Jan 22 '22 16:01 Robbepop

I think we can close this PR.

  • It is outdated.
  • We already have an open issue that informs people about no_std support in wasmparser et. al.
  • The issue contains a link to the actual wasmparser-nostd fork that I maintain since a while.

Robbepop avatar Sep 12 '22 14:09 Robbepop

Sounds good.

alexcrichton avatar Sep 12 '22 15:09 alexcrichton