ESP32 micropython port build with relative path to external user C-modules was failed
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!
USER_C_MODULES for ESP32
Port, board and/or hardware
esp32
MicroPython version
Master
Reproduction
For building the example modules which come with MicroPython, set USER_C_MODULES to the examples/usercmodule directory for Make, or to examples/usercmodule/micropython.cmake for CMake.
The recent commit b65e89107c0194bfdaf92720786341a2047f36b6 enforces that USER_C_MODULES must point to a directory in the Make system. However, this causes confusion with the documentation, which mixes usage of relative paths and file references for both Make and CMake.
but that's half the battle. We can comment on this committee.
Also, they no longer work as they used to.
Observed behaviour
Examples:
- The following command no longer works with Make after the commit:
cd micropython/ports/esp32
make USER_C_MODULES=../../examples/usercmodule/micropython.cmake
- Instead, absolute paths are required:
make USER_C_MODULES=/dev_iot/opt/upy/micropython/examples/usercmodule/micropython.cmake BOARD=ESP32_GENERIC all