Skip to content
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

Output for CMake actions? #129

Open
AnalogWeapon opened this issue Dec 4, 2024 · 10 comments
Open

Output for CMake actions? #129

AnalogWeapon opened this issue Dec 4, 2024 · 10 comments
Labels
enhancement New feature or request

Comments

@AnalogWeapon
Copy link

I'm presenting this as a "problem", but it might be that I don't understand where to look: When the "Clean CMake" and "Configure CMake" tasks are run, there is no output besides the little notification in the lower-right. I want to see the output from the CMake process, so I can can figure out what's going on and make changes if needed. I don't know what files it is referencing to execute CMake, so that's the first thing I'm trying to figure out.

If something goes wrong, the notification bubble will advise to "check the logs". Where are those logs? I have searched through all the possible output sources in vscode's output tab. I don't see any terminals created either. I don't see anything popping up in the developer tools of vscode either.

@will-v-pi
Copy link
Collaborator

will-v-pi commented Dec 4, 2024

To get more output from CMake, I’d recommend using the CMake Tools Integration - this will give you all the logs from the CMake Tools extension, and that will provide a lot more configurability for the CMake build

@AnalogWeapon
Copy link
Author

AnalogWeapon commented Dec 5, 2024

I have enabled those settings, reloaded the window, and restarted vscode. No output shows when I click "Clean CMake" or "Configure CMake" from the Raspberry Pi Pico extension pane on the right. When you say that it gives the logs, do you mean what is generated in the build folder? I'm looking for output from the running processes. Maybe there's a conflict with another extension?

@will-v-pi
Copy link
Collaborator

With the CMake Tools integration enabled you'll need to use that to run the configure/clean - simplest way is with Ctrl+Shift+P "CMake: Configure". The output appears in the Output window (Ctrl+Shift+U).

You should get an error mentioning this when you click the "Configure CMake" button from this extension (when you have the CMake Tools Integration enabled), saying that you must use the CMake Tools extension.

@AnalogWeapon
Copy link
Author

That makes sense. The output does appear when I use CMake Tools.

So I guess the only problem I'm having is that that error isn't popping up for me when I click "Configure CMake". It just continues to show the notification of success or failure. But that's a pretty trivial error, knowing that I should just use the CMake Tools extension for those functions instead.

@will-v-pi
Copy link
Collaborator

Just to confirm, have you definitely changed the raspberry-pi-pico.useCmakeTools setting in settings.json in your project directory from false to true and reloaded the VS Code window?

@AnalogWeapon
Copy link
Author

I swear that I had done that while testing yesterday, but when I went to confirm again now, it is behaving as you expected: I am getting the warnings that I should use CMake Tools instead. I'm sorry for the confusion. Appreciate the help.

@Stokestack
Copy link

Stokestack commented Dec 7, 2024

I just encountered the same problem: "Cmake failed to configure your build." but no way to find out why. If I run CMake from the command line, it reports success.

Which "Cmake Tools Integration" extension do you mean? I have the Microsoft "CMake Tools" installed and enabled, but I'm not seeing any options to get useful information.

Do not use "CMake Integration" by Christoph Seitz; it blanks out your environment variables for some reason, so the paths in settings.json will break: go2sh/cmake-integration-vscode#110

OK... I noticed among the comments raspberry-pi-pico.useCmakeTools, which I have now enabled.

Now my CMake builds fail because
ninja: error: loading 'build.ninja': No such file or directory

For some reason, running the Pico extension's "Clean CMake" option blew it away, and it doesn't get rebuilt.

@will-v-pi
Copy link
Collaborator

Which "Cmake Tools Integration" extension do you mean? I have the Microsoft "CMake Tools" installed and enabled, but I'm not seeing any options to get useful information.

As detailed in the readme, it’s the “CMake Tools Extension” integration, which integrates Microsoft’s CMake Tools Extension with this extension.

For some reason, running the Pico extension's "Clean CMake" option blew it away, and it doesn't get rebuilt.

The “Clean CMake command is supposed to blow it away (that’s the whole point of the clean), but it should reconfigure it after. It sounds like your CMake configuration isn’t correct (possibly an error in your CMakeLists.txt file), so you should enable the CMake Tools Extension integration to get more output to see what’s going wrong with the CMake configure.

@Stokestack
Copy link

Thanks. I restored my project from a backup and tried another clean. This time it didn't blow away the Ninja file, so I don't know what happened last time. I'm using the CMake extension to build now, and the Pi one to debug. It's working fine at the moment.

@will-v-pi will-v-pi added the enhancement New feature or request label Dec 17, 2024
@will-v-pi
Copy link
Collaborator

Leaving this open to maybe improve the error message so it's clearer which logs to check, and mention the CMake Tools Extension integration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants