cquery icon indicating copy to clipboard operation
cquery copied to clipboard

No Clang archive url specified for current platform (CYGWIN)

Open mlangiu opened this issue 7 years ago • 7 comments

Couldn't build cquery on Windows 10 via cygwin b/c of the above error message. Filing issue as requested in cmake output

mlangiu avatar Aug 14 '18 06:08 mlangiu

I'm not super familiar with cygwin. Does it use the same program binaries that a normal Windows installation uses?

DaanDeMeyer avatar Aug 14 '18 10:08 DaanDeMeyer

As far as I know, it doesn't. Otherwise, ycmd would work on cygwin.

bstaletic avatar Aug 14 '18 10:08 bstaletic

@mlangiu Could you test if cquery works with a system installation of Clang? I'd like to know if cquery works on cygwin at all before adding clang download support for cygwin to cmake.

Instructions for building with system clang can be found here

DaanDeMeyer avatar Aug 14 '18 17:08 DaanDeMeyer

I did, here's the output

 $ cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=release -DCMAKE_EXPORT_COMPILE_COMMANDS=YES -DSYSTEM_CLANG=ON
-- The CXX compiler identification is GNU 7.3.0
-- Check for working CXX compiler: /usr/bin/c++.exe
-- Check for working CXX compiler: /usr/bin/c++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Using system Clang
-- The C compiler identification is GNU 7.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Looking for pipe2
-- Looking for pipe2 - found
-- Could NOT find Clang: Found unsuitable version "5.0.1", but required is at least "6.0.0" (found _libclang_LIBRARY-NOTFOUND)
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE
-- Configuring done
CMake Error at CMakeLists.txt:17 (add_executable):
  Target "cquery" links to target "Clang::Clang" but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?


-- Generating done
-- Build files have been written to: /cygdrive/c/Users/m.langiu/sciebo/IEK-10/cquery/clang_build

It looks like it's not happy about my clang version, but in the near future I probably won't find the time to set up and compile a newer clang version, since it seems tu be quite a hustle to get it right...

Any other suggestions?

mlangiu avatar Aug 15 '18 07:08 mlangiu

cquery should still work with older clang versions but it seems CMake can't find libclang.so. Can you verify libclang.so is available?

You can also try editing cmake/DownloadAndExtractClang.cmake to add support for downloading for cygwin. It should be sufficient to add OR ${CMAKE_SYSTEM_NAME} STREQUAL Cygwin to the if statement at the start of the file that sets the archive name required by cygwin. I have no idea if any of the official binaries released by LLVM work on Cygwin however.

DaanDeMeyer avatar Aug 15 '18 08:08 DaanDeMeyer

cquery should still work with older clang versions

There are some deal-breaking bugs with anything lower than 6.0.0 though, e.g. #488.

but it seems CMake can't find libclang.so.

I think it did find it judging by Found unsuitable version "5.0.1".

jhasse avatar Aug 15 '18 13:08 jhasse

It's followed by found _libclang_LIBRARY-NOTFOUND however. It might be a bug in FindClang.cmake. I'll need to update it to provide a clearer error.

DaanDeMeyer avatar Aug 15 '18 14:08 DaanDeMeyer