Commit Graph

127 Commits

Author SHA1 Message Date
Lewis Russell
688b961d13 feat(treesitter): add support for wasm parsers
Problem: Installing treesitter parser is hard (harder than
climbing to heaven).

Solution: Add optional support for wasm parsers with `wasmtime`.

Notes:

* Needs to be enabled by setting `ENABLE_WASMTIME` for tree-sitter and
  Neovim. Build with
  `make CMAKE_EXTRA_FLAGS=-DENABLE_WASMTIME=ON
  DEPS_CMAKE_FLAGS=-DENABLE_WASMTIME=ON`
* Adds optional Rust (obviously) and C11 dependencies.
* Wasmtime comes with a lot of features that can negatively affect
  Neovim performance due to library and symbol table size. Make sure to
  build with minimal features and full LTO.
* To reduce re-compilation times, install `sccache` and build with
  `RUSTC_WRAPPER=<path/to/sccache> make ...`
2024-08-26 16:44:03 +02:00
Christian Clason
fa79a8ad6d build(deps): vendor libvterm at v0.3.3
Problem: Adding support for modern Nvim features (reflow, OSC 8, full
utf8/emoji support) requires coupling libvterm to Nvim internals
(e.g., utf8proc).

Solution: Vendor libvterm at v0.3.3.
2024-08-10 10:26:07 +02:00
bfredl
1247684ae1 build(deps): remove msgpack-c dependency 2024-08-05 12:22:12 +02:00
dundargoc
32e16cb0b6 build: add utf8proc as dependency
utf8proc contains all the data which is currently in
unicode_tables.generated.h internally, but in quite a different format.
Ideally unicode_tables.generated.h should be removed as well so we rely
solely on utf8proc. We want to avoid a situation where the possibility
of unicode mismatch occurs, e.g a distro using both unicode 12 and
unicode 13.
2024-06-28 19:47:39 +02:00
dundargoc
f09f5c45fa build: reuse code for deps.txt for both deps and main build 2024-05-28 20:58:07 +02:00
dundargoc
187ae67735 build: introduce variable DEPS_IGNORE_SHA for skipping dependency hash check
This will reduce friction as developers no longer need to provide a hash
when testing out different commits.

