Closed Jaywalker closed 10 months ago
I do not have an openbsd system to check, but maybe a newer version of abseil would fix the issue.
I can confirm that the latest version of abseil has a patch that fixes it, specifically here: https://github.com/abseil/abseil-cpp/blob/master/absl/time/internal/cctz/src/time_zone_format.cc#L22
I didn't try recompiling with the latest version, just tested with that line in place to verify that it does indeed work like I expected it to, and I can confirm it does!
I'll leave selecting the proper version of abseil to update to in your hands. Just ensure that it has the #if !defined(_XOPEN_SOURCE) && !defined(__FreeBSD__) && !defined(__OpenBSD__)
and not simply #if !defined(_XOPEN_SOURCE)
. Of note, it looks like this may also be an issue on FreeBSD too if that line is to be believed.
Thanks f9r checking. I will make a pull request for ycmd tonight.
In the mean time, if you have a new version of abseil on installed system-wide, there is a workaround.
EXTRA_CMAKE_ARGS=-DUSE_SYSTEM_ABSEIL=ON ./install.py --go-completer --ts-completer
I am using a phone right now, so excuse any typos.
I experienced a similar issue on FreeBSD. The provided workaround allowed me to compile it, but I have no clue why it required EXTRA_CMAKE_ARGS=-DUSE_SYSTEM_ABSEIL=ON
because I have the latest version of YCM code.
Excerpt from the errors, all from the abseil lib.
In file included from /usr/local/lib/gcc12/include/c++/bits/postypes.h:40,
from /usr/local/lib/gcc12/include/c++/bits/char_traits.h:39,
from /usr/local/lib/gcc12/include/c++/string:40,
from /usr/home/hugh/.bundle/YouCompleteMe/third_party/ycmd/cpp/absl/absl/time/internal/cctz/include/cctz/time_zone.h:27,
from /usr/home/hugh/.bundle/YouCompleteMe/third_party/ycmd/cpp/absl/absl/time/internal/cctz/src/time_zone_format.cc:28:
/usr/local/lib/gcc12/include/c++/cwchar:166:11: error: 'vfwscanf' has not been declared in '::'
166 | using ::vfwscanf;
| ^~~~~~~~
/usr/local/lib/gcc12/include/c++/cwchar:172:11: error: 'vswscanf' has not been declared in '::'
172 | using ::vswscanf;
| ^~~~~~~~
/usr/local/lib/gcc12/include/c++/cwchar:176:11: error: 'vwscanf' has not been declared in '::'
176 | using ::vwscanf;
| ^~~~~~~
/usr/local/lib/gcc12/include/c++/cwchar:193:11: error: 'wcstof' has not been declared in '::'
193 | using ::wcstof;
| ^~~~~~
/usr/local/lib/gcc12/include/c++/cwchar:283:14: error: 'wcstof' has not been declared in 'std'
283 | using std::wcstof;
| ^~~~~~
/usr/local/lib/gcc12/include/c++/cwchar:286:14: error: 'vfwscanf' has not been declared in 'std'
286 | using std::vfwscanf;
| ^~~~~~~~
/usr/local/lib/gcc12/include/c++/cwchar:289:14: error: 'vswscanf' has not been declared in 'std'
289 | using std::vswscanf;
| ^~~~~~~~
/usr/local/lib/gcc12/include/c++/cwchar:292:14: error: 'vwscanf' has not been declared in 'std'
292 | using std::vwscanf;
| ^~~~~~~
[ 8%] Linking CXX static library libabsl_spinlock_wait.a
In file included from /usr/local/lib/gcc12/include/c++/bits/localefwd.h:42,
from /usr/local/lib/gcc12/include/c++/string:43:
/usr/local/lib/gcc12/include/c++/cctype:87:11: error: 'isblank' has not been declared in '::'
87 | using ::isblank;
| ^~~~~~~
[ 8%] Built target absl_spinlock_wait
In file included from /usr/local/lib/gcc12/include/c++/string:53:
/usr/local/lib/gcc12/include/c++/bits/basic_string.h: In function 'float std::__cxx11::stof(const std::wstring&, std::size_t*)':
/usr/local/lib/gcc12/include/c++/bits/basic_string.h:4141:36: error: 'wcstof' is not a member of 'std'; did you mean 'wcstol'?
4141 | { return __gnu_cxx::__stoa(&std::wcstof, "stof", __str.c_str(), __idx); }
| ^~~~~~
| wcstol
[ 10%] Linking CXX static library libabsl_exponential_biased.a
[ 10%] Built target absl_exponential_biased
[ 11%] Linking CXX static library libabsl_log_severity.a
[ 11%] Built target absl_log_severity
[ 13%] Building CXX object _deps/absl-build/absl/base/CMakeFiles/absl_raw_logging_internal.dir/internal/raw_logging.cc.o
gmake[3]: *** [_deps/absl-build/absl/time/CMakeFiles/absl_time_zone.dir/build.make:90: _deps/absl-build/absl/time/CMakeFiles/absl_time_zone.dir/internal/cctz/src/time_zone_format.cc.o] Error 1
gmake[3]: *** Waiting for unfinished jobs....
That looks odd. At time_zone.h:27
abseil just #include
s <string>
.
That said, since 20240116.1
, there was an update to cctz
on abseil master, though not in the files that are mentioned in your errors.
What release of abseil is on your system?
I am using an older version.
abseil-20230125.3
Name : abseil
Version : 20230125.3
Installed on : Wed Mar 6 21:40:50 2024 CET
Origin : devel/abseil
Architecture : FreeBSD:13:amd64
Prefix : /usr/local
Categories : devel
Licenses : APACHE20
Maintainer : danfe@FreeBSD.org
WWW : https://abseil.io/
Comment : Abseil Common Libraries (C++)
I'm guessing the freebsd package hasn't been updated yet?
That makes me think there might be a new reason abseil is not compiling on FreeBSD. I have two suggestions:
EXTRA_CMAKE_ARGS=-DUSE_SYSTEM_ABSEIL=ON
. It's not going anywhere and I would assume FreeBSD does test whatever version of abseil they decide to ship, so I would not expect any breaks there.
Issue Prelude
Please complete these steps and check these boxes (by putting an
x
inside the brackets) before filing your issue:vim --version
.:YcmDebugInfo
.:YcmToggleLogs
command.vim -Nu /path/to/YCM/vimrc_ycm_minimal
, including what I expected to happen and what actually happened.install.py
(orcmake
/make
/ninja
) including its invocationThank 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
OpenBSD fails to compile since OpenBSD 6.8 to latest (7.4).
This issue was reported on the mailing list here: https://groups.google.com/g/ycm-users/c/eJHzetNm_KM
I have solved the issue by, as the install script is is "Generating ycmd build configuration...", editing the file
third_party/ycmd/cpp/absl/absl/time/internal/cctz/src/time_zone_format.cc
and commenting out line 23,#define _XOPEN_SOURCE
after the file exists but before it gets to the next "Compiling ycmd target: ycm_core..." step.This is also the solutions provided in the links referenced in the mailing list post: https://github.com/google/flatbuffers/issues/6185 https://github.com/google/flatbuffers/pull/6205
Compile to succeed.
The compile failed.
Diagnostic data
Output of
vim --version
Output of
YcmDebugInfo
Unavailable without a fix for this issue
Output of
YcmDiags
Unavailable without a fix for this issue
Output of
git rev-parse HEAD
in YouCompleteMe installation directoryContents of YCM, ycmd and completion engine logfiles
Unavailable without a fix for this issue
OS version, distribution, etc.
OpenBSD 7.4
Output of build/install commands