-
Notifications
You must be signed in to change notification settings - Fork 7.2k
-
Notifications
You must be signed in to change notification settings - Fork 7.2k
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
[TW#20807] CMake-Based Build System Preview instructions very poor (IDFGH-1199) #1906
Comments
Hi @versamodule, Thanks for flagging this. We'll take a look at the docs and endeavour make the experience as streamlined as we can.
Will add this explanation which is missing from the docs (sincerely sorry for just dropping the context-free link in there), but for now: the "Setup for cmake on Windows from Scratch" is an alternative to using the ESP-IDF Tools installer. It's analogous to the two methods for Windows we have in the GNU Make build system documentation (either you can grab a zip file with MSYS+toolchain+everything, or there are "from scratch" instructions where you install everything bit by bit yourself.) Will make this clearer for cmake.
I think I'm missing something here, because I can't see the mingw32 link. Starting here: Scrolling to the bottom (I see there's definitely some cruft/cleanup needed here) Then click the "Get ESP-IDF" link, I end up here: ...which has the rest of the (non-platform-specific) steps for CMake on this page, but I don't see mingw32 mentioned. I'm guessing there's a stray link back to the other build system steps here, I just can't see it (or maybe it's because there are multiple headings with the same name in the two different sets of steps?) Thanks for your help with this. Clearly the docs need improvement, and will put some time in today figuring out what we can do. (Another thing with Windows that I'm unsure about is use of Git on Windows, and what tools are most popular. The current "Get ESP-IDF" cmake instructions will work with the "Git Bash" terminal which comes with the Git For Windows installer, but maybe it would help more people if we recommended something like Tortoise Git - and provided some Windows UI-oriented instructions? Any tips welcome.) |
gus, I just wanted to remind you (and your crew) of how awesome you are. I saw the gripe about docs on the forum and while I had no trouble with it since I'm kinda battle-hardened from "enterprise" (heh) projects with word-of-mouth "knowledge of the ancients," I did jot down a few pointers.
I'd do a pull request for the doc updates mentioned, but I don't know what your traffic pattern looks like on the feature being as you guys are trying to wrap this into a release. Get it wrapped up and I'll gift you guys your very own Visual Studio project template. |
Thanks for the kind words & the tips @ndotb ! Thanks also for the offer of a PR. At this point we're actually reviewing a full rewrite of the CMake preview docs (to swap over the "default" steps to use CMake), so don't worry about this too much. That should land in a day or so. I'll roll your tips into it. Will add a Github Desktop link now, and look at making a graphical step-by-step for this in a future update. |
Is this the Python Tools plugin for Visual Studio? Will add a note. We have a long overdue TODO item to make IDF work with Python 2 & 3. There's not a lot left to do there, so this maybe an incentive to finally push that over the line. |
Hi @versamodule @ndotb, The docs have been updated so they use the exact same structure as the old ones. The new docs can be found here: https://docs.espressif.com/projects/esp-idf/en/feature-cmake/ Please let me know if you still see any errors or confusing sections. Angus |
Thank you for the update! P.S. I see that the Eclipse section is not ready yet. Please also consider using Visual Studio Code as another option. I did a video of doing that here. https://www.youtube.com/watch?v=VPgEc8FUiqI&feature=youtu.be |
Ah, thanks for pointing that out. The docs don't say to check out the
It's not ready yet, but you may be pleasantly surprised at some time in the future... |
There 2 more fixes that i see. One more to be made in "Configure" section. For Windows Command Prompt users: The problem is that your not changing into the hello_world folder first. The Second is I got this error when trying to flash: P.S. what is the reasoning for doing things this new way? Mingw32 was super simplistic. I am having a rough time converting projects from that to this new method. With Mingw32 I could just create new files in my main folder and it took care of things. This new way is not recognizing any of the new files. CMakeFiles/hello-world.elf.dir/main/main.c.obj:(.literal.app_main+0x4c): undefined reference to |
Hi @versamodule , Thanks for persisting with this, I appreciate the feedback.
oops, will fix.
I think I know what happened here. If the ESP-IDF Tools installer installs Python 2.7 then it will also install "pyserial" into Python. If Python 2.x is already installed then nothing happens. Running "pip install pyserial" should fix this for now. I'll see if we can extend the installer so it will offer to install pyserial into an existing Python install.
The rationale is set out in the announcemnt post: https://esp32.com/viewtopic.php?f=13&t=5559&p=24109 . Happy to elaborate on any point. I know things are still a bit rough at the moment, but we wanted to do the Preview Release partially to get this early feedback and also to let people get started experimenting with IDE integration.
There's a list of changes between the "old" and "new" build system here, and also description of an automatic conversion tool for converting projects: One thing that list doesn't mention explicitly (it's mentioned elsewhere in this document, but I'll put it into this section as well) is that "main" is no longer a component. This is because of some CMake assumptions about building executables. Instead, the MAIN_SRCS variable in the project CMakeLists.txt file should be a list all of the source files which are part of the executable (ie the files in "main"). If you create "components" as part of your project (ie PROJDIR/components/name) then tyou can still have CMake detect all of the files in the component's (The trade-off here is that you have to add the files once, but not having to scan the filesystem for new files on every build makes the builds faster - and usually you build a lot more often than you add a new file.)
There's also a "cheat sheet" for GNU Make users here: |
@projectgus, Than you for all the very helpful information.
Had to do this: "python -m pip install serial" |
Thanks for the heads-up. Do you happen to know what version of Python you have installed? (The one the ESP-IDF Tools installer bundles should install a pip.exe, but maybe there are other versions which don't do this by default.) PS You probably installed |
I have Python 2.7.13 Installed. |
Ah, I see now. If |
Explains idf.py build as mentioned here: #1906 (comment)
I think the issues here should be improved in feature/cmake branch now. I'm going to close this, but if you find other shortcomings in the CMake getting started docs then please open new issues and we'll look into them. Thanks again for helping us with this feedback. |
Hello everyone, ...i have what it seems to be the very same problem, trying to make the hello_world application i get: ..... therefore the error is "error: cannot start 'C:/Users/DELL/esp/esp-idf/Kconfig': %1 is |
I found a workaround, first just build it "$ idf.py build" (which was successful despite previous above error) and then flash it "$ idf.py -p COM8 flash" ...still i would be nice to know why the "idf.py menuconfig" fails...thank you! |
HI @jcabad100 , Thanks for reporting this. I don't think what you're seeing is related to the older issue above. Could you please open a new issue and provide all these details plus the other details which are asked for in the issue template (most importantly, the IDF version you are using). Thanks. |
Ok, i will try, thx ( i do have much more issues with the other examples that would not build...i will open at least two new issues... |
I just ran the installer, this is about https://docs.espressif.com/projects/esp-idf/en/latest/get-started/index.html#id9:
|
Thanks, will correct the guide to explain that the path needs to be adjusted to the one used in the installer. Regarding the default location where IDF is cloned, the normal place where "data" should be placed on Windows is the Documents folder. I am not sure why the default is currently "Desktop", we will correct that. Regarding installing into the root directory, I think this is not a recommended practice on Windows. However the installer does allow you to choose the path if you prefer to use the root path. |
Languages/environments like Lazarus, Go and Flutter do use that system. Short pathnames are more important than one might think, if only to prevent lines in the output from breaking up.
Yes, I uninstalled (.espressif itself wasn't deleted) and then reinstalled. Apparently all is fine.
I do think so, it is an important decision for many. But I'm sure if the default location was fine, that would make less of a difference. |
Sorry, a bit confused here: was your issue related to the location where IDF is cloned (Desktop) or where the tools are installed ( |
No confusion here. This comment was about the uninstall, and insignificant. |
I have come to think about this a little more. The issue is more important than it seems, and shortness of paths is not the main issue. When the default install uses In addition it would be possible to make a portable install, and pass the project to someone, without needing an installation or instructions. These things make a BIG difference in ergonomics for the user and for you folks. Heck, even Python (supposedly battle tested) doesn't correctly handle its installs. I have seen cases where I have to uninstall then reinstall to get the desired behaviour. Reliability (of install and communications) is highly favored by simplicity. But doing it this way of course means only one install per machine. Which isn't standard practice, except for development, as exemplified by the examples I gave (and have installed). Also, anything that depends on instructions is bad, as humans are bad at following instructions. Inevitably they introduce small differences that later cause breakage, without anyone being able to pinpoint why. It is therefore important to minimize such needless variations. The insertion of a username in a path is such a thing. Is the benefit worth the costs? I'm now firmly in the "No" camp. I think it is mistake. |
A few words about the install place. As I know, user-installed apps are tending to install to System-wide traditionally are installing to: For back compatibility commonly Microsoft uses Juncuion links (e.g. AppData was Application Data). We could create one at |
The common install locations are perfect for when the user has no interaction with them, they keep the install out of the way and, additionally, grouped per user. For development "out of the way" is largely a negative. I now ran my first build and it serves as an example of the impact of paths. Note I didn't find any project-migration instructions (from MSYS32 to CMake), so it failed. I got messages like this (which still wrap even in a fullscreen 237 column wide terminal):
These messages are sometimes the only way to diagnose a problem. But I would be much happier with:
I understand these messages are not really under your control, but they illustrate paths do make a big difference. cmd.exe complicates matters further, relative to MSYS32, as there are no colors. Now back to my project :/ Thanks for making this work and generally doing a very good job. |
@freedaun Thanks for explaining this concern. I agree this is a legitimate difficulty (path noise in error messages) and we'll try to find a way to improve it if possible. One request, could you please open a new issue describing this issue (feel free to link back to this discussion)? This thread already has a number of other discussions about different aspects of CMake in it, and it makes it hard for us to keep track.
For the record, you don't have to use cmd.exe - it should be possible to build under an MSYS2 terminal or Git Bash (which is also MSYS2), PowerShell, etc. We changed the instructions to use Windows Shell because this is more familiar for Windows users, and we don't require the Unix emulation environment any more. But it should still be available for those who want it. |
To everyone seeing this in the future: Please open new issues for new problems in CMake (if no other issue describes the problem you see), rather than replying here. (I've locked this not because we don't care about CMake issues but because we do care about them, and tracking a number of discussions in a long thread makes it hard for us to address them all.) |
I would like to first thank you guys to help make things better!
The original "Standard Setup of Toolchain for Windows" instructions were clear on what to do for every step.
This new CMake-Based Build System Preview instructions are far from easy to understand each step.
Things like:
"Next Steps
To carry on with development environment setup, proceed to section Get ESP-IDF.
"
If I click on that link it takes me to needing to install mingw32, if i just click next a little lower at the bottom of the page I am shown "Setup for cmake on Windows from Scratch" What? I was just told eairlier to download "https://dl.espressif.com/dl/esp-idf-tools-setup-1.0.exe" which installs this automatically. This section is very confusing. Please, make it a step by step process and not page links jumping around here and there.
The text was updated successfully, but these errors were encountered: