microsoft / vscode-cmake-tools

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

`NINJA_STATUS` creates floating-point exception on alpine #4127

Open AntonPieper opened 1 month ago

AntonPieper commented 1 month ago

Brief Issue Summary

If I use the Ninja generator on alpine linux, subsequent builds (zero steps) fail with a floating-point exception. Unsetting the NINJA_STATUS environment variable fixes this.

CMake Tools Diagnostics

{
  "os": "linux",
  "vscodeVersion": "1.94.2",
  "cmtVersion": "1.19.52",
  "configurations": [
    {
      "folder": "/home/vscode/workspace",
      "cmakeVersion": "3.29.3",
      "configured": true,
      "generator": "Ninja",
      "usesPresets": false,
      "compilers": {
        "C": "/usr/bin/gcc",
        "CXX": "/usr/bin/g++"
      }
    }
  ],
  "cpptoolsIntegration": {
    "isReady": true,
    "hasCodeModel": true,
    "activeBuildType": "Debug",
    "buildTypesSeen": [
      "Debug"
    ],
    "requests": [],
    "responses": [],
    "partialMatches": [],
    "targetCount": 40,
    "executablesCount": 3,
    "librariesCount": 9,
    "targets": []
  },
  "settings": [
    {
      "communicationMode": "automatic",
      "useCMakePresets": "auto",
      "configureOnOpen": true
    }
  ]
}

Debug Log

