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

CMake install does not run in terminal as a task #2693

Closed
cjhowedev opened this issue Aug 14, 2022 · 1 comment · Fixed by #2636
Closed

CMake install does not run in terminal as a task #2693

cjhowedev opened this issue Aug 14, 2022 · 1 comment · Fixed by #2636
Assignees
Labels
bug a bug in the product Feature: tasks
Milestone

Comments

@cjhowedev
Copy link

cjhowedev commented Aug 14, 2022

Brief Issue Summary

If I have a tasks.json like this:

{
  "version": "2.0.0",
  "tasks": [
    {
      "type": "cmake",
      "label": "install",
      "command": "install",
      "targets": [
        "all"
      ]
    }
  ]
}

And I run the task, then I see the following in the integrated terminal:

Install Started...

 *  The terminal process failed to launch (exit code: -1). 

And then the install runs successfully from the Output pane asynchronously.

What I expect is for the task to complete successfully. Because of the above error, the install task fails before the install ever runs. This means if I use install as a preLaunchTask for a debug configuration, I will be unable to run the debug configuration successfully.

CMake Tools Diagnostics

{
  "os": "win32",
  "vscodeVersion": "1.70.1",
  "cmtVersion": "1.12.22",
  "configurations": [
    {
      "folder": "c:\\Source\\gin",
      "cmakeVersion": "3.23.2",
      "configured": true,
      "generator": "Ninja",
      "usesPresets": true,
      "compilers": {
        "C": "cl",
        "CXX": "cl"
      }
    }
  ],
  "cpptoolsIntegration": {
    "isReady": true,
    "hasCodeModel": true,
    "activeBuildType": "Debug",
    "buildTypesSeen": [
      "Debug"
    ],
    "requests": [
      "file:///c%3A/Source/gin/app/application.cpp"
    ],
    "responses": [
      {
        "uri": "file:///c%3A/Source/gin/app/application.cpp",
        "configuration": {
          "includePath": [
            "c:/source/gin",
            "c:/source/gin/out/build/x64-debug/vcpkg_installed/x64-windows/include",
            "c:/source/gin/out/build/x64-debug/vcpkg_installed/x64-windows/include/directxmath"
          ],
          "defines": [
            "UNICODE",
            "_UNICODE"
          ],
          "compilerPath": "c:/program files/microsoft visual studio/2022/community/vc/tools/msvc/14.33.31629/bin/hostx86/x64/cl.exe",
          "compilerArgs": [],
          "compilerFragments": [
            "/DWIN32 /D_WINDOWS /EHsc /Zi /Ob0 /Od /RTC1 -MDd",
            "-std:c++20"
          ]
        }
      }
    ],
    "partialMatches": [],
    "targetCount": 10,
    "executablesCount": 1,
    "librariesCount": 7,
    "targets": [
      {
        "name": "gin",
        "type": "EXECUTABLE"
      },
      {
        "name": "gin_app",
        "type": "STATIC_LIBRARY"
      },
      {
        "name": "gin_ecs",
        "type": "STATIC_LIBRARY"
      },
      {
        "name": "gin_except",
        "type": "STATIC_LIBRARY"
      },
      {
        "name": "gin_gfx",
        "type": "STATIC_LIBRARY"
      },
      {
        "name": "gin_io",
        "type": "STATIC_LIBRARY"
      },
      {
        "name": "gin_resources",
        "type": "UTILITY"
      },
      {
        "name": "gin_shaders",
        "type": "UTILITY"
      },
      {
        "name": "gin_str",
        "type": "STATIC_LIBRARY"
      },
      {
        "name": "gin_win",
        "type": "STATIC_LIBRARY"
      }
    ]
  },
  "settings": [
    {
      "communicationMode": "automatic",
      "useCMakePresets": "auto",
      "configureOnOpen": true
    }
  ]
}

Debug Log

