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

env in presets not work and cmake.cmakePath not work #4218

Open
vipcxj opened this issue Dec 25, 2024 · 5 comments
Open

env in presets not work and cmake.cmakePath not work #4218

vipcxj opened this issue Dec 25, 2024 · 5 comments
Labels
more info needed More info is needed from the community for us to properly triage and investigate.

Comments

@vipcxj
Copy link

vipcxj commented Dec 25, 2024

Brief Issue Summary

This problem happened in the last few days.

  1. cmake.cmakePath is not working, causing the configuration to fail. I found that the original value was cmake and that it was fine before. I could also get the result by typing cmake --version directly in the terminal. However, to fix the problem, I changed it to the absolute path of cmake, and the problem was temporarily solved
  2. I set a customized cacheVariable in CMakePresets.json, "CMAKE_TOOLCHAIN_FILE":"$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake", However, according to the output window, "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" is resolved to "/env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake", which leads to configuration failure. But I tried it in the terminal and the environment variable VCPKG_ROOT was configured correctly. For this I tried restarting vscode, restarting vscode-server, both no effect

CMake Tools Diagnostics

{
  "os": "linux",
  "vscodeVersion": "1.96.2",
  "cmtVersion": "1.19.52",
  "configurations": [
    {
      "folder": "/home/ps/workspace/projects/company/ai-server-cpp",
      "cmakeVersion": "3.29.6",
      "configured": true,
      "generator": "",
      "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": true
    }
  ]
}

Debug Log