[main] Building folder: /home/vscode/workspace/build 
[main] Saving open files before configure/build
[build] Starting build
[driver] Start build all
[proc] Executing command: /usr/bin/cmake --build /home/vscode/workspace/build --config Debug --target all --
[proc]   with environment: {"HOSTNAME":"512a385f7699","SHLVL":"2","HOME":"/home/vscode","PATH":"/vscode/vscode-server/bin/linux-alpine/384ff7382de624fb94dbaf6da11977bba1ecd427/bin/remote-cli:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin","SHELL":"/bin/zsh","PWD":"/vscode/vscode-server/bin/linux-alpine/384ff7382de624fb94dbaf6da11977bba1ecd427","TZ":"Europe/Berlin","VSCODE_CWD":"/vscode/vscode-server/bin/linux-alpine/384ff7382de624fb94dbaf6da11977bba1ecd427","VSCODE_NLS_CONFIG":"{\"userLocale\":\"en\",\"osLocale\":\"en\",\"resolvedLanguage\":\"en\",\"defaultMessagesFile\":\"/vscode/vscode-server/bin/linux-alpine/384ff7382de624fb94dbaf6da11977bba1ecd427/out/nls.messages.json\",\"locale\":\"en\",\"availableLanguages\":{}}","VSCODE_HANDLES_SIGPIPE":"true","VSCODE_AMD_ENTRYPOINT":"vs/workbench/api/node/extensionHostProcess","VSCODE_HANDLES_UNCAUGHT_ERRORS":"true","REMOTE_CONTAINERS_IPC":"/tmp/vscode-remote-containers-ipc-c3d17f89-beba-46c7-8815-8d7aa1b8584b.sock","REMOTE_CONTAINERS_SOCKETS":"[\"/tmp/vscode-ssh-auth-c3d17f89-beba-46c7-8815-8d7aa1b8584b.sock\",\"/tmp/.X11-unix/X0\"]","LOGNAME":"vscode","OLDPWD":"/vscode/vscode-server/bin/linux-alpine/384ff7382de624fb94dbaf6da11977bba1ecd427","PAGER":"less","CHARSET":"UTF-8","LANG":"C.UTF-8","LC_COLLATE":"C","PS1":"%n@%m:%~$ ","_":"/bin/cat","SSH_AUTH_SOCK":"/tmp/vscode-ssh-auth-c3d17f89-beba-46c7-8815-8d7aa1b8584b.sock","DISPLAY":":0","REMOTE_CONTAINERS_DISPLAY_SOCK":"/tmp/.X11-unix/X0","XDG_RUNTIME_DIR":"/tmp/user/1000","WAYLAND_DISPLAY":"vscode-wayland-9ccf0300-4c3b-4a40-9c9e-3508f9150cc8.sock","REMOTE_CONTAINERS":"true","BROWSER":"/vscode/vscode-server/bin/linux-alpine/384ff7382de624fb94dbaf6da11977bba1ecd427/bin/helpers/browser.sh","ELECTRON_RUN_AS_NODE":"1","VSCODE_IPC_HOOK_CLI":"/tmp/user/1000/vscode-ipc-2d3d019c-6e23-4dcf-b955-9b382195be4d.sock","VSCODE_L10N_BUNDLE_LOCATION":"","NINJA_STATUS":"[%s/%t %p :: %e] "}
[build] Floating-point exception
[build] CMake Error: Generator: execution of make failed. Make command was: /usr/bin/ninja all
[proc] The command: /usr/bin/cmake --build /home/vscode/workspace/build --config Debug --target all -- exited with code: 1
[driver] Build completed: 00:00:00.061
[cmakefileapi-parser] Read reply folder: /home/vscode/workspace/build/.cmake/api/v1/reply
[cmakefileapi-parser] Found index files: ["cache-v2-53e6359e5c62503c8e82.json","cmakeFiles-v1-4f7be9d92b2c17ebee60.json","codemodel-v2-1807f75615883b31602d.json","directory-.-Debug-f5ebdc15457944623624.json","directory-_deps.googletest-build-Debug-325181791364522dc3de.json","directory-_deps.googletest-build.googlemock-Debug-03dedc1da48c6595c9f4.json","directory-_deps.googletest-build.googletest-Debug-8f9002bca4cc1e7f91fa.json","directory-src-Debug-c67d03d4414282e2baea.json","directory-src.endpoints-Debug-12f3bfbbc1e198f0157c.json","directory-src.restapi-Debug-3519d1446c8a4b80d373.json","directory-src.utils-Debug-3e06762d87894fb62125.json","directory-src.utils.doublebuffer-Debug-961e34984abdbca4cda6.json","directory-src.utils.logging-Debug-f17aa6eb4a50ac8142b8.json","directory-src.utils.platform-Debug-4f9c491beda772805165.json","directory-src.utils.ringbuffer-Debug-34009423a186fe46d610.json","directory-src.utils.sse-Debug-9593bb2f206232f0acb6.json","directory-src.utils.sse.logging_sink-Debug-9dc03f90429ea2c829ba.json","directory-src.utils.udphandler-Debug-f111de44ac3dfa4f31bd.json","directory-tests-Debug-b01f6abb0ab61427ef3b.json","directory-tests.restapi-Debug-df93cd209018e4864f40.json","directory-tests.utils-Debug-38f149791fe98fdf41b9.json","directory-tests.utils.udphandler-Debug-5fd6f82fa083a78098dc.json","index-2024-10-15T07-36-52-0320.json","target-Continuous-Debug-848588c8b3af73c06d70.json","target-ContinuousBuild-Debug-1831243440439e1aaaa0.json","target-ContinuousConfigure-Debug-f605747fbefa562c6406.json","target-ContinuousCoverage-Debug-8fe9e44348bb27581875.json","target-ContinuousMemCheck-Debug-148328fb92a952f7b7b2.json","target-ContinuousStart-Debug-fa9449552f761475293e.json","target-ContinuousSubmit-Debug-48ee3d7a87587e4e0bb1.json","target-ContinuousTest-Debug-200e5c9a368891e10d12.json","target-ContinuousUpdate-Debug-40bb9afb602e7f869477.json","target-Experimental-Debug-a8a1d1630a187a310eb3.json","target-ExperimentalBuild-Debug-d55c8c0a0c49e1722d83.json","target-ExperimentalConfigure-Debug-92489801e5c2fecf7e66.json","target-ExperimentalCoverage-Debug-3836e45aaf2f68f97e94.json","target-ExperimentalMemCheck-Debug-b88cef2a6cc6a80a2f3f.json","target-ExperimentalStart-Debug-626f7154e29a6bac1f59.json","target-ExperimentalSubmit-Debug-efe9c00b4ecd93d4b903.json","target-ExperimentalTest-Debug-708fd6e6970028982510.json","target-ExperimentalUpdate-Debug-b4e16c11acdcadf9e5e4.json","target-Nightly-Debug-f317be7a4c445794594e.json","target-NightlyBuild-Debug-146c29d3f54ae738d6da.json","target-NightlyConfigure-Debug-cfeb57729d8a08e34554.json","target-NightlyCoverage-Debug-c585cd429badfdf97c7c.json","target-NightlyMemCheck-Debug-928eaab1dc45c4c747e0.json","target-NightlyMemoryCheck-Debug-0ad3644300e94c3f8f40.json","target-NightlyStart-Debug-d53df817f66761e82e06.json","target-NightlySubmit-Debug-08d1e79b5e9c223aebb9.json","target-NightlyTest-Debug-a759a616ab5cdce53834.json","target-NightlyUpdate-Debug-1a461d75132a2eeee0d4.json","target-RestApiTests-Debug-606bc2d0206fc4255461.json","target-Rest_API-Debug-e251c56340d86a081f9c.json","target-UDPHandlerTests-Debug-d8752a395a1a9af4e825.json","target-doublebuffer-Debug-6d1940a39993cf44548d.json","target-endpoints-Debug-a5c2eca965e3d332664a.json","target-gmock-Debug-b91c0e2737c51fe6c1ac.json","target-gmock_main-Debug-84d4ce643ec73e40be99.json","target-gtest-Debug-a14b9ddd1a874dd6de08.json","target-gtest_main-Debug-4e513253967fb8b159a2.json","target-restapi-Debug-041fa04b76312b3610a6.json","target-sse-Debug-3a04d0ee58c8bdda078f.json","target-udphandler-Debug-de112b66a9037a284c8a.json","toolchains-v1-9d5409b1d03242a9c8ce.json"]
[expand] expanded ${workspaceFolder}/build
[build] Build finished with exit code 1
[cache] Reading CMake cache file /home/vscode/workspace/build/CMakeCache.txt
[cache] Parsing CMake cache string
[extension] [3381] cmake.build finished (returned 1)

Additional Information

No response

Amy-Li03 commented 1 month ago

Hi @AntonPieper , thanks for reporting issue here! We try to repro this issue on our side with Linux OS and latest cmake tools, unfortunately we cannot repro it. Build is successfully after setting NINJA_STATUS environment variable. Following video is our test result, we also attached sample project. Please correct us if we have done something wrong. my_project.zip

"os": "linux",
  "vscodeVersion": "1.94.1",
  "cmtVersion": "1.19.52",
  "configurations": [
    {
      "folder": "/home/test/Desktop/Amy/4127/my_project",
      "cmakeVersion": "3.30.5",
      "configured": true,
      "generator": "Ninja",
      "usesPresets": false,
      "compilers": {
        "C": "/usr/bin/gcc-12",
        "CXX": "/usr/bin/g++-12"
      }
    }
  ]

Image