Fix "west init" failure to detect reinitialization in some cases#936
Open
marc-hb wants to merge 4 commits intozephyrproject-rtos:mainfrom
Open
Fix "west init" failure to detect reinitialization in some cases#936marc-hb wants to merge 4 commits intozephyrproject-rtos:mainfrom
marc-hb wants to merge 4 commits intozephyrproject-rtos:mainfrom
Conversation
Many tests call create_workspace() which creates a barebones .west/. Then, they invoked a spurious cmd(['init', '-l', manifest_repo]) which does not fail because of re-init bug zephyrproject-rtos#935 To prepare the fix for zephyrproject-rtos#935, drop these spurious calls. Signed-off-by: Marc Herbert <marc.herbert@gmail.com>
The detection of an already existing workspace was incomplete because it only checked the current directory. Then, west pretended nothing was there and silently reset the values in the existing .west/config. Fix the detection and fail consistently no matter where `west init` is run from. Fixes zephyrproject-rtos#935 Signed-off-by: Marc Herbert <Marc.Herbert@gmail.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #936 +/- ##
=======================================
Coverage 85.97% 85.98%
=======================================
Files 11 11
Lines 3466 3474 +8
=======================================
+ Hits 2980 2987 +7
- Misses 486 487 +1
|
pdgendt
approved these changes
Mar 27, 2026
Fix detection of some existing (and very unlikely) .west/ "pollution" at an intermediate level, for details see first comment at zephyrproject-rtos#935 This pollution is very unlikely because it's pretty difficult to have the manifest clone more than one level down before zephyrproject-rtos#774 / zephyrproject-rtos#854 - so it's difficult to have "intermediate" levels. Signed-off-by: Marc Herbert <Marc.Herbert@gmail.com>
Add test coverage for the previous commit that fixes the failure to detect re-initializations described in zephyrproject-rtos#935 Signed-off-by: Marc Herbert <Marc.Herbert@gmail.com>
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.
Fixes #935, see commit messages and #935 for details.
cc: @thorsten-klein