microsoft / vscode-cmake-tools

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

CMake auto-configure corrupts my build directory #3098

Closed wjk closed 1 year ago

wjk commented 1 year ago

Brief Issue Summary

I am using a project that requires a cross-compiler. I have installed the compiler, as well as a specific (tested) build of CMake. I configure my project by running the configure.sh script in the repo root from the Terminal. This configure succeeds, as does any build.

However, when I then load VSCode, I get the output below. Apparently, it thinks that I am using a compiler targeting Windows to develop a program to be run on macOS. This is clearly nonsensical.

[variant] Loaded new set of variants
[kit] Successfully loaded 2 kits from /Users/wjk/.local/share/CMakeTools/cmake-tools-kits.json
[proc] Executing command: /opt/RosBE-2.2.1/bin/cmake --version
[proc] Executing command: /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-gcc -v
[proc] Executing command: /opt/RosBE-2.2.1/bin/cmake -S/Volumes/Sources/ReactOS -B/Volumes/Sources/ReactOS/output-MinGW-i386 -G Ninja
[cmakefileapi-driver] This version of CMake does not support the "toolchains" object kind. Compiler paths will be determined by reading CMakeCache.txt.
[main] Configuring project: ReactOS 
[main] Configuring project: ReactOS 
[proc] Executing command: /opt/RosBE-2.2.1/bin/cmake --no-warn-unused-cli -DCMAKE_TOOLCHAIN_FILE:FILENAME=/Volumes/Sources/ReactOS/toolchain-gcc.cmake -DARCH:STRING=i386 -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_C_COMPILER:FILEPATH=/opt/RosBE-2.3/i386/bin/i686-w64-mingw32-gcc -DCMAKE_CXX_COMPILER:FILEPATH=/opt/RosBE-2.3/i386/bin/i686-w64-mingw32-g++ -S/Volumes/Sources/ReactOS -B/Volumes/Sources/ReactOS/output-MinGW-i386 -G Ninja
[cmake] Not searching for unused variables given on the command line.
[cmake] -- clb has no base address
[cmake] -- seclogon has no base address
[cmake] Cross-compiling on non-msvc, no special host-tools cmake command
[cmake] -- Build type: Debug
[cmake] CMake Warning at CMakeLists.txt:223 (message):
[cmake]   -- Disabling precompiled headers on GCC by default CORE-17108.
[cmake] 
[cmake] 
[cmake] -- Selected localization: all
[cmake] -- fusion has no base address
[cmake] -- fusion_1_1 has no base address
[cmake] -- fusion_2_0 has no base address
[cmake] -- sfcfiles has no base address
[cmake] -- gdi32_vista has no base address
[cmake] -- Configuring done
[cmake] You have changed variables that require your cache to be deleted.
[cmake] Configure will be re-run and you may have to reset some variables.
[cmake] The following variables have changed:
[cmake] CMAKE_C_COMPILER= /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-gcc
[cmake] CMAKE_CXX_COMPILER= /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-g++
[cmake] CMAKE_C_COMPILER= /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-gcc
[cmake] CMAKE_CXX_COMPILER= /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-g++
[cmake] CMAKE_C_COMPILER= /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-gcc
[cmake] CMAKE_CXX_COMPILER= /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-g++
[cmake] CMAKE_C_COMPILER= /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-gcc
[cmake] CMAKE_CXX_COMPILER= /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-g++
[cmake] CMAKE_C_COMPILER= /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-gcc
[cmake] CMAKE_CXX_COMPILER= /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-g++
[cmake] CMAKE_C_COMPILER= /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-gcc
[cmake] CMAKE_CXX_COMPILER= /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-g++
[cmake] CMAKE_C_COMPILER= /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-gcc
[cmake] CMAKE_CXX_COMPILER= /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-g++
[cmake] CMAKE_C_COMPILER= /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-gcc
[cmake] CMAKE_CXX_COMPILER= /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-g++
[cmake] CMAKE_C_COMPILER= /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-gcc
[cmake] CMAKE_CXX_COMPILER= /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-g++
[cmake] CMAKE_C_COMPILER= /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-gcc
[cmake] CMAKE_CXX_COMPILER= /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-g++
[cmake] CMAKE_C_COMPILER= /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-gcc
[cmake] CMAKE_CXX_COMPILER= /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-g++
[cmake] CMAKE_C_COMPILER= /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-gcc
[cmake] CMAKE_CXX_COMPILER= /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-g++
[cmake] CMAKE_C_COMPILER= /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-gcc
[cmake] CMAKE_CXX_COMPILER= /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-g++
[cmake] CMAKE_C_COMPILER= /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-gcc
[cmake] CMAKE_CXX_COMPILER= /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-g++
[cmake] CMAKE_C_COMPILER= /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-gcc
[cmake] CMAKE_CXX_COMPILER= /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-g++
[cmake] CMAKE_C_COMPILER= /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-gcc
[cmake] CMAKE_CXX_COMPILER= /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-g++
[cmake] CMAKE_C_COMPILER= /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-gcc
[cmake] CMAKE_CXX_COMPILER= /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-g++
[cmake] CMAKE_C_COMPILER= /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-gcc
[cmake] CMAKE_CXX_COMPILER= /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-g++
[cmake] CMAKE_C_COMPILER= /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-gcc
[cmake] CMAKE_CXX_COMPILER= /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-g++
[cmake] CMAKE_C_COMPILER= /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-gcc
[cmake] CMAKE_CXX_COMPILER= /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-g++
[cmake] CMAKE_C_COMPILER= /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-gcc
[cmake] CMAKE_CXX_COMPILER= /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-g++
[cmake] CMAKE_C_COMPILER= /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-gcc
[cmake] CMAKE_CXX_COMPILER= /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-g++
[cmake] CMAKE_C_COMPILER= /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-gcc
[cmake] CMAKE_CXX_COMPILER= /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-g++
[cmake] CMAKE_C_COMPILER= /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-gcc
[cmake] CMAKE_CXX_COMPILER= /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-g++
[cmake] CMAKE_C_COMPILER= /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-gcc
[cmake] CMAKE_CXX_COMPILER= /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-g++
[cmake] CMAKE_C_COMPILER= /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-gcc
[cmake] CMAKE_CXX_COMPILER= /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-g++
[cmake] CMAKE_C_COMPILER= /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-gcc
[cmake] CMAKE_CXX_COMPILER= /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-g++
[cmake] CMAKE_C_COMPILER= /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-gcc
[cmake] CMAKE_CXX_COMPILER= /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-g++
[cmake] CMAKE_C_COMPILER= /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-gcc
[cmake] CMAKE_CXX_COMPILER= /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-g++
[cmake] CMAKE_C_COMPILER= /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-gcc
[cmake] CMAKE_CXX_COMPILER= /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-g++
[cmake] CMAKE_C_COMPILER= /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-gcc
[cmake] CMAKE_CXX_COMPILER= /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-g++
[cmake] CMAKE_C_COMPILER= /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-gcc
[cmake] CMAKE_CXX_COMPILER= /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-g++
[cmake] 
[cmake] -- The C compiler identification is GNU 8.4.0
[cmake] -- The CXX compiler identification is GNU 8.4.0
[cmake] -- Checking whether C compiler has -isysroot
[cmake] -- Checking whether C compiler has -isysroot - yes
[cmake] -- Checking whether C compiler supports OSX deployment target flag
[cmake] -- Checking whether C compiler supports OSX deployment target flag - no
[cmake] -- Check for working C compiler: /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-gcc
[cmake] -- Check for working C compiler: /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-gcc - broken
[cmake] CMake Error at /opt/RosBE-2.2.1/share/cmake-3.17/Modules/CMakeTestCCompiler.cmake:60 (message):
[cmake]   The C compiler
[cmake] 
[cmake]     "/opt/RosBE-2.3/i386/bin/i686-w64-mingw32-gcc"
[cmake] 
[cmake]   is not able to compile a simple test program.
[cmake] 
[cmake]   It fails with the following output:
[cmake] 
[cmake]     Change Dir: /Volumes/Sources/ReactOS/output-MinGW-i386/CMakeFiles/CMakeTmp
[cmake]     
[cmake]     Run Build Command(s):/opt/RosBE-2.2.1/bin/ninja cmTC_c7a8a && [1/2] Building C object CMakeFiles/cmTC_c7a8a.dir/testCCompiler.c.obj
[cmake]     [2/2] Linking C executable cmTC_c7a8a
[cmake]     FAILED: cmTC_c7a8a 
[cmake]     : && /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-gcc -isysroot /Applications/Xcode-14.1.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names  CMakeFiles/cmTC_c7a8a.dir/testCCompiler.c.obj  -o cmTC_c7a8a   && :
[cmake]     /opt/RosBE-2.3/i386/lib/gcc/i686-w64-mingw32/8.4.0/../../../../i686-w64-mingw32/bin/ld: Error: unable to disambiguate: -search_paths_first (did you mean --search_paths_first ?)
[cmake]     collect2: error: ld returned 1 exit status
[cmake]     ninja: build stopped: subcommand failed.
[cmake]     
[cmake]     
[cmake] 
[cmake]   
[cmake] 
[cmake]   CMake will not be able to correctly generate this project.
[cmake] Call Stack (most recent call first):
[cmake]   CMakeLists.txt:17 (project)
[cmake] 
[cmake] 
[cmake] -- Configuring incomplete, errors occurred!
[cmake] See also "/Volumes/Sources/ReactOS/output-MinGW-i386/CMakeFiles/CMakeOutput.log".
[cmake] See also "/Volumes/Sources/ReactOS/output-MinGW-i386/CMakeFiles/CMakeError.log".
[proc] The command: /opt/RosBE-2.2.1/bin/cmake --no-warn-unused-cli -DCMAKE_TOOLCHAIN_FILE:FILENAME=/Volumes/Sources/ReactOS/toolchain-gcc.cmake -DARCH:STRING=i386 -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_C_COMPILER:FILEPATH=/opt/RosBE-2.3/i386/bin/i686-w64-mingw32-gcc -DCMAKE_CXX_COMPILER:FILEPATH=/opt/RosBE-2.3/i386/bin/i686-w64-mingw32-g++ -S/Volumes/Sources/ReactOS -B/Volumes/Sources/ReactOS/output-MinGW-i386 -G Ninja exited with code: 1

After this happens, my build directory is corrupted and unrecoverable. Nothing I do — even deleting CMakeCache.txt and the CMakeFiles directory — will convince it to configure properly. The only thing I can do is to close VSCode, delete the build directory, and reconfigure using the script again. This of course results in my losing all my incremental-build products (and ReactOS takes a very long time to build fully). Worse, when I reopen VSCode, it does corrupts my build directory again.

This only started happening very recently, perhaps after a VSCode update. I am on version 1.77.1.

CMake Tools Diagnostics

{
  "os": "darwin",
  "vscodeVersion": "1.77.1",
  "cmtVersion": "1.13.45",
  "configurations": [
    {
      "folder": "/Volumes/Sources/ReactOS",
      "cmakeVersion": "3.17.2",
      "configured": true,
      "generator": "Ninja",
      "usesPresets": false,
      "compilers": {
        "C": "/opt/RosBE-2.2.1/i386/bin/i686-w64-mingw32-gcc",
        "CXX": "/opt/RosBE-2.2.1/i386/bin/i686-w64-mingw32-g++"
      }
    }
  ],
  "cpptoolsIntegration": {
    "isReady": true,
    "hasCodeModel": true,
    "activeBuildType": "Debug",
    "buildTypesSeen": [
      "Debug"
    ],
    "requests": [],
    "responses": [],
    "partialMatches": [],
    "targetCount": 3059,
    "executablesCount": 146,
    "librariesCount": 1754,
    "targets": []
  },
  "settings": [
    {
      "communicationMode": "automatic",
      "useCMakePresets": "auto",
      "configureOnOpen": true
    }
  ]
}

Debug Log

[extension] [4862] cmake.buildDirectory started
[extension] [4862] cmake.buildDirectory finished (returned "/Volumes/Sources/ReactOS/output-MinGW-i386")
[extension] [6665] cmake.configure started
[main] Configuring project: ReactOS 
[main] Saving open files before configure/build
[driver] Start configure 
[driver] Running pre-configure checks and steps
[driver] Using compilers in GCC 8.4.0 i686-w64-mingw32 for configure
[cmakefileapi-driver] Configuring using kit
[cmakefileapi-driver] Invoking CMake /opt/RosBE-2.2.1/bin/cmake with arguments ["--no-warn-unused-cli","-DCMAKE_TOOLCHAIN_FILE:FILENAME=/Volumes/Sources/ReactOS/toolchain-gcc.cmake","-DARCH:STRING=i386","-DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE","-DCMAKE_BUILD_TYPE:STRING=Debug","-DCMAKE_C_COMPILER:FILEPATH=/opt/RosBE-2.3/i386/bin/i686-w64-mingw32-gcc","-DCMAKE_CXX_COMPILER:FILEPATH=/opt/RosBE-2.3/i386/bin/i686-w64-mingw32-g++","-S/Volumes/Sources/ReactOS","-B/Volumes/Sources/ReactOS/output-MinGW-i386","-G","Ninja"]
[proc] Executing command: /opt/RosBE-2.2.1/bin/cmake --no-warn-unused-cli -DCMAKE_TOOLCHAIN_FILE:FILENAME=/Volumes/Sources/ReactOS/toolchain-gcc.cmake -DARCH:STRING=i386 -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_C_COMPILER:FILEPATH=/opt/RosBE-2.3/i386/bin/i686-w64-mingw32-gcc -DCMAKE_CXX_COMPILER:FILEPATH=/opt/RosBE-2.3/i386/bin/i686-w64-mingw32-g++ -S/Volumes/Sources/ReactOS -B/Volumes/Sources/ReactOS/output-MinGW-i386 -G Ninja
[proc]   with environment: {"COMMAND_MODE":"unix2003","ELECTRON_NO_ATTACH_CONSOLE":"1","HOME":"/Users/wjk","LANG":"en_US.UTF-8","LESS":"-R","LOGNAME":"wjk","LSCOLORS":"Gxfxcxdxbxegedabagacad","LS_COLORS":"di=1;36:ln=35:so=32:pi=33:ex=31:bd=34;46:cd=34;43:su=30;41:sg=30;46:tw=30;42:ow=30;43","MAVEN_REPOSITORY":"/Users/wjk/Library/Developer/Maven/repository","MallocNanoZone":"0","ORIGINAL_XDG_CURRENT_DESKTOP":"undefined","PAGER":"less","PATH":"/opt/RosBE-2.2.1/bin:/opt/RosBE-2.2.1/i386/bin:/opt/RosBE-2.2.1/bin:/opt/RosBE-2.2.1/i386/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/VMware Fusion.app/Contents/Public:/Library/Apple/usr/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/usr/local/mysql/bin:/Users/wjk/.dotnet","PWD":"/Volumes/Sources/ReactOS/output-MinGW-i386","ROS_ARCH":"i386","SHELL":"/bin/zsh","SHLVL":"2","SSH_AUTH_SOCK":"/private/tmp/com.apple.launchd.JCrBDAHNoL/Listeners","TERM":"xterm-256color","TERM_PROGRAM":"Apple_Terminal","TERM_PROGRAM_VERSION":"447","TERM_SESSION_ID":"686BD4EB-55A9-4677-9158-731C10FDA5B9","TMPDIR":"/var/folders/b9/51v4kkt10vg658dyh7xm91wr0000gn/T/","USER":"wjk","VSCODE_AMD_ENTRYPOINT":"vs/workbench/api/node/extensionHostProcess","VSCODE_CLI":"1","VSCODE_CODE_CACHE_PATH":"/Users/wjk/Library/Application Support/Code/CachedData/b7886d7461186a5eac768481578c1d7ca80e2d21","VSCODE_CRASH_REPORTER_PROCESS_TYPE":"extensionHost","VSCODE_CRASH_REPORTER_SANDBOXED_HINT":"1","VSCODE_CWD":"/Volumes/Sources/ReactOS/output-MinGW-i386","VSCODE_HANDLES_UNCAUGHT_ERRORS":"true","VSCODE_IPC_HOOK":"/Users/wjk/Library/Application Support/Code/1.77-main.sock","VSCODE_NLS_CONFIG":"{\"locale\":\"en-us\",\"osLocale\":\"en-us\",\"availableLanguages\":{},\"_languagePackSupport\":true}","VSCODE_PID":"18518","XPC_FLAGS":"0x0","XPC_SERVICE_NAME":"application.com.microsoft.VSCode.11172234.11172240.7ECFA391-CAE2-4B5C-8E59-958E327BD61F","ZSH":"/Users/wjk/.oh-my-zsh","__CFBundleIdentifier":"com.microsoft.VSCode","__CF_USER_TEXT_ENCODING":"0x1F5:0x0:0x0","ELECTRON_RUN_AS_NODE":"1","APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL":"1","VSCODE_L10N_BUNDLE_LOCATION":""}
[cmake] Not searching for unused variables given on the command line.
[cmake] -- The C compiler identification is GNU 8.4.0
[cmake] -- The CXX compiler identification is GNU 8.4.0
[cmake] -- Checking whether C compiler has -isysroot
[cmake] -- Checking whether C compiler has -isysroot - yes
[cmake] -- Checking whether C compiler supports OSX deployment target flag
[cmake] -- Checking whether C compiler supports OSX deployment target flag - no
[cmake] -- Check for working C compiler: /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-gcc
[cmake] -- Check for working C compiler: /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-gcc - broken
[cmake] CMake Error at /opt/RosBE-2.2.1/share/cmake-3.17/Modules/CMakeTestCCompiler.cmake:60 (message):
[cmake]   The C compiler
[cmake] 
[cmake]     "/opt/RosBE-2.3/i386/bin/i686-w64-mingw32-gcc"
[cmake] 
[cmake]   is not able to compile a simple test program.
[cmake] 
[cmake]   It fails with the following output:
[cmake] 
[cmake]     Change Dir: /Volumes/Sources/ReactOS/output-MinGW-i386/CMakeFiles/CMakeTmp
[cmake]     
[cmake]     Run Build Command(s):/opt/RosBE-2.2.1/bin/ninja cmTC_9cc19 && [1/2] Building C object CMakeFiles/cmTC_9cc19.dir/testCCompiler.c.o
[cmake]     [2/2] Linking C executable cmTC_9cc19
[cmake]     FAILED: cmTC_9cc19 
[cmake]     : && /opt/RosBE-2.3/i386/bin/i686-w64-mingw32-gcc -isysroot /Applications/Xcode-14.1.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names  CMakeFiles/cmTC_9cc19.dir/testCCompiler.c.o  -o cmTC_9cc19   && :
[cmake]     /opt/RosBE-2.3/i386/lib/gcc/i686-w64-mingw32/8.4.0/../../../../i686-w64-mingw32/bin/ld: Error: unable to disambiguate: -search_paths_first (did you mean --search_paths_first ?)
[cmake]     collect2: error: ld returned 1 exit status
[cmake]     ninja: build stopped: subcommand failed.
[cmake]     
[cmake]     
[cmake] 
[cmake]   
[cmake] 
[cmake]   CMake will not be able to correctly generate this project.
[cmake] Call Stack (most recent call first):
[cmake]   CMakeLists.txt:17 (project)
[cmake] 
[cmake] 
[cmake] -- Configuring incomplete, errors occurred!
[cmake] See also "/Volumes/Sources/ReactOS/output-MinGW-i386/CMakeFiles/CMakeOutput.log".
[cmake] See also "/Volumes/Sources/ReactOS/output-MinGW-i386/CMakeFiles/CMakeError.log".
[proc] The command: /opt/RosBE-2.2.1/bin/cmake --no-warn-unused-cli -DCMAKE_TOOLCHAIN_FILE:FILENAME=/Volumes/Sources/ReactOS/toolchain-gcc.cmake -DARCH:STRING=i386 -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_C_COMPILER:FILEPATH=/opt/RosBE-2.3/i386/bin/i686-w64-mingw32-gcc -DCMAKE_CXX_COMPILER:FILEPATH=/opt/RosBE-2.3/i386/bin/i686-w64-mingw32-g++ -S/Volumes/Sources/ReactOS -B/Volumes/Sources/ReactOS/output-MinGW-i386 -G Ninja exited with code: 1
[extension] [6665] cmake.configure finished (returned 1)

Additional Information

No response

benmcmorran commented 1 year ago

Thanks for the report! I'm not quite sure what's going on here, but I have a few suggestions. Can you try setting cmake.skipConfigureWhenCachePresent: true in your settings.json file? I realized this is an undocumented flag (we'll get on that) but it should stop the extension from trying to reconfigure if there's already a cache present (from your configure.sh script).

Also, how are you currently configuring the extension? I noticed that you're not using CMakePresets, so can you provide the values of all the cmake.* settings in settings.json and what kit and variant you have selected (if known)?

wjk commented 1 year ago

Unfortunately, your suggestion did nothing. Here is my settings.json:

{
  "cmake.buildDirectory": "${workspaceFolder}/output-MinGW-i386",
  "cmake.skipConfigureWhenCachePresent": true,
  "cmake.configureArgs": [
    "-DCMAKE_TOOLCHAIN_FILE:FILENAME=${workspaceFolder}/toolchain-gcc.cmake",
    "-DARCH:STRING=i386"
  ],

  "cmake.buildTask": true,
  "cmake.clearOutputBeforeBuild": false,
  "cmake.cmakePath": "/opt/RosBE-2.2.1/bin/cmake",
  "cmake.loggingLevel": "info"
}

I am using an automatically detected kit that picks up a specific crosscompiler, installed for me in /opt/RosBE-2.2.1. These tools were prepended to my PATH before running configure.sh. I am running a Debug build, if that is what you mean. Thanks!

wjk commented 1 year ago

Did not mean to close, sorry!

cworld1 commented 1 year ago
"cmake.automaticReconfigure": false

maybe this config can give help with you.

wjk commented 1 year ago

This apparently works fine now.