-
Notifications
You must be signed in to change notification settings - Fork 468
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
New machine experience: Ninja not found (in VS, even though it can find CMake in the VS installation just fine) #3260
Comments
Thanks for the report! The suggestion sounds reasonable to me. As a workaround, are you able to launch VS Code from a Visual Studio Developer Command Prompt? That should have all the proper environment variables set for Ninja (and MSVC) to be easily discoverable. @sinemakinci1 FYI this is related to our broader discussion about streamlining tool acquisition. |
I'm experiencing the same issue. As a result, I'm unable to build anything using Ninja. The suggested workaround is not viable because opening VS Dev CMD is too complicated for the simple task of just opening a folder. It should "just work". |
@Thomas1664 Could you provide exact repro steps for when you're seeing this? Are you using kits / presets? What type of project are you opening? Etc. |
@gcampbell-msft We can reproduce this issue on latest VSCode and you can get the details below. ENV:
Repro steps:
Expected result: Actual result: |
@TheJCAB @Yingzi1234 This is a known limitation that we are currently investigating / working on improving. Possibly by implementing something like #3497. |
@gcampbell-msft Yes, thanx! That sounds like a similar issue, and I agree that improving/generalizing tool acquisition (as mentioned here before) would provide good benefits. The extension generally doesn't rely on VSCode being launched from a developer command prompt, which would preclude fully using it as a GUI (launch from Start menu, taskbar or desktop shortcut, open directory/project from the recent list, etc...). That's a good thing, except when it doesn't work, as reported here and in that other issue. Another similar issue we experience is in vcpkg, where it attempts to locate tools like dumpbin and fails. It uses this to read the dependencies of built binaries, and copy any dependencies built by vcpkg. This is noisy but benign (we only use header libraries, so all this work vcpkg does is not really needed in our case). |
We're glad your issue is being addressed! For the other issue, could you reopen a new issue for it and add the details to it? That would help us track down the issue a lot more. Thank you! |
Related to #3497 |
Hi, @TheJCAB, could you please test this version of cmaketools: |
@qarni I'll need to set up a new machine/VM for this. In the meantime, your .zip says 1.13 but the extension is up to 1.18 now. Why the discrepancy? I'd expect a test install to be relatively current... |
@TheJCAB It is current, we often leave it at an old version so that test installations don't overtake your current version except for testing. |
@qarni @gcampbell-msft @TheJCAB |
@qarni I couldn't reproduce the issue with the 1.13 test build. But I was also unable to reproduce the issue with the current 1.18 either. I didn't set up a fresh VM for this, though (I just removed/renamed all ninja tools outside of VS), so I might have missed something. Maybe the path got centrally cached somewhere? I ran the test by building with both: cl.exe and clang-cl.exe, and I verified that I have no ninja.exe in the path when I launch VSCode, but still it somehow managed to find the one in VS. So, inconclusive for me, but the change looks good, thanx! |
@Thomas1664 Are you still able to reproduce your issue? |
I have another vsix here to test, where we also check for if ninja is missing when you're trying to use ninja, and if so, add it if we can find it from vs devenv. |
@gcampbell-msft I can still reproduce this issue in v1.19.27. I can't find the setting |
@gcampbell-msft Yesterday it worked after setting |
@Thomas1664 This may be a regression related to #3905, could you please create an issue with explicit reproduction steps? We would want to fix this before releasing any official release. |
@Thomas1664 I followed up on the new issue you created, if you could please try out the new vsix or test out the PR I created, that would be great. |
Brief Issue Summary
This is a basic ease-of-use user experience issue.
A fresh machine, with VS 2022 installed on it and ready to go. Open a CMake/Ninja project folder VSCode, and try to build. This happens:
So... it can find "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" just fine (it's not in the PATH). But it can't be bothered to put, say, "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja" in the PATH when calling CMake.
This sounds like a relatively simple fix. Ninja is included in VS along with CMake, and it should be usable right out of the box, no?
Thanx!
CMake Tools Diagnostics
No response
Debug Log
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: