Skip to content

Conversation

@marc-hb
Copy link
Collaborator

@marc-hb marc-hb commented Jan 22, 2026

3 commits. Main commit:

manifest: restore "path: ." ability but with a warning

Restore the ability to have a project at the top level but with an
"unsupported" warning printed every time.

Fixes v1.3 commit 2b2d3f2 ("manifest: Do not allow projects inside
the west directory") which accidentally broke it with an pretty obscure
backtrace:

File "python/site-packages/west/manifest.py", line 2460, in _load_project
    if Path(ret_norm).parts[0] == util.WEST_DIR:
       ~~~~~~~~~~~~~~~~~~~~^^^
IndexError: tuple index out of range

Fixes issue number #910

This is STILL not supported!

"path" can have whitespace or can look like regular words: quote them in
error messages.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
@marc-hb marc-hb marked this pull request as ready for review January 22, 2026 06:04
@codecov
Copy link

codecov bot commented Jan 22, 2026

Codecov Report

❌ Patch coverage is 87.50000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 85.92%. Comparing base (ed868f7) to head (a07cd25).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/west/manifest.py 87.50% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #911      +/-   ##
==========================================
- Coverage   85.93%   85.92%   -0.01%     
==========================================
  Files          11       11              
  Lines        3455     3461       +6     
==========================================
+ Hits         2969     2974       +5     
- Misses        486      487       +1     
Files with missing lines Coverage Δ
src/west/manifest.py 95.36% <87.50%> (-0.08%) ⬇️

@chirambaht
Copy link

Tested this and for the most part it works well, thanks! Only found this when running it on west update

(.venv) user@6f98e55bdaba:~/project$ west update
west.manifest: WARNING: Making the topdir a git clone is not supported; do not report bugs.
west.manifest: WARNING: Making the topdir a git clone is not supported; do not report bugs.

I suppose you wouldn't want the warning to print twice.

Comment on lines +2539 to +2542
# Unsupported, see https://github.com/zephyrproject-rtos/zephyr/commit/7d40091fbfedfc
if _path == Path('.'):
_logger.warning("Making the topdir a git clone is not supported; do not report bugs.")
return ret
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't allow the manifest project to be in the topdir directory, I would argue that we shouldn't allow "regular" projects to do it either.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't allow the manifest project to be in the topdir directory,

Is that actually blocked or just discouraged?

As far as I understand,
2b2d3f2 says "it is discouraged for the topdir to be a git repo". Anything else on that topic?

Note the manifest does not have to be in git at all: that is documented and works fine.

Copy link
Collaborator Author

@marc-hb marc-hb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose you wouldn't want the warning to print twice.

Ideally not, but it does not really matter because the workspace is not supposed to be a git repo.

It may not be simple to print this only once. If you find a very simple way with barely additional code then please share.

Comment on lines +2539 to +2542
# Unsupported, see https://github.com/zephyrproject-rtos/zephyr/commit/7d40091fbfedfc
if _path == Path('.'):
_logger.warning("Making the topdir a git clone is not supported; do not report bugs.")
return ret
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't allow the manifest project to be in the topdir directory,

Is that actually blocked or just discouraged?

As far as I understand,
2b2d3f2 says "it is discouraged for the topdir to be a git repo". Anything else on that topic?

Note the manifest does not have to be in git at all: that is documented and works fine.

@pdgendt pdgendt requested a review from carlescufi January 26, 2026 07:12
marc-hb and others added 2 commits January 26, 2026 19:08
Restore the ability to have a project at the top level but with an
"unsupported" warning printed every time.

Fixes v1.3 commit 2b2d3f2 ("manifest: Do not allow projects inside
the west directory") which accidentally broke it with an pretty obscure
backtrace:

File "python/site-packages/west/manifest.py", line 2460, in _load_project
    if Path(ret_norm).parts[0] == util.WEST_DIR:
       ~~~~~~~~~~~~~~~~~~~~^^^
IndexError: tuple index out of range

Fixes issue number zephyrproject-rtos#910

This is STILL not supported!

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Test coverage for the previous commit that fixes zephyrproject-rtos#910. Will catch any
regression like what happened in v1.3 commit 2b2d3f2.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants