neovim / neovim

Vim-fork focused on extensibility and usability
https://neovim.io
Other
83.34k stars 5.7k forks source link

make install does not work with cmake 3.13 / 3.14 #30756

Open ImNotaGit opened 1 month ago

ImNotaGit commented 1 month ago

Problem

I tried to build and install v0.10.2 (tags/v0.10.2) from source with gcc/10.3.0 and cmake/3.13.4 on CentOS.

There was no error. But in the end of make install there was a warning message WARNING: Target "nvim_bin" has EXCLUDE_FROM_ALL set and will not be built by default but an install rule has been provided for it. CMake does not define behavior for this case., and it appeared that the install did not complete. In the end $HOME/neovim is not present.

BTW I used exactly the same process and dependencies to build v0.9.2 without any issue.

Steps to reproduce

git clone https://github.com/neovim/neovim.git 
cd neovim
git checkout tags/v0.10.2
make CMAKE_BUILD_TYPE=RelWithDebInfo CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX=$HOME/neovim"
make install

Expected behavior

I expect the install to complete with the files installed to the specified destination.

Nvim version (nvim -v)

tags/v0.10.2

Vim (not Nvim) behaves the same?

NA

Operating system/version

CentOS

Terminal name/version

NA

$TERM environment variable

xterm-256color

Installation

build from repo

dundargoc commented 1 month ago

I can't recreate this, neither on macos or on centos docker container. I wonder if this might be related to the cmake version somehow. Do you have the possibility to try out a newer cmake version? It would really help in pinpointing the problem I think.

dundargoc commented 1 month ago

Also, could you link to the full build/install logs in a gist or something? I'd like to see what actually happens.

ImNotaGit commented 1 month ago

I can't recreate this, neither on macos or on centos docker container. I wonder if this might be related to the cmake version somehow. Do you have the possibility to try out a newer cmake version? It would really help in pinpointing the problem I think.

cmake/3.13.4 is the newest version available on our system... I'm afraid it will be hard for me to get a newer version... sorry.

Also, could you link to the full build/install logs in a gist or something? I'd like to see what actually happens.

Sure, please find it here: https://gist.github.com/ImNotaGit/4121920dccd6e6a8a3f094f63e708860 This gist contains output (i.e. the messages printed to stdout) from make and make install, as well as the CMakeOutput.log and CMakeError.log. It turned out that CMakeError.log does include some errors (which I cannot decipher), but they were not shown during make or make install (both of which did reach 100% w/o displaying any error).

justinmk commented 1 month ago

I'm afraid it will be hard for me to get a newer version... sorry.

https://cmake.org/download/ has a single .sh script that you can curl onto most linux systems and it will just work. Why doesn't that work?

ImNotaGit commented 1 month ago

I'm afraid it will be hard for me to get a newer version... sorry.

https://cmake.org/download/ has a single .sh script that you can curl onto most linux systems and it will just work. Why doesn't that work?

Ahh... a while ago I tried downloading the latest cmake binary at that time and it didn't run for some reason. But given your comment I tried again with the current latest version (3.30.5), it worked! Sorry for jumping to conclusions without trying.

So, build install Neovim v0.10.2 worked with the latest cmake-3.30.5. I thought that the version I used before (3.13.4) should work since in BUILD.md it was written that only cmake 3.13+ is needed. You can close this issue unless you want to investigate the compatibility issue with cmake-3.13.4. But maybe please do update BUILD.md. Thank you again.

wookayin commented 1 month ago

For reference, neovim 0.10 requires CMake 3.13+ (#25638), CI also uses CMake 3.13.0 (see https://github.com/neovim/neovim/blob/v0.10.2/.github/workflows/build.yml#L25), so building 0.10.2 should work well with CMake 3.13.

michaelrommel commented 6 days ago

For reference, neovim 0.10 requires CMake 3.13+ (#25638), CI also uses CMake 3.13.0 (see https://github.com/neovim/neovim/blob/v0.10.2/.github/workflows/build.yml#L25), so building 0.10.2 should work well with CMake 3.13.

I have a Debian Buster system and it does NOT work with 3.13.4.

justinmk commented 6 days ago

@michaelrommel can you try the install script (it can target a local directory, just make sure that dir is in $PATH so that Nvim's Makefile can find it), or a slightly later cmake version, so we can decide if we need to bump the minimum required cmake version in our docs.

michaelrommel commented 6 days ago

I already used the official cmake install sh script and installed version 3.31.0. With that the neovim install works as before. I just wanted to report that 3.13.4 that comes with Debian Buster per default is not sufficient. I do not have a problem. I just would recommend revisiting the docs and adding a hint or so.

Also: the CI install uses different cmd line arguments. I used both ones from the docs with CMAKE_BUILD_TYPE=RelWithDebInfo and with CMAKE_BUILD_TYPE=Release and CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX=/root/software/neovim"

I am now installing 3.13.4 and 3.13.5 via the official sh script. Let me try both.

michaelrommel commented 6 days ago

Nope, 3.13.4 is not working with this commandline: make CMAKE_BUILD_TYPE=RelWithDebInfo CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX=/root/software/neovim"

3.13.5 is also not working. Same error, no install directoy created.

Version 3.14:

neovim_src> make install
mkdir -p ".deps"
/usr/bin/cmake -S /root/software/neovim_src//cmake.deps -B ".deps" -G "Ninja"
-- Found GNU Make at /usr/bin/make
-- CMAKE_BUILD_TYPE=Release
-- Configuring done
-- Generating done
-- Build files have been written to: /root/software/neovim_src/.deps
mkdir -p build
touch "build/.ran-deps-cmake"
/usr/bin/cmake --build ".deps"
ninja: no work to do.
/usr/bin/cmake --build build
[0/2] Re-checking globbed directories...
[41/41] Generating zh_CN.UTF-8.mo
/usr/bin/cmake --install build
-- Found GNU Make at /usr/bin/make
-- CMAKE_INSTALL_PREFIX=/root/software/neovim
-- CMAKE_BUILD_TYPE=Release
-- Using Lua interpreter: /root/software/neovim_src/.deps/usr/bin/luajit
-- Using Lua interpreter for code generation: /root/software/neovim_src/.deps/usr/bin/luajit
-- Using Lua compiler: /root/software/neovim_src/.deps/usr/bin/luajit -b -s %s -
-- main_lib props '/root/software/neovim_src/.deps/usr/include/luajit-2.1;/root/software/neovim_src/.deps/usr/include;/root/software/neovim_src/build/src/nvim/auto;/root/software/neovim_src/build/include;/root/software/neovim_src/build/cmake.config;/root/software/neovim_src/src'
-- nlua0 props '/root/software/neovim_src/.deps/usr/include/luajit-2.1;/root/software/neovim_src/src;/root/software/neovim_src/build/cmake.config;/root/software/neovim_src/build/include'
-- iconv props '/usr/include'
-- libuv props '/root/software/neovim_src/.deps/usr/include'
-- libvterm props '/root/software/neovim_src/.deps/usr/include'
-- msgpack props '/root/software/neovim_src/.deps/usr/include'
-- treesitter props '/root/software/neovim_src/.deps/usr/include'
-- unibilium props '/root/software/neovim_src/.deps/usr/include'
-- libintl props '/usr/include'
-- Configuring done
-- Generating done
-- Build files have been written to: /root/software/neovim_src/build
neovim_src> ls -la /root/software/neovim
ls: cannot access '/root/software/neovim': No such file or directory

Version: 3.31.0

neovim_src> make install
mkdir -p ".deps"
/usr/bin/cmake -S /root/software/neovim_src//cmake.deps -B ".deps" -G "Ninja"
-- Found GNU Make at /usr/bin/make
-- CMAKE_BUILD_TYPE=Release
-- Configuring done (0.3s)
-- Generating done (0.0s)
-- Build files have been written to: /root/software/neovim_src/.deps
mkdir -p build
touch "build/.ran-deps-cmake"
/usr/bin/cmake --build ".deps"
ninja: no work to do.
/usr/bin/cmake --build build
[0/2] Re-checking globbed directories...
[2/137] cd /root/software/neovim_src/build/src/nvim && /root/cmake-3.14.0...tware/neovim_src -P /root/software/neovim_src/cmake/GenerateVersion.cmake
/usr/bin/cmake --install build
-- Install configuration: "Release"
neovim_src> ls -la /root/software/neovim
total 20
drwxr-xr-x 5 root root 4096 Nov 10 22:06 .
drwxr-xr-x 8 root root 4096 Nov 10 22:06 ..
drwxr-xr-x 2 root root 4096 Nov 10 22:06 bin
drwxr-xr-x 3 root root 4096 Nov 10 22:06 lib
drwxr-xr-x 7 root root 4096 Nov 10 22:06 share

I did not check further versions. Maybe just write that an error like the one mentioned or a missing install directoy hints at an outdated cmake version. Please note, that in the 3.14 install not even an error was visible. It just did not work...

Between the tests I did a make clean. Maybe this is not sufficient, because in the last output I saw still a reference to the cmake-3.14 directory from the previous run. But that worked just fine.