Skip to content

Conversation

@mbolivar-nordic
Copy link
Contributor

Fix up some error handling for the new zephyr-export extension used in the getting started guide, and do some other cleanups in the GSG.

@nashif
Copy link
Member

nashif commented Apr 1, 2020

for the gsg, this is no cleanup, this is almost a rewrite :)

@mbolivar-nordic
Copy link
Contributor Author

for the gsg, this is no cleanup, this is almost a rewrite :)

That's not totally unfair. In my defense, I will say that there were items in #19123 and #23054 that I had either suggested or intimated should be done "later". Later is now :).

Copy link
Contributor

@tejlmand tejlmand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this.

In general I think the cleanup looks good, but still has some suggestions.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally, I prefer to have my tools / programs outside any repository.

Especially as tools might be up-/downgrade independently of the repo.

Or I could have multiple up-/downstream workspaces, but just a single toolchain.

So I would suggest to still advice users with a different path.

Which of course also means the comment goes for remaining part of this commit.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am doing this on purpose for the getting started guide precisely to make the Zephyr environment more self-contained, so we appear to have different preferences in this regard. The question is really what will be easier for more people, I suppose.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you take a look at:
zephyrproject-rtos/sdk-ng#199
#24143

those will remove the need for the environment variables, and in such way make it easier to get started.
And not polluting the Zephyr workspace with a toolchain folder.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you take a look at:
zephyrproject-rtos/sdk-ng#199
#24143

OK, I like that PR very much. Let's wait until it gets reviewed by @nashif and @galak to decide how to proceed here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I completely agree with @tejlmand here. I think we should not encourage users to install tools, any tools, inside a west workspace because of the following reasons:

  • A west workspace is akin to a Git repo in many ways, and in fact I am still considering adding some sort of west reset --hard in the future because there are many valid use cases for this, such as cleaning up after modules have been renamed
  • You might have multiple workspaces and you'd likely want to share the SDK among those
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest using either /opt/ or ~/bin/` instead

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest using either /opt/ or ~/bin/` instead

I think ~/bin is a bad option, as the Zephyr SDK is not a single executable file, but several folders with executables, libraries, etc.

Currently, the suggested default paths to search for the SDK are:

$HOME/zephyr-sdk* $HOME/.local/zephyr-sdk* $HOME/.local/opt/zephyr-sdk* /opt/zephyr-sdk* /usr/zephyr-sdk* /usr/local/zephyr-sdk* 

so I suggest we pick one among those in the example given in gsg.

Feel free to comment on default paths for SDK in this PR:
zephyrproject-rtos/sdk-ng#199

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant ~/bin/zephyr-sdk @tejlmand

Comment on lines 186 to 188
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing the changes in later commit in same PR.
So unfriendly of you 😉

Suggested change
#. Export a :ref:`Zephyr CMake package <cmake_pkg>`. This allows CMake to
load boilerplate code required for building Zephyr applications.
#. Export a :ref:`Zephyr CMake package <cmake_pkg>`. This allows CMake to
automatically load boilerplate code required for building Zephyr applications.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I will try to be more friendly in the future. Comments now addressed.

@mbolivar-nordic
Copy link
Contributor Author

mbolivar-nordic commented Apr 14, 2020

Last force-push is just a rebase. Will address comments after to make it easier for reviewers.

Edit: comments on this PR now addressed in a separate push.

Copy link
Member

@carlescufi carlescufi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I finally had a chance to render this locally and review it. In general this is a great improvement, thank you @mbolivar-nordic. I only have a few suggestions and one section that I'd like changed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While the rest of the changes in this section are fine, I'd keep the link for the rest of Linux distros here. Makes it easier for all those on non-Ubuntu distros to find what they need quickly from the beginning of the GSG.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I'll remove it from the first ubuntu tab instead, then. The same link appears twice in consecutive paragraphs, so I was trying to remove one of them. I agree keeping it here makes more sense.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I completely agree with @tejlmand here. I think we should not encourage users to install tools, any tools, inside a west workspace because of the following reasons:

  • A west workspace is akin to a Git repo in many ways, and in fact I am still considering adding some sort of west reset --hard in the future because there are many valid use cases for this, such as cleaning up after modules have been renamed
  • You might have multiple workspaces and you'd likely want to share the SDK among those
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
They rely on `Chocolatey`_. If Chocolatey isn't an option, you can
The instructions rely on `Chocolatey`_. If Chocolatey isn't an option, you can
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest using either /opt/ or ~/bin/` instead

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
does not meet Blinky's :ref:`blinky-sample-requirements`, :ref:`hello_world`
does not meet Blinky's :ref:`blinky-sample-requirements`, then :ref:`hello_world`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is so that the 2 hyperlinks do not "visually merge"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest also linking to the debugging section here, which is likely one of the things users want to try first.

@mbolivar-nordic
Copy link
Contributor Author

I suggest using either /opt/ or ~/bin/ instead

I will just drop the patch affecting the Zephyr SDK entirely if that is OK, since @tejlmand already has a plan for that. This will minimize user-visible churn during the release cycle.

@mbolivar-nordic
Copy link
Contributor Author

@carlescufi rebased and comments addressed. I added a couple of patches to the main two samples referenced from the guide

@zephyrbot zephyrbot added the area: Samples Samples label Apr 17, 2020
@tejlmand
Copy link
Contributor

I suggest using either /opt/ or ~/bin/ instead

I will just drop the patch affecting the Zephyr SDK entirely if that is OK, since @tejlmand already has a plan for that. This will minimize user-visible churn during the release cycle.

That is fine with me.
And I think it makes it easier to get this in, and I can rebase #24143 and then adjust the Zephyr SDK accordingly.
Makes it clearer what changes are introduced for which reason.

Copy link
Contributor

@tejlmand tejlmand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great cleanup.
Found two small places I think can improve even more, feel free to take them in or ignore them.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When looking at the rendered doc, I think there should be just a single line explaining why users should do those commands, so maybe add a little:

Suggested change
Click the operating system you are using.
Click the operating system you are using and follow the guide to ensure it is up-to-date.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is implied by the title "Select and Update OS"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, but when I first read it, I just read the content and my eyes didn't notice the title.
Not sure if i'm the only one 😆

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess adding more text isn't likely to make eyes glaze less, though. That's exactly why I'm trying to strip this down and remove any text I can -- people generally ignore text and just start copy pasting command lines into their terminals as fast as they can, in my experience.

@mbolivar-nordic
Copy link
Contributor Author

Rebased, hopefully CI is happy now

Copy link
Member

@carlescufi carlescufi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM now, thank you @mbolivar-nordic, this will be clearer and more accessible for upcoming new users

@mbolivar-nordic
Copy link
Contributor Author

Thanks! Rebased, hopefully good to go after CI re-runs.

@tejlmand
Copy link
Contributor

If we get this in, then I can rebase: #24143
and adjust the getting started changes in that PR accordingly.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reason for removing qemu and dtc?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was a leftover from removing optional dependencies. Fixed, thanks.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we really installing Zephyr? This is misleading, we are just getting the code, Install is used for applications, we do not want to make it sound as if Zephyr was an installable application, because it is not.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we do not want to make it sound as if Zephyr was an installable application, because it is not.

addressed

@mbolivar-nordic mbolivar-nordic force-pushed the gsg-cleanups branch 2 times, most recently from d42d345 to 2f30206 Compare May 5, 2020 16:37
Strip out text that isn't needed to try to minimize the GSG's length. Fix up some grammar nits. Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Various commands are getting put into their own sections when they are really just steps along the way towards getting zephyr and installing Python dependencies. Group them together in a section by that name, moving the west install step there. Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
The devicetree link is rendering as "Devicetree Guide" instead of "devicetree". Fix that. My guess is that most users won't care about the details of the requirements, and rather just want to know if their board is supported or not. So move the error you'll see on unsupported boards before the details about how to add support (which involve a pretty significant learning curve). Also mention overlays as a way to get this working. Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Since this is such a basic sample, it's worth nitpicking the wording a bit: - Add a link to the supported boards, since many first time users will not know where it is and may start near here. - Remove the single and multi threaded note. There's no information on how to build it in either of these two modes or what the default is, so it feels like a distraction for such a basic sample. - Give a clue about how to build for another board. Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
@nashif
Copy link
Member

nashif commented May 6, 2020

probably not fault of this PR, I just tried following the new gsg on new ubuntu 2020.04 and python3-dev is required by some python package we install (psutil)...
Without the pkg the install fails...

@carlescufi carlescufi merged commit a6b8644 into zephyrproject-rtos:master May 6, 2020
@tejlmand tejlmand mentioned this pull request May 6, 2020

.. code-block:: console
choco install git python ninja dtc-msys2 gperf
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mbolivar-nordic I'm sure this is documented somewhere (as otherwise we'd have new users complaining all day long), but I wonder how windows users are supposed to get dtc if not documented here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mbolivar-nordic I'm sure this is documented somewhere (as otherwise we'd have new users complaining all day long), but I wonder how windows users are supposed to get dtc if not documented here.

It's not required; 23df708

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ho, right!
I was confused about dtc status, I knew it was still in use (at least on my side).
That's clear now. Txs @mbolivar-nordic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment