-
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
CMakePresets error including nested presets files #3959
Comments
@pilarArr Thanks for the issue. We are aware of this and have a PR open here: #3958. Addiitonally, you can confirm that the PR fixes your issue by testing out the vsix here: #3956 (comment) |
Hello @gcampbell-msft , thanks for the quick reply. I saw that issue but I wasn't sure it was my case as well. I've being doing some testing on the unix setup and it does not work. Either of them. But it's another error. It looks like this one #1841. I tried resetting vscode by deleting the folders mentioned there and I still get the same error. But using CMakeTools 1.18.19 does work. Should I open a new issue or continue with #1841 ? |
@pilarArr I think I understand the issue. Essentially, on Linux there is a weird behavior of Fedora where it uses aliasing and environment variables, and because we try to expand all environment variables, it says that there is an error. In the event now that we're being more strict about validation, it fails the configure preset. I think it'd be worthwhile for you to create a new issue, link the other, and provide a full repro steps and repro project. Thank you for testing on pre-release as well |
@pilarArr Thank you very much for your testing, it greatly helps us. Could you try out a quick fix I'm investigating to see if it possibly fixes your issue? My understanding is that we should scope our expansion of the environment to the environment variables that are defined in the preset. Please let me know if this fixes the issue on linux and still works on windows. Thanks! |
@gcampbell-msft I've tested the vsix (on unix) and it does not work. I've opened a new issue as you suggested. #3961 |
Brief Issue Summary
Nested includes on preset files fail to load, when loaded a second time, the final error on the log is that there are expansion errors on the presets files.
These presets setup works correctly from the command line and CMakeTools successfully validates them with the schema.
My case would be this. I have a project that I need to build on linux and windows platforms. I have the following cmake presets files which I load with includes and presets that have a condition to either hide them or show them.
I've stripped the presets files the most I could to generate a MWE
CMakePresets.json
: root preset file00_CMakePresetsBasics.json
: this file stores common presets for both operating systems that the specific presets inherit. A MWE follows:01_CMakePresets_win.json
: this file holds the presets configurations for windows and it includes the basics presets file01_CMakePresets_unix.json
: this file holds the presets configurations for windows and it includes the basics presets fileThis setup does not work. Things I've tried:
01_CMakePresets_unix.json
on the root preset makes it all work again.00_CMakePresetsBasics.json
to the root preset does not work. this needs to be included on the relevant files.CMake Tools Diagnostics
Debug Log
Additional Information
So currently I'm testing this on windows, I assume the error would be the same on linux.
Anyways I'll update the issue only in the case that I find something different on unix.
These are the versions for my development environment. I work on an offline system so my update cycle is not as good as it could be. I have to install extensions from vsix
Versions:
Visual Studio Code 1.88.0
CMake 3.27.9
Windows Server 2016
CMakeTools 1.19.36
Visual Studio 2019
The text was updated successfully, but these errors were encountered: