#18200·micropython

Why PC .c files full path strings are in built Micropython firmware (usermod) ?

Author: garywillCreated Oct 3, 2025Updated Sep 1, 2026
Labelsbugport-esp32proposed-closeneeds-info

Port, board and/or hardware

esp32

MicroPython version

1.26.1

Reproduction

.

Expected behaviour

.

Observed behaviour

I'm upgrading from MPY 1.25 + IDF 5.3 to MPY 1.26.1 + IDF 5.4.2 , for ESP32C3. I built my MPY firmware. Using a lot of custom code in usermod.

Using strings micropython.bin command, I found that newly generated micropython.bin contains many usermod .c file absolute PC path strings:

/onpc/long/path/micropython/ports/esp32/usermod/aa.c
/onpc/long/path/micropython/ports/esp32/usermod/xxxx/gg.c
....

(only usermod .c file paths appeared. Other MPY .c file path not)

Although those PC path strings won't take 200KB, is their being there in firmware is a config bug? (Since MPY 1.26 or since IDF 5.4 ?)

I checked firmware files I built before upgrading (also have usermod). Those path strings were not in old firmwares.

When you have many .c files in usermod, those strings can take tens of KB, which is not good for small-Flash mcu.

Additional Information

I didn't add any debugging or logging flag to build config.

My .cmake in usermod has always be like:

cmake
add_library(usermod_xxxx INTERFACE)
target_sources(usermod_xxxx INTERFACE
    ${CMAKE_CURRENT_LIST_DIR}/xxxx.c
    ${CMAKE_CURRENT_LIST_DIR}/xxxxx.c
.....
)
target_include_directories(usermod_xxxx INTERFACE
    ${CMAKE_CURRENT_LIST_DIR}
)
target_link_libraries(usermod INTERFACE usermod_xxxx)

Code of Conduct

Yes, I agree