microsoft / vscode-cmake-tools

CMake integration in Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=vector-of-bool.cmake-tools
MIT License
1.43k stars 429 forks source link

CMake Error: Not a file: G:/dev/cmaketest #3828

Open tengai650 opened 2 weeks ago

tengai650 commented 2 weeks ago

Brief Issue Summary

Very simple project and with { "cmake.loggingLevel": "debug" } set.

[cmake] loading initial cache file G:\dev\cmaketest [cmake] CMake Error: Not a file: G:/dev/cmaketest [cmake] CMake Error: Error processing file: G:/dev/cmaketest

Why are these error messages generated?

image
{
    "version": 6,
    "cmakeMinimumRequired": {
        "major": 3,
        "minor": 26,
        "patch": 0
    },
    "configurePresets": [
        {
            "name": "vs_debug",
            "displayName": "VS Debug Custom preset",
            "description": "Sets Ninja generator, build and install directory",
            "generator": "Visual Studio 17 2022",
            "binaryDir": "${workspaceFolder}/build/${presetName}",
            "architecture": {
                "value": "x64",
                "strategy": "external"
              },
            "cacheVariables": {
                "BOOST_ROOT": "G:/dev/boost_1_85_0",
                "CMAKE_BUILD_TYPE": "Debug",
                "CMAKE_RUNTIME_OUTPUT_DIRECTORY": "${workspaceFolder}/bin",
                "CMAKE_LIBRARY_OUTPUT_DIRECTORY": "${workspaceFolder}/bin/debug/plugins",
                "CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/${presetName}"
            }
        },
        {
            "name": "vs_release",
            "displayName": "VS Release Custom preset",
            "description": "Sets Ninja generator, build and install directory",
            "generator": "Visual Studio 17 2022",
            "binaryDir": "${workspaceFolder}/build/${presetName}",
            "architecture": {
                "value": "x64",
                "strategy": "external"
              },
            "cacheVariables": {
                "BOOST_ROOT": "G:/dev/boost_1_85_0",
                "CMAKE_BUILD_TYPE": "Release"
            }
        },
        {
            "name": "clang_debug",
            "displayName": "CLang Debug configure preset",
            "description": "Sets Ninja generator, build and install directory",
            "generator": "Ninja",
            "binaryDir": "${workspaceFolder}/build/${presetName}",
            "architecture": {
                "value": "x64",
                "strategy": "external"
              },
            "cacheVariables": {
                "BOOST_ROOT": "G:/dev/boost_1_85_0",
                "CMAKE_BUILD_TYPE": "Debug",
                "CMAKE_RUNTIME_OUTPUT_DIRECTORY": "${workspaceFolder}/bin",
                "CMAKE_LIBRARY_OUTPUT_DIRECTORY": "${workspaceFolder}/bin/debug/plugins",
                "CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/${presetName}"
            }
        }
    ],
    "buildPresets": [
        {
            "name": "ClangDebug",
            "configurePreset": "clang_debug",
            "description": "",
            "displayName": "ClangDebug"
        },
        {
            "name": "WinDebug",
            "configurePreset": "vs_debug",
            "description": "",
            "displayName": "WinDebug"
        }
    ]
}

CMake Tools Diagnostics

[expand] expanding cmake
[main] Configuring project: cmaketest 
[main] Saving open files before configure/build
[driver] Removing g:/dev/cmaketest/build/vs_release/CMakeCache.txt
[driver] Removing g:\dev\cmaketest\build\vs_release\CMakeFiles
[expand] expanding G:/dev/cmaketest
[driver] Start configure 
[driver] Running pre-configure checks and steps
[expand] expanding 
[expand] expanding G:/dev/cmaketest
[cmakefileapi-driver] Configuring using preset
[cmakefileapi-driver] Invoking CMake C:\Program Files\Microsoft Visual Studio\2022\Preview\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe with arguments ["-C","G:\\dev\\cmaketest","-DBOOST_ROOT=G:/dev/boost_1_85_0","-DCMAKE_BUILD_TYPE=Release","-SG:/dev/cmaketest","-Bg:/dev/cmaketest/build/vs_release","-G","Visual Studio 17 2022"]
[proc] Executing command: "C:\Program Files\Microsoft Visual Studio\2022\Preview\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -C G:\dev\cmaketest -DBOOST_ROOT=G:/dev/boost_1_85_0 -DCMAKE_BUILD_TYPE=Release -SG:/dev/cmaketest -Bg:/dev/cmaketest/build/vs_release -G "Visual Studio 17 2022"
[proc]   with environment: {"ALLUSERSPROFILE":"C:\\ProgramData","AMDRMSDKPATH":"C:\\Program Files\\AMD\\RyzenMasterSDK\\","APPDATA":"C:\\Users\\tengai\\AppData\\Roaming","APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL":"1","CHROME_CRASHPAD_PIPE_NAME":"\\\\.\\pipe\\crashpad_40236_FRQZBGHRRJHZTDPK","COMPUTERNAME":"MSI_MAG","ComSpec":"C:\\Windows\\system32\\cmd.exe","CommonProgramFiles":"C:\\Program Files\\Common Files","CommonProgramFiles(x86)":"C:\\Program Files (x86)\\Common Files","CommonProgramW6432":"C:\\Program Files\\Common Files","DriverData":"C:\\Windows\\System32\\Drivers\\DriverData","EFC_6040":"1","ELECTRON_RUN_AS_NODE":"1","HOMEDRIVE":"C:","HOMEPATH":"\\Users\\tengai","LOCALAPPDATA":"C:\\Users\\tengai\\AppData\\Local","LOGONSERVER":"\\\\MSI_MAG","NUMBER_OF_PROCESSORS":"32","ORIGINAL_XDG_CURRENT_DESKTOP":"undefined","OS":"Windows_NT","OneDrive":"C:\\Users\\tengai\\OneDrive","PATHEXT":".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC","PROCESSOR_ARCHITECTURE":"AMD64","PROCESSOR_IDENTIFIER":"AMD64 Family 25 Model 97 Stepping 2, AuthenticAMD","PROCESSOR_LEVEL":"25","PROCESSOR_REVISION":"6102","PSModulePath":"C:\\Program Files\\WindowsPowerShell\\Modules;C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\Modules","PUBLIC":"C:\\Users\\Public","Path":"C:\\Program Files (x86)\\Common Files\\Oracle\\Java\\javapath;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Windows\\System32\\OpenSSH\\;","ProgramData":"C:\\ProgramData","ProgramFiles":"C:\\Program Files","ProgramFiles(x86)":"C:\\Program Files (x86)","ProgramW6432":"C:\\Program Files","SESSIONNAME":"Console","SystemDrive":"C:","SystemRoot":"C:\\Windows","TEMP":"C:\\Users\\tengai\\AppData\\Local\\Temp","TMP":"C:\\Users\\tengai\\AppData\\Local\\Temp","USERDOMAIN":"MSI_MAG","USERDOMAIN_ROAMINGPROFILE":"MSI_MAG","USERNAME":"tengai","USERPROFILE":"C:\\Users\\tengai","VSCODE_AMD_ENTRYPOINT":"vs/workbench/api/node/extensionHostProcess","VSCODE_CODE_CACHE_PATH":"C:\\Users\\tengai\\AppData\\Roaming\\Code\\CachedData\\611f9bfce64f25108829dd295f54a6894e87339d","VSCODE_CRASH_REPORTER_PROCESS_TYPE":"extensionHost","VSCODE_CWD":"C:\\Users\\tengai\\AppData\\Local\\Programs\\Microsoft VS Code","VSCODE_HANDLES_UNCAUGHT_ERRORS":"true","VSCODE_IPC_HOOK":"\\\\.\\pipe\\e3ec2487-1.90.1-main-sock","VSCODE_L10N_BUNDLE_LOCATION":"","VSCODE_NLS_CONFIG":"{\"locale\":\"en-us\",\"osLocale\":\"en-us\",\"availableLanguages\":{},\"_languagePackSupport\":true}","VSCODE_PID":"40236","windir":"C:\\Windows"}
[cmake] loading initial cache file G:\dev\cmaketest
[cmake] CMake Error: Not a file: G:/dev/cmaketest
[cmake] CMake Error: Error processing file: G:/dev/cmaketest
[cmake] -- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.22631.
[cmake] -- The C compiler identification is MSVC 19.40.33811.0
[cmake] -- The CXX compiler identification is MSVC 19.40.33811.0
[cmake] -- Detecting C compiler ABI info
[cmake] -- Detecting C compiler ABI info - done
[cmake] -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Tools/MSVC/14.40.33807/bin/Hostx64/x64/cl.exe - skipped
[cmake] -- Detecting C compile features
[cmake] -- Detecting C compile features - done
[cmake] -- Detecting CXX compiler ABI info
[cmake] -- Detecting CXX compiler ABI info - done
[cmake] -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Tools/MSVC/14.40.33807/bin/Hostx64/x64/cl.exe - skipped
[cmake] -- Detecting CXX compile features
[cmake] -- Detecting CXX compile features - done
[cmake] -- Configuring incomplete, errors occurred!
[proc] The command: "C:\Program Files\Microsoft Visual Studio\2022\Preview\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -C G:\dev\cmaketest -DBOOST_ROOT=G:/dev/boost_1_85_0 -DCMAKE_BUILD_TYPE=Release -SG:/dev/cmaketest -Bg:/dev/cmaketest/build/vs_release -G "Visual Studio 17 2022" exited with code: 1
[expand] expanding cmake
[expand] expanding cmake
[extension] [7854] cmake.cleanConfigure finished (returned {"result":1,"resultType":0})
[expand] expanding cmake
[expand] expanding cmake
[expand] expanding cmake
[expand] expanding cmake
[expand] expanding cmake
[expand] expanding cmake
[expand] expanding cmake
[expand] expanding cmake
[expand] expanding cmake
[expand] expanding cmake
[expand] expanding cmake

Debug Log

No response

Additional Information

No response

tengai650 commented 2 weeks ago

This issue seems to be related to settings.json { "cmake.cacheInit": "" }

However, when set to 'null' the IDE says the following:

image

Please fix the IDE.

Yingzi1234 commented 1 week ago

@tengai650 Thank you for your github issue! We can't reproduce your problem, can you try to follow the steps below for a long time

  1. Is path “G:\dev\cmaketest” a valid path?
  2. Could you try to delete the CMake cache file? Maybe the old cache file is causing this error as well.
  3. Does this problem recur on every file?

Please feel free if you have any concern!

tengai650 commented 6 days ago

FYI, I solved the issue myself (see my last comment). However, the IDE is misleading with the yellow squiggle for 'null'. Type 'null' is supported.

Yingzi1234 commented 2 days ago

Glad to see that your problem has been resolved, please feel free if you have any concerns! Thank you!