Thanks to visit codestin.com
Credit goes to github.com

Skip to content

tools: Self-hosting of mpy-tool. #16042

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

Merged
merged 3 commits into from
Mar 5, 2025

Conversation

vshymanskyy
Copy link
Contributor

@vshymanskyy vshymanskyy commented Oct 18, 2024

Summary

This allows running mpy-tool using MicroPython itself.

Testing

Currently it is used in ViperIDE to disassemble .mpy files:

Also, a test is added to ci.sh

Trade-offs and Alternatives

None that I'm aware of

@vshymanskyy vshymanskyy force-pushed the mpy-tool-selfhosting branch 2 times, most recently from 5db2688 to 9f6405f Compare October 18, 2024 09:43
Copy link

codecov bot commented Oct 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.54%. Comparing base (859b6ef) to head (6fba1e4).
Report is 3 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #16042   +/-   ##
=======================================
  Coverage   98.54%   98.54%           
=======================================
  Files         169      169           
  Lines       21864    21864           
=======================================
  Hits        21545    21545           
  Misses        319      319           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

Code size report:

   bare-arm:    +0 +0.000% 
minimal x86:    +0 +0.000% 
   unix x64:    +0 +0.000% standard
      stm32:    +0 +0.000% PYBV10
     mimxrt:    +0 +0.000% TEENSY40
        rp2:    +0 +0.000% RPI_PICO_W
       samd:    +0 +0.000% ADAFRUIT_ITSYBITSY_M4_EXPRESS
  qemu rv32:    +0 +0.000% VIRT_RV32

@vshymanskyy vshymanskyy force-pushed the mpy-tool-selfhosting branch 5 times, most recently from a6b18f0 to c27fa18 Compare October 18, 2024 10:48
@dpgeorge dpgeorge added the tools Relates to tools/ directory in source, or other tooling label Oct 29, 2024
Copy link
Member

@dpgeorge dpgeorge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, definitely good to be able to self-host these basic tools.

Can you please split out the change to makeqstrdata.py to a separate commit, because that's independently making makeqstrdata.py MicroPython-compatible.

@dpgeorge dpgeorge added this to the release-1.25.0 milestone Oct 29, 2024
@dpgeorge
Copy link
Member

@vshymanskyy any comments on the above review?

@vshymanskyy vshymanskyy force-pushed the mpy-tool-selfhosting branch 3 times, most recently from 5b4fa03 to 0289e32 Compare January 8, 2025 14:22
@vshymanskyy vshymanskyy requested a review from dpgeorge January 8, 2025 18:50
@dpgeorge
Copy link
Member

Can you please also split out the change to makeqstrdata.py to a separate commit (or, I can do that during merge, but it's easier if you do it).

Copy link
Contributor

@projectgus projectgus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM, I don't have anything to add.

@vshymanskyy Do you have time to run through the minor outstanding discussions, or would you rather one of us picked them up?

@jonnor
Copy link
Contributor

jonnor commented Mar 3, 2025

@projectgus I believe @vshymanskyy said on Discord that he is rather preoccupied at the moment (the situation in Ukraine remains difficult). So I am sure he would appreciate it if anyone can do the small things to get this unblocked and merged :)

@projectgus projectgus force-pushed the mpy-tool-selfhosting branch 2 times, most recently from 822589d to efbd3f7 Compare March 4, 2025 05:44
@projectgus
Copy link
Contributor

I've done an update according to the review. I'd not rebased, so changes can be viewed via https://github.com/micropython/micropython/compare/0289e32a9afdb87d82cde42996f5bf924a17517e..efbd3f7

However I see that there's a merge conflict, so I'll rebase now.

@projectgus projectgus force-pushed the mpy-tool-selfhosting branch from efbd3f7 to 91e8a2f Compare March 4, 2025 05:47
@projectgus
Copy link
Contributor

Now rebased. Use the compare link above to see the pre-rebase changes.

@dpgeorge
Copy link
Member

dpgeorge commented Mar 5, 2025

This looks good now, thanks @projectgus for updating.

This allows running `py/makeqstrdata.py` with MicroPython itself.

Signed-off-by: Volodymyr Shymanskyy <[email protected]>
Signed-off-by: Angus Gratton <[email protected]>
This allows running mpy-tool using MicroPython itself.

An appropriate test is added to CI to make sure it continues to work.

Signed-off-by: Volodymyr Shymanskyy <[email protected]>
Signed-off-by: Angus Gratton <[email protected]>
Signed-off-by: Volodymyr Shymanskyy <[email protected]>
Signed-off-by: Angus Gratton <[email protected]>
@dpgeorge dpgeorge force-pushed the mpy-tool-selfhosting branch from e31b0a2 to 6fba1e4 Compare March 5, 2025 05:02
@dpgeorge dpgeorge merged commit 6fba1e4 into micropython:master Mar 5, 2025
64 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tools Relates to tools/ directory in source, or other tooling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants