Neovim QT was originally bundled on Windows as a response to the then
lackluster terminal options. The situation has dramatically changed,
with viable options such as Windows terminal, Alacritty and Wezterm to
name a few. The Windows build no longer needs this special treatment for
neovim to be usable.
Pros:
- Release builds will be smaller.
- Less maintenance burden.
- Clearer separation of responsibility (neovim issues go to the neovim
repo and neovim-qt issues to the neovim-qt repo).
- More consistent treatment between platforms.
Cons:
- Users who've come to expect neovim-qt to be bundled with nvim will
need to adjust and download neovim-qt from
https://github.com/equalsraf/neovim-qt instead.
- Similarly, build scripts will need to be adjusted to reflect this
change.
Closes https://github.com/neovim/neovim/issues/21209.
libvterm v0.3 supports reflow of terminal buffer when Nvim is resized
Since v0.3 is now a required dependency, enable it by default to find
(and fix) possible issues.
Note: Neovim's scrollback buffer does not support reflow (yet), so lines
vanishing into the buffer due to a too small window will be restored
without reflow.
Uncrustify is sensitive to version changes, which causes friction for
contributors that doesn't have that exact version. It's also simpler to
download and install the correct version than to have bespoke version
checking.
- Simplify error checking when using execute_process.
- Set BUILD_SHARED_LIBS to OFF when building dependencies.
This is normally not needed, but msgpack interprets an unset
BUILD_SHARED_LIBS to build a shared library, which is the opposite of
the cmake behavior.
- Move function check_lua_module to Util.cmake.
- Remove unnecessary code.
- Make variable naming more consistent
Cmake won't rebuild with the new URL when bumping dependency version.
This is because the old URL is still cached, and won't be removed
automatically. The workaround for using non-cached variables, but also
let users specify an alternative URL is to only set the defined
variables in deps.txt if the corresponding variable hasn't already been
set by the user from the command line.
Also apply the CMAKE_CONFIFGURE_DEPENDS property to deps.txt, as we want
cmake to rebuild when changing this file.
The previous logic made it possible to install bundled luarocks, but
also use external rocks, making the luarocks installation unnecessary.
Instead, let's assume that if the user wants to use the bundled
luarocks, then they also want to use it to install necessary rocks.
Problem: Lpeg requires Lua headers. Currently the include directories
for Lpeg are set only to the bundled deps folder, so if the user wants
to use system Lua/Luajit, Lpeg will not find the system headers and will
fail to build.
Solution: Add system Lua/Luajit include directories when USE_BUNDLED_LUA
and USE_BUNDLED_LUAJIT are turned off.
Fixes#23469
The cmake.deps build will read this file and set the left part of the
text as the variable name and the right part as the variable value. The
benefit of doing this is that it becomes much easier to parse which
dependencies are required, as well as to bump dependencies with
scripts/bump_deps.lua.
Adjust bump_deps.lua script to work with this new format.
The shipped versions of xdiff already does everything diff does, so this
duplication of tools isn't necessary. Furthermore, this setup is more
consistent overall, as the 'diffopt=external' option should be for
external programs rather than programs we bundle neovim with.
Install diffutils for oldtests in CI to avoid needing to modify tests.
- Remove unused function argument from GetBinaryDeps
- Remove unused variable LUA_LOAD_PACKAGE_MODULE_SOURCE
- Add LUA_FS_MODULE_SOURCE as a dependency of VIM_MODULE_FILE
The function keeps track of the previously installed rock, meaning we no
longer need to manually keep track of the dependency chain. This will
make adding or removing rocks much easier.
Currently, the release build picks up headers in
`/Library/Frameworks/Mono.framework/Headers`. You can verify this by
downloading the latest nightly build and checking the output of `nvim
--version`.
These headers are likely to be from a different version of `libintl` than the
one we link to. Let's avoid usage of them by setting `CMAKE_FIND_FRAMEWORK` to
`NEVER`.
Follow-up to eb1da498d6. The workaround in
that case only works if md5sum is in users path. We work around this by
adding the directory with the md5sum shipped with luarocks to PATH.
Co-authored-by: erw7 <erw7.github@gmail.com>
Problem: tree-sitter-viml parser was not maintained and missing a
release, making it difficult for distros to package Neovim.
Solution: fork the parser under the neovim org, merge some outstanding
PRs, perform general cleanup, make a release, and use this for the
build.
Problem: www.leonerd.org.uk is sometimes unreachable
Solution: switch to Launchpad URLs for libvterm (official page) and
libtermkey (source mirror for Ubuntu package)
The wintools executables are stored in a zip file, making it
inconvenient to bump these during releases. Instead, unpack the
executables in the deps repository and download each executable
separately.
Older gcc versions (4.x) require passing --std=c99 compiler flag to
prevent warnings from being emitted. Instead of setting it for each
dependency, it's easier to just pass the CMAKE_C_STANDARD flag to all
dependencies. This also prevents the scenario of us forgetting to set it
if we add new dependencies.
Neovim and the generated headers needs to use the same include
directories to build correctly. However, we need to generate headers
before all target dependencies has been resolved, meaning that we cannot
rely on any target to determine the final list of include directories.
This may lead to a problems when bundling some, but not all or none,
dependencies as the dependency include directory won't be included.
Also remove the dependency path options as this assumes a specific
structure on the dependency build directory.
Problem:
When building with gcc 4.9.2, tree-sitter throws warning: "for loop initial
declarations are only allowed in C99 or C11 mode"
Solution:
set CMAKE_C_STANDARD option to 99
Since 0007aa50bd the build unsets all URL
variable immediately when USE_EXISTING_SRC_DIR is TRUE, which is
correct. However, this causes the function BuildTSParser to break down
as cmake functions aren't traditionally equipped to deal with empty
variables. Using cmake_parse_arguments fixes this issue.
We provide options such as "DEPS_BIN_DIR" for the user to set, but only
sometimes use them. This makes binaries and other files to be spread out
if the user defines a custom DEPS_BIN_DIR location.
* Remove C++ requirement if test is disabled
* Change CMake package name of C library to msgpack-c
* Unified all C package, library, cmake, tarball name become msgpack-c.
This will reduce required boilerplate, but more importantly it will
automatically unset variables ending on URL. This will help people
needing to avoid to unset the URL variable each time a new dependency is
added.
It is possible that this may remove a non-download variable ending on
"URL" in the future, however, the risk of this is likely much lower than
the risk of someone forgetting to unset the variable.
- Remove unused code
- Use consistent casing. Variable names such as LibLuV_LIBRARIES is
needlessly jarring, even if the name might be technically correct.
- Use title casing for packages. find_package(unibilium) requires the
find_module to be named "Findunibilium.cmake", which makes it harder
to spot when scanning the files. Instead, use "Unibilium".
Previously, all targets were connected in one main target called
third-party in order to remove any potentially conflicting shared
library. We can make each dependency target independent of each other by
only removing shared libraries from luajit and msgpack in their own
targets, as only these has unwanted shared libraries.
Eliminates lua-client and non-static libluv as test time dependencies
Note: the API for a public lua-client is not yet finished.
The interface needs to be adjusted to work in the embedded loop
of a nvim instance (to use it to talk between instances)
This makes it easier to see that -D is referring to the entire
"<variable>=<value>", rather than only <variable>. It also help syntax
highlighters highlight built-in variables.
Also remove Libvterm-tbl2inc_c.cmake as it's not required. It's used to
generate files that are already provided by the Libvterm project by
default. It's also not really something we need to concern ourselves
with as it's more of an authoring tool for the Libvterm creator as
mentioned in
https://github.com/neovim/neovim/pull/21986#issuecomment-1403733054.
There are a number of cmake variables and cache variables that need to
be passed to all dependencies. This is not only cumbersome, but also
fragile as it's easy to miss adding or removing a flag from a dependency
by accident. Introducing a global variable that controls all builds
makes it much easier to handle our dependencies.
Also fixes the currently broken release workflow as we need to pass the
CMAKE_OSX_ARCHITECTURES variable to all dependencies built with cmake.
It's simpler to let cmake figure out what flags to add to each platforms
to create position independent code rather than handling it ourselves.
Also remove code that sets POSITION_INDEPENDENT_CODE property on SHARED
and MODULE libraries, as it's already on by default.
* build: various cmake refactors and simplifications
- Add STATUS keyword to message to ensure messages are shown in the
correct order.
- Remove DEPS_CXX_COMPILER as we don't rely on C++ for any of our
dependencies.
- Simplify how msgpack and luv configure options are constructed.
- Rely on the default installation for luv instead of manually passing
configure, build and install commands.
- Simplify return code conditional.
* build: remove CMAKE_OSX_ARCHITECTURES_ALT_SEP workaround
CMAKE_OSX_ARCHITECTURES_ALT_SEP was defined as a workaround to prevent
the shell from interpreting `;`, which CMake uses as a list separator.
However, the same thing can be achieved by instead passing
CMAKE_OSX_ARCHITECTURES as a cache variable instead, which is a more
idiomatic way of achieving the same thing.
* build: define CMAKE_BUILD_TYPE before adding it to BUILD_TYPE_STRING
The problem with the current setup is that CMAKE_BUILD_TYPE is defined
after BUILD_TYPE_STRING. BUILD_TYPE_STRING will then be empty on the
first run, meaning that dependencies are built without a build type.
However, since CMAKE_BUILD_TYPE is a cache variable its value will
persist in subsequent runs. On the second run BUILD_TYPE_STRING will
have the correct value, but it's a different value from the ones the
dependencies were built with. This will force some dependencies to be
built again.
Fixes https://github.com/neovim/neovim/issues/21672.
Included patches:
821. By Paul "LeoNerd" Evans on 2022-12-29
Don't bother to emit the unrecognised sequence in DECRQSS response as it provides an echo roundtrip possibility
820. By Paul "LeoNerd" Evans on 2022-11-26
erase_internal() should only set fg/bg colour, resetting other attributes (especially RV)
819. By Paul "LeoNerd" Evans on 2022-11-09
Added vterm_screen_set_default_colors(), which repaints the cells in the buffer(s)
818. By Paul "LeoNerd" Evans on 2022-11-09
Permit either colour argument to be NULL to vterm_state_set_default_colors()
817. By Paul "LeoNerd" Evans on 2022-10-01
Delete the mk_wcswidth functions as they're not used; guard the CJK-wide one with an ifdef as by default we don't use it
816. By Paul "LeoNerd" Evans on 2022-10-01
Make sure to supply empty (void) prototype to functions that take no arguments in bin/vterm-ctrl.c
The default cmake installation process for dependencies that use cmake
on all platforms is in general more robust and less verbose, so we rely
on that if possible.
build(deps): disable shared library for libvterm
Problem:
Cannot build both static and share libraries for libvterm under Windows.
The static and shared library would have the same name "vterm.lib", thus there would be multiple rules to build the same target.
Solution:
Disable shared library for libvterm.
This makes it possible to use Ninja on Windows to build dependencies (2x speedup!).
But not for Release builds yet.
Co-authored-by: Wei Tang <gauchyler@uestc.edu.cn>
Problem:
- Docs HTML: "foo ~" headings (column_heading) are not aligned with
their table columns/contents because the leading whitespace is not
emitted.
- taglinks starting with hyphen like |-x| were not recognized.
- keycodes like `<foo>` and `CTRL-x` were not recognized.
- ToC is not scrollable.
Solution:
- Add ws() to the column_heading case.
- Update help parser to latest version
- supports `keycode`
- fixes for taglink, argument
- Update .toc CSS. https://github.com/neovim/neovim.github.io/issues/297
fix https://github.com/neovim/neovim.github.io/issues/297
59d5f692f removed cmake.deps/cmake/DownloadAndExtractFile.cmake and
support for USE_EXISTING_SRC_DIR. The Ubuntu nightly PPA still relies
on USE_EXISTING_SRC_DIR functionality since it can't access the network
during the build.
Supplying an empty value for ExternalProject_Add()'s URL value appears
to provide the needed mechanism to avoid re-downloading when the sources
are already present. This is undocumented behavior, though, so it may
break in the future.
Now, if USE_EXISTING_SRC_DIR is set, the ExternalProject's URL variable
is unset, preventing the download and erroring out if the source doesn't
actually exist.
DownloadAndExtractFile.cmake was initially introduced as a workaround to
avoid the massive amounts of logs generated by the download progress.
This is not a problem anymore as ExternalProject_Add has had the
DOWNLOAD_NO_PROGRESS option since cmake version 3.1.
We don't support 32bit Windows anymore, so it's not needed. Also remove
TargetArch.cmake and related code as we don't need architecture
detection for the same reason.
- fix regression by #20411
- `diff.exe` is required for non-default 'diffopt' (diffopt=filler, diffopt=context, …)
- the names of some required nvim-qt DLLs changed
Change the default build type to always be Debug, and allow only four
predefined build types: Debug, Release, RelWithDebInfo and MinRelSize.
Furthermore, flags meant for single-configuration generator (make,
ninja) will not be used for multi-configuration generators (visual
studio, Xcode), and flags meant for multi-configuration generators will
not be used for single-configuration generators.
This will allow Debug builds to be built with MSVC which requires that
all dependencies are also built with the Debug build type to avoid
runtime library mismatch.
The correct way to specify build type (for example Release) for
single-configuration generators (Make and Ninja) is to run
cmake -B build -D CMAKE_BUILD_TYPE=Release
cmake --build build
while for multi-configuration generators (Visual Studio, Xcode and Ninja
Multi-Config) is to run
cmake -B build
cmake --build build --config Release
Passing CMAKE_BUILD_TYPE for multi-config generators will now not only
not be used, but also generate a warning for the user.
Co-authored-by: dundargoc <gocundar@gmail.com>
The @error capture is used for tree-sitter's ERROR node, which indicates
a parsing error -- which can be quite frequent (and jarring) while typing.
Users can still manually `hi link @error Error` in their config.
Use the same logic for both deps (including LuaJIT, for which setting
this variable is mandatory) and Nvim: either the eponymous environment
variable if set, or the current software version if not.
Removes annoying warnings when building locally on macOS.
Problem:
Dirs "config", "packaging", and "third-party" are all closely related
but this is not obvious from the layout. This adds friction for new
contributors.
Solution:
- rename config/ to cmake.config/
- rename test/config/ to test/cmakeconfig/ because it is used in Lua
tests: require('test.cmakeconfig.paths').
- rename packaging/ to cmake.packaging/
- rename third-party/ to cmake.deps/ (parallel with .deps/)