ycm-core / YouCompleteMe

A code-completion engine for Vim
http://ycm-core.github.io/YouCompleteMe/
GNU General Public License v3.0
25.47k stars 2.81k forks source link

MSYS2/MingW64 compilation failure #4163

Closed RivenSkaye closed 1 year ago

RivenSkaye commented 1 year ago

Issue Prelude

Please complete these steps and check these boxes (by putting an x inside the brackets) before filing your issue:

Thank you for adhering to this process! It ensures your issue is resolved quickly and that neither your nor our time is needlessly wasted.

You're very much welcome! Proper reports save lives a lot of precious developer time

Issue Details

Provide a clear description of the problem, including the following key questions:

Attempted installation through vim-plug and subsequent CLI steps to build YCM. The build subsequently fails in one of two ways.

  1. It fails on account of not being able to find the libclang it downloaded itself, and halts.

  2. It fails when using --system-libclang

    • It first emits errors about unicode points
    • it subsequently fails the build later on
  3. PlugInstall 'ycm-core/YouCompleteMe'

  4. Add Plug 'ycm-core/YouCompleteMe' to .vimrc

  5. :wq

  6. cd ~/.vim/plugged/YouCompleteMe

  7. python3.11 install.py --clang-completer --rust-completer --verbose (fails to find the libclang it downloads) or python3.11 install.py --clang-completer --rust-completer --verbose --system-libclang (errors in compilation)

    • I added > ~/ycmd_build[-sys].log 2>&1 to the commands to produce the attached log files

Successful compilation and use of YCM

Include description of the observed behaviour, including actual output, Without --system-libclang With --system-libclang, zipped because it's 46MB Failure to finish compilation, leaving it in a currently unusable state.

Diagnostic data

Output of vim --version

❯ vim --version
VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Jul 14 2023 00:15:07)
Included patches: 1-1403
Compiled by <https://www.msys2.org/>
Huge version without GUI.  Features included (+) or not (-):
+acl               +file_in_path      +mouse_urxvt       -tag_any_white
+arabic            +find_in_path      +mouse_xterm       -tcl
+autocmd           +float             +multi_byte        +termguicolors
+autochdir         +folding           +multi_lang        +terminal
-autoservername    -footer            -mzscheme          +terminfo
-balloon_eval      +fork()            +netbeans_intg     +termresponse
+balloon_eval_term +gettext           +num64             +textobjects
-browse            -hangul_input      +packages          +textprop
++builtin_terms    +iconv             +path_extra        +timers
+byte_offset       +insert_expand     +perl/dyn          +title
+channel           +ipv6              +persistent_undo   -toolbar
+cindent           +job               +popupwin          +user_commands
-clientserver      +jumplist          +postscript        +vartabs
+clipboard         +keymap            +printer           +vertsplit
+cmdline_compl     +lambda            +profile           +vim9script
+cmdline_hist      +langmap           -python            +viminfo
+cmdline_info      +libcall           +python3/dyn       +virtualedit
+comments          +linebreak         +quickfix          +visual
+conceal           +lispindent        +reltime           +visualextra
+cryptv            +listcmds          +rightleft         +vreplace
+cscope            +localmap          +ruby/dyn          +wildignore
+cursorbind        -lua               +scrollbind        +wildmenu
+cursorshape       +menu              +signs             +windows
+dialog_con        +mksession         +smartindent       +writebackup
+diff              +modify_fname      -sodium            -X11
+digraphs          +mouse             -sound             -xfontset
-dnd               -mouseshape        +spell             -xim
-ebcdic            +mouse_dec         +startuptime       -xpm
+emacs_tags        -mouse_gpm         +statusline        -xsmp
+eval              -mouse_jsbterm     -sun_workshop      -xterm_clipboard
+ex_extra          +mouse_netterm     +syntax            -xterm_save
+extra_search      +mouse_sgr         +tag_binary
-farsi             -mouse_sysmouse    -tag_old_static
   system vimrc file: "/etc/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
  fall-back for $VIM: "/etc"
 f-b for $VIMRUNTIME: "/usr/share/vim/vim90"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -I/usr/include/ncursesw -march=nocona -msahf -mtune=generic -O2 -pipe -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -pipe -Wl,--as-needed -o vim.exe -lm -lncursesw -liconv -lacl -lintl -Wl,--enable-auto-import -Wl,--export-all-symbols -Wl,--enable-auto-image-base -fstack-protector-strong -L/usr/lib/perl5/core_perl/CORE -lperl -lpthread -ldl -lcrypt

Output of YcmDebugInfo

N/A

Output of YcmDiags

N/A

Output of git rev-parse HEAD in YouCompleteMe installation directory

❯ git rev-parse HEAD
142a559acd70a4da190e36b1b05b9f1eec67acd0

Contents of YCM, ycmd and completion engine logfiles

N/A

OS version, distribution, etc.

❯ uname -a
MINGW64_NT-10.0-19045 DESKTOP-2M2MTV7 3.4.7.x86_64 2023-07-14 16:57 UTC x86_64 Msys

From the Windows info itself:

Output of build/install commands

See log files provided earlier, gist doesn't like the 46MB one either

If any additional info is desired, please do let me know and I'll provide it ASAP. I was busy migrating my office workflow to vim, and as such I haven't uninstalled my alternative options yet. It does, however, mean I can only collect info during my office hours.

puremourning commented 1 year ago

Sorry, mingw is not an officially supported platform. Per the instructions on README, for windows, we assume you are using cmd.exe. This works fine. Mingw can be made to work, and there is some community-supported info here: https://github.com/ycm-core/YouCompleteMe/wiki/Windows-Installation-Guide-for-Unix%E2%80%90like-Environments

As an aside, you provably shouldn't be using libclang completer nowadays (it's considered legacy); we officially recommend using clangd completer instead. To do that use install.py without --clang-completer and specify g:ycm_clangd_binary_path to a clangd that works on your mingw environment.

but I don't consider it a bug that YCM's installer/prebuilt binaries don't support mingw, so closing.