west icon indicating copy to clipboard operation
west copied to clipboard

app: more versatile initialization for path in config

Open fouge opened this issue 1 year ago • 5 comments

in case a manifest file is contained into some sub directories, the command to init a workspace locally should be

west init -l sub1/sub2 --mf west.yml

but in that case, the west top dir is going to be into sub1 which is an issue.

one workaround is to use:

west init -l sub1 --mf sub2/west.yml

but in that case, the config is initialized incorrectly: manifest.path contains only sub1 and manifest.file is sub2/west.yml.

manifest.path should contain a path, even if --mf is a relative path. manifest.file should only contain the filename.

this change allows any usage so that the workspace top dir is created next to sub1 and the manifest repo can be located into nested directories

fixes #774

fouge avatar Dec 18 '24 14:12 fouge

IMO to go even further, I think directory should point to the location of the west top dir not:

.west is created next to "directory"

but

.west is created in "directory"

the command would become

west init -l . --mf sub1/sub2/west.yml

this is a breaking change though, thoughts?

fouge avatar Dec 18 '24 14:12 fouge

Verify that tox runs on your local machine before pushing :)

pdgendt avatar Dec 18 '24 14:12 pdgendt

@pdgendt tox fails with errors even on main on my machine 😞

fouge avatar Dec 18 '24 14:12 fouge

Again, thanks for the excellent report.

this is a breaking change though, thoughts?

Interestingly, even your very first west init -l development/west_project1/ --mf west.yml suggestion at the top would already be a backwards incompatible change.

I'm afraid we need to clearly and formally define the user interface before even looking at the code.

EDIT: see rsync-based suggestion in https://github.com/zephyrproject-rtos/west/issues/774#issuecomment-2552507976

@pdgendt tox fails with errors even on main on my machine 😞

Please file a separate bug for this. Don't forget the OS and OS version.

marc-hb avatar Dec 18 '24 23:12 marc-hb

@fouge please test and review newer

  • #854

marc-hb avatar Oct 07 '25 19:10 marc-hb