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

Non-existent build folder used with doubly inheriting configure preset #4023

Closed
mpayrits opened this issue Aug 29, 2024 · 5 comments · Fixed by #4028
Closed

Non-existent build folder used with doubly inheriting configure preset #4023

mpayrits opened this issue Aug 29, 2024 · 5 comments · Fixed by #4028
Labels
bug a bug in the product Feature: presets regression used to work and no longer does. Regressions are typically high priority

Comments

@mpayrits
Copy link

Brief Issue Summary

With a CMakeUserPresets.json and no CMakePresets.json where the active preset inherits from two hidden presets, the CMake vscode tools build step executes with a made-up, non-existent build folder, and consequently fails.
The specific setup that fails is included in the Additional Information section.
Adding a CMakePresets.json file, even if its configurePresets field is empty, makes the problem go away, as does moving the specification of binaryDir to the default preset.

CMake Tools Diagnostics

{
  "os": "win32",
  "vscodeVersion": "1.92.2",
  "cmtVersion": "1.19.49",
  "configurations": [
    {
      "folder": "c:\\repos\\cmake_repro",
      "cmakeVersion": "3.30.0",
      "configured": true,
      "generator": "Ninja",
      "usesPresets": true,
      "compilers": {
        "CXX": "C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Tools/MSVC/14.40.33807/bin/Hostx64/x64/cl.exe"
      }
    }
  ],
  "cpptoolsIntegration": {
    "isReady": true,
    "hasCodeModel": false,
    "activeBuildType": "",
    "buildTypesSeen": [
      "Debug"
    ],
    "requests": [],
    "responses": [],
    "partialMatches": [],
    "targetCount": 0,
    "executablesCount": 0,
    "librariesCount": 0,
    "targets": []
  },
  "settings": [
    {
      "communicationMode": "automatic",
      "useCMakePresets": "auto",
      "configureOnOpen": true
    }
  ]
}

Debug Log

[main] Building folder: C:/repos/cmake_repro/build/Release 
[main] Saving open files before configure/build
[build] Starting build
[driver] Start build 
[proc] Executing command: "C:\Program Files\CMake\bin\cmake.EXE" --build C:/repos/cmake_repro/out/build/default-Release --parallel 22 --
[proc]   with environment:  # Deleted by OP
[build] Error: C:/repos/cmake_repro/out/build/default-Release is not a directory
[proc] The command: "C:\Program Files\CMake\bin\cmake.EXE" --build C:/repos/cmake_repro/out/build/default-Release --parallel 22 -- exited with code: 1
[driver] Build completed: 00:00:00.101
[cmakefileapi-parser] Read reply folder: C:\repos\cmake_repro\build\Release\.cmake\api\v1\reply
[cmakefileapi-parser] Found index files: ["cache-v2-6a79af79a33f529f12b0.json","cmakeFiles-v1-e2d2853485946773b423.json","codemodel-v2-ab181b5ee363a1d3bd47.json","directory-.-Debug-d0094a50bb2071803777.json","index-2024-08-29T14-46-54-0792.json","toolchains-v1-d7ac54a936b2bd07920c.json"]
[build] Build finished with exit code 1
[cache] Reading CMake cache file C:/repos/cmake_repro/build/Release/CMakeCache.txt
[cache] Parsing CMake cache string
[extension] [9669] cmake.build finished (returned 1)
[cache] Reading CMake cache file C:/repos/cmake_repro/build/Release/CMakeCache.txt
[cache] Parsing CMake cache string
[cpptools] The build configurations generated do not contain the active build configuration. Using "Debug" for CMAKE_BUILD_TYPE instead of "null" to ensure that IntelliSense configurations can be found

Additional Information

The reproducing project consists of these two files.
CMakeUserPresets.json
CMakeLists.txt
Adding the following trivial file makes the problem go away.
CMakePresets.json

@github-project-automation github-project-automation bot moved this to Blocked in CMake Tools Aug 29, 2024
@gcampbell-msft gcampbell-msft added bug a bug in the product regression used to work and no longer does. Regressions are typically high priority Feature: presets labels Aug 29, 2024
@gcampbell-msft
Copy link
Collaborator

@mpayrits We are investigating and I have diagnosed the issue. I hope to have a PR up and merge by tomorrow so that we can get a pre-release version out with a fix for you to use. Thanks for your understanding.

@gcampbell-msft
Copy link
Collaborator

Could you please test the changes I've made in #4028 by installing this vsix (you'll have to modify the extension from .zip to .vsix) and confirm whether it fixes the issue?

Thanks!
cmake-tools.zip

@mpayrits
Copy link
Author

Hi, I've tried out the custom vsix and can confirm it fixes the issue 👍

@gcampbell-msft
Copy link
Collaborator

The fix for this issue will be released in the next hour or so in v1.20.2.

@v-frankwang
Copy link
Collaborator

@gcampbell-msft We verified this issue on CMake tools:v1.20.2 (pre-release) and it has been fixed.

CMake Tools Diagnostics.txt

Actual result:
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 regression used to work and no longer does. Regressions are typically high priority
Projects
Status: Completed
Development

Successfully merging a pull request may close this issue.

3 participants