Open FrostKiwi opened 2 years ago
Hey @FrostKiwi , I've made a fix for this. It's on the devel
branch. Could you try if it works for you?
Hey @FrostKiwi , I've made a fix for this. It's on the
devel
branch. Could you try if it works for you?
Looks like progress :] It's not complaing about missing syscalls anymore. The pre-processor complains now though with the following error:
[ 5%] Building CXX object libsys/CMakeFiles/sys_a.dir/source/Os.cc.obj
C:/DMGMORI_Development/msys64/home/artsimow/pom/lbs/Bear/source/libsys/source/Os.cc:33:14: error: missing binary operator before token "HAVE_CONFSTR"
33 | #if definded HAVE_CONFSTR
| ^~~~~~~~~~~~
C:/DMGMORI_Development/msys64/home/artsimow/pom/lbs/Bear/source/libsys/source/Os.cc:56:14: error: missing binary operator before token "HAVE_CS_PATH"
56 | #if definded HAVE_CS_PATH && defined HAVE_CONFSTR
| ^~~~~~~~~~~~
In file included from C:/DMGMORI_Development/msys64/mingw64/include/c++/11.2.0/cstdlib:75,
from C:/DMGMORI_Development/msys64/mingw64/include/c++/11.2.0/bits/stl_algo.h:59,
from C:/DMGMORI_Development/msys64/mingw64/include/c++/11.2.0/functional:65,
from C:/DMGMORI_Development/msys64/home/artsimow/pom/lbs/Bear/source/libresult/include/libresult/Result.h:22,
from C:/DMGMORI_Development/msys64/home/artsimow/pom/lbs/Bear/source/libsys/include/libsys/Os.h:22,
from C:/DMGMORI_Development/msys64/home/artsimow/pom/lbs/Bear/source/libsys/source/Os.cc:20:
C:/DMGMORI_Development/msys64/home/artsimow/pom/lbs/Bear/source/libsys/source/Guard.h:35:66: error: cannot declare pointer to 'const class std::map<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >&'
35 | explicit Guard(const std::map<std::string, std::string>& environ);
| ^~~~~~~
make[5]: *** [libsys/CMakeFiles/sys_a.dir/build.make:77: libsys/CMakeFiles/sys_a.dir/source/Os.cc.obj] Error 1
make[4]: *** [CMakeFiles/Makefile2:311: libsys/CMakeFiles/sys_a.dir/all] Error 2
make[3]: *** [Makefile:136: all] Error 2
make[2]: *** [CMakeFiles/BearSource.dir/build.make:87: subprojects/Stamp/BearSource/BearSource-build] Error 2
make[1]: *** [CMakeFiles/Makefile2:174: CMakeFiles/BearSource.dir/all] Error 2
make: *** [Makefile:156: all] Error 2
I'm sorry @FrostKiwi , it was a typo. (I wrote definded
instead of defined
.) Did force pushed the devel
branch.
Hahaha, that's a fail for me as well. I thought "missing binary operator" is something easy, so I stared at it for a good minute and gave up.
One thing down, one more to go, at least as per my log:
Guard.h:35:66: error: cannot declare pointer to 'const class std::map<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >&'
[ 5%] Building CXX object libsys/CMakeFiles/sys_a.dir/source/Os.cc.obj
In file included from C:/DMGMORI_Development/msys64/mingw64/include/c++/11.2.0/cstdlib:75,
from C:/DMGMORI_Development/msys64/mingw64/include/c++/11.2.0/bits/stl_algo.h:59,
from C:/DMGMORI_Development/msys64/mingw64/include/c++/11.2.0/functional:65,
from C:/DMGMORI_Development/msys64/home/artsimow/pom/lbs/Bear/source/libresult/include/libresult/Result.h:22,
from C:/DMGMORI_Development/msys64/home/artsimow/pom/lbs/Bear/source/libsys/include/libsys/Os.h:22,
from C:/DMGMORI_Development/msys64/home/artsimow/pom/lbs/Bear/source/libsys/source/Os.cc:20:
C:/DMGMORI_Development/msys64/home/artsimow/pom/lbs/Bear/source/libsys/source/Guard.h:35:66: error: cannot declare pointer to 'const class std::map<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >&'
35 | explicit Guard(const std::map<std::string, std::string>& environ);
| ^~~~~~~
make[5]: *** [libsys/CMakeFiles/sys_a.dir/build.make:77: libsys/CMakeFiles/sys_a.dir/source/Os.cc.obj] Error 1
make[4]: *** [CMakeFiles/Makefile2:311: libsys/CMakeFiles/sys_a.dir/all] Error 2
make[3]: *** [Makefile:136: all] Error 2
make[2]: *** [CMakeFiles/BearSource.dir/build.make:87: subprojects/Stamp/BearSource/BearSource-build] Error 2
make[1]: *** [CMakeFiles/Makefile2:174: CMakeFiles/BearSource.dir/all] Error 2
make: *** [Makefile:156: all] Error 2
Thx for supporting esoteric programming setups with so much passion and love <3
I'm guessing here: I think the name environ
is a macro somewhere in MinGW and collide with the argument name. I did renamed the argument in my file. The fix is on devel
branch again.
Guard.cc, Os.cc and Flags.cc don't complain anymore. π
Next up, Path.cc starts complaining though with Path.cc:54:31: error: could not convert 'std::accumulate(_InputIterator [...]
[ 1%] Building CXX object libflags/CMakeFiles/flags_a.dir/source/Flags.cc.obj
[ 1%] Built target flags_a
[ 3%] Building CXX object libshell/CMakeFiles/shell_a.dir/source/Command.cc.obj
[ 3%] Built target shell_a
[ 5%] Building CXX object libsys/CMakeFiles/sys_a.dir/source/Os.cc.obj
[ 6%] Building CXX object libsys/CMakeFiles/sys_a.dir/source/Guard.cc.obj
[ 8%] Building CXX object libsys/CMakeFiles/sys_a.dir/source/Errors.cc.obj
[ 10%] Building CXX object libsys/CMakeFiles/sys_a.dir/source/Path.cc.obj
C:/DMGMORI_Development/msys64/home/artsimow/pom/lbs/Bear/source/libsys/source/Path.cc: In function 'std::string {anonymous}::join_with(const std::__cxx11::list<std::filesystem::__cxx11::path>&, char)':
C:/DMGMORI_Development/msys64/home/artsimow/pom/lbs/Bear/source/libsys/source/Path.cc:54:31: error: could not convert 'std::accumulate(_InputIterator, _InputIterator, _Tp, _BinaryOperation) [with _InputIterator = std::_List_const_iterator<std::filesystem::__cxx11::path>; _Tp = std::filesystem::__cxx11::path; _BinaryOperation = {anonymous}::join_with(const std::__cxx11::list<std::filesystem::__cxx11::path>&, char)::<lambda(std::string, const std::filesystem::__cxx11::path&)>]((& input)->std::__cxx11::list<std::filesystem::__cxx11::path>::end(), std::filesystem::__cxx11::path((* &(& input)->std::__cxx11::list<std::filesystem::__cxx11::path>::begin().std::_List_const_iterator<std::filesystem::__cxx11::path>::operator*())), <lambda closure object>{anonymous}::join_with(const std::__cxx11::list<std::filesystem::__cxx11::path>&, char)::<lambda(std::string, const std::filesystem::__cxx11::path&)>{sep})' from 'std::filesystem::__cxx11::path' to 'std::string' {aka 'std::__cxx11::basic_string<char>'}
54 | return std::accumulate(std::next(input.begin()), input.end(),
| ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| std::filesystem::__cxx11::path
55 | *input.begin(),
| ~~~~~~~~~~~~~~~
56 | [&sep](std::string acc, const fs::path &item) {
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
57 | return std::move(acc) + sep + item.string();
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
58 | });
| ~~
In file included from C:/DMGMORI_Development/msys64/mingw64/include/c++/11.2.0/numeric:62,
from C:/DMGMORI_Development/msys64/home/artsimow/pom/lbs/Bear/source/libsys/source/Path.cc:23:
C:/DMGMORI_Development/msys64/mingw64/include/c++/11.2.0/bits/stl_numeric.h: In instantiation of '_Tp std::accumulate(_InputIterator, _InputIterator, _Tp, _BinaryOperation) [with _InputIterator = std::_List_const_iterator<std::filesystem::__cxx11::path>; _Tp = std::filesystem::__cxx11::path; _BinaryOperation = {anonymous}::join_with(const std::__cxx11::list<std::filesystem::__cxx11::path>&, char)::<lambda(std::string, const std::filesystem::__cxx11::path&)>]':
C:/DMGMORI_Development/msys64/home/artsimow/pom/lbs/Bear/source/libsys/source/Path.cc:54:31: required from here
C:/DMGMORI_Development/msys64/mingw64/include/c++/11.2.0/bits/stl_numeric.h:169:29: error: no match for call to '({anonymous}::join_with(const std::__cxx11::list<std::filesystem::__cxx11::path>&, char)::<lambda(std::string, const std::filesystem::__cxx11::path&)>) (std::filesystem::__cxx11::path&, const std::filesystem::__cxx11::path&)'
169 | __init = __binary_op(_GLIBCXX_MOVE_IF_20(__init), *__first);
| ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/DMGMORI_Development/msys64/home/artsimow/pom/lbs/Bear/source/libsys/source/Path.cc:56:32: note: candidate: '{anonymous}::join_with(const std::__cxx11::list<std::filesystem::__cxx11::path>&, char)::<lambda(std::string, const std::filesystem::__cxx11::path&)>'
56 | [&sep](std::string acc, const fs::path &item) {
| ^
C:/DMGMORI_Development/msys64/home/artsimow/pom/lbs/Bear/source/libsys/source/Path.cc:56:32: note: no known conversion for argument 1 from 'std::filesystem::__cxx11::path' to 'std::string' {aka 'std::__cxx11::basic_string<char>'}
make[5]: *** [libsys/CMakeFiles/sys_a.dir/build.make:122: libsys/CMakeFiles/sys_a.dir/source/Path.cc.obj] Error 1
make[4]: *** [CMakeFiles/Makefile2:311: libsys/CMakeFiles/sys_a.dir/all] Error 2
make[3]: *** [Makefile:136: all] Error 2
make[2]: *** [CMakeFiles/BearSource.dir/build.make:87: subprojects/Stamp/BearSource/BearSource-build] Error 2
make[1]: *** [CMakeFiles/Makefile2:174: CMakeFiles/BearSource.dir/all] Error 2
make: *** [Makefile:156: all] Error 2
Looks like your compiler is more pedantic and was not called the implicit conversion from std::filesystem::path
to std::string
. Anyway, I've replaced this with a simpler for-loop, which has no STL magic. The fix is on devel
branch again.
Path.cc succesfully cleared π Right the next source file complains ;____;
Apparently it's once more POSIX related. Process.cc:76:15: error: 'posix_spawn_file_actions_t' does not name a type
This I don't know how to fix. Yet. Can you pass the config.h
file from <build dir>/subprojects/Build/BearSource/config.h
after the cmake
configure step? That will tell me which header files are included.
I'll also need to see what are the content of the MinGW header files. Is that available somewhere on GitHub or some public repository?
Uploading text files is forbidden ( I mean it's GitHub, what's the logic O.o ) So it's compressed here: config.h.zip Also for convinience included literally here:
Whether there is a public place to look at how the includes look, I think no. There is a public package listing for all of MSYS2: https://packages.msys2.org , but the filesystem is built via the package manager and each package contributing it's contents. So virtual machine + installing MSYS or a straight up Windows machine is propably the way to go? I know you can cross-compile with MinGW64 packages to Windows from Linux, but that possibly(?) changes what layout we are working with. In this case we are compiling specifically with the MinGW64 environment. As described in the MSYS documentation, two include directories play a role here:
The MSYS environment contains the unix-like/cygwin based tools, lives under /usr and are special in that it is always active. All the other environments inherit from the MSYS environment and add various things on top of it.
So here is what I did for the sake of providing something useful - I archived the MSYS include directory from /usr/include here: MSYS-usr-include.zip And for convinience here is the output of Tree for that directory:
And here the same for the MinGW64 include directory, which is a real chonker: mingw64-include.zip
edit: Actually I'm not sure about that last statement. Since MinGW64 is another environment, maybe MSYS includes dont matter. Those provide different C libraries after all. After a bit of thinking, maybe only the mingw64 includes play a role, I'll ask for context, out of my own curiosity aswell.
Thanks so much @FrostKiwi this is very good...
After a quick look, I see that there is no spawn.h
(CMake did not find it), but there is unistd.h
(CMake did find it). Which means I can't use posix_spawn
call, but fork
and exec
. This will take more time to change... But I have not found the unistd.h
in the zip files you've sent. Can you confirm the fork
and execve
functions are available? Or maybe the spawn.h
is also available, but CMake was not looking into the right place.
In the MinGW64-packages repo issue it was mentioned... https://github.com/msys2/MINGW-packages/issues/7411#issuecomment-921968850
but I'm also not sure due to that constraint if bear should be in MINGW-packages and I think it might be better off in MSYS2-packages
...Maybe I'm creating the wrong approach here. Bear might be more of a basic sysutil and may not need to be compiled with the Windows-Native MinGW64 toolchain. Only thing regarding fork I find is this comment: https://news.ycombinator.com/item?id=11391797
There does not seem to be a spawn.h and there man fork returns just GNU awk's fork man page. Though I have zero idea how any of this works or how to compile for MSYS, instead of the Windows native MinGW64...
Oh, so there is no POSIX layer in MinGW. And Bear should call Windows native... That will be challenging.
I asked around and maybe my it really is the best to not build Bear Windows native and not try to square the circle. A year ago this was commented here https://github.com/msys2/MINGW-packages/issues/7411#issuecomment-921968850
I'm also not sure due to that constraint if bear should be in MINGW-packages and I think it might be better off in MSYS2-packages
And again when I asked yesturday: https://github.com/msys2/MINGW-packages/issues/7411#issuecomment-981120925
Native tools are preferred when possible but it doesn't seem doable here so I think it should be ok.
So since Bear is more of a tool close to the system, maybe it should remain within the MSYS environment and get access to all that emulated POSIX goodness. Unfortunately I have zero idea how to build in that environment or how to get those emulated Posix features.
Hi all,
I kind of stuck in windows. So, are there any progress here?
I am using mingw-w64 as well. Bear cannot be built on msys2 environment alone because Bear's dependencies doesn't exist as msys2 package.
I tried building Bear on mingw-w64 after installing dependencies. I am a bit confused here. Bear doesn't seem to have the macro definitions to see these system headers as posix headers:
$ cmake -DENABLE_UNIT_TESTS=OFF -DENABLE_FUNC_TESTS=OFF .. -- Building for: Ninja -- The C compiler identification is GNU 12.1.0 -- The CXX compiler identification is GNU 12.1.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: C:/Users/mehmet.basaran/Desktop/msys2/mingw64/bin/cc.exe - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: C:/Users/mehmet.basaran/Desktop/msys2/mingw64/bin/c++.exe - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Setting build type to 'Release' as none was specified. -- Looking for nlohman_json dependency -- Looking for nlohman_json dependency -- found -- Looking for fmt dependency -- Looking for fmt dependency -- found -- Looking for spdlog dependency -- Looking for pthread.h -- Looking for pthread.h - found -- Performing Test CMAKE_HAVE_LIBC_PTHREAD -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success -- Found Threads: TRUE -- Looking for spdlog dependency -- found -- Looking for gRPC::grpc++ dependency -- Found PkgConfig: C:/Users/mehmet.basaran/Desktop/msys2/mingw64/bin/pkg-config.exe (found version "1.8.0") -- Checking for modules 'protobuf>=3.11;grpc++>=1.26' -- Found protobuf, version 3.16.0.0 -- Found grpc++, version 1.45.2 -- Looking for gRPC::grpc++ dependency -- found -- Looking for protoc -- Looking for protoc -- found -- Looking for grpc_cpp_plugin -- Looking for grpc_cpp_plugin -- found -- Configuring done -- Generating done -- Build files have been written to: C:/Users/mehmet.basaran/Desktop/Bear-master/build
$ ninja
[1/9] Creating directories for 'BearSource'
[2/9] No download step for 'BearSource'
[3/9] No update step for 'BearSource'
[4/9] No patch step for 'BearSource'
[5/9] Performing configure step for 'BearSource'
loading initial cache file C:/Users/mehmet.basaran/Desktop/Bear-master/build/subprojects/tmp/BearSource/BearSource-cache-Release.cmake
-- The C compiler identification is GNU 12.1.0
-- The CXX compiler identification is GNU 12.1.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Users/mehmet.basaran/Desktop/msys2/mingw64/bin/cc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Users/mehmet.basaran/Desktop/msys2/mingw64/bin/c++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Found nlohmann_json: C:/Users/mehmet.basaran/Desktop/msys2/usr/lib/cmake/nlohmann_json/nlohmann_jsonConfig.cmake (found version "3.10.5")
-- Found PkgConfig: C:/Users/mehmet.basaran/Desktop/msys2/mingw64/bin/pkg-config.exe (found version "1.8.0")
-- Checking for modules 'protobuf;grpc++'
-- Found protobuf, version 3.16.0.0
-- Found grpc++, version 1.45.2
-- Looking for spawn.h
-- Looking for spawn.h - not found
-- Looking for unistd.h
-- Looking for unistd.h - found
-- Looking for dlfcn.h
-- Looking for dlfcn.h - not found
-- Looking for errno.h
-- Looking for errno.h - found
-- Looking for sys/utsname.h
-- Looking for sys/utsname.h - not found
-- Looking for sys/wait.h
-- Looking for sys/wait.h - not found
-- Looking for sys/time.h
-- Looking for sys/time.h - found
-- Looking for sys/stat.h
-- Looking for sys/stat.h - found
-- Looking for gnu/lib-names.h
-- Looking for gnu/lib-names.h - not found
-- Looking for _NSGetEnviron
-- Looking for _NSGetEnviron - not found
-- Looking for dlopen
-- Looking for dlopen - not found
-- Looking for dlsym
-- Looking for dlsym - not found
-- Looking for dlerror
-- Looking for dlerror - not found
-- Looking for dlclose
-- Looking for dlclose - not found
-- Looking for RTLD_NEXT
-- Looking for RTLD_NEXT - not found
-- Looking for EACCES
-- Looking for EACCES - found
-- Looking for ENOENT
-- Looking for ENOENT - found
-- Looking for strerror_r
-- Looking for strerror_r - not found
-- Looking for environ
-- Looking for environ - not found
-- Looking for uname
-- Looking for uname - not found
-- Looking for confstr
-- Looking for confstr - not found
-- Looking for _CS_PATH
-- Looking for _CS_PATH - not found
-- Looking for _CS_GNU_LIBC_VERSION
-- Looking for _CS_GNU_LIBC_VERSION - not found
-- Looking for _CS_GNU_LIBPTHREAD_VERSION
-- Looking for _CS_GNU_LIBPTHREAD_VERSION - not found
-- Looking for protoc ... C:/Users/mehmet.basaran/Desktop/msys2/mingw64/bin/protoc.exe
-- Looking for grpc_cpp_plugin ... C:/Users/mehmet.basaran/Desktop/msys2/mingw64/bin/grpc_cpp_plugin.exe
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/mehmet.basaran/Desktop/Bear-master/build/subprojects/Build/BearSource
[6/9] Performing build step for 'BearSource'
FAILED: subprojects/Stamp/BearSource/BearSource-build C:/Users/mehmet.basaran/Desktop/Bear-master/build/subprojects/Stamp/BearSource/BearSource-build
cmd.exe /C "cd /D C:\Users\mehmet.basaran\Desktop\Bear-master\build\subprojects\Build\BearSource && C:\Users\mehmet.basaran\Desktop\msys2\mingw64\bin\cmake.exe --build .op/Bear-master/build/subprojects/Stamp/BearSource/BearSource-build"
[1/60] Building CXX object libsys/CMakeFiles/sys_a.dir/source/Errors.cc.obj
[2/60] Building CXX object libsys/CMakeFiles/sys_a.dir/source/Guard.cc.obj
[3/60] Building CXX object libsys/CMakeFiles/sys_a.dir/source/Signal.cc.obj
FAILED: libsys/CMakeFiles/sys_a.dir/source/Signal.cc.obj
C:\Users\mehmet.basaran\Desktop\msys2\mingw64\bin\c++.exe -DFMT_LOCALE -DFMT_SHARED -DSPDLOG_COMPILED_LIB -DSPDLOG_FMT_EXTERNAL -DSPDLOG_SHARED_LIB -IC:/Users/mehmet.baster/source/libsys/include -IC:/Users/mehmet.basaran/Desktop/Bear-master/build/subprojects/Build/BearSource/libsys/include -IC:/Users/mehmet.basaran/Desktop/Bear-master/s -O3 -DNDEBUG -Wa,-mbig-obj -std=c++17 -MD -MT libsys/CMakeFiles/sys_a.dir/source/Signal.cc.obj -MF libsys\CMakeFiles\sys_a.dir\source\Signal.cc.obj.d -o libsys/CMakeFilSignal.cc
In file included from C:/Users/mehmet.basaran/Desktop/Bear-master/source/libsys/source/Signal.cc:20:
C:/Users/mehmet.basaran/Desktop/Bear-master/source/libsys/include/libsys/Signal.h:39:9: error: 'pid_t' does not name a type
39 | pid_t pid_;
| ^~~~~
C:/Users/mehmet.basaran/Desktop/Bear-master/source/libsys/source/Signal.cc: In function 'constexpr bool {anonymous}::shall_forward(int)':
C:/Users/mehmet.basaran/Desktop/Bear-master/source/libsys/source/Signal.cc:30:18: error: 'SIGKILL' was not declared in this scope; did you mean 'SIGILL'?
30 | case SIGKILL:
| ^~~~~~~
| SIGILL
C:/Users/mehmet.basaran/Desktop/Bear-master/source/libsys/source/Signal.cc:31:18: error: 'SIGCHLD' was not declared in this scope
31 | case SIGCHLD:
| ^~~~~~~
C:/Users/mehmet.basaran/Desktop/Bear-master/source/libsys/source/Signal.cc: In function 'void {anonymous}::handler(int)':
C:/Users/mehmet.basaran/Desktop/Bear-master/source/libsys/source/Signal.cc:43:19: error: '::kill' has not been declared
43 | ::kill(pid, signum);
| ^~~~
C:/Users/mehmet.basaran/Desktop/Bear-master/source/libsys/source/Signal.cc: In constructor 'sys::SignalForwarder::SignalForwarder(const sys::Process&)':
C:/Users/mehmet.basaran/Desktop/Bear-master/source/libsys/source/Signal.cc:52:15: error: class 'sys::SignalForwarder' does not have any field named 'pid_'
52 | : pid_(child.get_pid())
| ^~~~
C:/Users/mehmet.basaran/Desktop/Bear-master/source/libsys/source/Signal.cc:55:32: error: 'pid_' was not declared in this scope; did you mean 'pid_t'?
55 | CHILD_PROCESSES.insert(pid_);
| ^~~~
| pid_t
C:/Users/mehmet.basaran/Desktop/Bear-master/source/libsys/source/Signal.cc: In destructor 'sys::SignalForwarder::~SignalForwarder()':
C:/Users/mehmet.basaran/Desktop/Bear-master/source/libsys/source/Signal.cc:63:31: error: 'pid_' was not declared in this scope; did you mean 'pid_t'?
63 | CHILD_PROCESSES.erase(pid_);
| ^~~~
| pid_t
[4/60] Building CXX object libsys/CMakeFiles/sys_a.dir/source/Os.cc.obj
[5/60] Building CXX object libsys/CMakeFiles/sys_a.dir/source/Path.cc.obj
[6/60] Building CXX object intercept/CMakeFiles/exec_a.dir/source/report/libexec/Buffer.cc.obj
[7/60] Building CXX object intercept/CMakeFiles/exec_a.dir/source/report/libexec/Environment.cc.obj
[8/60] Building CXX object libflags/CMakeFiles/flags_a.dir/source/Flags.cc.obj
[9/60] Building CXX object libsys/CMakeFiles/sys_a.dir/source/Process.cc.obj
FAILED: libsys/CMakeFiles/sys_a.dir/source/Process.cc.obj
C:\Users\mehmet.basaran\Desktop\msys2\mingw64\bin\c++.exe -DFMT_LOCALE -DFMT_SHARED -DSPDLOG_COMPILED_LIB -DSPDLOG_FMT_EXTERNAL -DSPDLOG_SHARED_LIB -IC:/Users/mehmet.baster/source/libsys/include -IC:/Users/mehmet.basaran/Desktop/Bear-master/build/subprojects/Build/BearSource/libsys/include -IC:/Users/mehmet.basaran/Desktop/Bear-master/s -O3 -DNDEBUG -Wa,-mbig-obj -std=c++17 -MD -MT libsys/CMakeFiles/sys_a.dir/source/Process.cc.obj -MF libsys\CMakeFiles\sys_a.dir\source\Process.cc.obj.d -o libsys/CMakeFce/Process.cc
C:/Users/mehmet.basaran/Desktop/Bear-master/source/libsys/source/Process.cc:76:15: error: 'posix_spawn_file_actions_t' does not name a type
76 | const posix_spawn_file_actions_t* file_actions_ptr,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
C:/Users/mehmet.basaran/Desktop/Bear-master/source/libsys/source/Process.cc:77:15: error: 'posix_spawnattr_t' does not name a type
77 | const posix_spawnattr_t* attr_ptr,
| ^~~~~~~~~~~~~~~~~
C:/Users/mehmet.basaran/Desktop/Bear-master/source/libsys/source/Process.cc: In lambda function:
C:/Users/mehmet.basaran/Desktop/Bear-master/source/libsys/source/Process.cc:93:24: error: '::posix_spawnp' has not been declared; did you mean 'posix_spawn_t'?
93 | if (0 != ::posix_spawnp(&child, path, nullptr, nullptr, const_cast
$ env ProgramFiles(x86)=C:\Program Files (x86) !::=::\ CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files !F:=F:\ SHELL=/usr/bin/bash NUMBER_OF_PROCESSORS=8 PROCESSOR_LEVEL=6 IWBPath=C:\Program Files (x86)\SAP\FrontEnd\iwb TERM_PROGRAM_VERSION=3.6.1 MINGW_PREFIX=/mingw64 PKG_CONFIG_PATH=/mingw64/lib/pkgconfig:/mingw64/share/pkgconfig USERDOMAIN_ROAMINGPROFILE=TBTK HOSTNAME=BLG-BB05943 PROGRAMFILES=C:\Program Files MSYSTEM=MINGW64 PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC ORIGINAL_TEMP=/c/Users/MEHMET~1.BAS/AppData/Local/Temp MINGW_CHOST=x86_64-w64-mingw32 OS=Windows_NT HOMEDRIVE=C: MSYSTEM_CARCH=x86_64 SSF_LIBRARY_PATH_64=C:\Program Files\SAP\FrontEnd\SecureLogin\lib\sapcrypto.dll USERDOMAIN=TBTK USERDNSDOMAIN=TBTK.GOV.TR PWD=/c/Users/mehmet.basaran/Desktop/Bear-master/build USERPROFILE=C:\Users\mehmet.basaran MANPATH=/mingw64/local/man:/mingw64/share/man:/usr/local/man:/usr/share/man:/usr/man:/share/man PRINTER=\\SRV-UniFlow\GuvenliBaski TZ=Europe/Istanbul MINGW_PACKAGE_PREFIX=mingw-w64-x86_64 tmp=C:\Users\MEHMET~1.BAS\AppData\Local\Temp ALLUSERSPROFILE=C:\ProgramData ORIGINAL_PATH=/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/ CommonProgramW6432=C:\Program Files\Common Files HOME=/home/mehmet.basaran USERNAME=mehmet.basaran COMSPEC=C:\Windows\system32\cmd.exe APPDATA=C:\Users\mehmet.basaran\AppData\Roaming SYSTEMROOT=C:\Windows LOCALAPPDATA=C:\Users\mehmet.basaran\AppData\Local SSF_LIBRARY_PATH=C:\Program Files (x86)\SAP\FrontEnd\SecureLogin\lib\sapcrypto.dll SNC_LIB_64=C:\Program Files\SAP\FrontEnd\SecureLogin\lib\sapcrypto.dll COMPUTERNAME=BLG-BB05943 INFOPATH=/usr/local/info:/usr/share/info:/usr/info:/share/info TERM=xterm LOGONSERVER=\\BIRUNI ACLOCAL_PATH=/mingw64/share/aclocal:/usr/share/aclocal USER=mehmet.basaran PSModulePath=C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules TEMP=/tmp temp=C:\Users\MEHMET~1.BAS\AppData\Local\Temp MSYSTEM_CHOST=x86_64-w64-mingw32 ORIGINAL_TMP=/c/Users/MEHMET~1.BAS/AppData/Local/Temp SHLVL=1 PROCESSOR_REVISION=1e05 DriverData=C:\Windows\System32\Drivers\DriverData COMMONPROGRAMFILES=C:\Program Files\Common Files LC_CTYPE=tr_TR.UTF-8 PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 30 Stepping 5, GenuineIntel SESSIONNAME=Console PS1=\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[35m\]$MSYSTEM\[\e[0m\] \[\e[33m\]\w\[\e[0m\]\n\$ SNC_LIB=C:\Program Files (x86)\SAP\FrontEnd\SecureLogin\lib\sapcrypto.dll HOMEPATH=\Users\mehmet.basaran XDG_DATA_DIRS=/mingw64/share/:/usr/local/share/:/usr/share/ MSYSCON=mintty.exe TMP=/tmp CONFIG_SITE=/etc/config.site PATH=/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl ProgramW6432=C:\Program Files MSYSTEM_PREFIX=/mingw64 WINDIR=C:\Windows PROCESSOR_ARCHITECTURE=AMD64 PUBLIC=C:\Users\Public SYSTEMDRIVE=C: OLDPWD=/c/Users/mehmet.basaran/Desktop/Bear-master TERM_PROGRAM=mintty ProgramData=C:\ProgramData _=/usr/bin/env
Bear version: c5fb0ea9eea4275aefff7b3619006700c5d6a249
I'll be happy to help & provide more details. Thanks in advance.
Hey @memoks , thanks for the follow up... There are no progress on this unfortunately.
The code is written mostly by me, who has experience and access for POSIX based OSes. Happy to have contributions to port some of the OS specific parts (process creation) to Windows.
If you intend to use Bear to make LSP to work properly from within MSYS2, here are some alternatives that all worked for me. Both ccls and clangd support a simple txt file to define the compilation rules. In case of ccls ( https://github.com/MaskRay/ccls/wiki/Project-Setup#ccls-file ) it's called .ccls, should be placed in the project root and looks like this in my case:
cc
-Iinc
-Iinc/external
-std=c17
-pipe
-O0
-DGLEW_STATIC
-Wall
Works flawlessly. Clangd has the same thing ( https://clang.llvm.org/docs/JSONCompilationDatabase.html#alternatives ) , called compile_flags.txt. I wrote them manually, but now just autogenerate the .ccls file with my Makefile.
Alternatively, if you compile with clang, you have the ability to output the json formatted compilation database information ( https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-mj-arg ), if your project is more complex than what a single compile flags collection can express.
If you compile with clang, you can pass the -MJ flag. In my Makefile it looks like -MJ $<.json
. This will place a .json file along side each source file, which you have to paste manually into the final compile_commands.json, encapsulated by square brackets [] and each separated by commas. This can be also automated in a makefile I guess.
All these worked for me, but I ended up using ccls and simply outputting the .ccls file.
Hi all,
@FrostKiwi Huge thanks for the suggestions. I am, in fact, trying to get LSP+emacs to work :). Unfortunately, my project is a a bit complex where compilation commands can change on per file basis. And I am using GNU compiler toolchain.
One approach, as you have pointed out, would be to have the makefiles output compilation commands. This should be very easy through changing makefiles (if they are well organized). But this is not the case and I don't have the permission to change all the makefiles. So, I am trying to work around this for now.
@rizsotto After evaluating the situation further, maybe using mingw was a mistake. Out of curiosity, I am trying to compile Bear using cygwin this time. Because cygwin is basically POSIX this should work if I can manage the dependencies. I will write the steps if it succeeds. And there is also WSL (Windows subsystem for Linux) which I don't have atm and probably is the better way to do this.
@memoks also Emacs + LSP here :]
Both cygwin and WSL2 would indeed sidestep the problem, but it depends on your use-case. AFAIK, Cygwin means shipping a bunch (maybe just 1?) of .dll files with your program, creating an extra dependency and WSL2 requires the whole WSL2 subsystem to be installed for the program to run. That's the reason I stuck with MinGW64, as you can produce dependent free binaries, for the installer-free user experience.
@FrostKiwi You are right about .dll files and dependencies. Mingw is the most dependency free compared to other alternatives.
In file included from /cygdrive/c/Users/mehmet.basaran/Desktop/cyg32/Bear-master/build/subprojects/Source/grpc_dependency/third_party/abseil-cpp/absl/base/config.h:67, from /cygdrive/c/Users/mehmet.basaran/Desktop/cyg32/Bear-master/build/subprojects/Source/grpc_dependency/third_party/abseil-cpp/absl/base/internal/scheduling_mode.h:21, from /cygdrive/c/Users/mehmet.basaran/Desktop/cyg32/Bear-master/build/subprojects/Source/grpc_dependency/third_party/abseil-cpp/absl/base/internal/spinlock_wait.h:24, from /cygdrive/c/Users/mehmet.basaran/Desktop/cyg32/Bear-master/build/subprojects/Source/grpc_dependency/third_party/abseil-cpp/absl/base/internal/spinlock_wait.cc:22: /cygdrive/c/Users/mehmet.basaran/Desktop/cyg32/Bear-master/build/subprojects/Source/grpc_dependency/third_party/abseil-cpp/absl/base/policy_checks.h:40:2: hata: #error "Cygwin is not supported." 40 | #error "Cygwin is not supported." | ^~~~~ In file included from /cygdrive/c/Users/mehmet.basaran/Desktop/cyg32/Bear-master/build/subprojects/Source/grpc_dependency/third_party/abseil-cpp/absl/base/config.h:67, from /cygdrive/c/Users/mehmet.basaran/Desktop/cyg32/Bear-master/build/subprojects/Source/grpc_dependency/third_party/abseil-cpp/absl/random/seed_gen_exception.h:31, from /cygdrive/c/Users/mehmet.basaran/Desktop/cyg32/Bear-master/build/subprojects/Source/grpc_dependency/third_party/abseil-cpp/absl/random/seed_gen_exception.cc:15: /cygdrive/c/Users/mehmet.basaran/Desktop/cyg32/Bear-master/build/subprojects/Source/grpc_dependency/third_party/abseil-cpp/absl/base/policy_checks.h:40:2: hata: #error "Cygwin is not supported." 40 | #error "Cygwin is not supported." | ^~~~~ In file included from /cygdrive/c/Users/mehmet.basaran/Desktop/cyg32/Bear-master/build/subprojects/Source/grpc_dependency/third_party/abseil-cpp/absl/base/config.h:67, from /cygdrive/c/Users/mehmet.basaran/Desktop/cyg32/Bear-master/build/subprojects/Source/grpc_dependency/third_party/abseil-cpp/absl/profiling/internal/exponential_biased.h:20, from /cygdrive/c/Users/mehmet.basaran/Desktop/cyg32/Bear-master/build/subprojects/Source/grpc_dependency/third_party/abseil-cpp/absl/profiling/internal/exponential_biased.cc:15: /cygdrive/c/Users/mehmet.basaran/Desktop/cyg32/Bear-master/build/subprojects/Source/grpc_dependency/third_party/abseil-cpp/absl/base/policy_checks.h:40:2: hata: #error "Cygwin is not supported." 40 | #error "Cygwin is not supported." | ^~~~~ In file included from /cygdrive/c/Users/mehmet.basaran/Desktop/cyg32/Bear-master/build/subprojects/Source/grpc_dependency/third_party/abseil-cpp/absl/base/config.h:67, from /cygdrive/c/Users/mehmet.basaran/Desktop/cyg32/Bear-master/build/subprojects/Source/grpc_dependency/third_party/abseil-cpp/absl/random/internal/randen_traits.h:25, from /cygdrive/c/Users/mehmet.basaran/Desktop/cyg32/Bear-master/build/subprojects/Source/grpc_dependency/third_party/abseil-cpp/absl/random/internal/randen_round_keys.cc:15: /cygdrive/c/Users/mehmet.basaran/Desktop/cyg32/Bear-master/build/subprojects/Source/grpc_dependency/third_party/abseil-cpp/absl/base/policy_checks.h:40:2: hata: #error "Cygwin is not supported." 40 | #error "Cygwin is not supported." | ^~~~~ make[5]: *** [third_party/abseil-cpp/absl/random/CMakeFiles/random_internal_platform.dir/build.make:76: third_party/abseil-cpp/absl/random/CMakeFiles/random_internal_platform.dir/internal/randen_round_keys.cc.o] Error 1 make[4]: *** [CMakeFiles/Makefile2:3499: third_party/abseil-cpp/absl/random/CMakeFiles/random_internal_platform.dir/all] Error 2 make[4]: *** BitmemiΕ iΕler iΓ§in bekliyor.... In file included from /cygdrive/c/Users/mehmet.basaran/Desktop/cyg32/Bear-master/build/subprojects/Source/grpc_dependency/third_party/abseil-cpp/absl/base/config.h:67, from /cygdrive/c/Users/mehmet.basaran/Desktop/cyg32/Bear-master/build/subprojects/Source/grpc_dependency/third_party/abseil-cpp/absl/numeric/int128.h:37, from /cygdrive/c/Users/mehmet.basaran/Desktop/cyg32/Bear-master/build/subprojects/Source/grpc_dependency/third_party/abseil-cpp/absl/numeric/int128.cc:15: /cygdrive/c/Users/mehmet.basaran/Desktop/cyg32/Bear-master/build/subprojects/Source/grpc_dependency/third_party/abseil-cpp/absl/base/policy_checks.h:40:2: hata: #error "Cygwin is not supported." 40 | #error "Cygwin is not supported." | ^~~~~ make[5]: *** [third_party/abseil-cpp/absl/base/CMakeFiles/spinlock_wait.dir/build.make:76: third_party/abseil-cpp/absl/base/CMakeFiles/spinlock_wait.dir/internal/spinlock_wait.cc.o] Error 1 make[4]: *** [CMakeFiles/Makefile2:2052: third_party/abseil-cpp/absl/base/CMakeFiles/spinlock_wait.dir/all] Error 2 In file included from /cygdrive/c/Users/mehmet.basaran/Desktop/cyg32/Bear-master/build/subprojects/Source/grpc_dependency/third_party/abseil-cpp/absl/base/config.h:67, from /cygdrive/c/Users/mehmet.basaran/Desktop/cyg32/Bear-master/build/subprojects/Source/grpc_dependency/third_party/abseil-cpp/absl/base/attributes.h:37, from /cygdrive/c/Users/mehmet.basaran/Desktop/cyg32/Bear-master/build/subprojects/Source/grpc_dependency/third_party/abseil-cpp/absl/base/log_severity.h:21, from /cygdrive/c/Users/mehmet.basaran/Desktop/cyg32/Bear-master/build/subprojects/Source/grpc_dependency/third_party/abseil-cpp/absl/base/log_severity.cc:15: /cygdrive/c/Users/mehmet.basaran/Desktop/cyg32/Bear-master/build/subprojects/Source/grpc_dependency/third_party/abseil-cpp/absl/base/policy_checks.h:40:2: hata: #error "Cygwin is not supported." 40 | #error "Cygwin is not supported." | ^~~~~ In file included from /cygdrive/c/Users/mehmet.basaran/Desktop/cyg32/Bear-master/build/subprojects/Source/grpc_dependency/third_party/abseil-cpp/absl/base/config.h:67, from /cygdrive/c/Users/mehmet.basaran/Desktop/cyg32/Bear-master/build/subprojects/Source/grpc_dependency/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_fixed.h:20, from /cygdrive/c/Users/mehmet.basaran/Desktop/cyg32/Bear-master/build/subprojects/Source/grpc_dependency/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_fixed.cc:15: /cygdrive/c/Users/mehmet.basaran/Desktop/cyg32/Bear-master/build/subprojects/Source/grpc_dependency/third_party/abseil-cpp/absl/base/policy_checks.h:40:2: hata: #error "Cygwin is not supported." 40 | #error "Cygwin is not supported." | ^~~~~ In file included from /cygdrive/c/Users/mehmet.basaran/Desktop/cyg32/Bear-master/build/subprojects/Source/grpc_dependency/third_party/abseil-cpp/absl/base/config.h:67, from /cygdrive/c/Users/mehmet.basaran/Desktop/cyg32/Bear-master/build/subprojects/Source/grpc_dependency/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_format.cc:27: /cygdrive/c/Users/mehmet.basaran/Desktop/cyg32/Bear-master/build/subprojects/Source/grpc_dependency/third_party/abseil-cpp/absl/base/policy_checks.h:40:2: hata: #error "Cygwin is not supported." 40 | #error "Cygwin is not supported." | ^~~~~ make[5]: *** [third_party/abseil-cpp/absl/profiling/CMakeFiles/exponential_biased.dir/build.make:76: third_party/abseil-cpp/absl/profiling/CMakeFiles/exponential_biased.dir/internal/exponential_biased.cc.o] Error 1 make[4]: *** [CMakeFiles/Makefile2:3271: third_party/abseil-cpp/absl/profiling/CMakeFiles/exponential_biased.dir/all] Error 2 make[5]: *** [third_party/abseil-cpp/absl/base/CMakeFiles/log_severity.dir/build.make:76: third_party/abseil-cpp/absl/base/CMakeFiles/log_severity.dir/log_severity.cc.o] Error 1 make[4]: *** [CMakeFiles/Makefile2:2000: third_party/abseil-cpp/absl/base/CMakeFiles/log_severity.dir/all] Error 2 make[5]: *** [third_party/abseil-cpp/absl/random/CMakeFiles/random_seed_gen_exception.dir/build.make:76: third_party/abseil-cpp/absl/random/CMakeFiles/random_seed_gen_exception.dir/seed_gen_exception.cc.o] Error 1 make[4]: *** [CMakeFiles/Makefile2:3356: third_party/abseil-cpp/absl/random/CMakeFiles/random_seed_gen_exception.dir/all] Error 2 make[5]: *** [third_party/abseil-cpp/absl/numeric/CMakeFiles/int128.dir/build.make:76: third_party/abseil-cpp/absl/numeric/CMakeFiles/int128.dir/int128.cc.o] Error 1 make[4]: *** [CMakeFiles/Makefile2:3245: third_party/abseil-cpp/absl/numeric/CMakeFiles/int128.dir/all] Error 2 make[5]: *** [third_party/abseil-cpp/absl/time/CMakeFiles/time_zone.dir/build.make:76: third_party/abseil-cpp/absl/time/CMakeFiles/time_zone.dir/internal/cctz/src/time_zone_fixed.cc.o] Error 1 make[5]: *** BitmemiΕ iΕler iΓ§in bekliyor.... make[5]: *** [third_party/abseil-cpp/absl/time/CMakeFiles/time_zone.dir/build.make:90: third_party/abseil-cpp/absl/time/CMakeFiles/time_zone.dir/internal/cctz/src/time_zone_format.cc.o] Error 1 In file included from /cygdrive/c/Users/mehmet.basaran/Desktop/cyg32/Bear-master/build/subprojects/Source/grpc_dependency/third_party/abseil-cpp/absl/base/config.h:67, from /cygdrive/c/Users/mehmet.basaran/Desktop/cyg32/Bear-master/build/subprojects/Source/grpc_dependency/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_if.h:23, from /cygdrive/c/Users/mehmet.basaran/Desktop/cyg32/Bear-master/build/subprojects/Source/grpc_dependency/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_if.cc:15: /cygdrive/c/Users/mehmet.basaran/Desktop/cyg32/Bear-master/build/subprojects/Source/grpc_dependency/third_party/abseil-cpp/absl/base/policy_checks.h:40:2: hata: #error "Cygwin is not supported." 40 | #error "Cygwin is not supported." | ^~~~~ In file included from /cygdrive/c/Users/mehmet.basaran/Desktop/cyg32/Bear-master/build/subprojects/Source/grpc_dependency/third_party/abseil-cpp/absl/base/config.h:67, from /cygdrive/c/Users/mehmet.basaran/Desktop/cyg32/Bear-master/build/subprojects/Source/grpc_dependency/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_impl.h:21, from /cygdrive/c/Users/mehmet.basaran/Desktop/cyg32/Bear-master/build/subprojects/Source/grpc_dependency/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_impl.cc:15: /cygdrive/c/Users/mehmet.basaran/Desktop/cyg32/Bear-master/build/subprojects/Source/grpc_dependency/third_party/abseil-cpp/absl/base/policy_checks.h:40:2: hata: #error "Cygwin is not supported." 40 | #error "Cygwin is not supported." | ^~~~~ In file included from /cygdrive/c/Users/mehmet.basaran/Desktop/cyg32/Bear-master/build/subprojects/Source/grpc_dependency/third_party/abseil-cpp/absl/base/config.h:67, from /cygdrive/c/Users/mehmet.basaran/Desktop/cyg32/Bear-master/build/subprojects/Source/grpc_dependency/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_info.h:24, from /cygdrive/c/Users/mehmet.basaran/Desktop/cyg32/Bear-master/build/subprojects/Source/grpc_dependency/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_info.cc:33: /cygdrive/c/Users/mehmet.basaran/Desktop/cyg32/Bear-master/build/subprojects/Source/grpc_dependency/third_party/abseil-cpp/absl/base/policy_checks.h:40:2: hata: #error "Cygwin is not supported." 40 | #error "Cygwin is not supported." | ^~~~~ In file included from /cygdrive/c/Users/mehmet.basaran/Desktop/cyg32/Bear-master/build/subprojects/Source/grpc_dependency/third_party/abseil-cpp/absl/base/config.h:67, from /cygdrive/c/Users/mehmet.basaran/Desktop/cyg32/Bear-master/build/subprojects/Source/grpc_dependency/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_libc.h:20, from /cygdrive/c/Users/mehmet.basaran/Desktop/cyg32/Bear-master/build/subprojects/Source/grpc_dependency/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_libc.cc:19: /cygdrive/c/Users/mehmet.basaran/Desktop/cyg32/Bear-master/build/subprojects/Source/grpc_dependency/third_party/abseil-cpp/absl/base/policy_checks.h:40:2: hata: #error "Cygwin is not supported." 40 | #error "Cygwin is not supported." | ^~~~~ make[5]: *** [third_party/abseil-cpp/absl/time/CMakeFiles/time_zone.dir/build.make:104: third_party/abseil-cpp/absl/time/CMakeFiles/time_zone.dir/internal/cctz/src/time_zone_if.cc.o] Error 1 make[5]: *** [third_party/abseil-cpp/absl/time/CMakeFiles/time_zone.dir/build.make:146: third_party/abseil-cpp/absl/time/CMakeFiles/time_zone.dir/internal/cctz/src/time_zone_libc.cc.o] Error 1 make[5]: *** [third_party/abseil-cpp/absl/time/CMakeFiles/time_zone.dir/build.make:118: third_party/abseil-cpp/absl/time/CMakeFiles/time_zone.dir/internal/cctz/src/time_zone_impl.cc.o] Error 1 make[5]: *** [third_party/abseil-cpp/absl/time/CMakeFiles/time_zone.dir/build.make:132: third_party/abseil-cpp/absl/time/CMakeFiles/time_zone.dir/internal/cctz/src/time_zone_info.cc.o] Error 1 make[4]: *** [CMakeFiles/Makefile2:4246: third_party/abseil-cpp/absl/time/CMakeFiles/time_zone.dir/all] Error 2 make[3]: *** [Makefile:156: all] Error 2
As reported in the MinGW64-packages repo: https://github.com/msys2/MINGW-packages/issues/7411 and in this issue: https://github.com/rizsotto/Bear/issues/427 , Bear does currently not build on MSYS2 + MinGW64. Since that Bear repo issue is closed, I thought I open up this one to properly present info regarding this issue.
Describe the bug Building Bear in with MSYS2 and it's MinGW64 environment fails. The main culprit is the missing 'confstr'
Os.cc:49:2: error: #error "System call "confstr" not exists."
, which is apparently not present with this Unix environment.Configure log from 'cmake -G "Unix Makefiles" -DENABLE_UNIT_TESTS=OFF -DENABLE_FUNC_TESTS=OFF ..'
``` -- The C compiler identification is GNU 11.2.0 -- The CXX compiler identification is GNU 11.2.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: C:/msys64/mingw64/bin/cc.exe - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: C:/msys64/mingw64/bin/c++.exe - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Setting build type to 'Release' as none was specified. -- Looking for nlohman_json dependency -- Looking for nlohman_json dependency -- not found -- Looking for fmt dependency -- Looking for fmt dependency -- found -- Looking for spdlog dependency -- Looking for pthread.h -- Looking for pthread.h - found -- Performing Test CMAKE_HAVE_LIBC_PTHREAD -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success -- Found Threads: TRUE -- Looking for spdlog dependency -- found -- Looking for gRPC::grpc++ dependency -- Found PkgConfig: C:/msys64/mingw64/bin/pkgconf.exe (found version "1.8.0") -- Checking for modules 'protobuf>=3.11;grpc++>=1.26' -- Found protobuf, version 3.16.0.0 -- Found grpc++, version 1.35.0 -- Looking for gRPC::grpc++ dependency -- found -- Looking for protoc -- Looking for protoc -- found -- Looking for grpc_cpp_plugin -- Looking for grpc_cpp_plugin -- found -- Configuring done -- Generating done -- Build files have been written to: C:/msys64/home/Bayonetta2.0/new-horizon/lbs/Bear/build ```Here is the most important compile log, which shows the error happening:
Compile log end error from 'make'
``` [ 0%] Built target grpc_dependency [ 0%] Built target googletest_dependency [ 5%] Creating directories for 'nlohmann_json_dependency' [ 11%] Performing download step (download, verify and extract) for 'nlohmann_json_dependency' -- Downloading... dst='C:/msys64/home/Bayonetta2.0/new-horizon/lbs/Bear/build/subprojects/Download/nlohmann_json_dependency/v3.10.4.tar.gz' timeout='none' inactivity timeout='none' -- Using src='https://github.com/nlohmann/json/archive/v3.10.4.tar.gz' -- verifying file... file='C:/msys64/home/Bayonetta2.0/new-horizon/lbs/Bear/build/subprojects/Download/nlohmann_json_dependency/v3.10.4.tar.gz' -- Downloading... done -- extracting... src='C:/msys64/home/Bayonetta2.0/new-horizon/lbs/Bear/build/subprojects/Download/nlohmann_json_dependency/v3.10.4.tar.gz' dst='C:/msys64/home/Bayonetta2.0/new-horizon/lbs/Bear/build/subprojects/Source/nlohmann_json_dependency' -- extracting... [tar xfz] -- extracting... [analysis] -- extracting... [rename] -- extracting... [clean up] -- extracting... done [ 17%] No update step for 'nlohmann_json_dependency' [ 23%] No patch step for 'nlohmann_json_dependency' [ 29%] Performing configure step for 'nlohmann_json_dependency' -- nlohmann_json_dependency configure command succeeded. See also C:/msys64/home/Bayonetta2.0/new-horizon/lbs/Bear/build/subprojects/Stamp/nlohmann_json_dependency/nlohmann_json_dependency-configure-*.log [ 35%] Performing build step for 'nlohmann_json_dependency' -- nlohmann_json_dependency build command succeeded. See also C:/msys64/home/Bayonetta2.0/new-horizon/lbs/Bear/build/subprojects/Stamp/nlohmann_json_dependency/nlohmann_json_dependency-build-*.log [ 41%] Performing install step for 'nlohmann_json_dependency' -- nlohmann_json_dependency install command succeeded. See also C:/msys64/home/Bayonetta2.0/new-horizon/lbs/Bear/build/subprojects/Stamp/nlohmann_json_dependency/nlohmann_json_dependency-install-*.log [ 47%] Completed 'nlohmann_json_dependency' [ 47%] Built target nlohmann_json_dependency [ 47%] Built target fmt_dependency [ 47%] Built target spdlog_dependency [ 52%] Creating directories for 'BearSource' [ 58%] No download step for 'BearSource' [ 64%] No update step for 'BearSource' [ 70%] No patch step for 'BearSource' [ 76%] Performing configure step for 'BearSource' loading initial cache file C:/msys64/home/Bayonetta2.0/new-horizon/lbs/Bear/build/subprojects/tmp/BearSource/BearSource-cache-Release.cmake -- The C compiler identification is GNU 11.2.0 -- The CXX compiler identification is GNU 11.2.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: C:/msys64/mingw64/bin/cc.exe - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: C:/msys64/mingw64/bin/c++.exe - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Looking for pthread.h -- Looking for pthread.h - found -- Performing Test CMAKE_HAVE_LIBC_PTHREAD -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success -- Found Threads: TRUE -- Found nlohmann_json: C:/msys64/home/Bayonetta2.0/new-horizon/lbs/Bear/build/subprojects/Install/nlohmann_json_dependency/lib/cmake/nlohmann_json/nlohmann_jsonConfig.cmake (found version "3.10.4") -- Found PkgConfig: C:/msys64/mingw64/bin/pkgconf.exe (found version "1.8.0") -- Checking for modules 'protobuf;grpc++' -- Found protobuf, version 3.16.0.0 -- Found grpc++, version 1.35.0 -- Looking for spawn.h -- Looking for spawn.h - not found -- Looking for unistd.h -- Looking for unistd.h - found -- Looking for dlfcn.h -- Looking for dlfcn.h - found -- Looking for errno.h -- Looking for errno.h - found -- Looking for sys/utsname.h -- Looking for sys/utsname.h - not found -- Looking for sys/wait.h -- Looking for sys/wait.h - not found -- Looking for sys/time.h -- Looking for sys/time.h - found -- Looking for gnu/lib-names.h -- Looking for gnu/lib-names.h - not found -- Looking for _NSGetEnviron -- Looking for _NSGetEnviron - not found -- Looking for dlopen -- Looking for dlopen - not found -- Looking for dlsym -- Looking for dlsym - not found -- Looking for dlerror -- Looking for dlerror - not found -- Looking for dlclose -- Looking for dlclose - not found -- Looking for RTLD_NEXT -- Looking for RTLD_NEXT - found -- Looking for EACCES -- Looking for EACCES - found -- Looking for ENOENT -- Looking for ENOENT - found -- Looking for strerror_r -- Looking for strerror_r - not found -- Looking for environ -- Looking for environ - not found -- Looking for uname -- Looking for uname - not found -- Looking for confstr -- Looking for confstr - not found -- Looking for _CS_PATH -- Looking for _CS_PATH - not found -- Looking for _CS_GNU_LIBC_VERSION -- Looking for _CS_GNU_LIBC_VERSION - not found -- Looking for _CS_GNU_LIBPTHREAD_VERSION -- Looking for _CS_GNU_LIBPTHREAD_VERSION - not found -- Looking for protoc ... C:/msys64/mingw64/bin/protoc.exe -- Looking for grpc_cpp_plugin ... C:/msys64/mingw64/bin/grpc_cpp_plugin.exe -- Configuring done -- Generating done -- Build files have been written to: C:/msys64/home/Bayonetta2.0/new-horizon/lbs/Bear/build/subprojects/Build/BearSource [ 82%] Performing build step for 'BearSource' [ 1%] Building CXX object libflags/CMakeFiles/flags_a.dir/source/Flags.cc.obj [ 1%] Built target flags_a [ 3%] Building CXX object libshell/CMakeFiles/shell_a.dir/source/Command.cc.obj [ 3%] Built target shell_a [ 5%] Building CXX object libsys/CMakeFiles/sys_a.dir/source/Os.cc.obj C:/msys64/home/Bayonetta2.0/new-horizon/lbs/Bear/source/libsys/source/Os.cc:49:2: error: #error "System call "confstr" not exists." 49 | #error "System call "confstr" not exists." | ^~~~~ In file included from C:/msys64/mingw64/include/c++/11.2.0/cstdlib:75, from C:/msys64/mingw64/include/c++/11.2.0/bits/stl_algo.h:59, from C:/msys64/mingw64/include/c++/11.2.0/functional:65, from C:/msys64/home/Bayonetta2.0/new-horizon/lbs/Bear/source/libresult/include/libresult/Result.h:22, from C:/msys64/home/Bayonetta2.0/new-horizon/lbs/Bear/source/libsys/include/libsys/Os.h:22, from C:/msys64/home/Bayonetta2.0/new-horizon/lbs/Bear/source/libsys/source/Os.cc:20: C:/msys64/home/Bayonetta2.0/new-horizon/lbs/Bear/source/libsys/source/Guard.h:35:66: error: cannot declare pointer to 'const class std::mapFor completion sake here is the output of
env
, which shows how the MinGW64 environment is setup and the corresponding PATH variable.Full output of 'env'
``` ProgramFiles(x86)=C:\Program Files (x86) !::=::\ CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files !C:=C:\msys64 SHELL=/usr/bin/bash NUMBER_OF_PROCESSORS=16 FPS_BROWSER_USER_PROFILE_STRING=Default PROCESSOR_LEVEL=23 WD=C:\msys64\usr\bin\ TERM_PROGRAM_VERSION=3.5.2 MINGW_PREFIX=/mingw64 PKG_CONFIG_PATH=/mingw64/lib/pkgconfig:/mingw64/share/pkgconfig USERDOMAIN_ROAMINGPROFILE=BAYONETTA2 HOSTNAME=Bayonetta2 PROGRAMFILES=C:\Program Files MSYSTEM=MINGW64 PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC ORIGINAL_TEMP=/c/Users/BAYONE~1.0/AppData/Local/Temp MINGW_CHOST=x86_64-w64-mingw32 OS=Windows_NT HOMEDRIVE=C: INTEL_DEV_REDIST=C:\Program Files (x86)\Common Files\Intel\Shared Libraries\ MSYSTEM_CARCH=x86_64 USERDOMAIN=BAYONETTA2 PWD=/home/Bayonetta2.0/new-horizon/lbs/Bear/build USERPROFILE=C:\Users\Bayonetta2.0 MANPATH=/mingw64/local/man:/mingw64/share/man:/usr/local/man:/usr/share/man:/usr/man:/share/man PRINTER=Xerox Phaser 3250 PS TZ=Europe/Berlin MINGW_PACKAGE_PREFIX=mingw-w64-x86_64 tmp=C:\Users\BAYONE~1.0\AppData\Local\Temp ALLUSERSPROFILE=C:\ProgramData ORIGINAL_PATH=/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/ CommonProgramW6432=C:\Program Files\Common Files HOME=/home/Bayonetta2.0 USERNAME=Bayonetta2.0 VBOX_MSI_INSTALL_PATH=C:\Program Files\Oracle\VirtualBox\ OneDrive=C:\Users\Bayonetta2.0\OneDrive COMSPEC=C:\WINDOWS\system32\cmd.exe ADSK_CLM_WPAD_PROXY_CHECK=FALSE ADSK_3DSMAX_x64_2019=C:\Program Files\Autodesk\3ds Max 2019\ APPDATA=C:\Users\Bayonetta2.0\AppData\Roaming SYSTEMROOT=C:\WINDOWS LOCALAPPDATA=C:\Users\Bayonetta2.0\AppData\Local PROMPT=$P$G COMPUTERNAME=BAYONETTA2 INFOPATH=/usr/local/info:/usr/share/info:/usr/info:/share/info TERM=xterm LOGONSERVER=\\BAYONETTA2 ACLOCAL_PATH=/mingw64/share/aclocal:/usr/share/aclocal USER=Bayonetta2.0 PSModulePath=C:\Program Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules TEMP=/tmp temp=C:\Users\BAYONE~1.0\AppData\Local\Temp MSYSTEM_CHOST=x86_64-w64-mingw32 ORIGINAL_TMP=/c/Users/BAYONE~1.0/AppData/Local/Temp SHLVL=1 PROCESSOR_REVISION=0802 DriverData=C:\Windows\System32\Drivers\DriverData VBOX_HWVIRTEX_IGNORE_SVM_IN_USE=1 COMMONPROGRAMFILES=C:\Program Files\Common Files CONICON=mingw64.ico MOZ_PLUGIN_PATH=C:\Program Files (x86)\Foxit Software\Foxit Reader\plugins\ LC_CTYPE=en_GB.UTF-8 PROCESSOR_IDENTIFIER=AMD64 Family 23 Model 8 Stepping 2, AuthenticAMD SESSIONNAME=Console PS1=\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[35m\]$MSYSTEM\[\e[0m\] \[\e[33m\]\w\[\e[0m\]\n\$ HOMEPATH=\Users\Bayonetta2.0 XDG_DATA_DIRS=/mingw64/share/:/usr/local/share/:/usr/share/ MSYSCON=mintty.exe TMP=/tmp CONFIG_SITE=/etc/config.site PATH=/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl ProgramW6432=C:\Program Files MSYSTEM_PREFIX=/mingw64 LOGINSHELL=bash CONTITLE=MinGW x64 MIC_LD_LIBRARY_PATH=C:\Program Files (x86)\Common Files\Intel\Shared Libraries\compiler\lib\mic WINDIR=C:\WINDOWS FPS_BROWSER_APP_PROFILE_STRING=Internet Explorer PROCESSOR_ARCHITECTURE=AMD64 PUBLIC=C:\Users\Public SYSTEMDRIVE=C: OLDPWD=/home/Bayonetta2.0/new-horizon/lbs/Bear TERM_PROGRAM=mintty ProgramData=C:\ProgramData _=/usr/bin/env ```To Reproduce Install MSYS2 and the GNU Toolchain
mingw-w64-x86_64-toolchain
via pacman. Open up the MinGW64 environment, via the "MSYS2 MinGW 64-bit" shortcut. Try to compile Bear.Environment:
I'm happy to quickly test any suggested solution.