To skip the hash check, set `DEPS_IGNORE_SHA` to `TRUE` in
`cmake.deps/CMakeLists.txt`.
2024-03-19 08:52:03 +01:00
Gregory Anders
a75ef40f4c
build: set deps default build type to Release (#27495)
Debugging dependencies is rare so a Debug build type is usually not
needed. In cases where it _is_ needed it is easy to rebuild in Debug
mode. But since Release builds are more common, it makes more sense as a
default.

For Neovim itself we stick with a Debug build as a default, since
rebuilding and debugging is done _much_ more frequently than with
dependencies (which we _mostly_ expect to "just work").

Also remove the CMAKE_BUILD_TYPE variable in the Makefile, since this is
set by default in CMake.
2024-02-16 11:56:52 -06:00
dundargoc
ae3eed53d6 build: various build improvements
- remove "ran-" prefix from touch files as it's redundant since the
  they're already in the directory named `touches`.
- Include `contrib` when formatting with `make formatlua`.
- Use TARGET_FILE generator expression instead of assuming the
  executable location.
- reuse logic that determines whether to use lua or luajit.
- add translations to the `nvim` target.

Makefile improvements:
- rename variable `CMAKE_PRG` to `CMAKE` to make it more consistent with
  the builtin `MAKE` variable.
- stop propagating flags to generator. Users should use cmake for
  non-standard use cases.
- remove `+` prefix from targets. If the user for whatever reason wants
  to dry-run a target then they should be able to.
2024-01-24 12:41:09 +01:00
Justin M. Keyes
95cbedaa17
docs: various #25289
Co-authored-by: Jongwook Choi <wookayin@gmail.com>
Co-authored-by: Oliver Marriott <hello@omarriott.com>
Co-authored-by: Benoit de Chezelles <bew@users.noreply.github.com>
Co-authored-by: Jongwook Choi <wookayin@gmail.com>
2024-01-18 00:14:48 -08:00
dundargoc
404fdb0f36 build: cmake fixes
- add EXTERNALPROJECT_OPTIONS variable to main build
- use `REQUIRED` keyword for IWYU.
- remove check_c_compiler_flag checks when `ENABLE_COMPILER_SUGGESTIONS`
  is `ON`. If we explicitly enable it then we probably want it to give
  an error if it doesn't exist, rather than silently skip it.
- Move dependency interface libraries to their find module and use them
  as a pseudo-imported target.
- Remove BUSTED_OUTPUT_TYPE. It's not used and we can reintroduce it
  again if something similar is needed.
- Use LINK_OPTIONS intead of LINK_FLAGS when generating the `--version`
  output.
2023-12-16 21:06:28 +01:00
dundargoc
7840760776 build: bump minimum cmake version to 3.13
The benefits are primarily being able to use FetchContent, which allows
for a more flexible dependency handling. Other various quality-of-life
features such as `-B` and `-S` flags are also included.

This also removes broken `--version` generation as it does not work for
version 3.10 and 3.11 due to the `JOIN` generator expression.

Reference: https://github.com/neovim/neovim/issues/24004
2023-12-16 17:17:24 +01:00
dundargoc
404043e74c build: vendor libtermkey
This is a proof of concept/WIP to evaluate the viability of vendoring
libtermkey as it's been deprecated.
2023-11-30 12:02:10 -06:00
dundargoc
bec2ebebda build: various cmake fixes
- Correct MSVC warning suppression. The C4003 warning is issued during
  file generation and not for the actual source files.
- Remove non-existent "scripts/pvscheck.sh" file from `lintsh` target.
- Remove spaces inside for loops with uncrustify.
- Point dependencies to use a git tag rather than releases, as releases
  might have changes that deviate from the actual source code.
- Automatically update uncrustify config before formatting or linting.
2023-11-18 18:38:45 +01:00
ObserverOfTime
f9416470b1 fix(build): include FindPackageHandleStandardArgs 2023-11-06 17:46:02 +01:00
dundargoc
8ae39eb584 build: remove git requirement
We do not have any patches that we use at the moment, so git is not
needed right now. Futhermore, we've become more strict with not adding
patches, which makes it pretty safe to remove this for the time being.
2023-11-05 21:39:24 +01:00
dundargoc
5cefec7349 build: various cmake fixes
- silence false warnings on MSVC
- merge `clang-tidy` cmake target into `lintc` and remove the
  corresponding make target
- use cmake's built-in endianness detection
2023-11-04 18:32:47 +01:00
James McCoy
a8fc94a2fd build(deps): include Find module
Now that all the Find<Foo>.cmake modules are using our custom
find_path2, the bundled deps build needs to include the Find module so
it has access to find_path2.

The missing include was causing the PPA build to fail:

```
cd .deps && \
	cmake -G 'Unix Makefiles'   \
	-DUSE_EXISTING_SRC_DIR=ON -DUSE_BUNDLED_LUAROCKS=OFF -DUSE_BUNDLED_LUAJIT=OFF -DUSE_BUNDLED_GPERF=OFF -DUSE_BUNDLED_LUA=OFF /<<PKGBUILDDIR>>//cmake.deps
-- The C compiler identification is GNU 7.5.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
-- Found GNU Make at /usr/bin/make
-- CMAKE_BUILD_TYPE not specified, default is 'Debug'
-- Performing Test HAS_OG_FLAG
-- Performing Test HAS_OG_FLAG - Success
-- Found Git: /usr/bin/git (found version "2.17.1")
CMake Error at /<<PKGBUILDDIR>>/cmake/FindLuajit.cmake:1 (find_path2):
  Unknown CMake command "find_path2".
Call Stack (most recent call first):
  cmake/BuildLuv.cmake:13 (find_package)
  CMakeLists.txt:127 (include)

-- Configuring incomplete, errors occurred!
```
2023-10-18 23:47:20 +02:00
dundargoc
0370e4def0
build!: remove neovim qt
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.
2023-06-06 19:19:00 +02:00
James McCoy
8a6716682e
fix(deps): restore functionality of USE_EXISTING_SRC_DIR
30a0299bc removed the USE_EXISTING_SRC_DIR hack which broke building the
nightly PPA since ExternalProject tried to download the sources.
2023-05-22 19:24:36 -04:00
dundargoc
8b8e607284
build: move luarocks and rocks installation to main build
This will ensure luacheck and busted are only installed when they're
actually needed. This cuts total build time by over 50%.

Closes https://github.com/neovim/neovim/issues/22797.
2023-05-21 20:57:39 +02:00
dundargoc
826b95203a
build: bundle uncrustify
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.
2023-05-18 16:27:47 +02:00
dundargoc
1086016477
build: cmake cleanup
- 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
2023-05-13 12:12:29 +02:00
dundargoc
30a0299bc6
build: make dependency URL variables non-cached (#23577)
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.
2023-05-11 20:17:15 +02:00
dundargoc
9909668111
build: create a text file for specifying dependency information
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.
2023-05-03 00:31:07 +02:00
dundargoc
37bc73e9bc
build: change dependency URLs to cache variables
This makes it possible to specify a different URL or file path from the
command line.

Closes https://github.com/neovim/neovim/issues/23366.
2023-05-01 07:52:23 +02:00
Christian Clason
7e3d6ff405
build(deps): bump LuaJIT to HEAD - 224129a8e (#23405) 2023-04-30 15:36:17 +02:00
bfredl
45bcf83869 refactor(build): include lpeg as a library 2023-04-27 11:40:00 +02:00
dundargoc
801ac2accb
build: drop diff.exe from windows builds
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.
2023-04-22 18:36:33 +02:00
Christian Clason
0b24ab1892
build(deps): bump tree-sitter to HEAD - 321a65262 (#23261) 2023-04-22 12:58:35 +02:00
Christian Clason
a30e61eb4d
build(deps): bump tree-sitter to HEAD - af92bfc02 (#23151) 2023-04-17 11:39:57 +02:00
Christian Clason
0dbb0419f4
build(deps): bump LuaJIT to HEAD - 1c2791270 (#23140) 2023-04-17 09:08:43 +02:00
Carlo Cabrera
5d387c3388
build(ci): ensure correct headers are used on macOS
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`.
2023-04-09 20:31:13 +02:00
Christian Clason
56e4d79b28
build(deps): switch vim parser to maintained fork (#22896)
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.
2023-04-05 16:25:33 +02:00
dundargoc
81f2bce775
build: cmake cleanup
- Change libtermkeyCMakeLists.txt to LibtermkeyCMakeLists.txt
- Remove duplicate mark_as_advanced calls in FindLibuv.cmake
- Fix "Enabling Clang sanitizer" messages as it's no longer clang-only
- Simplify parser installation syntax
- Rename tree-sitter to treesitter
2023-04-04 19:27:21 +02:00
Christian Clason
b83f949fd9
build(deps): bump tree-sitter to v0.20.8 (#22882) 2023-04-04 12:16:26 +02:00
Christian Clason
bc96bda5a2
build(deps): bump tree-sitter-vimdoc to v2.0.0 (#22870) 2023-04-03 14:08:00 +02:00
Christian Clason
9084948893
Merge pull request #22832 from clason/bump-Luv
build(deps): bump luv to HEAD
docs(luvref): update to version bump
2023-04-01 18:07:11 +02:00
Christian Clason
2d840b6b77 build(deps): bump Luv to HEAD - 093a977b8 2023-04-01 17:26:04 +02:00
Christian Clason
d7f7450017 refactor(treesitter)!: rename help parser to vimdoc 2023-04-01 15:07:16 +02:00
Christian Clason
dee559d744 build(deps): bump tree-sitter-viml to HEAD 2023-03-31 15:58:19 +02:00
Christian Clason
92005db760
build(deps): switch to Launchpad for libvterm and libtermkey (#22811)
Problem: www.leonerd.org.uk is sometimes unreachable

Solution: switch to Launchpad URLs for libvterm (official page) and
libtermkey (source mirror for Ubuntu package)
2023-03-29 14:39:11 +02:00
dundargoc
81abd5c5c7 build: download wintools executables separately
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.
2023-03-28 16:18:13 +02:00
dundargoc
b155608bff
build: set CMAKE_C_STANDARD to 99 for all dependencies
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.
2023-03-24 10:22:15 +01:00
Christian Clason
ba8b564986
build(deps): bump win32yank to v0.1.1 (#22700) 2023-03-17 13:04:37 +01:00
Christian Clason
46079c3396 build(deps): bump luarocks to v3.9.2
Changes from 3.8.0:
https://github.com/luarocks/luarocks/blob/master/CHANGELOG.md#whats-new-in-luarocks-392
2023-03-15 18:10:54 +01:00
Christian Clason
5a38e951ec
build(deps): bump tree-sitter to HEAD - a318b42c8 2023-03-15 14:25:04 +01:00
Christian Clason
27b467bad2
build(deps): bump tree-sitter to v0.20.8 (#22663) 2023-03-14 09:29:56 +01:00
dundargoc
29a43ef8af
build: explicitly add dependency include dir for header generation
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.
2023-03-10 22:40:41 +01:00
Christian Clason
8a3220ba49
build(deps): set query parser to release (#22603) 2023-03-10 10:05:47 +01:00
dundargoc
f4d83ac1e2
build: consistently use the provided option paths
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.
2023-03-05 15:21:46 +01:00