← index #14358Issue #14307
Off-topic · high · value 0.067
QUERY · ISSUE

ports/webassembly: import of a preloaded Emscripten FS fails on Node

openby hoihuopened 2024-04-22updated 2024-05-13
bugport-webassembly

Checks

  • I agree to follow the MicroPython Code of Conduct to ensure a safe and respectful space for everyone.

  • I've searched for existing issues matching this bug, and didn't find any.

Port, board and/or hardware

webassembly

MicroPython version

MicroPython v1.23.0-preview.324.g6634fea23.dirty on 2024-04-22; JS with Emscripten

(I've added more modules to the manifest)

Reproduction

  • build webassembly port pyscript -> OK
  • open repl via node build-pyscript/micropython.mjs -> OK
  • micropython.mjs can be used on HTML pages as described in the readme file -> OK

so far so good - however... I want to "freeze" existing micropython files in an emscripten FS. For this I'm using the --preload-file argument in the makefile like this:

$(Q)emcc $(LDFLAGS) -o $@ $(OBJ) $(JSFLAGS) --preload-file <directory_with_python_files>

this works as expected in the browser and I can successfully import it via mp.pyimport(xxxx)

But I can't run the node repl with that micropython.mjs anymore. When trying to start the REPL I'm getting the following error:
<img width="872" alt="image" src="https://github.com/micropython/micropython/assets/5887072/5155d12f-1939-4fd4-a0c3-562ef621148f">

Expected behaviour

When building with --preload-file I'd expect that the REPL still starts and I can import the preloaded files

Observed behaviour

The above error appears (no REPL)

Additional Information

No, I've provided everything above.

CANDIDATE · ISSUE

[webassembly][pyscript] Unable to process over 88Kb of code

openby WebReflectionopened 2024-04-15updated 2024-10-01
bugport-webassembly

Checks

  • I agree to follow the MicroPython Code of Conduct to ensure a safe and respectful space for everyone.

  • I've searched for existing issues matching this bug, and didn't find any.

Port, board and/or hardware

webassemply

MicroPython version

latest for pyscript

Reproduction

We bootstrap our virtual env via FS operations and we port that whole operation via strings (as in Python strings) but we reached a memory limit so that everything breaks. Under 60Kb of single run we don't have issues but beyond that it's breaking.

Expected behaviour

MicroPython should be able to run up to 256Kb of code or more to me or we should be able to raise that limit. We tried to explicitly increase the heapsize without any success.

Observed behaviour

runPython(moreThan88KCode) fails, it doesn't on Pyodide, it doesn't if we manually remove some line to evaluate from that code.

Additional Information

This file contains our bootstrap logic which is automatically generated and it travels across workers or projects to be sure our namespace is up and running by the time users' code executes.

It served us well as logic to date and we never had issues with MicroPython but a recent branch that would like to bring more is failing hard on it.

micropython-limit.txt

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied