-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
West update tooling dependency management #55056
Comments
My view on this is use a package manager if you want a package manager and keep it out of west, the package manager can invoke west commands. |
@yperess there are two levels of dependencies to consider:
Does this RFC cover point 2 only or both? |
This proposal covers the second case. I hadn't considered checking if a module is added (I assume at build time since it'll be config/board dependent) but that's an interesting use. We would need to assign name/version to modules but that can easily be done in the module manifest. Since people can have their own version of modules (maybe their own forks out computer custom logic they would just need to make sure it matches the name). Let me think about that some more. |
I'm not familiar with a package manager that can handle multiple types. Afaik they are usually separated by domains; for example: pip (python), npm (node), APT (Ubuntu binaries). Are you familiar with one that manages all? The issue will remain that downstream might need to override the source of these. For example, Google will not let us install from pip in CI. We have CIPD which manages our packages. So I was trying to think of a flexible way to default to the common package manager while allowing downstream to override. |
Adding to the thread some people that may be interested @fabiobaltieri @andyross @mbolivar |
@yperess what would improve upstream from this? I think we discussed how this could help maintaining what right now is under |
Upstream would benefit from:
All of this will make things easier to set up CI and generally develop for Zephyr over a long period of time. |
Touched upon here as well Some copy-paste
|
is something like https://github.com/kdeldycke/meta-package-manager be useful to abstract the different pkg/os managers? |
During Arch WG, @yperess said that it doesn't have to go into west update, it could go into its own command, etc. I want to encourage not putting it into west update for the following reasons off the top of my head:
|
@yperess as a general design request, I'd like to see more information on the layering where the changes to 'core' west are all mechanism, and the uses in zephyr are the application of those mechanisms towards some particular policy that achieves the desired goal here. |
@mbolivar-nordic thanks for the feedback and your patience. I get your point about
I'm currently only really fuzzy on the last step of using python to enter the virtual environment. It might be impossible but someone with more Python experience should probably weigh in. |
Using the name
It is impossible to enter a virtual environment from a west command. Entering a virtual environment involves changing environment variables. Child processes cannot change the environments of their parents. West therefore cannot change the shell environment it runs under. This is why the venv module creates multiple activation scripts, one per supported calling environment (bash, .bat, etc.), and it's why you have to source, not run, the scripts. |
Not me. @yperess feel free to reopen and assign yourself |
Introduction
This work intends to automate the tooling dependency management of Zephyr projects. The idea is to script https://docs.zephyrproject.org/latest/develop/getting_started/index.html in an extensible way that will work for most projects.
NOTE: this is not intended to manage zephyr modules. Those will still need to be done the same way they currently are via the West projects.
Problem description
Managing dependencies and communicating changes to these dependencies comes with unnecessary overhead that can easily be automated
Proposed change
west update
get a snapshot of all the modules + zephyr and take the union of the dependenciesMilestone 1
As step 4, print the changed dependencies
Milestone 2
Add a new top level west class
WestInstaller
that's similar to how west commands are done. The west.yml will be able to map dependencytype
to an installer. By defaultpython
type will map topip
,native
under linux can be mapped to an installer that callsapt-get
etc. This way downstream clients can remap the installers to their own trusted sources or include any custom install instructions they might need.west update
will automatically attempt to install the dependencies. This can easily be turned on/off via a west config value (we can default it tofalse
).Detailed RFC
Proposed change (Detailed)
The first step is to add the dependency list to Zephyr and the official modules. Each repo will include a PR that adds a list of dependencies which currently include the following:
python
- a single python package dependencypython-list
- a list of python dependencies that will be installed using the-r
flag inpip
native
- a native executable that needs to be available.At this point, we'll add a new flag (
west update --list-deps
) which will allow the developers to see the current snapshot of the dependencies. We'll also add a new west config value which will be defaulted tofalse
to enable dependency management inwest update
. If enabled by thewest.yml
of the project, thenwest update
will print the dependency diff at the end.The second step will be to add the top level
WestInstaller
class and aPipInstaller
andPipListInstaller
subclasses that will handlepython
andpython-list
types. If the above config value is enabled, we'll also by default create the.venv
python virtual environment or read a name for the virtual environment from another config value.The third step will be to add the
NativeInstaller
which will handle thenative
type for various operating systems (automativing https://docs.zephyrproject.org/latest/develop/getting_started/index.html#install-dependencies).The text was updated successfully, but these errors were encountered: