-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
tools/boardgen: Ensure locals_dict is generated with consistent order. #17433
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
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #17433 +/- ##
=======================================
Coverage 98.54% 98.54%
=======================================
Files 169 169
Lines 21943 21943
=======================================
Hits 21623 21623
Misses 320 320 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Code size report:
|
ecbabf0
to
54cfd75
Compare
Updated to just order the board name iterating (over a set) Also created some unit tests for this module, I don't believe there was any automated testing on it previously? |
Correct, there's no existing test for it. Except of course that boards build without error. I can see it's AI generated, and not actually run as part of the CI (yet). It's quite a large test and would take time to review. Maybe put that in a separate PR, so this one (sorting pin names) is easier and quicker to get merged? |
54cfd75
to
1143c9d
Compare
Yes it was generated, I used it to check the results of the change here and gave a quick sanity check over the other tests thinking they looked better than nothing. I didn't think a build / no build of ports is quite enough coverage as doens't show if things are missed, nor the ordering as found today! It does warrant separate discussion though so good idea, I've split it out into its own PR here #17434 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested on PYBD_SF2. The board pins are now in a sorted order (sorting is first done on CPU name, then boards name).
`tools/boardgen.py` is used by the `make-pins.py` scripts in many ports to generate the pin definitions for the machine module. In micropython#17391 it was found that this is currently generating the C structs for board pin definitions with inconsistent ordering (across different build runs), which makes it sometimes impossible to get a consistent binary file even for no change in source files. This commit fixes that by sorting the board pin names alphabetically. Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
1143c9d
to
95203ab
Compare
Summary
tools/boardgen.py
is used by themake-pins.py
scripts in many ports to generate the pin definitions for the machine module.In #17391 (comment) I found that this is currently generating the C structs for pin definitions with inconsistent ordering which makes it sometimes impossible to get a consistent built binary file even for no change in source files.
Testing
Reviewed the generated files from running to see the content is the same as previously, however now with different / repeatable order.