adafruit / circuitpython-build-tools

Build scripts for CircuitPython libraries and the bundle
MIT License
28 stars 17 forks source link

Add circuitpython-mpy-cross command #119

Closed jepler closed 1 month ago

jepler commented 5 months ago

This adds the ability to (download or build, then) invoke any supported version of mpy-cross:

$ circuitpython-mpy-cross --circuitpython-version 8.x -- --version
CircuitPython 8.2.0 on 2023-07-05; mpy-cross emitting mpy v5-CircuitPython
$ circuitpython-mpy-cross --circuitpython-version 9.x -- --version
CircuitPython 9.0.0-alpha.2 on 2023-10-27; mpy-cross emitting mpy v6.1

The idea of having a download & run wrapper around mpy-cross originates with https://pypi.org/project/mpy-cross-multi/ but re-uses our existing infra for downloading or building mpy-cross as needed, instead of uploading binary artifacts to pypi.

This also improves how mpy-cross is downloaded or built: These activities happen in the user's "cache" directory (e.g., $HOME/.cache on Linux/Mac, some other folder on Windows)

this also enables sharing the copy of mpy-cross across multiple repos.

Testing performed:

jepler commented 5 months ago

once #111 is merged, it might be nice to make this enough smarter that it can munge before mpy-cross compiling.

jepler commented 1 month ago

Thanks for testing! I'd forgotten this was out there.