Open
Detect variants for stand-alone port frozen stubs instead of collapsing to GENERIC#740
Conversation
Copilot
AI
changed the title
[WIP] Fix bug in standalone ports frozen modules
Detect variants for stand-alone port frozen stubs instead of collapsing to GENERIC
May 3, 2026
Josverl
approved these changes
May 3, 2026
Josverl
marked this pull request as ready for review
May 3, 2026 21:48
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #740 +/- ##
==========================================
+ Coverage 72.06% 72.10% +0.03%
==========================================
Files 71 71
Lines 8399 8410 +11
Branches 1541 1544 +3
==========================================
+ Hits 6053 6064 +11
Misses 1837 1837
Partials 509 509 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Josverl
force-pushed
the
copilot/fix-standalone-ports-bug
branch
from
May 3, 2026 22:13
f3c1a21 to
c8ee00c
Compare
Josverl
approved these changes
May 3, 2026
Josverl
force-pushed
the
copilot/fix-standalone-ports-bug
branch
from
May 4, 2026 23:05
c8ee00c to
6e3e623
Compare
…GENERIC) Signed-off-by: Jos Verlinde <Jos_Verlinde@hotmail.com>
Agent-Logs-Url: https://github.com/Josverl/micropython-stubber/sessions/d6201815-bb44-43c0-9a7e-e0a2a9892559 Co-authored-by: Josverl <981654+Josverl@users.noreply.github.com>
Signed-off-by: Jos Verlinde <Jos_Verlinde@hotmail.com>
Josverl
force-pushed
the
copilot/fix-standalone-ports-bug
branch
from
May 4, 2026 23:20
6e3e623 to
26efd35
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.
For stand-alone ports (
webassembly,unix,windows), every variant manifest was being written to a single<port>/GENERIC/folder, overwriting earlier variants and not matching the path thatcombo_sources()/default_board()expect (e.g.webassembly/PYSCRIPT,unix/STANDARD). Reproducer:stubber build --port webassembly --version v1.26.1.Root cause
get_portboard()only matchedports/<port>/boards/<board>/. Stand-alone ports useports/<port>/variants/<variant>/manifest.py(or a port-levelmanifest.pyfor the implicitstandardvariant), soboardcame back empty for every variant andget_freeze_path()defaulted them all to legacyGENERIC.Changes
publish/defaults.py— addSTAND_ALONE_PORTS = {"unix", "windows", "webassembly"}andSTANDARD_VARIANT = "standard".freeze/common.pyget_portboard()regex now also capturesvariants/<variant>; returns(port, board, variant).get_freeze_path(stub_path, port, board, variant="")usesvariant(or"standard"for stand-alone ports) when noboardis given. Non-stand-alone ports keep theGENERICfallback for backward compatibility.freeze/freeze_manifest_2.pymake_path_vars()resolvesBOARD_DIRtoports/<port>/variants/<variant>when a variant is provided so manifests execute in the correct working directory.freeze_one_manifest_2()/copy_frozen_to_stubs()threadvariantthrough.freeze/freeze_folder.py— consume the new 3-tuple.test_get_portboardfor the 3-tuple, add variant-path cases, addtest_get_freeze_pathcovering board / variant / stand-alone-default-to-STANDARDresolution..gitignore— excluderepos/to keep generated DBs out of the tree.Resulting freeze folders
ports/webassembly/manifest.pywebassembly/GENERICwebassembly/STANDARDports/webassembly/variants/pyscript/manifest.pywebassembly/GENERIC(collision)webassembly/PYSCRIPTports/unix/variants/standard/manifest.pyunix/GENERICunix/STANDARDports/unix/variants/minimal/manifest.pyunix/GENERIC(collision)unix/MINIMALports/esp32/boards/manifest.pyesp32/GENERICesp32/GENERIC(unchanged)ports/stm32/boards/PYBV11/...stm32/PYBV11stm32/PYBV11(unchanged)Notes / follow-ups
get_portboard()is now a 3-tuple; only in-tree callers and one test consume it, all updated.GENERICfor--boardstill resolves correctly for stand-alone ports viadefault_board()(which already returnspyscript/standard), so no CLI default change was needed in this PR — flagged in the issue as a separate follow-up to revisit alongside per-port build defaults.