8000 esp32: Makefile, remove submodules sideeffect. by hmaerki · Pull Request #16549 · micropython/micropython · GitHub
[go: up one dir, main page]

Skip to content

esp32: Makefile, remove submodules sideeffect. #16549

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

hmaerki
Copy link
Contributor
@hmaerki hmaerki commented Jan 8, 2025

Summary

This PR removes an unwanted sideffect of
make -C micropython/ports/esp32 submodules
versus
make -C micropython/ports/esp32 submodules BOARD=ESP32_GENERIC_S3

This sideffect broke the build of ESP32_GENERIC_S3 when running on docker.io/espressif/idf:v5.2.2.

Testing

This compile ok:

docker run -t docker.io/espressif/idf:v5.2.2 bash -c "git clone https://github.com/micropython/micropython.git && make -C micropython/mpy-cross && make -C micropython/ports/esp32 submodules && make -C micropython/ports/esp32 BOARD=ESP32_GENERIC_S3"

This compile fails (added: BOARD=ESP32_GENERIC_S3):

docker run -t docker.io/espressif/idf:v5.2.2 bash -c "git clone https://github.com/micropython/micropython.git && make -C micropython/mpy-cross && make -C micropython/ports/esp32 submodules BOARD=ESP32_GENERIC_S3 && make -C micropython/ports/esp32 BOARD=ESP32_GENERIC_S3"

Error message

CMake Error at /opt/esp/idf/tools/cmake/build.cmake:544 (message):
  ERROR: Some components (espressif/tinyusb) in the "managed_components"
  directory were modified on the disk since the last run of the CMake.
  Content of this directory is managed automatically.

Subfailure in cmake

In ports/esp32/Makefile

submodules:
	@GIT_SUBMODULES=$$(idf.py $(IDFPY_FLAGS) -B $(BUILD)/submodules -D ECHO_SUBMODULES=1 build 2>&1 | \
	                  grep '^GIT_SUBMODULES=' | cut -d= -f2); \
	rm -rf ./managed_components; \
	$(MAKE) -f ../../py/mkrules.mk GIT_SUBMODULES="$${GIT_SUBMODULES}" submodules

Here, idf.py crashes silently with

CMake Error at /opt/esp/idf/tools/cmake/component.cmake:313 (message):
  Include directory '/home/maerki/2025-01-08b_espressif/ori/lib/tinyusb/src'
  is not a directory.

This error occurs using docker.io/espressif/idf:v5.2.2 and the current version hmaerki/build-micropython-esp32:v5.2.2.

The second commit in this MR fixes this.

Sidenote: It is quite dangerous, that idf.py may crash silently - and leave GIT_SUBMODULES empty. This should be fixed.

Fix

With this PR applied, both docker commands succeed.

@hmaerki hmaerki force-pushed the hmaerki/esp32_make_submodules_sideeffects branch 4 times, most recently from 7d36304 to a8347dc Compare January 8, 2025 13:24
Signed-off-by: Hans Maerki <buhtig.hans.maerki@ergoinfo.ch>
Signed-off-by: Hans Maerki <buhtig.hans.maerki@ergoinfo.ch>
@hmaerki hmaerki force-pushed the hmaerki/esp32_make_submodules_sideeffects branch from a8347dc to e012b18 Compare January 8, 2025 13:25
@hmaerki hmaerki marked this pull request as ready for review January 8, 2025 13:26
@hmaerki
Copy link
Contributor Author
hmaerki commented Jan 23, 2025

This PR is superseeded by #16581. I close it.

@hmaerki hmaerki closed this Jan 23, 2025
@hmaerki hmaerki deleted the hmaerki/esp32_make_submodules_sideeffects branch June 29, 2025 04:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0