[main] 正在配置项目: ai-server-cpp 
[main] 在配置/生成前保存打开的文件
[driver] 开始配置 
[driver] 正在运行预配置检查和步骤
[driver] 注意: 你正在使用预设 release 进行配置,但正在从 VS Code 设置中应用一些替代。
[cmakefileapi-driver] Configuring using preset
[cmakefileapi-driver] Invoking CMake /home/ps/workspace/cmake/bin/cmake with arguments ["-DCMAKE_BUILD_TYPE=RelWithDebInfo","-DGSTREAMER_SUPPORT=ON","-DUSE_GSTREAMER_FULL_STATIC=ON","-DCMAKE_TOOLCHAIN_FILE=/scripts/buildsystems/vcpkg.cmake","-DCMAKE_CUDA_HOST_COMPILER=/usr/bin/g++-11","-Donnxruntime_TENSORRT_HOME=/usr","-S/home/ps/workspace/projects/company/ai-server-cpp","-B/home/ps/workspace/projects/company/ai-server-cpp/build"]
[proc] 执行命令: /home/ps/workspace/cmake/bin/cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DGSTREAMER_SUPPORT=ON -DUSE_GSTREAMER_FULL_STATIC=ON -DCMAKE_TOOLCHAIN_FILE=/scripts/buildsystems/vcpkg.cmake -DCMAKE_CUDA_HOST_COMPILER=/usr/bin/g++-11 -Donnxruntime_TENSORRT_HOME=/usr -S/home/ps/workspace/projects/company/ai-server-cpp -B/home/ps/workspace/projects/company/ai-server-cpp/build
[proc]   环境为 {"LANGUAGE":"en_US:en","USER":"ps","SSH_CLIENT":"192.168.1.4 65173 22","LC_TIME":"zh_CN.UTF-8","XDG_SESSION_TYPE":"tty","SHLVL":"0","MOTD_SHOWN":"pam","HOME":"/home/ps","LC_MONETARY":"zh_CN.UTF-8","SSL_CERT_FILE":"/usr/lib/ssl/certs/ca-certificates.crt","DBUS_SESSION_BUS_ADDRESS":"unix:path=/run/user/1000/bus","LOGNAME":"ps","_":"/home/ps/.vscode-server/cli/servers/Stable-fabdb6a30b49f79a7aba0f2ad9df9b399473380f/server/node","XDG_SESSION_CLASS":"user","XDG_SESSION_ID":"1735","VSCODE_CLI_REQUIRE_TOKEN":"a762151c-104d-45d1-9c41-1163252dd246","PATH":"/home/ps/.vscode-server/cli/servers/Stable-fabdb6a30b49f79a7aba0f2ad9df9b399473380f/server/bin/remote-cli:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/ps/.dotnet/tools","VSCODE_AGENT_FOLDER":"/home/ps/.vscode-server","LC_ADDRESS":"zh_CN.UTF-8","XDG_RUNTIME_DIR":"/run/user/1000","SSL_CERT_DIR":"/usr/lib/ssl/certs","LANG":"en_US.UTF-8","LC_TELEPHONE":"zh_CN.UTF-8","SHELL":"/bin/bash","LC_NAME":"zh_CN.UTF-8","LC_MEASUREMENT":"zh_CN.UTF-8","LC_IDENTIFICATION":"zh_CN.UTF-8","PWD":"/home/ps","SSH_CONNECTION":"192.168.1.4 65173 192.168.1.233 22","LC_NUMERIC":"zh_CN.UTF-8","LC_PAPER":"zh_CN.UTF-8","VSCODE_CWD":"/home/ps","VSCODE_NLS_CONFIG":"{\"userLocale\":\"zh-cn\",\"osLocale\":\"zh-cn\",\"resolvedLanguage\":\"zh-cn\",\"defaultMessagesFile\":\"/home/ps/.vscode-server/cli/servers/Stable-fabdb6a30b49f79a7aba0f2ad9df9b399473380f/server/out/nls.messages.json\",\"languagePack\":{\"translationsConfigFile\":\"/home/ps/.vscode-server/data/clp/6d6cd612ec0ae3cd32737a6f6b7ad966.zh-cn/tcf.json\",\"messagesFile\":\"/home/ps/.vscode-server/data/clp/6d6cd612ec0ae3cd32737a6f6b7ad966.zh-cn/fabdb6a30b49f79a7aba0f2ad9df9b399473380f/nls.messages.json\",\"corruptMarkerFile\":\"/home/ps/.vscode-server/data/clp/6d6cd612ec0ae3cd32737a6f6b7ad966.zh-cn/corrupted.info\"},\"locale\":\"zh-cn\",\"availableLanguages\":{\"*\":\"zh-cn\"},\"_languagePackId\":\"6d6cd612ec0ae3cd32737a6f6b7ad966.zh-cn\",\"_languagePackSupport\":true,\"_translationsConfigFile\":\"/home/ps/.vscode-server/data/clp/6d6cd612ec0ae3cd32737a6f6b7ad966.zh-cn/tcf.json\",\"_cacheRoot\":\"/home/ps/.vscode-server/data/clp/6d6cd612ec0ae3cd32737a6f6b7ad966.zh-cn\",\"_resolvedLanguagePackCoreLocation\":\"/home/ps/.vscode-server/data/clp/6d6cd612ec0ae3cd32737a6f6b7ad966.zh-cn/fabdb6a30b49f79a7aba0f2ad9df9b399473380f\",\"_corruptedFile\":\"/home/ps/.vscode-server/data/clp/6d6cd612ec0ae3cd32737a6f6b7ad966.zh-cn/corrupted.info\"}","VSCODE_HANDLES_SIGPIPE":"true","DM_HOME":"/home/ps/workspace/dameng/unoffical/package","DOTNET_BUNDLE_EXTRACT_BASE_DIR":"/home/ps/.cache/dotnet_bundle_extract","LD_LIBRARY_PATH":":/home/ps/workspace/dameng/unoffical/package/bin","XDG_DATA_DIRS":"/usr/share/gnome:/usr/local/share:/usr/share:/var/lib/snapd/desktop","VSCODE_ESM_ENTRYPOINT":"vs/workbench/api/node/extensionHostProcess","VSCODE_HANDLES_UNCAUGHT_ERRORS":"true","BROWSER":"/home/ps/.vscode-server/cli/servers/Stable-fabdb6a30b49f79a7aba0f2ad9df9b399473380f/server/bin/helpers/browser.sh","ELECTRON_RUN_AS_NODE":"1","VSCODE_IPC_HOOK_CLI":"/run/user/1000/vscode-ipc-00864071-5b1f-411a-bc63-fe4a433ec84d.sock","APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL":"1","VSCODE_DOTNET_INSTALL_TOOL_ORIGINAL_HOME":"/home/ps","NODE_TLS_REJECT_UNAUTHORIZED":"0","VSCODE_L10N_BUNDLE_LOCATION":"vscode-local:/c%3A/Users/cxj/.vscode/extensions/ms-ceintl.vscode-language-pack-zh-hans-1.96.2024121109/translations/extensions/vscode.json-language-features.i18n.json","TRT_ROOT":"/home/ps/workspace/tensorrt/TensorRT-8.6.1.6","VCPKG_ROOT":"/home/ps/workspace/projects/vcpkg","http_proxy":"http://192.168.1.4:7890","https_proxy":"http://192.168.1.4:7890"}
[cmake] CMake Error at /home/ps/workspace/cmake/share/cmake-3.29/Modules/CMakeDetermineSystem.cmake:152 (message):
[cmake]   Could not find toolchain file: /scripts/buildsystems/vcpkg.cmake
[cmake] Call Stack (most recent call first):
[cmake]   CMakeLists.txt:2 (project)
[cmake] 
[cmake] 
[cmake] CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
[cmake] CMake Error: CMAKE_CUDA_COMPILER not set, after EnableLanguage
[cmake] CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
[cmake] CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
[cmake] -- Configuring incomplete, errors occurred!
[proc] 命令“/home/ps/workspace/cmake/bin/cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DGSTREAMER_SUPPORT=ON -DUSE_GSTREAMER_FULL_STATIC=ON -DCMAKE_TOOLCHAIN_FILE=/scripts/buildsystems/vcpkg.cmake -DCMAKE_CUDA_HOST_COMPILER=/usr/bin/g++-11 -Donnxruntime_TENSORRT_HOME=/usr -S/home/ps/workspace/projects/company/ai-server-cpp -B/home/ps/workspace/projects/company/ai-server-cpp/build”已退出,代码为 1
[extension] [3327] cmake.configure 已完成(已返回 1)

Additional Information

From the Debug log you can see that vscode does get the value of the environment variable VCPKG_ROOT, so I think this should be the bug

@vipcxj
Copy link
Author

vipcxj commented Dec 25, 2024

Given that the environment variable doesn't work, I temporarily replaced it with a defined value, and then it still failed to configure.

[cmake] -- The CUDA compiler identification is unknown
[cmake] CMake Error at /home/ps/workspace/cmake/share/cmake-3.29/Modules/CMakeDetermineCUDACompiler.cmake:266 (message):
[cmake]   Failed to detect a default CUDA architecture.
[cmake] 
[cmake] 
[cmake] 
[cmake]   Compiler output:
[cmake] 
[cmake] Call Stack (most recent call first):
[cmake]   CMakeLists.txt:2 (project)
[cmake] 
[cmake] 
[cmake] CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
[cmake] CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
[cmake] -- Configuring incomplete, errors occurred!
[proc] 命令“/home/ps/workspace/cmake/bin/cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DGSTREAMER_SUPPORT=ON -DUSE_GSTREAMER_FULL_STATIC=ON -DCMAKE_TOOLCHAIN_FILE=/home/ps/workspace/projects/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_CUDA_HOST_COMPILER=/usr/bin/g++-11 -Donnxruntime_TENSORRT_HOME=/usr -S/home/ps/workspace/projects/company/ai-server-cpp -B/home/ps/workspace/projects/company/ai-server-cpp/build”已退出,代码为 1
[extension] [6236] cmake.configure 已完成(已返回 1)

I have a feeling that cmake tools is completely broken, and even if you back off and temporarily fix one problem, you'll still be faced with the next one

@Yingzi1234
Copy link
Collaborator

@vipcxj Thank you for your github issue! We would like to reproduce your issue, could you give us a repro steps?

@Yingzi1234 Yingzi1234 added more info needed More info is needed from the community for us to properly triage and investigate. and removed triage labels Dec 31, 2024
@gcampbell-msft
Copy link
Collaborator

@vipcxj Does this reproduce in the most recent pre-release version of the extension?

@vipcxj
Copy link
Author

vipcxj commented Jan 7, 2025

As a contingency, I've changed all relative paths to absolute ones, but I've realized that my other problem may be due to the same cause #13124

@gcampbell-msft
Copy link
Collaborator

@vipcxj Following up on whether the issue reproduces in the most recent pre-release version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
more info needed More info is needed from the community for us to properly triage and investigate.
Projects
Status: Blocked
Development

No branches or pull requests

3 participants