-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
py/misc: Add explicit dependency on py/mpconfig.h. #17843
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 Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #17843 +/- ##
=========================================
Coverage ? 98.38%
=========================================
Files ? 171
Lines ? 22283
Branches ? 0
=========================================
Hits ? 21924
Misses ? 359
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Code size report:
|
I'm happy to merge this, but it feels like a layering violation. Over time this file has gained things that depend on MP configuration variables (eg float, error message compression), and perhaps that was the wrong direction to go in. I would like Do you think that's a good idea/goal? At least that way there's a good metric as to what can go in Or maybe that's not really possible. In that case we should remove the comment at the top of |
I think it's potentially a good goal (and actually I thought this was the case before I got a compiler error and realised it wasn't true!) I guess the question is where the parts which do depend on config go. Quite a lot would have to be moved - one of the first sections has all of the Python heap allocator functions - some of these depend on (Those dependencies aren't as obvious as the ones which fail to compile if config macros are missing, but they're still dependencies - if you put |
Thinking a bit more, we could potentially split this into something like:
(Names I've come up with here are not good, but I can't think of better ones right now.) I'm not sure whether such a restructure has much long-term benefit, though. |
It is a bit of effort and churn for seemingly little gain, although at the moment Is this a blocking issue? Can we discuss it later? |
Definitely can be left to later, but suggest we merge this now in the meantime as it makes the existing implicit relationship explicit. |
Macros in misc.h depend on values defined by including mpconfig.h. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
34f0d3e
to
744270a
Compare
Summary
Macros in misc.h depend on values defined by including mpconfig.h (i.e. the checks for
MICROPY_ROM_TEXT_COMPRESSION
)This PR makes the relationship explicit. Noticed while trying to restructure #17735.
This work was funded through GitHub Sponsors.