← index #14352Issue #17666
Related · high · value 1.396
QUERY · ISSUE

ESP32 micropython port build with relative path to external user C-modules was failed

openby aso-copened 2024-04-22updated 2025-03-03
bugport-esp32

Checks

  • I agree to follow the MicroPython Code of Conduct to ensure a safe and respectful space for everyone.

  • I've searched for existing issues matching this bug, and didn't find any.

Port, board and/or hardware

esp32 port, ESP32-boards of any kind, I guess

MicroPython version

MicroPython v1.22.2-dirty on 2024-04-18; Generic ESP32 module with ESP32

Reproduction

make USER_C_MODULES=../../examples/usercmodule/micropython.cmake

Expected behaviour

Make process failed with error message like a:
modules not found in the path <specified_path>

Observed behaviour

During the build, make changed current directory and relative path to micropython.cmake file turns out to be incorrect

Additional Information

Need expand relative path of USER_C_MODULES variable, to absolute path before passed it to the ./py/usermod.cmake as described below:
In the file ./ports/esp32/Makefile , line 41:

ifdef USER_C_MODULES
       CMAKE_ARGS += -DUSER_C_MODULES=${USER_C_MODULES}
endif

change it to a:

ifdef USER_C_MODULES
        CMAKE_ARGS += -DUSER_C_MODULES=$(abspath ${USER_C_MODULES})
endif

Thnx!

CANDIDATE · ISSUE

Argument list too long compile error [ESP32}

closedby kdschlosseropened 2025-07-12updated 2025-12-01
bug

Port, board and/or hardware

ESP32-S3

MicroPython version

1.25.0

Reproduction

compile Micropython for the ESP32-S3 generic and once it is done compiling navigate to ports/esp32/build_ESP32_GENERIC_S3/esp-idf/main/CMakeFiles and edit the qstr.i.last-*.sh script in that folder. CMake builds this file and calls it as part of the build system. What is in this file is the shell command to run makeqstrdefs.py. If you look you will see repeated parameters, ones that start with -I

When compiling MicroPython it will compile fine but if you add a few user_c_modules is when the error happens. The error is because of the added includes from the user c modules.

Expected behaviour

to compile without any errors

Observed behaviour

make[3]: /bin/sh: Argument list too long
make[3]: *** [esp-idf/main/CMakeFiles/BUILD_FROZEN_CONTENT.dir/build.make:799: genhdr/qstr.i.last] Error 127

Additional Information

The fix should be pretty simple. adding list(REMOVE_DUPLICATES MICROPY_CPP_FLAGS) to the py/mkrules.cmake file right above where it says # Generate qstrs in the file.

That will remove all of the duplicate entries.

I do also suggest possibly adding some code that will turn all of the include paths into relative paths instead of absolute ones. It will trim down the length of the arguments as well.

Code of Conduct

Yes, I agree

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied