-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
esp32: Fix component manager issue with "make submodules" #16581
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
esp32: Fix component manager issue with "make submodules" #16581
Conversation
@hmaerki I was testing your PR and ended up finding another approach. Can you please check if this works for you? |
Code size report:
|
- 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. |
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @hmaerki for testing this PR. Let's merge it.
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_components
directories in an inconsistent state if CMake exits early. Runningmake submodules
causes this early exit from CMake. Themake submodules
step appears to succeed, but a subsequent build with the same build directory fails with an error similar to:Fix implemented as three commits:
idf.py
that collects theGIT_SUBMODULES
list. This still completes successfully, and is a bit less heavy-handed (and faster) than deleting the managed_components directory afterwards.GIT_SUBMODULES
run 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 BRANCHN 8000 AME is master but succeeds for this branch.