Skip to content

Conversation

@MarinaKalashina
Copy link
Contributor

@MarinaKalashina MarinaKalashina commented Jul 10, 2023

doc: develop: tools: add CLion tutorial

This commit adds a tutorial on how to set up, build, and debug Zephyr ‘example-application’ in CLion.

📄 CI BUILD: https://builds.zephyrproject.io/zephyr/pr/60204/docs/develop/tools/clion.html#clion

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Hello @MarinaKalashina, and thank you very much for your first pull request to the Zephyr project!

A project maintainer just triggered our CI pipeline to run it against your PR and ensure it's compliant and doesn't cause any issues. You might want to take this opportunity to review the project's Contributor Expectations and make any updates to your pull request if necessary. 😊

@carlescufi
Copy link
Member

@MarinaKalashina thanks for your contribution. Please take a look at this page to fix the compliance issues:
https://docs.zephyrproject.org/latest/contribute/guidelines.html#commit-message-guidelines

@MarinaKalashina
Copy link
Contributor Author

@MarinaKalashina thanks for your contribution. Please take a look at this page to fix the compliance issues:
https://docs.zephyrproject.org/latest/contribute/guidelines.html#commit-message-guidelines

Thank you, done

@kartben
Copy link
Contributor

kartben commented Jul 10, 2023

@MarinaKalashina thanks for your contribution. Please take a look at this page to fix the compliance issues:
https://docs.zephyrproject.org/latest/contribute/guidelines.html#commit-message-guidelines

Thank you, done

Please make sure to "push force" your fixed & amended commit! :)

@MarinaKalashina
Copy link
Contributor Author

