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

Clean All Projects menu item builds rather than cleans #2460

Closed
chris-miner opened this issue Mar 27, 2022 · 2 comments · Fixed by #2461
Closed

Clean All Projects menu item builds rather than cleans #2460

chris-miner opened this issue Mar 27, 2022 · 2 comments · Fixed by #2461
Labels
bug a bug in the product Feature: build
Milestone

Comments

@chris-miner
Copy link

Brief Issue Summary

Clicking Clean All Projects in the extension more actions pop-up builds rather than cleans project

There's really not much more to say.

  1. set up a project with a single file and an appropriate CMakeLists.txt file
  2. click on the CMake extension
  3. click on the more actions menu (...)
  4. click on Clean All Projects menu item
  5. open up the CMake/build output

Found:

[main] Building folder: cmake-tutorial 
[build] Starting build
[proc] Executing command: /usr/local/bin/cmake --build /Users/chris/Dev/build-systems/cmake-tutorial/build --config Debug --target all --
[build] ninja: no work to do.
[build] Build finished with exit code 0

Expected:

[main] Building folder: cmake-tutorial clean
[build] Starting build
[proc] Executing command: /usr/local/bin/cmake --build /Users/chris/Dev/build-systems/cmake-tutorial/build --config Debug --target clean --
[build] [1/1 100% :: 0.009] Cleaning all built files...
[build] Cleaning... 2 files.
[build] Build finished with exit code 0

CMake Tools Diagnostics

{
  "os": "darwin",
  "vscodeVersion": "1.65.2",
  "cmtVersion": "1.10.5",
  "configurations": [
    {
      "folder": "/Users/chris/Dev/build-systems/cmake-tutorial",
      "cmakeVersion": "3.22.3",
      "configured": true,
      "generator": "Ninja",
      "usesPresets": false,
      "compilers": {
        "C": "/usr/local/opt/llvm/bin/clang-13",
        "CXX": "/usr/local/opt/llvm/bin/clang++"
      }
    }
  ],
  "cpptoolsIntegration": {
    "isReady": true,
    "hasCodeModel": true,
    "activeBuildType": "Debug",
    "buildTypesSeen": [
      "Debug"
    ],
    "requests": [],
    "responses": [],
    "partialMatches": [],
    "targetCount": 1,
    "executablesCount": 1,
    "librariesCount": 0,
    "targets": [
      {
        "name": "Tutorial",
        "type": "EXECUTABLE"
      }
    ]
  },
  "settings": [
    {
      "communicationMode": "automatic",
      "useCMakePresets": "auto",
      "configureOnOpen": true
    }
  ]
}

Debug Log

[main] Building folder: cmake-tutorial 
[main] Saving open files before configure/build
[build] Starting build
[driver] Start build all
[proc] Executing command: /usr/local/bin/cmake --build /Users/chris/Dev/build-systems/cmake-tutorial/build --config Debug --target all --
[build] ninja: no work to do.
[cmakefileapi-parser] Read reply folder: /Users/chris/Dev/build-systems/cmake-tutorial/build/.cmake/api/v1/reply
[cmakefileapi-parser] Found index files: ["cache-v2-c17d01cd299e3fb08756.json","codemodel-v2-2ef5b8d371b38c0f406e.json","directory-.-Debug-f5ebdc15457944623624.json","index-2022-03-27T16-25-22-0718.json","target-Tutorial-Debug-1e5a34eb554be29a04fc.json","toolchains-v1-542d304298130fbabc27.json"]
[build] Build finished with exit code 0
[cache] Reading CMake cache file /Users/chris/Dev/build-systems/cmake-tutorial/build/CMakeCache.txt
[cache] Parsing CMake cache string
[extension] [7437] cmake.cleanAll finished (returned 0)
@chris-miner
Copy link
Author

It is worth noting that a clean / rebuild of all projects actually does clean and then rebuild. Here's the results of that:

[main] Building folder: cmake-tutorial clean
[main] Saving open files before configure/build
[build] Starting build
[driver] Start build clean
[proc] Executing command: /usr/local/bin/cmake --build /Users/chris/Dev/build-systems/cmake-tutorial/build --config Debug --target clean --
[build] [1/1 100% :: 0.016] Cleaning all built files...
[build] Cleaning... 2 files.
[cmakefileapi-parser] Read reply folder: /Users/chris/Dev/build-systems/cmake-tutorial/build/.cmake/api/v1/reply
[cmakefileapi-parser] Found index files: ["cache-v2-c17d01cd299e3fb08756.json","codemodel-v2-2ef5b8d371b38c0f406e.json","directory-.-Debug-f5ebdc15457944623624.json","index-2022-03-27T16-25-22-0718.json","target-Tutorial-Debug-1e5a34eb554be29a04fc.json","toolchains-v1-542d304298130fbabc27.json"]
[build] Build finished with exit code 0
[cache] Reading CMake cache file /Users/chris/Dev/build-systems/cmake-tutorial/build/CMakeCache.txt
[cache] Parsing CMake cache string
[main] Building folder: cmake-tutorial 
[main] Saving open files before configure/build
[build] Starting build
[driver] Start build all
[proc] Executing command: /usr/local/bin/cmake --build /Users/chris/Dev/build-systems/cmake-tutorial/build --config Debug --target all --
[build] [1/2  50% :: 1.812] Building CXX object CMakeFiles/Tutorial.dir/tutorial.cpp.o
[build] [2/2 100% :: 2.024] Linking CXX executable ../bin/Tutorial
[cmakefileapi-parser] Read reply folder: /Users/chris/Dev/build-systems/cmake-tutorial/build/.cmake/api/v1/reply
[cmakefileapi-parser] Found index files: ["cache-v2-c17d01cd299e3fb08756.json","codemodel-v2-2ef5b8d371b38c0f406e.json","directory-.-Debug-f5ebdc15457944623624.json","index-2022-03-27T16-25-22-0718.json","target-Tutorial-Debug-1e5a34eb554be29a04fc.json","toolchains-v1-542d304298130fbabc27.json"]
[build] Build finished with exit code 0
[cache] Reading CMake cache file /Users/chris/Dev/build-systems/cmake-tutorial/build/CMakeCache.txt
[cache] Parsing CMake cache string
[extension] [2078] cmake.cleanRebuildAll finished (returned 0)

@bobbrow
Copy link
Member

bobbrow commented Mar 28, 2022

Thank you for reporting this. We have a fix pending which should be in tomorrow's pre-release build.

@bobbrow bobbrow linked a pull request Mar 28, 2022 that will close this issue
@bobbrow bobbrow modified the milestones: On Deck, 1.11.0 Apr 20, 2022
@github-actions github-actions bot locked and limited conversation to collaborators May 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug a bug in the product Feature: build
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants