aboutsummaryrefslogtreecommitdiff
path: root/cmake
Commit message (Collapse)AuthorAge
* build(test): dead manifest cleanup in RunTests.cmake #41514Willaaaaaaa2026-09-11
| | | NVIM_RPLUGIN_MANIFEST was removed in f034e5f66b74cafb027dce157eef36e8766e0e7e
* docs(cmake): remove misleading commentChristian Clason2026-08-30
| | | | | We still require this file since the upstream version can't find the glibc version on Linux.
* build(deps): vendor lpegChristian Clason2026-08-30
| | | | | | | | | | | | | | Problem: LPeg is hosted on a single unreliable external hoster, forcing is to mirror it in neovim/deps, which adds maintenance friction. Also, we have already vendored the Lua `re.lua` module. Solution: Vendor all of LPeg v1.1.0; as development is not very active anymore, this should not add much overhead (and allow us to simplify in particular the Zig build scripts). Note: LPeg defines a `luaL_newlib` macro for Lua 5.1, which conflicts with LuaJIT's extension. This requires inlining the macro defined in `lptypes.h` and used in `lptree.c`; see README.md for the patch.
* fix(build): fix wasmtime version regex (#41438)Eamon Burns2026-08-23
| | | | | Problem: Regex assumes a single-digit patch number, but LTS wasmtime releases (which we track) can run into double digits. Solution: Allow for multi-digit patch numbers.
* refactor(test): unify XDG path handling (cmake vs zig)bfredl2026-07-06
| | | | fixes #40381
* test: run Lua harness with nvim -lLewis Russell2026-05-13
| | | | | | | | | | | | | | | | | | Problem: The Lua test harness still ran through standalone -ll mode, so tests depended on the low-level Lua path instead of the regular Nvim Lua environment. That also meant os.exit() coverage had to carry an ASAN workaround because Lua's raw process exit skipped Nvim teardown and let LeakSanitizer interfere with the observed exit code. Solution: Run the harness and related fixtures with nvim -l. Patch os.exit() in the main Lua state to exit through getout(), so scripts observe normal Nvim shutdown while standalone -ll remains available for generator-style scripts. As a consequence, the startup test can assert os.exit() without disabling leak detection. AI-assisted: Codex
* ci: drop cirrus #39321Justin M. Keyes2026-04-22
| | | | | | | | Problem: cirrus will shutdown soon, and we are running out of minutes anyway, which causes ci failures. Solution: Drop cirrus config.
* test: replace busted with local harnessLewis Russell2026-04-15
| | | | | | | | | | | | | | | | | | | Replace the busted-based Lua test runner with a repo-local harness. The new harness runs spec files directly under `nvim -ll`, ships its own reporter and lightweight `luassert` shim, and keeps the helper/preload flow used by the functional and unit test suites. Keep the file boundary model shallow and busted-like by restoring `_G`, `package.loaded`, `package.preload`, `arg`, and the process environment between files, without carrying extra reset APIs or custom assertion machinery. Update the build and test entrypoints to use the new runner, add black-box coverage for the harness itself, and drop the bundled busted/luacheck dependency path. AI-assisted: Codex
* test: start test runners in Xtest_xdg dir (#37964)zeertzjq2026-02-20
| | | | | | | | | | | | | | This is a better way to prevent parallel tests from interfering with each other, as there are many ways files can be created and deleted in tests, so enforcing different file names is hard. Using $TMPDIR can also work in most cases, but 'backipskip' etc. have special defaults for $TMPDIR. Symlink runtime/, src/, test/ and README.md to Xtest_xdg dir to make tests more convenient (and symlinking test/ is required for busted). Also, use README.md instead of test/README.md in the Ex mode inccommand test, as test/README.md no longer contains 'N' char.
* test: remove XDG dir and rplugin manifest on cleanup (#37954)zeertzjq2026-02-18
|
* feat(logging): rename ".nvimlog" => "nvim.log" #37935Justin M. Keyes2026-02-18
| | | | | | - Rename ".nvimlog" to "nvim.log" - doesn't need to be "hidden"/dotfile - ".log" extension helps with filetype detection - Also rename "nvim/log" => "nvim/nvim.log"
* test: support running functionaltests in parallel by directory (#37918)zeertzjq2026-02-18
| | | | | | | | | Define a CMake target for every subdirectory of test/functional that contains functional tests, and a functionaltest_parallel target that depends on all those targets, allowing multiple test runners to run in parallel. On CI, use at most 2 parallel test runners, as using more may increase system load and make tests unstable.
* test: fail CI if .nvimlog is not empty (#37470)zeertzjq2026-01-20
| | | | | | | | This will prevent adding passing tests which logs errors in .nvimlog. Close #28323 Related: https://github.com/neovim/neovim/pull/27660#issuecomment-2035738597 Co-authored-by: dundargoc <gocdundar@gmail.com>
* build: ship "_core/*" as bytecode (built-into Nvim binary)Justin M. Keyes2025-12-30
| | | | | | | | | | | | | | | | | | | | | | | | | | Problem: We want to encourage implementing core features in Lua instead of C, but it's clumsy because: - Core Lua code (built into `nvim` so it is available even if VIMRUNTIME is missing/invalid) requires manually updating CMakeLists.txt, or stuffing it into `_editor.lua`. - Core Lua modules are not organized similar to C modules, `_editor.lua` is getting too big. Solution: - Introduce `_core/` where core Lua code can live. All Lua modules added there will automatically be included as bytecode in the `nvim` binary. - Move these core modules into `_core/*`: ``` _defaults.lua _editor.lua _options.lua _system.lua shared.lua ``` TODO: - Move `_extui/ => _core/ui2/`
* test: skip noisy "terminal mode unavailable" logs #36794Justin M. Keyes2025-12-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Every CI log has a lot of noise at the end, which makes it harder to find relevant test failures: Running tests from test/functional/terminal/tui_spec.lua ... T5831 TUI bg color queries the terminal for background color: T5832 TUI bg color triggers OptionSet from automatic background processing: T5833 TUI bg color sends theme update notifications when background changes #31652: ... Running tests from test/functional/ui/output_spec.lua ... WRN 2025-12-02T03:36:47.304 ui/c/T5831.28003.0 tui_handle_term_mode:223: TUI: terminal mode 2026 unavailable, state 0 WRN 2025-12-02T03:36:47.359 ui/c/T5832.28006.0 tui_handle_term_mode:223: TUI: terminal mode 2048 unavailable, state 0 WRN 2025-12-02T03:36:47.414 ui/c/T5833.28009.0 tui_handle_term_mode:223: TUI: terminal mode 2048 unavailable, state 0 Solution: - Skip logging in test-mode. - This can be reverted later, when these logs are changed to "INFO" level, per this TODO comment: ``` // TODO(bfredl): This is really ILOG but we want it in all builds. // add to show_verbose_terminfo() without being too racy ???? WLOG("TUI: terminal mode %d unavailable, state %d", mode, state); ```
* build: redundant variable in cmake/Deps.cmake #35924崔书豪2025-09-30
|
* build: allow comments in deps.txt #35765Justin M. Keyes2025-09-14
| | | | | | | Problem: It was not obvious where our source for "busted" is. Solution: Add a comment to `deps.txt`.
* build: unset $TMUX when running tests (#34178)zeertzjq2025-05-27
| | | | | | This prevents Nvim TUI running in tests from thinking it's inside tmux. Another solution is make :terminal unset $TMUX instead, but I'm not sure if that'll break some other use cases.
* fix(tests): don't surpress stderr outputbfredl2025-05-22
| | | | | | | This is a diabolical anti-pattern and is hiding errors which exist currently in unittests. Also we want to see _where_ in the process stderr was emitted, stashing it away at the end erases important context.
* feat(build): build.zig MVP: build and run functionaltests on linuxbfredl2025-05-02
| | | | | | | | | | | | | | | | | | | | | NEW BUILD SYSTEM! This is a MVP implementation which supports building the "nvim" binary, including cross-compilation for some targets. As an example, you can build a aarch64-macos binary from an x86-64-linux-gnu host, or vice versa Add CI target for build.zig currently for functionaltests on linux x86_64 only Follow up items: - praxis for version and dependency bumping - windows 💀 - full integration of libintl and gettext (or a desicion not to) - update help and API metadata files - installation into a $PREFIX - more tests and linters
* build: move all generator scripts to `src/gen/`Lewis Russell2025-02-26
| | | | | | | | | | | - Move all generator Lua scripts to the `src/gen/` - Add a `.luarc.json` to `src/gen/` - Add a `preload.lua` to `src/gen/` - Add `src` to `package.path` so it aligns with `.luarc.json' - Fix all `require` statements in `src/gen/` so they are consistent: - `require('scripts.foo')` -> `require('gen.foo')` - `require('src.nvim.options')` -> `require('nvim.options')` - `require('api.dispatch_deprecated')` -> `require('nvim.api.dispatch_deprecated')`
* build: mark CMake variables advanced #31412Eisuke Kawashima2024-12-09
| | | The variables are not marked as advanced, thus they appear in e.g. `ccmake`.
* build: specify POST_BUILD when using add_custom_commanddundargoc2024-11-09
| | | | | | | | This is needed specifically for the second signature of add_custom_command, which appends an operation to an existing target. This will prevent the cmake warning CMP0175. Reference: https://cmake.org/cmake/help/latest/policy/CMP0175.html
* build(lpeg): search for lpeg.so on MacOSTom Scogland2024-10-22
| | | | | | | | | | Problem: Currently Neovim only searches for lpeg.dylib, liblpeg.dylib, etc. on MacOS, but a normal installation of lpeg will produce lpeg.so instead. There are explicit workarounds for this by modifying lpeg's package in Homebrew, and will shortly be another in spack. Solution: also search for lpeg.so even if that's not the platform default, because Lua and luarocks use it anyway.
* build: remove enforcement of cmake build typedundargoc2024-10-22
| | | | | | | | | | | Forcing the build type to be one of the default types was intended to prevent usage of custom build types which risks unpredictability. Unfortunately, many distributions patch this check out so they can use a custom type anyway, making the check moot in the first place. Instead, allow custom build types but don't try to accomodate them in the code: we're making the assumption that anyone who wants to use a custom build type will be able to set any additional necessary flags needed for their specific system.
* build(cmake): remove unnecessary policy codedundargoc2024-09-22
| | | | Policy CMP0092 is by default on for minimum cmake versions above 3.15.
* feat(treesitter): add support for wasm parsersLewis Russell2024-08-26
| | | | | | | | | | | | | | | | | | | | 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 ...`
* build(deps): vendor libvterm at v0.3.3Christian Clason2024-08-10
| | | | | | | | 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.
* build(deps): remove msgpack-c dependencybfredl2024-08-05
|
* build: add utf8proc as dependencydundargoc2024-06-28
| | | | | | | | | 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.
* build: reuse code for deps.txt for both deps and main builddundargoc2024-05-28
|
* build: allow sccache as compiler cachedundargoc2024-05-09
| | | | | | Also enable caching for dependencies. Closes https://github.com/neovim/neovim/issues/28670
* build: simplify policy-setting for dependenciesdundargoc2024-05-03
| | | | | Passing `CMAKE_POLICY_DEFAULT_CMP0092=NEW` to all dependencies is simpler than setting it manually in each file.
* test: override XDG_STATE_HOME as well (#28604)zeertzjq2024-05-02
| | | This prevents tested Nvim from affecting ~/.local/state/
* build: do not use GIT_REPOSITORY for local dependenciesdundargoc2024-04-25
| | | | | | | | | This reverts a large portion of 2c1e8f7e96926f70151d737ea32f1e6ff3589263. The conclusion from that commit is incorrect: local builds are not used/updated correctly so much as it's not used at all. Instead the build will always use `master` branch rather than the current files.
* test: improve test conventionsdundargoc2024-04-08
| | | | Work on https://github.com/neovim/neovim/issues/27004.
* build: add function add_targetdundargoc2024-04-08
| | | | | | | It's a combination of add_custom_target and add_custom_command that does what most users probably expect should happen. This also fixes `make clean` removing files tracked by git.
* ci: provide separate macos releases for intel and armdundargoc2024-03-24
| | | | | | This will immensely reduce the complexity required to support both architectures, reduce overall lines of code and unblock follow-up simplifications.
* build: use `GIT_REPOSITORY` for local URLsdundargoc2024-03-23
| | | | | | | `GIT_REPOSITORY` will cause cmake to rebuild if local dependency changes, which isn't the case for `URL`. Also document how to test a different commits of a dependency.
* build: introduce variable DEPS_IGNORE_SHA for skipping dependency hash checkdundargoc2024-03-19
| | | | | | | | 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`.
* build: set deps default build type to Release (#27495)Gregory Anders2024-02-16
| | | | | | | | | | | | | 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.
* fixup: raise TS min versionChristian Clason2024-01-25
|
* build: various build improvementsdundargoc2024-01-24
| | | | | | | | | | | | | | | | | | - 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.
* fix(test): call separate_arguments() correctly to honor $BUSTED_ARGS (#26905)James McCoy2024-01-05
| | | | | separate_arguments() doesn't operate in place on a variable. It expects a string argument to parse and stores the results in the specified variable.
* build: cmake fixesdundargoc2023-12-16
| | | | | | | | | | | | | | - 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.
* build: bump minimum cmake version to 3.13dundargoc2023-12-16
| | | | | | | | | | | 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
* build: remove config-specific find_package search for libuvdundargoc2023-12-09
| | | | Having two separate find_package calls makes it harder to maintain.
* build: rework formatting to use add_glob_targetdundargoc2023-12-04
| | | | | | | | | | | | This will ensure that we can pass flags and make adjustments from the top level cmake file instead of digging through the cmake directory. More importantly, this will only format files that have been changed. This has a slightly higher initial cost compared to previous solution as all files must be initially formatted, but the gained speed up should more than make up for it quickly. `make formatlua` is always run due to a quirk of stylua of always changing modification time of the file regardless if there were any changes. This is not a major blocker as stylua is very fast.
* build: vendor libtermkeydundargoc2023-11-30
| | | | | This is a proof of concept/WIP to evaluate the viability of vendoring libtermkey as it's been deprecated.
* docs: small fixes (#26154)dundargoc2023-11-27
|