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

cmakeuserpresets.json not read by vscode-cmake-tools? #3725

Closed
aiyolo opened this issue Apr 28, 2024 · 6 comments · Fixed by #3826
Closed

cmakeuserpresets.json not read by vscode-cmake-tools? #3725

aiyolo opened this issue Apr 28, 2024 · 6 comments · Fixed by #3826
Assignees
Labels
bug a bug in the product Feature: presets
Milestone

Comments

@aiyolo
Copy link

aiyolo commented Apr 28, 2024

Brief Issue Summary

My CMake project folder has a cmakeuserpresets.json file, but the preset(both configure preset and build preset) is not loaded by vscode-cmake-tools, so I can't use the preset defined in cmakeuserpresets.json.
Is there any option to open this feature? How can use the preset defined in cmakeuserpresets.json?

CMake Tools Diagnostics

No response

Debug Log

No response

Additional Information

No response

@aiyolo aiyolo changed the title cmakeuserpresets not read by vscode-cmake-tools? cmakeuserpresets.json not read by vscode-cmake-tools? Apr 28, 2024
@v-ericawu v-ericawu added bug a bug in the product Feature: presets and removed triage labels Apr 30, 2024
@v-ericawu
Copy link
Collaborator

@gcampbell-msft We reproduced the issue using the following steps:

ENV:

  • OS: Win10 22H2
  • VS Code version: 1.88.1
  • CMake Tools extension: 1.18.31(pre-release)

Repro Steps:

  1. Download and unzip Test project.
  2. Open Test project with VS Code.
  3. Press F1 and run command 'CMake: Add Configure Preset', select 'Inherit from Configure Preset'.

Expected Result: Can add preset (both configure preset and build preset) for 'CMakeUserPresets.json' file.

Actual Result: preset (both configure preset and build preset) only adds to the CMakePresets.json file but not to the CMakeUserPresets.json file.

'CMake: Add Configure Preset'->'Inherit from Configure Preset':
image

‘CMake: Add Build Preset’->'Create from Configure Preset':
image

@gcampbell-msft
Copy link
Collaborator

@aiyolo Does the above reproduction match the issue that you are hitting? Is it only this use case that it is happening in? Or is there more general issues?

@gcampbell-msft gcampbell-msft added the more info needed More info is needed from the community for us to properly triage and investigate. label Apr 30, 2024
@aiyolo
Copy link
Author

aiyolo commented May 2, 2024

yes, it is the issue I'm hitting, I think it's a general issue.

@benschreiber
Copy link

Possibly related to #3636

@v-ericawu
Copy link
Collaborator

@gcampbell-msft @aiyolo @benschreiber Verified on CMake Tools v1.18.37(pre-release), this issue still repro:
image

@gcampbell-msft gcampbell-msft removed the more info needed More info is needed from the community for us to properly triage and investigate. label May 13, 2024
@gcampbell-msft gcampbell-msft added this to the On Deck milestone May 13, 2024
@qarni qarni self-assigned this Jun 11, 2024
@qarni qarni modified the milestones: On Deck, 1.19 Jun 11, 2024
@qarni qarni closed this as completed in 1ffb1c4 Jun 18, 2024
gcampbell-msft added a commit that referenced this issue Jul 3, 2024
* reversed order of creating workspace browse configurations (#3758)

* reversed order of creating workspace browse configurations

* updated tests

* minimized change by only reversing fileGroups, and reverted tests

* Add clarity in the build log when builds are out of source (#3778)

* Add chesscc to the allow-list of compilers. (#3777)

Co-authored-by: snehara99 <113148726+snehara99@users.noreply.github.com>

* Fix doubling of cpack args passed by package preset (#3766)

* Remove unnecessary logging about string expansion (#3761)

* Remove unnecessary logging about string expansion

* Fix typo in var name

---------

Co-authored-by: snehara99 <113148726+snehara99@users.noreply.github.com>

* Fix UI for settings override of package presets (#3770)

* Fix UI for settings override of package presets

* Fix linter errors

* Skip full configure on variant change for multi-config generators (#3763)

* Don't fully configure after variant change for multi-config generators. Only change parameter for build and refresh IntelliSense.

* Added missing return on 'if else'

* Removed unnecessary log. No previous configure message was printed before it.'

* Run clean-configure when workflow has different configure preset than project (#3768)

* Let cmake.configureArgs overwrite the default cmake args (#3762)

Co-authored-by: snehara99 <113148726+snehara99@users.noreply.github.com>

* Handle "~" in binaryDir path (#3764)

* File system APIs don't recognize ~ in paths and because of this the extension cannot properly interpret cmake file-api jsons to list targets.

* Fix path typo

---------

Co-authored-by: snehara99 <113148726+snehara99@users.noreply.github.com>

* Warning when VS installation instance not found (#3775)

* Add warning about not found VS installation instance and suggestion to re-scan kits, at the request of developers in the community.

* Fix linter errors

---------

Co-authored-by: snehara99 <113148726+snehara99@users.noreply.github.com>

* Fix GitHub 3602, mention --build-config even for default test preset (#3779)

* Better validations that validate before running.  (#3774)

* initial commit

* add better values

* check notice and changelog before release version

* Update kits-variants doc with unsupported commands that are specific for presets (#3784)

Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* colorization support in pre-release (#3794)

* colorization support in pre-release

* update changelog

* Sort CMakeLists.txt by depth (#3789)

* Sort CMakeLists.txt by depth

* Add changes to CHANGELOG.md

---------

Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* Fixed string parameters and added clarification to the log message (#3787)

* Localization - Translated Strings (#3753)

Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* fix schema field in v8 schema (#3809)

* Add check that limits when we -R a regex of all tests (#3814)

* fix ctest

* only try to be smart about this in the test explorer entry points

* updating comment

* add try catch in debug createRunProfile

* Localization - Translated Strings (#3816)

* Update CHANGELOG.md

* update localization for project status view and quick pick (#3810)

* fix issue with test results not found (#3823)

* update braces dependency (#3839)

* Fixes #3725 - user presets not read correctly (#3826)

* get all presets to show in inherit

* if new configure preset inherits from a user preset add to the user presets file

* todo: finish update for different types of presets

* checks for configure inherit and inherit. todo - check workflow

* cleanup + mark as isUserPreset

* undo use isuserpreset field

* cleanup and changelog

* cleanup

* rename interface

* update workflow preset to not extend preset + refactor inheritsfromuserpreset func

* remove preset class fields from workflow preset

* more workflow preset cleanup

* Fixes #3811 - checks for cmake.exe again if it wasnt present the previous time  (#3840)

checks for exe again if it wasn't present the previous time

* Tree view for tests using test suite delimiter (#3759)

* Implement treeview for tests using test suite delimiter

* Support regular expressions for delimiters

* Improve UI string

* Improve UI string

* Address CR comments

* Fix spacing

* make sure to pass entry point through

---------

Co-authored-by: Garrett Campbell <gcampbell@microsoft.com>
Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* Update telemetry API to latest version. (#3843)

* presets + cmake.buildToolArgs: make sure `--` is added in all cases (#3755)

* presets + cmake.buildToolArgs: make sure `--` is added in all cases

Fixes #3754.
This issue was introduced in #3537 (cmake.buildToolsArgs was ignored for presets before).

* Update changelog

---------

Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* Update CHANGELOG.md

* Fixes #3140 - Test log unavailable (#3752)

* Using \r\n as line ending

Seems like \r\n is the line ending characters in the Test Output even on systems different from win32

* Specify the test item in the call to appendOutput

Doing so allows to have the output of the test to be printed out in the left part of the "TEST RESULTS" pane when clicking on the desired test in the right part of the same pane.
Before this change we get "The test case did not report any output"

* Adds location information in the call to appendOutput.

The test object may have uri and ranges that can help localization

* Adds entry in the CHANGELOG

---------

Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* Upgrade cmake_minimum_required version 3.0.0 -> 3.5.0 (#3805)

* Update cmakeProject.ts

Upgrade cmake_minimum_required version 3.0.0 -> 3.5.0

* Update CHANGELOG.md

---------

Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* Add setting for deleting whole build dir when clean configuring (#3783)

* Add setting for deleting whole build dir when clean configuring

* Remove unnecessary tag in new setting in package.json

* Add changelog entry. Remove unnecessary | null from new boolean setting.

---------

Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* log error for cmake exe not found (#3847)

* Fixed how we use our '--warn-unused-cli' flag (#3860)

* '--warn-unused-cli' is now used to remove the default '--no-warn-unused-cli' command instead of removing and also adding itself to the arguments

* only removed '--warn--unused-cli' instead of all initial_common_flgs

* Set useCMakePresets context after quick start (#3853)

update active proj to set userpreset context

* remove from pre-release (#3861)

* clean configures when platform differs between old and new selected kit (#3859)

* clean configures when only platform changes between kits

* updated changelog

* check toolset too

* changelog

* update changelog

* add rel to branches (#3867)

---------

Co-authored-by: snehara99 <113148726+snehara99@users.noreply.github.com>
Co-authored-by: Andreea Isac <48239328+andreeis@users.noreply.github.com>
Co-authored-by: Joan Marcè i Igual <jmigual@users.noreply.github.com>
Co-authored-by: CSIGS@microsoft.com <csigs@users.noreply.github.com>
Co-authored-by: Fatima Qarni <fatimaqarni@microsoft.com>
Co-authored-by: vinocher-bc <160914867+vinocher-bc@users.noreply.github.com>
Co-authored-by: Bob Brown <bobbrow@users.noreply.github.com>
Co-authored-by: Jeremie Allard <jeremie.allard@insimo.fr>
Co-authored-by: hippo91 <guillaume.peillex@gmail.com>
Co-authored-by: LiuZengqiang <74355935+LiuZengqiang@users.noreply.github.com>
@Ashley-Li
Copy link
Collaborator

Ashley-Li commented Jul 9, 2024

Verified on CMake Tools v1.18.43(release), this issue was fixed:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug a bug in the product Feature: presets
Projects
Status: Completed
Development

Successfully merging a pull request may close this issue.

6 participants