X Tutup
The Wayback Machine - https://web.archive.org/web/20230507051021/https://github.com/RustPython/RustPython/issues/1826
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot run WASM demo: CompileError: "wasm validation error: at offset 87562: too many locals" #1826

Open
zer0x64 opened this issue Mar 22, 2020 · 4 comments
Labels

Comments

@zer0x64
Copy link

zer0x64 commented Mar 22, 2020

When I compile RustPython to WASM by running npm run dev in the wasm/demo/ folder, the browser returns an error when trying to load the wasm file:
Error importing rustpython: CompileError: "wasm validation error: at offset 87562: too many locals"

I'm using Rust 1.42 and Firefox 74.0

@coolreader18
Copy link
Member

Hmmm, maybe running in dev mode makes it too big to properly process. Does running it in release mode work? npm run dist and then serving from the dist/ directory?

@zer0x64
Copy link
Author

zer0x64 commented Mar 26, 2020

Hi!

Sorry for the late answer, but you're right, it's looks fine when using a production build. Do you have an idea what might be causing this?

EDIT: For the record, I also tried building with webpack --mode development and serve from there and the problem still occured, so it is not related to webpack-dev-server

@coolreader18
Copy link
Member

I'm able to reproduce it on my computer as well, with firefox. My guess is that llvm doesn't really validate that the wasm functions it codegens are actually legal wasm, at least with regard to the size limit for function bodies.

@zer0x64
Copy link
Author

zer0x64 commented Mar 26, 2020

Seems like it. For my personnal use case, it was about using the wasm module, not developing it, so building in release is a good solution for me. However, I do fear that if the debug build has too large functions, it might be the case for release too if that function becomes larger

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants
X Tutup