{{ message }}
py: Isolate mpy-cross sub-make from inherited BUILD. - #19675
Open
pablogventura wants to merge 1 commit into
Open
pablogventura wants to merge 1 commit into
pablogventura wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #19675 +/- ##
=======================================
Coverage 98.59% 98.59%
=======================================
Files 182 182
Lines 23335 23335
Branches 5 5
=======================================
Hits 23006 23006
Misses 328 328
Partials 1 1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
|
@pablogventura, |
Contributor
Author
Signed-off-by: Pablo Ventura <pablogventura@gmail.com>
pablogventura
force-pushed
the
py-mpy-cross-build-isolation
branch
from
September 1, 2026 13:25
76821c4 to
c4be68f
Compare
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
Fixes #19667.
When a port build passes
BUILD=on the make command line (common for out-of-tree builds), GNU make forwards that variable into the mpy-cross bootstrap sub-make. mpy-cross then writesgenhdrinto the port's build directory, qstr fragments can mix with the port's, and the firmware link fails (e.g.undefined reference to mp_module_string).USER_C_MODULES/FROZEN_MANIFESTwere already cleared in both bootstraps. EmptyBUILD=is not enough becauseBUILD ?= buildinmkenv.mkdoes not override a defined-but-empty value. PinBUILDto the canonicalmpy-cross/buildpath in:py/mkrules.cmake(cmake ports, including esp32)py/mkrules.mk(make-based ports)Testing
Reproduced the leak with a parent make that sets
BUILD=/tmp/...and invokes the mpy-cross sub-make without pinningBUILD(binary lands in the leak dir). With the pinnedBUILD=.../mpy-cross/buildrecipe, the binary stays undermpy-cross/build/and the parentBUILDdir is untouched.Did not run a full esp32 firmware build for this change (build-system only). Existing cmake CI on the PR covers the bootstrap path.
Trade-offs and Alternatives
No unix
.text/.mpydelta (build system only).Alternative of only clearing
BUILD=was rejected:BUILD ?= buildleaves an empty override in place.Generative AI
I used generative AI tools when creating this PR, but a human has checked the
code and is responsible for the code and the description above.