I guess I messed up something during the force push :(
Sorry, I'm not familiar enough with git.
Should I just create a new pull request?
Thank you for help.

@kartben
Copy link
Contributor

kartben commented Jul 12, 2023

I guess I messed up something during the force push :(

I don't think so! Thanks! I've triggered CI again, but from a quick look at the sign-off entry, I think it will not pass the check as your email should be between < >, ex. "Signed-off-by: Marina Kalashina marina@foo.com", and I think your commit message still is too long, it needs to wrap at 75 characters per line. Thanks again!

@MarinaKalashina
Copy link
Contributor Author

I guess I messed up something during the force push :(

I don't think so! Thanks! I've triggered CI again, but from a quick look at the sign-off entry, I think it will not pass the check as your email should be between < >, ex. "Signed-off-by: Marina Kalashina marina@foo.com", and I think your commit message still is too long, it needs to wrap at 75 characters per line. Thanks again!

Ok, I'll try again, thank you!

@MarinaKalashina
Copy link
Contributor Author

Hi @kartben!
Could you please help me understand the test message? It says:

 7eb567140944941d823ca9209560bc3fd409c47c: author email (Marina.Kalashina <marina.kalashina@jetbrains.com>) needs to match one of the signed-off-by entries.

7eb567140944941d823ca9209560bc3fd409c47c: author email (Marina.Kalashina <marina.kalashina@jetbrains.com>) does not follow the syntax: First Last <email>.

But in my commit message, the line is “Marina Kalashina marina.kalashina@jetbrains.com” (no dot between the first name and the last name).

How should I change it for the tests to pass? Thank you!

@kartben
Copy link
Contributor

kartben commented Jul 17, 2023

Hi @MarinaKalashina!
The issue is with your "author" field, not with the sign off. Your name there is not in the form "First Last" due to the dot, plus, the dot makes your name there (Marina.Kalashina) different from the one in the sign-off (Marina Kalashina).

Author: Marina.Kalashina <marina.kalashina@jetbrains.com>

You should be able to amend the author name like this:

 git commit --amend --author="Marina Kalashina <marina.kalashina@jetbrains.com>"

@MarinaKalashina
Copy link
Contributor Author

Hi @MarinaKalashina! The issue is with your "author" field, not with the sign off. Your name there is not in the form "First Last" due to the dot, plus, the dot makes your name there (Marina.Kalashina) different from the one in the sign-off (Marina Kalashina).

Author: Marina.Kalashina <marina.kalashina@jetbrains.com>

You should be able to amend the author name like this:

 git commit --amend --author="Marina Kalashina <marina.kalashina@jetbrains.com>"

Thanks a lot! Hopefully it's ok now :)

@MarinaKalashina
Copy link
Contributor Author

Hi @kartben, sorry to bother you again.
I'm trying to understand the build log: the only content-related message I can see is this warning /runner/_work/zephyr/zephyr/doc/_build/src/develop/tools/clion.rst:8: WARNING: Duplicate explicit target name: "clion".
I guess a warning should not ruin the build, right? Are there some other problems?
Could you please explain what needs to be done on my side? Thank you!

Copy link
Contributor

@kartben kartben left a comment

Choose a reason for hiding this comment

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

This actually looks pretty good, thanks @MarinaKalashina!
We actually treat documentation warnings as errors :) In your case, this is an easy fix which I've noted in one of my review comments. Please also squash your second commit onto the first one as there's really no need for two commits in this case. Thanks again for your patience and your work on this!

@MarinaKalashina
Copy link
Contributor Author

Hi @kartben! Sorry for the delay, back on track after my vacation :)
The builds look ok now, right? Is there anything else I need to do?
Thank you!

@kartben
Copy link
Contributor

kartben commented Aug 22, 2023

Hi @MarinaKalashina, and welcome back!
I am actually trying to follow the steps right now and I don't think the CMakePresets work as expected?

This presets file will activate the Python virtual environment for your Zephyr installation and will define the target board, the build directory, and the flashing tool.

I think something might be missing as I don't think adding the venv Scripts folder to CMAKE_PROGRAM_PATH would be enough?

I have several other comments in a pending review -- mostly formatting / ReStructuredText stuff -- but I want to wait until I actually have the thing running before sending these.

Thanks!

@elmot
Copy link

elmot commented Aug 22, 2023

@kartben , what does not work in your case?
What is missing?

Hi @MarinaKalashina, and welcome back! I am actually trying to follow the steps right now and I don't think the CMakePresets work as expected?

This presets file will activate the Python virtual environment for your Zephyr installation and will define the target board, the build directory, and the flashing tool.

I think something might be missing as I don't think adding the venv Scripts folder to CMAKE_PROGRAM_PATH would be enough?

I have several other comments in a pending review -- mostly formatting / ReStructuredText stuff -- but I want to wait until I actually have the thing running before sending these.

Thanks!

@kartben
Copy link
Contributor

kartben commented Aug 22, 2023

@kartben , what does not work in your case? What is missing?

I think I am finally getting the hang of it, and I have a debug session up and running now. If I'm not mistaken there are two issues with this particular section of the tutorial:

  • "This presets file will activate the Python virtual environment for your Zephyr installation" >> this is not true, so the wording should be updated and instructions on how to make sur the virtualenv is properly loaded should be added. I think there are two options:

    • recommend folks launch clion from the command line after having already loaded the virtualenv
    • or (better?) it should be possible to setup CLion's Python interpreter (Build, Execution, Deployment > Python Interpreter) to the one from the virtualenv, but I couldn't make it work, as my system's default Python install seems to still be used. I can confirm however that it's somewhat working as opening a Terminal session from CLion with the Python interpreter set to the one from the Zephyr virtualenv seems to correctly enable the venv?
  • I don't think people need to have .venv/Scripts in the CMAKE_PROGRAM_PATH in the first place, so this should probably be removed?

@kartben
Copy link
Contributor

kartben commented Aug 22, 2023

  • or (better?) it should be possible to setup CLion's Python interpreter (Build, Execution, Deployment > Python Interpreter) to the one from the virtualenv, but I couldn't make it work, as my system's default Python install seems to still be used. I can confirm however that it's somewhat working as opening a Terminal session from CLion with the Python interpreter set to the one from the Zephyr virtualenv seems to correctly enable the venv?

Related issue https://youtrack.jetbrains.com/issue/CPP-14593/Project-python-interpreter-should-be-passed-to-CMAKE

@elmot
Copy link

elmot commented Aug 22, 2023

  • recommend folks launch clion from the command line after having already loaded the virtualenv

That is a valid option, but quite hackish, since people usually start CLion either from GUI start menu or via Toolbox. At least we suppose it's done this way:).

  • or (better?) it should be possible to setup CLion's Python interpreter (Build, Execution, Deployment > Python Interpreter) to the one from the virtualenv, but I couldn't make it work, as my system's default Python install seems to still be used.

The interpreter is supposed to be used in Python projects, not as a general tool. At the moment I can't recommend that as a reliable way. Thanks for the ticket you found, I'll look at, it might be it's good step towards better Zephyr support. Let's get back to it later(when implemented).

I can confirm however that it's somewhat working as opening a Terminal session from CLion with the Python interpreter set to the one from the Zephyr virtualenv seems to correctly enable the venv?

Copy link
Contributor

@kartben kartben left a comment

Choose a reason for hiding this comment

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

very cool to see the progress on this! Some quick comments re: images and syntax for GUI elements, but I will try to give the updated tutorial a full pass again.

@MarinaKalashina MarinaKalashina force-pushed the main branch 4 times, most recently from 3534ed1 to abea58a Compare December 4, 2023 10:09
finikorg
finikorg previously approved these changes Dec 4, 2023
Copy link
Contributor

@kartben kartben left a comment

Choose a reason for hiding this comment

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

Really nice to see the progress on this!
Please see another round of comments, but this looks much better and streamlined than previous version.
Would be great to see if the instructions could be adapted to actually work for Linux/macOS, or if not there should a clear statement upfront that these are Windows specific.

Thanks again!

Copy link
Contributor

Choose a reason for hiding this comment

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

@MarinaKalashina looks like this comment woudl still need to be addressed?

@MarinaKalashina
Copy link
Contributor Author

Hello @kartben! Sorry for pinging, but could you please update me on the status of the review here? Thanks a lot!

@jancotipsarevic
Copy link

I am really interested on that. Having Zephyr + CLion could be amazing.
Thank you very much and please, keep going.

@kartben
Copy link
Contributor

kartben commented Feb 6, 2024

Hello @kartben! Sorry for pinging, but could you please update me on the status of the review here? Thanks a lot!

@MarinaKalashina Sorry for the delay (and it shouldn't be for you to apologize for the ping) :) - I will try to give this another look so that we can get it in time for the upcoming 3.6 release!

@kartben kartben force-pushed the main branch 5 times, most recently from 7790cab to 1b1c5f2 Compare March 5, 2024 17:43
Copy link
Contributor

@kartben kartben left a comment

Choose a reason for hiding this comment

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

Hi @MarinaKalashina!
I think we're almost there. I've reformatted the file and implemented some minor formatting changes (lines wrapping at 100 characters), reorganized the links (they show up altogether at the end of the file), and rebased/squashed everything on top of main.
I think this is pretty much ready to go, could you please just redo the screenshot mentioned in my latest comment? The boards' naming scheme has been reworked so the board used in your example now has a new name.

Thanks for your patience

@MarinaKalashina
Copy link
Contributor Author

Hi @MarinaKalashina! I think we're almost there. I've reformatted the file and implemented some minor formatting changes (lines wrapping at 100 characters), reorganized the links (they show up altogether at the end of the file), and rebased/squashed everything on top of main. I think this is pretty much ready to go, could you please just redo the screenshot mentioned in my latest comment? The boards' naming scheme has been reworked so the board used in your example now has a new name.

Thanks for your patience

Hello @kartben, huge thanks for your help! I changed the board name on the screenshot, hope everything is ok and ready now :)

This commit adds a tutorial on how to set up, build, and debug
a sample Zephyr application in CLion.

Signed-off-by: Marina Kalashina <marina.kalashina@jetbrains.com>
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
@kartben kartben requested a review from finikorg March 13, 2024 20:24
@kartben kartben added the area: DX Developer and User Experience label Mar 18, 2024
@carlescufi carlescufi merged commit 611d284 into zephyrproject-rtos:main Mar 19, 2024
@github-actions
Copy link

Hi @MarinaKalashina!
Congratulations on getting your very first Zephyr pull request merged 🎉🥳. This is a fantastic achievement, and we're thrilled to have you as part of our community!

To celebrate this milestone and showcase your contribution, we'd love to award you the Zephyr Technical Contributor badge. If you're interested, please claim your badge by filling out this form: Claim Your Zephyr Badge.

Thank you for your valuable input, and we look forward to seeing more of your contributions in the future! 🪁

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

Labels

area: Documentation area: DX Developer and User Experience

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants