-
Notifications
You must be signed in to change notification settings - Fork 2k
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
makefiles, treewide: Remove MCU variable #20397
Conversation
I'm flagging this as an "API change", not only because it's the right thing to do, but also because it will earn it a place around "changes possibly necessary in applications" section of the next release notes. |
One late addition is adding a RIOT_MCU variable to micropython because unlike for other packages, the RIOT specific code there is not in-tree but in a fork of upstream code; PR there |
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.
ACK.
Updated once more because the micropython RIOT port now doesn't need a workaround any more (kaspar030/micropython#5 was merged); updating micropython in a separate commit instead. There has been some flakiness in unrelated tests, let's see whether we're lucky this time. |
Replacing RIOT_MCU with RIOT_CPU is the only change between the old and the new version.
... and a few occurrences of |
This broke esp8266 😕 |
Follow-up-for: RIOT-OS#20397 Closes: RIOT-OS#20409 Closes: RIOT-OS#20415
Why wasn't this deprecated first? This also broke some external repos, such as https://github.com/netd-tud/riot-exercises/ (luckily we are currently still in the progress of deploying it still). |
The discrepancies between documentation of the MCU makefile variable and the actual mechansims use by CPU implementations indicated that the mechanism was not used. The removal of the RIOT_MCU define was a detail I didn't individually consider for whether or not it should have been deprecated (it could still have been set to indicate RIOT_CPU). I'd have no objections to re-introducing a RIOT_MCU define under a deprecation. However, given that compiler constants can not be annotated with deprecation warnings, I doubt doing a deprecation there would have any effect other than delaying when people notice that their builds are failing. |
To be honest, I did not consider I think it would be possible to add a proper deprecation if our mechanism to generate Note that in |
Contribution description
The MCU variable, which appears to historically be a place where a CPU (which defines which cpu/... directory gets included) can be refined, is not in use as advertised (its documentation said that it is "set by the board's Makefile.include, or defaulted to the same value as CPU", but grepping for MCU in boards/*/Makefile.include just mentions the term in prose). CPU is always equal to MCU as we use it now. In its place, we nowadays use the CPU_FAM and the CPU_MODEL variables.
This PR removes MCU from the Makefiles, and changes all the places where MCU is used (mainly esp_common and some drivers, [edit] as well as some examples) into the equivalent CPU checks.
Testing procedure
If we could assert that the compiled binaries (or even the C code after preprocessor) is the same, that'd be great, but we don't have those tools.[edit: Some binaries changed b/c they reported "the MCU" and now report "the CPU", and one example reported both CPU and MCU, thus shrank.]