Skip to content

mpy-cross: argument heapsize / why two mpy-cross / in case of errors, emit the Python source code line #11664

@massimosala

Description

@massimosala

MicroPython v1.20.0 on 2023-04-26; ESP module with ESP8266

I want to enforce the heap size check at compilation time.
I tried with the two Python tools:

  • mpy-cross-v6.1
  • mpy-cross==1.20

Invoking mpy-cross with -X heapsize=65536, both fail with

MemoryError: memory allocation failed, allocating 832 bytes

Without the argument, they create the .mpy files.
Uploaded the files to the esp8266, the program is running.

From https://forum.micropython.org/viewtopic.php?t=8243

One thing that is perhaps a bit surprising about mpy-cross is that it's actually just a regular MicroPython port. It loads and compiles your code as if it were about to execute it, like any other port would do, but then has an extra piece of code that dumps out the generated bytecode to disk.

Hmm we have something different between the mpy-cross calculations and the firmware ones.


BTW... why do exist two tools for the exact same purpose?
They have the same options.
They have the same error messages (sometimes a little cryptic).

Isn't it better for the community to have just one mpy-cross?
IHMO if the authors pool their work, they have more resources to improve it.
Sorry if I'm missing some particular reason... or if I'm pissing out of my pot!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions