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 causes duplicate build preset entries #4104

Open
mthierman opened this issue Sep 30, 2024 · 0 comments · May be fixed by #4106
Open

CMakeUserPresets.json causes duplicate build preset entries #4104

mthierman opened this issue Sep 30, 2024 · 0 comments · May be fixed by #4106
Assignees
Labels
bug a bug in the product Feature: presets
Milestone

Comments

@mthierman
Copy link

Brief Issue Summary

If CMakeUserPresets.json is present (and even if empty), build presets are duplicated. If CMakeUserPresets is deleted, the problem goes away.

CMake Tools Diagnostics

{
  "os": "win32",
  "vscodeVersion": "1.93.1",
  "cmtVersion": "1.19.52",
  "configurations": [
    {
      "folder": "d:\\Repos\\Glow",
      "cmakeVersion": "3.30.4",
      "configured": false,
      "generator": "Visual Studio 17 2022",
      "usesPresets": true,
      "compilers": {}
    }
  ],
  "cpptoolsIntegration": {
    "isReady": false,
    "hasCodeModel": false,
    "activeBuildType": "",
    "buildTypesSeen": [],
    "requests": [],
    "responses": [],
    "partialMatches": [],
    "targetCount": 0,
    "executablesCount": 0,
    "librariesCount": 0,
    "targets": []
  },
  "settings": [
    {
      "communicationMode": "automatic",
      "useCMakePresets": "auto",
      "configureOnOpen": false
    }
  ]
}

Debug Log

No response

Additional Information

Basic example preset files to reproduce issue:

CMakePresets.json:

{
    "$schema": "https://raw.githubusercontent.com/Kitware/CMake/master/Help/manual/presets/schema.json",
    "version": 9,
    "cmakeMinimumRequired": {
        "major": 3,
        "minor": 30,
        "patch": 0
    },
    "configurePresets": [
        {
            "name": "MSBuild",
            "generator": "Visual Studio 17 2022",
            "architecture": {
                "strategy": "set",
                "value": "x64"
            },
            "toolset": {
                "strategy": "set",
                "value": "host=x64"
            },
            "binaryDir": "${sourceDir}/build/Visual Studio 17 2022/MSVC"
        }
    ],
    "buildPresets": [
        {
            "name": "Debug",
            "configuration": "Debug",
            "configurePreset": "MSBuild"
        },
        {
            "name": "Release",
            "configuration": "Release",
            "configurePreset": "MSBuild"
        }
    ]
}

CMakeUserPresets.json

{
    "$schema": "https://raw.githubusercontent.com/Kitware/CMake/master/Help/manual/presets/schema.json",
    "version": 9,
    "cmakeMinimumRequired": {
        "major": 3,
        "minor": 30,
        "patch": 0
    }
}

This will cause Debug and Release build presets to show up twice in the dropdown selection list.

@gcampbell-msft gcampbell-msft added bug a bug in the product Feature: presets and removed triage labels Oct 1, 2024
@gcampbell-msft gcampbell-msft added this to the 1.20 milestone Oct 1, 2024
@gcampbell-msft gcampbell-msft linked a pull request Oct 1, 2024 that will close this issue
@gcampbell-msft gcampbell-msft self-assigned this Oct 1, 2024
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: Pending Prioritization
Development

Successfully merging a pull request may close this issue.

2 participants