py/mkrules.mk: Make MICROPY_MODULE_FROZEN_STR conditional on compiler.#40
Draft
andrewleech wants to merge 1 commit intomasterfrom
Draft
py/mkrules.mk: Make MICROPY_MODULE_FROZEN_STR conditional on compiler.#40andrewleech wants to merge 1 commit intomasterfrom
andrewleech wants to merge 1 commit intomasterfrom
Conversation
When MICROPY_ENABLE_COMPILER is set to 0 in a port/variant, freezing modules as source text (.py) cannot work because there is no runtime compiler to parse them. Default MICROPY_MODULE_FROZEN_STR to 0 in this case so the build only uses pre-compiled .mpy modules. The legacy behaviour is preserved when the compiler is enabled. Also propagate MICROPY_ENABLE_COMPILER=0 to CFLAGS when explicitly set, so the C code can ifdef on it consistently. Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When
MICROPY_ENABLE_COMPILER=0in a port/variant, freezing modules as source text (.py) cannot work because there is no runtime compiler to parse them. DefaultsMICROPY_MODULE_FROZEN_STRto 0 in this case so the build only uses pre-compiled.mpymodules. Legacy behaviour is preserved when the compiler is enabled.Also propagates
MICROPY_ENABLE_COMPILER=0to CFLAGS when explicitly set.Testing
Unix build with default settings (no behaviour change); a variant build with
MICROPY_ENABLE_COMPILER=0(frozen-only) now succeeds.