-
Notifications
You must be signed in to change notification settings - Fork 7.5k
ninja flash when running without west
#12812
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
Comments
NB: I have been able to do "ninja flash" from a Zephyr repo that was not cloned by west. But I was required to mv the zephyr repo inside of a "'west' parent directory" (don't know the terminology). So this issue is reporting that the zephyr repo should not need to be in a "'west' parent directory", right? |
then you most likely had the bootstrapper installed, i.e. |
correct. I interpreted that this was about not requiring users to manage their repo's with west, not about not requiring that users install and set up a multirepo direcotry with west. |
Root cause: arguments are passed on to underlying command (in this case Related to this issue: |
Agree, this might not be completely obviously. The expectation is, that someone not wanting to use |
TBH, I was not expecting this to be a requirement. But it should work / be working now:
I've tested the above without west installed on my system and it worked for me. @SebastianBoe @tejlmand does that meet your requirements? |
@tejlmand I think we can close this one now? |
@carlescufi, do you mean to close this bug with I think zehpyr tools (like |
I also believe
|
Amusingly now I get:
and it works. In the same shell window, albeit after moving back and forth between pre-west and post-west branches (but both tests at the same commit 4c3bcba which is a recent head of master). |
So this is not a "hack": you really do need the west code to be able to run the flashers and debuggers; they have been part of west for a long time. That doesn't mean you have to install west via pip. There are workaround in place in the build system that let you just clone the west code in the right place and still use ninja flash which is shown in my shell lines above. But if you've been using ninja flash, you've been using west and just might not have known it. |
@pabigot pre-west branches will add |
@RandomReaper let's not close this since the doc is actually wrong, but there's a PR to fix it already. After that, as @mbolivar mentioned, west has always been a requirement, it was just copied inside the zephyr repo. Once we switch to having all of west in PyPi the instructions should get simpler too. |
@RandomReaper alternatively you can go the easy way which is to install west via Edit:
https://docs.zephyrproject.org/latest/getting_started/getting_started.html#get-the-source-code I think we make it quite clear that while it's possible to use zephyr without west, this requires extra effort. |
Current master also adds I had an expectation that bisecting across the west switchover would work. I'm not sure it does/will. But west is just weird to me, so I'll keep slogging along. |
Sorry, as mentioned on Slack this is only a problem if you are juggling two or more zephyr trees, since you can then end up with an executable |
@carlescufi, thank you for the clarification, I was effectively not aware that west was used behind the scene. |
So I had a thought. Since the runner code is inside the Zephyr repository, I could create a script, let's call it It would then use the same infrastructure the west extension commands use to accomplish the "default" flash or debug behavior. No command line options or other configuration would be possible: that is what Would people find that useful? |
I have a recollection that there was an implicit if not explicit promise that after the transition to external west people could still to develop and use Zephyr without west. Not sure what constraints were implied (maybe only that there would be a non-west multi-repo workaround), but allowing the previously working |
Let me provide some historical context here.
Yes. And that is still possible, just as it always has been, using your target's flashing tools, which west wraps in its flash and debug commands. Flashing and debugging was actually the genesis of west. In the long distant past (say, a year and half ago), Zephyr was using shell scripts borrowed from the RIOT RTOS in the recipes for the As part of the push to make Windows a first-class citizen, I rewrote them in Python. And things were okay, because Kbuild uses Makefiles directly and Then we transitioned to CMake, also as part of making Windows a first class citizen, and things were not okay anymore, because targets in a CMake build system cannot take arguments (except via environment variables, which did not meet usability criteria on Windows). So we decided that flashing and debugging would be the first features implemented by a generic meta-tool. We'd keep the old
I have always tried to be clear that this was a west feature, we were keeping it on life support using the copy of west code in the Zephyr tree, and that there would be a transition when we felt west was ready for general use. Honestly if you need to do anything nontrivial with flashing and debugging (e.g. flashing a particular board by ID number if you've got multiple plugged in, maybe as part of a script that flashes all the ones on your system) I find using west is the only way to go due to the above limitation. That said, muscle memory does matter, so I'll see what I can do. |
This turns out to be impossible. The extension commands rely too much on modules inside west, such as |
I am going to close this issue because, while we have always maintained that one should be able to avoid using west for repo management, the fact that west is required in order to flash and debug is not new. Furthermore the issue with the doc that triggered the opening of this issue has been resolved: https://docs.zephyrproject.org/latest/tools/west/without-west.html even for out-of-tree apps now. If there is enough requests for being able to flash and debug using exclusively the zephyr repository then let's open a new issue, in the form of enhancement and we can consider that. That said, we will transition west completely to pypi in the mid-term, which will make "having west" as simple as using |
Uh oh!
There was an error while loading. Please reload this page.
Issue
With
west
as repo tool it is possible to doninja flash
However,
west
should not be mandatory for users as repo tool.ninja flash
should still work, even ifwest
was not used for repo installation.To Reproduce
Follow the guide:
https://github.com/zephyrproject-rtos/zephyr/blob/c2bea667641a6ccb75e1e7511ba8e8f42ef7eef9/doc/tools/west/index.rst#using-zephyr-without-westedit: https://docs.zephyrproject.org/latest/tools/west/without-west.html
in order to setup zephyr without
west
Go into any sample, build, and flash.
Using
ninja flash
and you'll see:
Expected behavior
Ability to flash using
ninja flash
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: