-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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/config west.yml and zephyr versioning during project development #35075
Comments
Also statement presented in https://docs.zephyrproject.org/latest/guides/west/basics.html#west-update-basics does not seem to be true:
To verify:
|
When you want to use
And the
Then
|
My scenario:
and that results in build failure:
What do I miss? :-) The reason not to use global Zephyr repository shared among all zephyr related project it that I can easily switch to a particular version of Zephyr only for that specific project. Also this is the simplest way to setup working environment on a development workstation. I also have a helper script that sets up the python venv and simply puts a developer into the venv + zephyr sdk ( Also the reason of this kind of approach, unlike in all sample programs, is that I want to use external modules/projects to use with my application and Zephyr (i.e. Nordic UART Service to use Shell over BLE) that can be easily controlled with my project's Update 1 Update 2
Update 3
|
Hi, I hope you don't mind that I've refiled this as a question instead of a bug. I think you've missed how west workspaces are supposed to be set up.
I think you may be confusing "project" with "workspace" in west terms, but other than that this is correct.
Right: the west.yml file is exactly this text file.
There are various examples showing how to do exactly this documented here: https://docs.zephyrproject.org/latest/guides/west/manifest.html#manifest-imports
There are various updates to this issue as you made progress, but it looks like at this point in time you were assuming that zephyr has to be the manifest repository. For the record, that's not the case: you can have your own manifest repository, as explained here: https://docs.zephyrproject.org/latest/guides/west/basics.html#workspace-concepts That repository can contain your own manifest file, which you did set up later, but not quite in the right way as far as I can tell.
As far as I can tell that is simply not true; the manifest imports section linked above has a lot of examples for various different use cases and they all explain what version of zephyr you get if you choose each approach. Everything is defined in terms of the manifest file format which is documented earlier in the same page.
I believe you may have missed this page, along with the 'west basics' page describing how the workspace is set up, yes.
Having
Are you trying to put this west.yml file in the workspace topdir itself? I'm not surprised it does not work because that's not how west is designed to work.
That's not how west is designed to be used. It's the job of You seem to be trying to treat the entire workspace as a single git repository, which is not the mental model that west was designed with. That model is introduced in the 'west basics' page I linked above and is documented further in the page explaining the manifest format: https://docs.zephyrproject.org/latest/guides/west/manifest.html#multiple-repository-model
It's not fine; .west is not meant to be part of a git repository in the workspace. The workspace is a larger structure that contains git repositories inside.
Please refer to the examples in the west manifest documentation, which are linked to above.
I'm truly sorry you had such a hard time, but I'm not seeing any gaps in the documentation on this front. West's 'workspace' concept is sometimes surprising for people who are used to putting everything in a single git repository and this can lead to misunderstanding sometimes. (It's not random, though: it's designed to work the same way Google's "repo" tool is used to manage an Android source code tree.) Any suggestions for making the documentation I've linked to in various places above better would be appreciated. One thing we are aware of a need for is a 'canned' application that shows you how to set up a manifest repository which also contains a custom driver, board, etc. and a west.yml file you can tweak for your own needs. That was recently merged and is available here: https:/zephyrproject-rtos/example-application/ You may find it to be an easier starting point than the west documentation. Any feedback on that repository would also be welcome. Note that its west.yml is using the bleeding edge, but you can easily change the and get a fixed version, e.g. Hope this helps! |
Hello @mbolivar-nordic thanks for your reply and hints :-)
I am working on FreeBSD Unix and this part is still missing in documentation and I will add it one day :-) Everything works perfectly fine here - this OS is real stress-tester of Open-Source quality, all dirty hacks will come out here - and I must admit Zephyr code is so elegant and versatile that I have no problems so far. Except that project structure that goes beyond simple build of a sample.. but this is work in progress I can see :-) Thank you for creating and developing Zephyr! :-) |
Thanks for your response and feedback!
Tomasz CEDRO ***@***.***> writes:
Hello @mbolivar-nordic thanks for your reply and hints :-)
* Zephyr documentation really needs to be extended here in terms of nomenclature, use cases, and examples. At the moment it is fine for simple samples but not enough for more advanced configurations. It may be clear for someone who already understands how things work but it is not clear for someone that wants to create this kind of template from scratch :-)
* Nomenclature clarification and examples.
I am probably too close to the details to understand what you're saying,
but I think the nomenclature is all properly defined and has examples,
starting from the 'basics' page and moving on to the more detailed
examples in the manifest documentation.
Can you please give me a concrete example of what nomenclature is either
unclear or lacks an example?
* Put all `west.yml` in one place with graduated sections of
in-depth details.
That's exactly what is done in the manifest documentation, so I again
don't really understand what you mean here.
* Thank you for sample application! This is exactly what is needed
here :-)
Good, glad to hear it!
* This sample application needs to `west init` at first. Then it fails
at `west update` because no `zephyr/west.yml` is found.
The documentation here for using the sample application works for me,
with no errors on 'west update':
https:/zephyrproject-rtos/example-application/#getting-started
I continue to suggest to you that you are not understanding west's
documented behavior.
* This sample application can also include
https:/nrfconnect/sdk-nrf and use some of its features
(i.e.
https:/nrfconnect/sdk-nrf/tree/master/samples/bluetooth/shell_bt_nus
that I need right now).
That is not an upstream Zephyr issue. Remember that the nRF Connect SDK
/ NCS is a downstream project and it would not be appropriate to include
vendor downstream details anywhere in the zephyrproject-rtos GitHub
organization.
However, since you mention you are an NCS user, there is a dedicated
page of workflows for managing your own code for downstream users of
NCS:
https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/dm_adding_code.html
Please let's not discuss that further in this upstream issue, though.
Devzone remains the right place to look for NCS-specific support, not
the upstream Zephyr project.
* With more understanding and experience I will probably commit some
documentation improvements.
I think that'd be much better than continuing this discussion here, as
it will give me the details on what you're seeing that I'm missing.
Thanks!
I am working on FreeBSD Unix and this part is still missing in
documentation and I will add it one day :-) Everything works perfectly
fine here - this OS is real stress-tester of Open-Source quality, all
dirty hacks will come out here - and I must admit Zephyr code is so
elegant and versatile that I have no problems so far. Except that
project structure that goes beyond simple build of a sample.. but this
is work in progress I can see :-)
I am glad you are finding that things work in BSD.
Thank you for creating and developing Zephyr! :-)
Thanks for your feedback!
|
Yes you seem to be "to close to the details" to the point where you don't see the big picture or understand simple question. Will not bother anymore no worries :-) The thing is really simple:
Thank you for your time :-) |
You are free to avoid using west entirely if you like. It's just harder to do so. That is in fact an option documented in the NCS guide I linked earlier as well as here: https://docs.zephyrproject.org/latest/guides/west/without-west.html If you are going to use west, though, you need to do things the way west expects.
This is already documented in several different use cases in the links I have given already.
Yes, of course it works. This question continues to reflect a lack of understanding about west.
I'm glad you've got what you need from NCS. |
Further discussion is pointless. We don't understand each other completely. I have what I need from |
Describe the bug
Current
west
approach does not allow easy version selection of the zephyr. Either I need to install global zephyr installation and provideZEPHYR_BASE
on where is is located, or use manifest approach and use local copy of zephyr within my project source tree. The problem arises when I need to switch to a different version of zephyr i.e. fromv2.4.0
tov2.5.0
orv2.6.0-rc1
. I either have togit checkout version_branch
on the global repository and this forces all other projects to use this version of zephyr, or I have togit checkout version_branch
in my local copy of the zephyr source tree within a project.In a commercial projects we cannot use simply master branch. We need to select one specific version, then after testing when new release comes up we may switch to that new release. But a specific zephyr version dependency is a must and coherently controlled with one simple text file and some script.
Zephyr version needs to be arbitrarily selected on project creation and then there is no easy way to change the zephyr version later on. In perfect world I would have
west.yml
for my project stored on a git repo, then when we change the zephyr version we change the version number inwest.yml
, developers pull that change, perform west update, and everyone uses now the same version of zephyr.Zephyr version selection should be provided in some sort of configuration file that is part of the source code repository. This way version change is consistent. We do not have a problem that someone has different version of the zephyr source code so for someone code builds and work and for someone else it builds but does not work or it does not build at all. No manual intervention in the local git zephyr pull should be necessary as this leads to confusion and problems.
Documentation on project file structure needs to be updated and extended with information on how the local project depends on zephyr versioning exactly and how this can be set in a consistent way with possibility to switch later during the code development based on a text file configuration variable.
None of the examples contain
west.yml
file nor there is an example that shows how to build for a specific version of the zephyr based on the local project configuration (nor how to build for a different zephyr releases).I may be missing something or this is not yet available in zephyr? :-)
To Reproduce
Steps to reproduce the behavior:
The most visible scenario is when a new developer wants to clone the local project repository to work on, normally it will be
git clone
to obtain the project code, thenwest update
to get all zephyr source dependencies. This is impossible at the moment. We need to manuallywest init
a project with a specific version of zephyr. That version of zephyr does not seems to be configurable during project development, except each developer need to performgit checkout zephyr_version
by hand. This also may impact current manifest coherence.Expected behavior
Zephyr version, a critical local project dependency, is provided within a configuration file and it can be easily updated during code development in a consistent and automated way.
Impact
Environment (please complete the following information):
Additional context
Presented above.
Any hints welcome :-) Thank you :-)
The text was updated successfully, but these errors were encountered: