ycm-core / YouCompleteMe

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

Compile issue on FreeBSD13.3 release, absl_time_zone.dir/all => Error code 2 #4242

Open nerozero opened 1 week ago

nerozero commented 1 week 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.

Issue Details

Unable to compile YCM, --- _deps/absl-build/absl/time/CMakeFiles/absl_time_zone.dir/all --- *** [_deps/absl-build/absl/time/CMakeFiles/absl_time_zone.dir/all] Error code 2

pushd ~/.vim/plugged/YouCompleteMe/ ; ./install.py --verbose --clangd-completer ; popd

successful compilation

compilation failed,

Diagnostic data

Output of vim --version

VIM - Vi IMproved 9.1 (2024 Jan 02, compiled Jun 20 2024 20:07:24)
Included patches: 1-470
Compiled by nerozero@freebsd_13_3_amd64_nox-HEAD-job-01
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              +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           +virtualedit
+comments          +linebreak         +quickfix          +visual
+conceal           +lispindent        +reltime           +visualextra
+cryptv            +listcmds          +rightleft         +vreplace
+cscope            +localmap          -ruby              +wildignore
+cursorbind        +lua               +scrollbind        +wildmenu
+cursorshape       +menu              +signs             +windows
+dialog_con        +mksession         +smartindent       +writebackup
+diff              +modify_fname      -sodium            -X11
+digraphs          +mouse             -sound             -xattr
-dnd               -mouseshape        +spell             -xfontset
-ebcdic            +mouse_dec         +startuptime       -xim
+emacs_tags        -mouse_gpm         +statusline        -xpm
+eval              -mouse_jsbterm     -sun_workshop      -xsmp
+ex_extra          +mouse_netterm     +syntax            -xterm_clipboard
+extra_search      +mouse_sgr         +tag_binary        -xterm_save
-farsi             +mouse_sysmouse    -tag_old_static    
   system vimrc file: "/usr/local/etc/vim/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
 3rd user vimrc file: "~/.config/vim/vimrc"
      user exrc file: "$HOME/.exrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
  fall-back for $VIM: "/usr/local/etc/vim"
 f-b for $VIMRUNTIME: "/usr/local/share/vim/vim91"
Compilation: cc -c -I. -Iproto -DHAVE_CONFIG_H -DLIBICONV_PLUG -I/usr/local/include -O2 -pipe -DLIBICONV_PLUG -fstack-protector-strong -fno-strict-aliasing -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 
Linking: cc -fstack-protector-strong -L/usr/local/lib -Wl,--as-needed -o vim -lm -pthread -lncursesw -lrt -lintl -L/usr/local/lib -llua-5.4 -L/usr/local/lib/python3.11/config-3.11 -lpython3.11 -lintl -ldl -L/usr/local/lib -lintl -lutil -lm 

Output of git rev-parse HEAD in YouCompleteMe installation directory

b5fe27bb82cc375d66a9a006cf30390bdb215ed2

OS version, distribution, etc.

FreeBSD13.3 RELEASE Python: Python 3.11.9 Python-absl: py311-absl-0.7.1_1 ( installed separately, has 0 effect )

Output of build/install commands

install.py output: ycm-compile-error.txt

bstaletic commented 1 week ago

Does it work if you install abseil through your system package manager and then pass -DUSE_SYSTEM_ABSEIL=ON to cmake? It should.

There's also EXTRA_CMAKE_ARGS that install.py knows about.

So something like EXTRA_CMAKE_ARGS=-DUSE_SYSTEM_ABSEIL=ON ./install.py --verbose --clangd-completer.

nerozero commented 1 week ago

@bstaletic thank you for quick reply.

Unfortunately I made a mistake, I thought ycm is using a python module of absl but it is a cpp version. I haven't find a BSD port for absl-cpp, so there is no System Package in bsd... If this is a absl-cpp module compile issue, then should i report a compiling issues in https://github.com/abseil/abseil-cpp?

bstaletic commented 1 week ago

I haven't find a BSD port for absl-cpp, so there is no System Package in bsd...

Bummer...

If this is a absl-cpp module compile issue, then should i report a compiling issues in https://github.com/abseil/abseil-cpp?

Basically yes. However, YCM is using this commit of abseil: https://github.com/ycm-core/ycmd/blob/master/cpp/CMakeLists.txt#L248

Maybe master is already fixed? Either way, the problem needs to be fixed in abseil-cpp first. Then YCM can update the referred-to commit.

nerozero commented 1 week ago

I found this post: https://github.com/abseil/abseil-cpp/issues/1587

bstaletic commented 1 week ago

Latest Abseil LTS is this https://github.com/abseil/abseil-cpp/commit/d7aaad83b488fd62bd51c81ecf16cd938532cc0a

Would you mind trying that commit? If YCM compiles, I can make a pull request that updates it. Or you can.

nerozero commented 1 week ago

Already done testing ( by changing GIT_TAG d7aaad83b488fd62bd51c81ecf16cd938532cc0a in third_party/ycmd/cpp/CMakeLists.txt ). Compiled and worked successfully.

nerozero commented 1 week ago

One day - no issues with YCM. I guess we can close issue. Hope this commit of absl ( https://github.com/abseil/abseil-cpp/commit/d7aaad83b488fd62bd51c81ecf16cd938532cc0a ) appear in next YCM release.

bstaletic commented 1 week ago

We keep issues like this open until the next time we update the ycmd submodule. We have updated it just before you opened this issue, though there is no fixed schedule. Rather "it's been a while".

In the mean time, a possible workaround isgit submodule update --remote, which pulls in ycmd master.

nerozero commented 1 week ago

@bstaletic Thank you so much for very quick reactions!

Fab1anDev commented 13 hours ago

Can confirm. i removed GIT TAG in third_party/ycmd/cpp/CMakeList.txt. Works well on FreeBSD 14.1.