WSL: cmake fails horribly (cause found)
To repeat and see for yourself:
sudo add-apt-repository ppa:george-edison55/cmake-3.x
sudo apt-get update
sudo aptitude install cmake
touch CMakeLists.txt
cmake .
You should see something like:
-- The C compiler identification is unknown
CMake Error at /usr/share/cmake-3.2/Modules/CMakeDetermineCCompiler.cmake:172 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
-- The CXX compiler identification is unknown
CMake Error at /usr/share/cmake-3.2/Modules/CMakeDetermineCXXCompiler.cmake:170 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
-- Check for working C compiler: /usr/bin/cc
CMake Error at /usr/share/cmake-3.2/Modules/CMakeTestCCompiler.cmake:47 (try_compile):
Unknown extension ".c" for file
/home/ned/test/CMakeFiles/CMakeTmp/testCCompiler.c
try_compile() works only for enabled languages. Currently these are:
C CXX
See project() command to enable other languages.
Call Stack (most recent call first):
-- Check for working C compiler: /usr/bin/cc -- broken
CMake Error at /usr/share/cmake-3.2/Modules/CMakeTestCCompiler.cmake:61 (message):
The C compiler "/usr/bin/cc" is not able to compile a simple test program.
It fails with the following output:
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
-- Configuring incomplete, errors occurred!
See also "/home/ned/test/CMakeFiles/CMakeOutput.log".
See also "/home/ned/test/CMakeFiles/CMakeError.log".
The cause appears to be that cmake doesn’t write anything into the CMakeFiles/3.2.2/CompilerIdC/CMakeCCompilerId.c file, and so when trying to invoke the compiler on said file the compiler sees an empty file.
Scanning through the cmake source code and it’s using either the C++ STL iostreams or C fopen(), not calling open() directly. I therefore ask a silly question: is your syscall translation layer doing something weird with file open flags?
I ask because cmake appears to write to files using fopen(“a+b”), so if your syscall translation layer were bugged in converting that to NtCreateFile(), that might explain things. Or it might be something else entirely, either way you have an easy repo case here.
A huge thank you for this layer though. Once you get this and /dev/pty working so I can use VS2015’s remote GDB debugging over SSH, this subsystem is a killer app for me for Windows 10. A huge time saver.
About this issue
- Original URL
- State: closed
- Created 10 years ago
- Comments: 28 (13 by maintainers)
@Manouchehri sshing into the WSL now works, and you can add the WSL to VS2015’s Linux project extension as a target. However launching a debug session fails for a non obvious reason (VS2015’s MIDebug engine is not ideal in terms of reporting causes of problems).
I’m going to try Linux Eclipse via xming next. If that works, great, if not then Windows Eclipse via gdbserver should work just fine, after all it works fine when debugging programs running on Android.
You can’t use openssh-server because the subsystem does not allow chroot(), so instead use use dropbear:
In putty on Windows SSH to localhost:22, enter your username and password and you get:
Dropbear prints this:
Contents of /dev directory:
I’m on Windows build 14342, slow path.
@Manouchehri You can’t start a SSH session without a working /dev/pts, so VS2015’s remote GDB support is not viable (it tunnels GDB over SSH)