Skip to content
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

Provide a command line option for skipping unwanted portions of manifest #608

Closed
omkar3141 opened this issue Oct 20, 2022 · 3 comments
Closed
Labels
Partial imports Incomplete or changing imports are much more complicated than you think

Comments

@omkar3141
Copy link

Doing a west update can consume a significant amount of time if there are many dependencies specified in the west.yml file. It will be really great to have a command line option to skip updates of certain repositories.

For example:
west update --skip "matter,homekit,liblc3codec,hal_st,other-unwanted-stuff"

Such an option should apply the filter to all nested manifest files (if any) and not just the top-level west.yml file.

Such commands can then be converted to shorthand aliases to quickly swap your checked-out repos depending on the projects being worked on. This can also help save some amount of disk space.

@mbolivar-nordic
Copy link
Contributor

mbolivar-nordic commented Oct 24, 2022

Short story, I thought about it and it's likely to be nontrivial.

If I'm going to do this, it would need to be prioritized against other ongoing work. If someone else is going to do this, they will need to become very familiar with the internal APIs related to manifest imports and the way west starts up to be successful.

A quick sketch of the scope of changes from a short think over it are (note this is not a guarantee of scope of work, it's just an initial sketch):

  • in the presence of this feature, we can't count on a complete workspace, so all commands which require a manifest to work would need to be revisited and correct semantics decided upon (e.g. if I do west init + west update --skip foo + west list, and 'foo' has some imports in it, the manifest will fail to load and west list won't have all the information it needs to do its job. Should it fail? Do we want something else? Etc.)
  • if --skip is given during west update, the command needs to assume that the manifest loaded at startup failed (for the reason above), and anyway needs to resolve the manifest again with ImportFlag.FORCE_PROJECTS set
  • in the main loop which updates projects we've resolved already, we can just skip them, that's easy
  • but then in the internal importer callback that we forced with FORCE_PROJECTS, check and see if the given project is in the skip list, and skip it if so
  • but then what do we do for the projects that we would have updated recursively after resolving the import? we're skipping the project, so we may not even have the data locally on the file system, and so I think the only safe thing to do is that we also skip anything that would have been updated after the import was done and the imported data are available, but...
  • that would result in subtly different semantics! the problem is that if I skip project 'foo', and ordinarily 'foo' has an import which pulls in project 'bar', then i would have project 'bar' from 'foo'. But then if 'foo' has another 'sibling' project 'baz' in the same projects list, and 'baz' has an import which also brings in 'bar', then ordinarily we would NOT get 'bar' from 'baz', but we would start getting 'bar' from 'baz' in this scenario instead of from 'foo'. It is really not obvious to me that this is desirable.

TL;DR the whole thing would need to be thought over very carefully and a lot of tests would need to be written to validate the design

@mbolivar-nordic
Copy link
Contributor

TL;DR the whole thing would need to be thought over very carefully and a lot of tests would need to be written to validate the design

... or we would need to limit the scope of the feature, e.g. "you can't skip a project update if the project has imports", something like that. Even then I'm not totally sure it's trivial.

@marc-hb marc-hb added the Partial imports Incomplete or changing imports are much more complicated than you think label Jan 5, 2023
@mbolivar-nordic mbolivar-nordic closed this as not planned Won't fix, can't repro, duplicate, stale Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Partial imports Incomplete or changing imports are much more complicated than you think
Projects
None yet
Development

No branches or pull requests

3 participants