MSYS2-packages icon indicating copy to clipboard operation
MSYS2-packages copied to clipboard

Add code server either to msys or to all providers

Open Febbe opened this issue 2 years ago • 2 comments

I have struggles, to correctly configure my MSYS2/Clang64 environment in vscode. Compiling simple projects are working with the cmake kits mentioned by microsoft-cmake-tools, but as soon the project pulls in subprojects, which require bash/sh and make, it fails. Therefore, I would like to have a feature to connect my vscode to a vscode server in an MSYS2 instance, which works, just like the code server in WSL.

If you have a better idea or a workaround, I would be happy too, but the code server in msys would solve all problems once and for all, which could arise.

My configuration in the cmake-tools-kits.json:

  {
    "name": "Clang 16.0.4 x86_64-w64-windows-gnu (clang64) custom",
    "compilers": {
      "C": "C:\\msys64\\clang64\\bin\\clang.exe",
      "CXX": "C:\\msys64\\clang64\\bin\\clang++.exe"
    },
    "isTrusted": true,
    "environmentSetupScript":"C:\\msys64\\msys2_shell.cmd -defterm -here -no-start -clang64",
    "environmentVariables": {
      "CMT_MINGW_PATH": "C:\\msys64\\clang64\\bin",
      "PATH":"C:\\msys64\\clang64\\bin;C:\\msys64\\usr\\bin;${env:PATH}"
    }
  },

Febbe avatar Jun 07 '23 11:06 Febbe

but as soon the project pulls in subprojects, which require bash/sh and make, it fails.

What is the error?

Biswa96 avatar Jun 07 '23 12:06 Biswa96

but as soon the project pulls in subprojects, which require bash/sh and make, it fails.

What is the error?

There are several:

[build] FAILED: src/win32/xournalpp.ico C:/Users/Febbe/workspace/xournalpp/build/src/win32/xournalpp.ico 
[build] cmd.exe /C "cd /D C:\Users\Febbe\workspace\xournalpp\build\src && convert C:/Users/Febbe/workspace/xournalpp/build/xournalpp-icon-16.png C:/Users/Febbe/workspace/xournalpp/build/xournalpp-icon-32.png C:/Users/Febbe/workspace/xournalpp/build/xournalpp-icon-48.png C:/Users/Febbe/workspace/xournalpp/build/xournalpp-icon-256.png C:/Users/Febbe/workspace/xournalpp/build/src/win32/xournalpp.ico"

Here, convert is not found in the path, but it should be, since it is defined in the kit. When I circumvent this step via the msys2 console, I get:

[build] FAILED: _deps/fbbe_stacktrace-build/libbacktrace/src/libbacktrace-stamp/libbacktrace-configure C:/Users/Febbe/workspace/xournalpp/build/_deps/fbbe_stacktrace-build/libbacktrace/src/libbacktrace-stamp/libbacktrace-configure 
[build] cmd.exe /C "cd /D C:\Users\Febbe\workspace\xournalpp\build\_deps\fbbe_stacktrace-build\libbacktrace\src\libbacktrace-build && bash -lic "../libbacktrace/configure --prefix=C:/Users/Febbe/workspace/xournalpp/build/_deps/fbbe_stacktrace-build/libbacktrace" && C:\msys64\clang64\bin\cmake.exe -E touch C:/Users/Febbe/workspace/xournalpp/build/_deps/fbbe_stacktrace-build/libbacktrace/src/libbacktrace-stamp/libbacktrace-configure"
[build] bash: ../libbacktrace/configure: /bin/sh^M: bad interpreter: No such file or directory

Which I can fix, by changing all line terminators in all files to LF

[build] FAILED: _deps/fbbe_stacktrace-build/libbacktrace/src/libbacktrace-stamp/libbacktrace-build _deps/fbbe_stacktrace-build/libbacktrace/lib/libbacktrace.a C:/Users/Febbe/workspace/xournalpp/build/_deps/fbbe_stacktrace-build/libbacktrace/src/libbacktrace-stamp/libbacktrace-build C:/Users/Febbe/workspace/xournalpp/build/_deps/fbbe_stacktrace-build/libbacktrace/lib/libbacktrace.a 
[build] cmd.exe /C "cd /D C:\Users\Febbe\workspace\xournalpp\build\_deps\fbbe_stacktrace-build\libbacktrace\src\libbacktrace-build && make && C:\msys64\clang64\bin\cmake.exe -E touch C:/Users/Febbe/workspace/xournalpp/build/_deps/fbbe_stacktrace-build/libbacktrace/src/libbacktrace-stamp/libbacktrace-build"
[build] Der Befehl "make" ist entweder falsch geschrieben oder
[build] konnte nicht gefunden werden.
[build] ninja: build stopped: subcommand failed.

This time, make can't be found anymore

Note, that I do not want to add any of the msys2 env. to the systems path, because it could break other toolchains, like msvc+vcpkg etc.

Febbe avatar Jun 07 '23 15:06 Febbe