[main] Building folder: gin install
[main] Saving open files before configure/build
[build] Starting build
[driver] Start build install
[proc] Executing command: "C:\Program Files\CMake\bin\cmake.EXE" --build c:/Source/gin/out/build/x64-debug --target install
[build] -- Install configuration: "Debug"
[build] -- Installing: C:/Source/gin/out/install/x64-debug/hlsl/main.vs.bin
[build] -- Installing: C:/Source/gin/out/install/x64-debug/hlsl/main.ps.bin
[build] -- Installing: C:/Source/gin/out/install/x64-debug/hlsl/common.lib.bin
[build] -- Up-to-date: C:/Source/gin/out/install/x64-debug/.
[build] -- Up-to-date: C:/Source/gin/out/install/x64-debug/./Avocado.glb
[build] -- Up-to-date: C:/Source/gin/out/install/x64-debug/./Box.glb
[build] -- Up-to-date: C:/Source/gin/out/install/x64-debug/./Corset.glb
[build] -- Up-to-date: C:/Source/gin/out/install/x64-debug/./Fox.glb
[build] -- Up-to-date: C:/Source/gin/out/install/x64-debug/./SciFiHelmet.bin
[build] -- Up-to-date: C:/Source/gin/out/install/x64-debug/./SciFiHelmet.gltf
[build] -- Up-to-date: C:/Source/gin/out/install/x64-debug/./Triangle.gltf
[build] -- Up-to-date: C:/Source/gin/out/install/x64-debug/./gin.exe
[build] [1/3] Running utility command for gin_shaders
[build] [2/3] Running utility command for gin_resources
[build] [2/3] Install the project...
[cmakefileapi-parser] Read reply folder: c:\Source\gin\out\build\x64-debug\.cmake\api\v1\reply
[cmakefileapi-parser] Found index files: ["cache-v2-23777afaa45b9daa90a4.json","cmakeFiles-v1-de57a1b83c44b1c9ba38.json","codemodel-v2-305fc0aa114b527e8e77.json","directory-.-Debug-67245af2ea0141aa6b4c.json","directory-app-Debug-7ab44524cbd5ada90c6a.json","directory-ecs-Debug-364072e3a24d4d62b624.json","directory-except-Debug-3256e117e089a7cbf9c8.json","directory-gfx-Debug-d06bfa0c0de15bd437be.json","directory-hlsl-Debug-90f888eb1a1156bee76d.json","directory-io-Debug-f70c811dfb55af01b35e.json","directory-str-Debug-b1882f4f9545ed73378e.json","directory-win-Debug-a9037d1c23bfabd5709e.json","index-2022-08-14T14-40-34-0496.json","target-gin-Debug-aa6dbb50f8e45e339692.json","target-gin_app-Debug-dc5da2b9e7761935fd06.json","target-gin_ecs-Debug-ffa04db117c28db622e1.json","target-gin_except-Debug-5f85c69e9c0b703dc36e.json","target-gin_gfx-Debug-d64a56e60338e6a5fa36.json","target-gin_io-Debug-7be581be3a10f0419aa0.json","target-gin_resources-Debug-3bf08f33d5ac1eaa9417.json","target-gin_shaders-Debug-11a0555fd80d0b392ab1.json","target-gin_str-Debug-9b1b903bd6ae067d42e7.json","target-gin_win-Debug-7d9d762d88274191a090.json","toolchains-v1-dc44b90a6d5ff7583f42.json"]
[build] Build finished with exit code 0
[cache] Reading CMake cache file c:/Source/gin/out/build/x64-debug/CMakeCache.txt
[cache] Parsing CMake cache string
[extension] [7267] cmake.install finished (returned 0)

Additional Information

No response

@elahehrashedi
Copy link
Contributor

We are pushing an update on tasks feature, including the "install" task, which will be available when this PR is checked in : #2636, I will provide a VSIX for you to test as soon as it is ready.
The install task doesn't support the "target" field.

@elahehrashedi elahehrashedi added Feature: tasks bug a bug in the product labels Aug 15, 2022
@elahehrashedi elahehrashedi self-assigned this Aug 15, 2022
@elahehrashedi elahehrashedi added this to the 1.12 milestone Aug 15, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Oct 11, 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: tasks
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants