-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmake fails on fedora 38 (missing: LUV_INCLUDE_DIR) #23898
Comments
I am currently working on a patch. over at https://github.com/CJ-Systems/neovim/tree/NoDepsFedora I have been able to resolve the main issue as cmake is now able to complete. However ninja fails with the following: /usr/bin/ld: cannot find -lluv: No such file or directory |
Same problem as #23395 (comment). We can do the same workaround as that issue, but I think it'd be more correct to contact the luv packager for fedora and ask them to build it with SONAME. |
@cryptomilk are you the luv packager for fedora? Would you mind taking a look at this and see if luv can be built with SONAME? |
a) I don't see what the INCLUDE_DIR has to do with the SONAME Also on x86_64 Fedora you want to use |
a) I was referring to OP's latest comment, the warning
I don't understand why this is relevant tbh, did a quick skim of the thread and luajit wasn't mentioned. |
@cryptomilk for me using -DLUV_LIBRARY="path to luv.so" has no effect on the output of cmake. I still have to manually edit the generated build ninja and apply the "hack" I've tried both libjt/2.1/luv.so and lua/5.1/luv.so and still get -lluv in my build.ninja. While looking through the cmake docs I found cmake policies CMP0060 Link libraries by full path even in implicit directories. and CMP0003 Libraries linked via full path no longer produce linker search paths.. I'm wondering if one of these might apply in this case? Based on #10407 using -DLUV_LIBRARY:STRING=-Wl,/usr/lib64/lua/5.1/luv.so allows ninja and ld to complete. |
I've submitted #23909 for review. I've considered changing the base Makefile to allow for a fedora option. Not sure it this would be appropriate considering Ubuntu had a similar issue with finding luv.so. |
CMP0060 states:
It doesn't look like it is doing that, it converts it to |
I submitted an issue to cmake. Was able to find link_directories not working correctly in CMake 3.18.0 from two years ago. In that resolution the ordering was backward for add_executable and link_directories so I'm not sure if that would apply here. looking in my pkgconfig there is no file for luv. Could this be the root cause of the issue since I am able to build with -DUSE_BUNDLED=OFF -DUSE_BUNDLED_LUV=ON when I run cmake in .deps? |
No. I've already specified the root cause, which is that fedora shared libraries doesn't have a SONAME and that cmake can't consistently find shared libraries without a SONAME. See https://gitlab.kitware.com/cmake/cmake/-/issues/22703. |
Why are you running these steps at all? If you're not going to use the bundled deps, then just build nvim.
FWIW, what I do in Debian is:
Neovim isn't dynamically linking against libluv. It's using the luv Lua module, whose loading is handled by Lua's No changes are required to Neovim's build system to fix this build issue. #23909 shouldn't be necessary. |
If they are meant to be linked using
For reference, that is CMake Issue 24973. However, this is not a CMake bug AFAICT.
It is not a bug in CMake. If CMake detects that the library file does not have any However, as discussed above, CMake should not be told to link anything to |
At the time I thought it was needed to perform those steps. I've never claimed to be a developer or expert in programming. Just an old-school true hacker that enjoys figuring things out.
When building ninja from a fresh clone on master using cmake ../cmake.deps/ -DUSE_BUNDLED=OFF -DUSE_BUNDLED_LUV=ON as per the example for DEB 10 then running cmake .. -G Ninija in build the output from a grep -l luv of build.nija is this running a cmake .. -G Ninja from build for no depends with only my fixes in FindLuv.cmake applied as I have to use those other wise cmake fails to find luv at all. The output from grep -i luv is this Clearly in both cases ld is linking to luv either the static in the case of using the bundled depends or shared when using no bundled depends. My initial fix to get this to work as I stated in my update post was to manually edit the generated build.ninja and change the -lluv to path to lib.so as this is the same thing that the package maintainer for neovim on fedora was having to do. |
@bradking well, as it so happens
This brings us to the heart of the matter. Many package maintainers seem convinced that SONAME should not be needed. Cmake seem convinced that SONAME is needed. The result is that neovim (and other software) end up needing to mediate this discrepancy. The best workaround so far has been to define the library as an unknown imported library to force cmake to use the full path. I was hoping we (as in fedora, cmake and neovim) could come up with a better long-term solution. |
I've submitted 2212583 for lua-luv to see if we can at least get the fedora maintainer to build with soname. |
Yes, I was mistaken. I had forgotten that Neovim uses luv directly in the C code, too. Debian has a common infrastructure for building Lua modules, which completely ignores any upstream buildsystem. :) We set our own SONAME in the resulting objects so multiple builds for different Lua versions can be co-installed. For example, we set SONAME to I don't think this process is well defined in the general Lua ecosystem, which is why Debian took the approach it did. |
I do apologize if my reply seem overly harsh. I meant no offense. |
None taken. :) I was confidently wrong and should have double checked what I was stating, especially since I've been a bit out of touch with the project lately. |
New builds of libluv and libluv-devel are now available for fedora rawhide. I can confirm installing libluv and libluv-devel 1.44.2.1-3.fc39 resolves this issue with out the need for any workarounds or hacks. |
This specific issue may have been solved, but the root problem still exists. It's only a matter of time until a clone of this issue pops up (since it has popped up time and time again before). As I see it there is roughly three different routes we can take: A) Accept the status quo as is. This will imply that building lua shared libraries as B) Fix the problem on package maintainers side. This would mean convincing them that they need to add SONAME on all lua shared libraries. Another approach could maybe be that they create duplicates/symlinks, one of them names C) Fix the problem on the cmake side. This would mean that we need to convince them that the current situation is a problem and of an appropriate solution/workaround. I have a few ideas in mind, but I am not sure which would be the best. I am thinking one approach would be to expand the fallback mechanism of cmake to search both I think for now option A will suffice, but I'm writing my thoughts when they're still fresh for the next time this problem show up. |
You should actually build a libluv.so library which then is used by the luv module. They way you can link against it correctly. That's what I've done in the Fedora package now.
|
If a Otherwise, an imported target with @cryptomilk's approach looks like the correct solution to me. It provides both a |
Ok at this point in time I'm a little confused on if this has been resolved or not at least when building nvim on fedora with no bundled dependencies. Before I submitted a bug report to fedora asking for libluv to be built with soname in my /lib64 there was no reference to libluv and also in /lib64/pkgconfig there was no libluv.pc. Which to my my understanding was what was causing the build to fail. Simply put. After I had submitted the report and the package maintainer updated libluv and libluv-devel I installed the packages for fc39 / rawhide as I had not received this update yet. I performed a fresh clone of nvim and attemted a cmake .. -DCMAKE_BUILD_TYPE=Release -G Ninja. When I performed a grep -l luv.so On LINK_LIBRARIES /usr/lib64/libluv.so was present. running ninja was able to bulid nvim. The only "error" that I was still receiving before updating my libluv packages and after was Could NOT find libuv (missing: libuv_DIR) In reference to #23938 my understanding is the OS-specific code for Ubuntu was added so Github Actions could be used based on this comment on my pr #23909 |
@ChrisJStone if neovim builds fine for you then you can consider your issue solved, I just hijacked this issue to be a discussion about a larger problem. |
Problem
When attempting to build neovim on Fedora 38 using -DUSE_BUNDLED=OFF as per steps outlined in https://github.com/neovim/neovim/wiki/Building-Neovim I receive the following output
-- The C compiler identification is GNU 13.1.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Found GNU Make at /usr/bin/gmake
-- CMAKE_INSTALL_PREFIX=/usr/local
-- CMAKE_BUILD_TYPE not specified, default is 'Debug'
-- Using Lua interpreter: /usr/bin/luajit
-- Using Lua interpreter for code generation: /usr/bin/luajit
-- Using Lua compiler: /usr/bin/luajit -b -s %s -
-- Could NOT find libuv (missing: libuv_DIR)
-- Looking for dlopen in dl
-- Looking for dlopen in dl - found
-- Looking for kstat_lookup in kstat
-- Looking for kstat_lookup in kstat - not found
-- Looking for kvm_open in kvm
-- Looking for kvm_open in kvm - not found
-- Looking for gethostbyname in nsl
-- Looking for gethostbyname in nsl - not found
-- Looking for perfstat_cpu in perfstat
-- Looking for perfstat_cpu in perfstat - not found
-- Looking for clock_gettime in rt
-- Looking for clock_gettime in rt - found
-- Looking for sendfile in sendfile
-- Looking for sendfile in sendfile - not found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Found Libuv: /usr/lib64/libuv.so (Required is at least version "1.28.0")
CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find Luv (missing: LUV_INCLUDE_DIR) (Required is at least version
"1.43.0")
Call Stack (most recent call first):
/usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
cmake/FindLuv.cmake:12 (find_package_handle_standard_args)
src/nvim/CMakeLists.txt:24 (find_package)
Steps to reproduce
mkdir .deps
cd .deps
cmake ../
cmake ../cmake.deps/ -DUSE_BUNDLED=OFF -DCMAKE_BUILD_TYPE=Release -G Ninja
ninja
cd ..
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -G Ninja
Expected behavior
cmake should complete so I can run ninja to build nvim
Neovim version (nvim -v)
master branch
Vim (not Nvim) behaves the same?
not applicable
Operating system/version
Fedora 38
Terminal name/version
Kitty 0.28.1
$TERM environment variable
xterm-kitty
Installation
build from repo master branch
The text was updated successfully, but these errors were encountered: