esp32: Fix component manager issue with "make submodules"#16581
Merged
projectgus merged 3 commits intomicropython:masterfrom Jan 29, 2025
Merged
esp32: Fix component manager issue with "make submodules"#16581projectgus merged 3 commits intomicropython:masterfrom
projectgus merged 3 commits intomicropython:masterfrom
Conversation
Contributor
Author
|
@hmaerki I was testing your PR and ended up finding another approach. Can you please check if this works for you? |
|
Code size report: |
dpgeorge
reviewed
Jan 14, 2025
- ECHO_SUBMODULES=1 exits CMake early. With idf_component_manager 1.x this seems to leave the managed_components directory in a state that causes later builds to fail. - Looks like the component manager isn't needed for this step, so disable it. This invocation logs a warning (not visible in normal output) but completes successfully and returns the correct list of submodules. Signed-off-by: Angus Gratton <angus@redyak.com.au>
Similar to other places, CMake will error out if this file doesn't exist yet but we don't want this if we're only getting the list of submodules. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
The way CMake gathers the submodule list, it can quietly be empty if the previous step fails. This makes it an explicit error. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
6a959bc to
06c0de6
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #16581 +/- ##
=======================================
Coverage 98.58% 98.58%
=======================================
Files 167 167
Lines 21596 21596
=======================================
Hits 21291 21291
Misses 305 305 ☔ View full report in Codecov by Sentry. |
Contributor
I like your PR - thanks a lot! I successfully tested (with and without your fix):
I will close now my initial #16549 in favor of this PR. |
Closed
This was referenced Mar 11, 2025
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This is an alternative version of #16549. I was testing it at @hmaerki's request and ended up with a slightly different approach.
The underlying bug is that some older versions of IDF Component Manager (definitely 1.4.2, maybe others) will leave the build and
managed_componentsdirectories in an inconsistent state if CMake exits early. Runningmake submodulescauses this early exit from CMake. Themake submodulesstep appears to succeed, but a subsequent build with the same build directory fails with an error similar to:Fix implemented as three commits:
idf.pythat collects theGIT_SUBMODULESlist. This still completes successfully, and is a bit less heavy-handed (and faster) than deleting the managed_components directory afterwards.GIT_SUBMODULESrun of CMake fails then it's possible for execution to appear to complete cleanly, but with an empty list of submodules. Then it fails at some later step. Add a flag to have it fail immediately in these cases.Testing
The latest IDF component manager doesn't exhibit the bug, so similar to @hmaerki I ran the build in a clean container. For speed I cross-mounted my local .git directory and then cloned from it:
This command fails with the error above when BRANCHNAME is master but succeeds for this branch.