Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Allow mpy-cross to exclude source lines - #19080

Merged
dpgeorge merged 1 commit into
micropython:masterfrom
trezor:romanz/upstream/source-lines
Jun 3, 2026
Merged

Allow mpy-cross to exclude source lines#19080
dpgeorge merged 1 commit into
micropython:masterfrom
trezor:romanz/upstream/source-lines

Conversation

@romanz

@romanz romanz commented Apr 10, 2026

Copy link
Copy Markdown
Contributor

This would allow building debug FW without source line data (following #19078).

Testing

Tested locally with trezor#29, on x86 emulator & stm32 device.

Trade-offs and Alternatives

Before this PR, mpy-cross needs to be built with MICROPY_ENABLE_SOURCE_LINE=0 to exclude source line data, since there is no command-line flag (except -O3 which also disables all debug-related features).

Generative AI

I did not use generative AI tools when creating this PR.

@romanz
romanz marked this pull request as draft April 10, 2026 18:17
@codecov

codecov Bot commented Apr 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.47%. Comparing base (8c6dfa5) to head (425318d).
⚠️ Report is 305 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #19080   +/-   ##
=======================================
  Coverage   98.46%   98.47%           
=======================================
  Files         176      176           
  Lines       22802    22845   +43     
=======================================
+ Hits        22453    22497   +44     
+ Misses        349      348    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Apr 10, 2026

Copy link
Copy Markdown

Code size report:

Reference:  rp2/CMakeLists.txt: Require boards to define PICO_FLASH_SIZE_BYTES. [44a569b]
Comparison: py: Allow mpy-cross to exclude source lines. [merge of 425318d]
  mpy-cross:  +225 +0.059% [incl +1(data)]
   bare-arm:    +0 +0.000% 
minimal x86:    +0 +0.000% 
   unix x64:    +0 +0.000% standard
      stm32:    +0 +0.000% PYBV10
      esp32:    +0 +0.000% ESP32_GENERIC
     mimxrt:    +0 +0.000% TEENSY40
        rp2:    +0 +0.000% RPI_PICO_W
       samd:    +0 +0.000% ADAFRUIT_ITSYBITSY_M4_EXPRESS
  qemu rv32:    +0 +0.000% VIRT_RV32

@romanz
romanz force-pushed the romanz/upstream/source-lines branch 2 times, most recently from ddd5112 to a0127ac Compare April 10, 2026 19:31
@dpgeorge dpgeorge added the py-core Relates to py/ directory in source label Apr 13, 2026
@romanz
romanz force-pushed the romanz/upstream/source-lines branch from a0127ac to b8de9f7 Compare April 13, 2026 06:42
@romanz romanz changed the title [WIP] emit: allow mpy-cross to exclude source lines emit: allow mpy-cross to exclude source lines Apr 13, 2026
@romanz romanz changed the title emit: allow mpy-cross to exclude source lines Allow mpy-cross to exclude source lines Apr 13, 2026
@romanz
romanz marked this pull request as ready for review April 13, 2026 07:37
@Josverl

Josverl commented Apr 14, 2026

Copy link
Copy Markdown
Contributor

Is a shame that there is a 8-16 bytes growth in firmware, is there a way to reduce /avoid that?

Comment thread py/mpstate.h Outdated
Comment thread mpy-cross/main.c
@romanz
romanz force-pushed the romanz/upstream/source-lines branch from 815072c to 08fc33e Compare June 1, 2026 07:28
Comment thread py/emitbc.c Outdated

@dpgeorge dpgeorge left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for updating! Looks good now.

This would allow building debug FW without source line data.

Signed-off-by: Roman Zeyde <[email protected]>
@romanz
romanz force-pushed the romanz/upstream/source-lines branch from 9405a1d to 425318d Compare June 2, 2026 14:45
@dpgeorge
dpgeorge merged commit 90ce8a1 into micropython:master Jun 3, 2026
72 checks passed
@romanz
romanz deleted the romanz/upstream/source-lines branch June 22, 2026 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

py-core Relates to py/ directory in source

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants