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

User-Local CMake Kits preferredGenerator "Watcom WMake" not working #2500

Closed
FredEckert opened this issue Apr 12, 2022 · 2 comments
Closed

Comments

@FredEckert
Copy link

Brief Issue Summary

When creating a cmake kit for open watcom v2. The preferredGenerator does not work:

AppData\Local\CMakeTools\cmake-tools-kits.json

  {
    "name": "OpenWatcom v2 Beta (32-bit DOS)",
    "compilers": {
        "C": "C:\\WATCOM\\binnt64\\wcl386.exe",
        "CXX": "C:\\WATCOM\\binnt64\\wcl386.exe"
    },
    "preferredGenerator": {
        "name": "Watcom WMake"
    },
    "cmakeSettings": {
        "CMAKE_SYSTEM_NAME":"DOS"
    }
  }

To work around the issue, we create a workspace settings.json to override the preferredGenerator

Preference: Open Workspace Settings (JSON) .vscode\settings.json entry:

{
    "cmake.configureArgs": [
        "-DCMAKE_CXX_COMPILER_WORKS=1",
        "-DCMAKE_C_COMPILER_WORKS=1"
    ],
    "cmake.generator": "Watcom WMake", //Comment this if you aren't using OpenWatcom compiler.
    "C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools",
}

This is not preferred because we cannot retarget to msvc win32 or gcc arm without commenting out the cmake.generator line in the .vscode\settings.json file.

references:

Open Watcom v2 VSCode CMake Kit #724
OW-tools-usage-with-VSCode

CMake Tools Diagnostics

without work around:

{
  "os": "win32",
  "vscodeVersion": "1.66.2",
  "cmtVersion": "1.10.5",
  "configurations": [
    {
      "folder": "ex22",
      "cmakeVersion": "unknown",
      "configured": false,
      "generator": "unknown",
      "usesPresets": false,
      "compilers": {}
    }
  ],
  "cpptoolsIntegration": {
    "isReady": true,
    "hasCodeModel": false,
    "activeBuildType": "",
    "buildTypesSeen": [],
    "requests": [],
    "responses": [],
    "partialMatches": [],
    "targetCount": 0,
    "executablesCount": 0,
    "librariesCount": 0,
    "targets": []
  },
  "settings": [
    {
      "communicationMode": "automatic",
      "useCMakePresets": "auto",
      "configureOnOpen": null
    }
  ]
}

with workaround:

{
  "os": "win32",
  "vscodeVersion": "1.66.2",
  "cmtVersion": "1.10.5",
  "configurations": [
    {
      "folder": "c:\\CMS\\SOURCE\\ex22",
      "cmakeVersion": "3.20.21032501",
      "configured": true,
      "generator": "Watcom WMake",
      "usesPresets": false,
      "compilers": {
        "C": "C:/WATCOM/binnt64/wcl386.exe",
        "CXX": "C:/WATCOM/binnt64/wcl386.exe"
      }
    }
  ],
  "cpptoolsIntegration": {
    "isReady": true,
    "hasCodeModel": true,
    "activeBuildType": "Debug",
    "buildTypesSeen": [
      "Debug"
    ],
    "requests": [],
    "responses": [],
    "partialMatches": [],
    "targetCount": 29,
    "executablesCount": 1,
    "librariesCount": 0,
    "targets": []
  },
  "settings": [
    {
      "communicationMode": "automatic",
      "useCMakePresets": "auto",
      "configureOnOpen": null
    }
  ]
}

Debug Log

without workaround:

[main] Safe constructing new CMakeTools instance
[variant] Constructing VariantManager
[main] Constructing new CMakeTools instance
[main] Starting CMakeTools second-phase init
[variant] Loaded new set of variants
[main] CMakeTools instance initialization complete.
[kit] Reading kits file C:\Users\frede\AppData\Local\CMakeTools\cmake-tools-kits.json
[kit] Successfully loaded 6 kits from C:\Users\frede\AppData\Local\CMakeTools\cmake-tools-kits.json
[kit] Not reading non-existent kits file: c:\SOURCE\ex22\.vscode\cmake-kits.json
[main] Injecting new Kit into CMake driver
[extension] Configuring workspace on open file:///c%3A/SOURCE/ex22
[main] Starting new CMake driver
[main] Starting CMake driver
[cmakefileapi-driver] Creating instance of CMakeFileApiDriver
[driver] Initializating base driver using kit
[driver] CMakeDriver Kit set to OpenWatcom v2 Beta (32-bit DOS)
[kit] The environment for kit 'OpenWatcom v2 Beta (32-bit DOS)': {
  "ALLUSERSPROFILE": "C:\\ProgramData",

...snip...

  "VSCODE_AMD_ENTRYPOINT": "vs/workbench/api/node/extensionHostProcess",
  "VSCODE_CODE_CACHE_PATH": "C:\\Users\\frede\\AppData\\Roaming\\Code\\CachedData\\dfd34e8260c270da74b5c2d86d61aee4b6d56977",
  "VSCODE_CWD": "C:\\Users\\frede\\AppData\\Local\\Programs\\Microsoft VS Code",
  "VSCODE_HANDLES_UNCAUGHT_ERRORS": "true",
  "VSCODE_IPC_HOOK": "\\\\.\\pipe\\f42df05537bac2273baad6f15dcc034b-1.66.2-main-sock",
  "VSCODE_IPC_HOOK_EXTHOST": "\\\\.\\pipe\\vscode-ipc-29aed816-934b-4227-92a0-dc3298021874-sock",
  "VSCODE_LOG_NATIVE": "false",
  "VSCODE_LOG_STACK": "false",
  "VSCODE_NLS_CONFIG": "{\"locale\":\"en-us\",\"availableLanguages\":{},\"_languagePackSupport\":true}",
  "VSCODE_PID": "24056",
  "VSCODE_PIPE_LOGGING": "true",
  "VSCODE_VERBOSE_LOGGING": "true",
  "WATCOM": "C:\\WATCOM",
  "windir": "C:\\WINDOWS"
}
[driver] Trying to detect generator supported by system
[main] Unable to determine what CMake generator to use. Please install or configure a preferred generator, or update settings.json, your Kit configuration or PATH variable. Error: No usable generator found.
[main] Configuring folder: ex22 
[main] Saving open files before configure/build
[main] Starting new CMake driver
[main] Starting CMake driver
[cmakefileapi-driver] Creating instance of CMakeFileApiDriver
[driver] Initializating base driver using kit
[driver] CMakeDriver Kit set to OpenWatcom v2 Beta (32-bit DOS)
[kit] The environment for kit 'OpenWatcom v2 Beta (32-bit DOS)': {
  "ALLUSERSPROFILE": "C:\\ProgramData",

... snip ...

  "VSCODE_AMD_ENTRYPOINT": "vs/workbench/api/node/extensionHostProcess",
  "VSCODE_CODE_CACHE_PATH": "C:\\Users\\frede\\AppData\\Roaming\\Code\\CachedData\\dfd34e8260c270da74b5c2d86d61aee4b6d56977",
  "VSCODE_CWD": "C:\\Users\\frede\\AppData\\Local\\Programs\\Microsoft VS Code",
  "VSCODE_HANDLES_UNCAUGHT_ERRORS": "true",
  "VSCODE_IPC_HOOK": "\\\\.\\pipe\\f42df05537bac2273baad6f15dcc034b-1.66.2-main-sock",
  "VSCODE_IPC_HOOK_EXTHOST": "\\\\.\\pipe\\vscode-ipc-29aed816-934b-4227-92a0-dc3298021874-sock",
  "VSCODE_LOG_NATIVE": "false",
  "VSCODE_LOG_STACK": "false",
  "VSCODE_NLS_CONFIG": "{\"locale\":\"en-us\",\"availableLanguages\":{},\"_languagePackSupport\":true}",
  "VSCODE_PID": "24056",
  "VSCODE_PIPE_LOGGING": "true",
  "VSCODE_VERBOSE_LOGGING": "true",
  "WATCOM": "C:\\WATCOM",
  "windir": "C:\\WINDOWS"
}
[driver] Trying to detect generator supported by system
[main] Unable to determine what CMake generator to use. Please install or configure a preferred generator, or update settings.json, your Kit configuration or PATH variable. Error: No usable generator found.
[cache] Reading CMake cache file 
[cache] Cache file does not exist: Returning empty cache data
[main] Starting new CMake driver
[main] Starting CMake driver
[cmakefileapi-driver] Creating instance of CMakeFileApiDriver
[driver] Initializating base driver using kit
[driver] CMakeDriver Kit set to OpenWatcom v2 Beta (32-bit DOS)
[kit] The environment for kit 'OpenWatcom v2 Beta (32-bit DOS)': {
  "ALLUSERSPROFILE": "C:\\ProgramData",

...snip...

  "VSCODE_AMD_ENTRYPOINT": "vs/workbench/api/node/extensionHostProcess",
  "VSCODE_CODE_CACHE_PATH": "C:\\Users\\frede\\AppData\\Roaming\\Code\\CachedData\\dfd34e8260c270da74b5c2d86d61aee4b6d56977",
  "VSCODE_CWD": "C:\\Users\\frede\\AppData\\Local\\Programs\\Microsoft VS Code",
  "VSCODE_HANDLES_UNCAUGHT_ERRORS": "true",
  "VSCODE_IPC_HOOK": "\\\\.\\pipe\\f42df05537bac2273baad6f15dcc034b-1.66.2-main-sock",
  "VSCODE_IPC_HOOK_EXTHOST": "\\\\.\\pipe\\vscode-ipc-29aed816-934b-4227-92a0-dc3298021874-sock",
  "VSCODE_LOG_NATIVE": "false",
  "VSCODE_LOG_STACK": "false",
  "VSCODE_NLS_CONFIG": "{\"locale\":\"en-us\",\"availableLanguages\":{},\"_languagePackSupport\":true}",
  "VSCODE_PID": "24056",
  "VSCODE_PIPE_LOGGING": "true",
  "VSCODE_VERBOSE_LOGGING": "true",
  "WATCOM": "C:\\WATCOM",
  "windir": "C:\\WINDOWS"
}
[driver] Trying to detect generator supported by system
[main] Unable to determine what CMake generator to use. Please install or configure a preferred generator, or update settings.json, your Kit configuration or PATH variable. Error: No usable generator found.

with work around:

[main] Safe constructing new CMakeTools instance
[variant] Constructing VariantManager
[main] Constructing new CMakeTools instance
[main] Starting CMakeTools second-phase init
[variant] Loaded new set of variants
[main] CMakeTools instance initialization complete.
[kit] Reading kits file C:\Users\frede\AppData\Local\CMakeTools\cmake-tools-kits.json
[kit] Successfully loaded 6 kits from C:\Users\frede\AppData\Local\CMakeTools\cmake-tools-kits.json
[kit] Not reading non-existent kits file: c:\SOURCE\ex22\.vscode\cmake-kits.json
[main] Injecting new Kit into CMake driver
[extension] Configuring workspace on open file:///c%3A/SOURCE/ex22
[main] Starting new CMake driver
[main] Starting CMake driver
[main] Using generator from user configuration: Watcom WMake
[cmakefileapi-driver] Creating instance of CMakeFileApiDriver
[driver] Initializating base driver using kit
[driver] CMakeDriver Kit set to OpenWatcom v2 Beta (32-bit DOS)
[kit] The environment for kit 'OpenWatcom v2 Beta (32-bit DOS)': {
  "ALLUSERSPROFILE": "C:\\ProgramData",

...snip...

  "VSCODE_AMD_ENTRYPOINT": "vs/workbench/api/node/extensionHostProcess",
  "VSCODE_CODE_CACHE_PATH": "C:\\Users\\frede\\AppData\\Roaming\\Code\\CachedData\\dfd34e8260c270da74b5c2d86d61aee4b6d56977",
  "VSCODE_CWD": "C:\\Users\\frede\\AppData\\Local\\Programs\\Microsoft VS Code",
  "VSCODE_HANDLES_UNCAUGHT_ERRORS": "true",
  "VSCODE_IPC_HOOK": "\\\\.\\pipe\\f42df05537bac2273baad6f15dcc034b-1.66.2-main-sock",
  "VSCODE_IPC_HOOK_EXTHOST": "\\\\.\\pipe\\vscode-ipc-88c6214a-c815-4a92-b3e3-16153024d018-sock",
  "VSCODE_LOG_NATIVE": "false",
  "VSCODE_LOG_STACK": "false",
  "VSCODE_NLS_CONFIG": "{\"locale\":\"en-us\",\"availableLanguages\":{},\"_languagePackSupport\":true}",
  "VSCODE_PID": "19360",
  "VSCODE_PIPE_LOGGING": "true",
  "VSCODE_VERBOSE_LOGGING": "true",
  "WATCOM": "C:\\WATCOM",
  "windir": "C:\\WINDOWS"
}
[driver] Setting new variant Debug
[main] Configuring folder: ex22 
[main] Saving open files before configure/build
[driver] Start configure 
[driver] Running pre-configure checks and steps
[driver] Using compilers in OpenWatcom v2 Beta (32-bit DOS) for configure
[cmakefileapi-driver] Configuring using kit
[cmakefileapi-driver] Invoking CMake C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe with arguments ["--no-warn-unused-cli","-DCMAKE_CXX_COMPILER_WORKS=1","-DCMAKE_C_COMPILER_WORKS=1","-DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE","-DCMAKE_BUILD_TYPE:STRING=Debug","-DCMAKE_C_COMPILER:FILEPATH=C:\\WATCOM\\binnt64\\wcl386.exe","-DCMAKE_CXX_COMPILER:FILEPATH=C:\\WATCOM\\binnt64\\wcl386.exe","-DCMAKE_SYSTEM_NAME:STRING=DOS","-Sc:/SOURCE/ex22","-Bc:/SOURCE/ex22/build","-G","Watcom WMake"]
[proc] Executing command: "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" --no-warn-unused-cli -DCMAKE_CXX_COMPILER_WORKS=1 -DCMAKE_C_COMPILER_WORKS=1 -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_C_COMPILER:FILEPATH=C:\WATCOM\binnt64\wcl386.exe -DCMAKE_CXX_COMPILER:FILEPATH=C:\WATCOM\binnt64\wcl386.exe -DCMAKE_SYSTEM_NAME:STRING=DOS -Sc:/SOURCE/ex22 -Bc:/SOURCE/ex22/build -G "Watcom WMake"
[cmake] Not searching for unused variables given on the command line.
[cache] Reading CMake cache file c:/SOURCE/ex22/build/CMakeCache.txt
[cache] Cache file does not exist: Returning empty cache data
[cmake] -- The C compiler identification is OpenWatcom 2.0
[cmake] -- The CXX compiler identification is OpenWatcom 2.0
[cmake] -- Detecting C compiler ABI info
[cmake] -- Detecting C compiler ABI info - done
[cmake] -- Check for working C compiler: C:/WATCOM/binnt64/wcl386.exe - skipped
[cmake] -- Detecting CXX compiler ABI info
[cmake] -- Detecting CXX compiler ABI info - done
[cmake] -- Check for working CXX compiler: C:/WATCOM/binnt64/wcl386.exe - skipped
[cmake] -- Configuring done
[cmake] -- Generating done
[cmake] -- Build files have been written to: C:/SOURCE/ex22/build
[cmakefileapi-parser] Read reply folder: c:\SOURCE\ex22\build\.cmake\api\v1\reply
[cmakefileapi-parser] Found index files: ["cache-v2-7c0988e32faccdb143eb.json","codemodel-v2-029dfc99367410fb6618.json","index-2022-04-12T18-52-39-0905.json","target-Continuous-Debug-6850fcebaeee8f15198e.json","target-ContinuousBuild-Debug-d005e829486de961dcc4.json","target-ContinuousConfigure-Debug-db2b809cee2928f0efb4.json","target-ContinuousCoverage-Debug-913f640845de34ee830c.json","target-ContinuousMemCheck-Debug-17003bb91127c61f0a6a.json","target-ContinuousStart-Debug-bff23fb4b08d38b2e7e4.json","target-ContinuousSubmit-Debug-6a40e31a0f230e57c1b4.json","target-ContinuousTest-Debug-7d589ffb01d2b4e5570c.json","target-ContinuousUpdate-Debug-2e35a25beecd62bbd0ee.json","target-ex22-Debug-0b1c837cecbd5fd00f18.json","target-Experimental-Debug-11ac4d630dfa236a32be.json","target-ExperimentalBuild-Debug-6eeb320157d8d64b26f5.json","target-ExperimentalConfigure-Debug-154482155734e9dcc88b.json","target-ExperimentalCoverage-Debug-10b19ea8dc392ddffe6f.json","target-ExperimentalMemCheck-Debug-7d2661c321fe2f4fde70.json","target-ExperimentalStart-Debug-6f1e7c403269656cf7cd.json","target-ExperimentalSubmit-Debug-766f1d2450de5b032511.json","target-ExperimentalTest-Debug-4876ea0c1e675fc4f056.json","target-ExperimentalUpdate-Debug-411c984f1199ec1871dc.json","target-Nightly-Debug-f8fb70dcf2a2415bebfd.json","target-NightlyBuild-Debug-37525f6ceb8b90da8ad1.json","target-NightlyConfigure-Debug-b137e31bc9100da8a7a9.json","target-NightlyCoverage-Debug-ef27d5dc1c87d450293e.json","target-NightlyMemCheck-Debug-fa741c84a351d638ff48.json","target-NightlyMemoryCheck-Debug-51e2f2852fc1da6dfb5f.json","target-NightlyStart-Debug-8907ee1f92d96fa7d236.json","target-NightlySubmit-Debug-d07a43e7dd3e10e2b3c0.json","target-NightlyTest-Debug-5a097e973d251166a7cd.json","target-NightlyUpdate-Debug-aaba7b95c876bf0b0f78.json","toolchains-v1-c61d9578a29bf8395883.json"]
[cache] Reading CMake cache file c:/SOURCE/ex22/build/CMakeCache.txt
[cache] Parsing CMake cache string
[ctest] There was an error running ctest to determine available test executables
[cache] Reading CMake cache file c:/SOURCE/ex22/build/CMakeCache.txt
[cache] Parsing CMake cache string

Additional Information

No response

@bobbrow
Copy link
Member

bobbrow commented Apr 13, 2022

Thank you for reporting this issue. I believe we have a fix for this. It will be available in the next pre-release.

@FredEckert
Copy link
Author

I confirm that as of version 1.11.10 this is fixed. Thank you.

@github-actions github-actions bot locked and limited conversation to collaborators May 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants