aboutsummaryrefslogtreecommitdiff
path: root/build.zig
Commit message (Collapse)AuthorAge
* 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.
* build(zig): use system library for libiconv on macOSChristian Clason2026-08-30
| | | | | | | | Problem: Unlike CMake, `build.zig` downloads and builds GNU libiconv on macOS instead of linking to the system framework. Solution: Only pull in the libiconv dependency on Windows and link against system framework on macOS.
* build(zig): keep all symbols for native Lua modules #41361Max Coplan2026-08-18
| | | | | | | | | | | | | Native Lua modules loaded with `require` or `package.loadlib` resolve Lua C API symbols from the nvim executable itself. Those symbols must stay in the binary even when nothing inside nvim references them. `rdynamic` is enough on Linux. On macOS the linker dead-strips unreferenced symbols before rdynamic exports them, so `_lua_tothread` is missing from the executable and loading such a module fails with: symbol not found in flat namespace '_lua_tothread' Disable section garbage collection so all non-static symbols are kept.
* Merge pull request #40772 from Rawan10101/wasm-browserbfredl2026-08-04
|\ | | | | feat(wasm-emcc): add browser support for Neovim
| * feat(wasm): implement initial web demorawan101012026-08-02
| | | | | | | | | | | | Introduce an initial browser-based Neovim demo with automatic startup and UI integration. The demo is functional but still requires persistence, additional testing, and further stabilization. Acknowledgment: UiState in app.js is based on the implementation from github.com/MuNeNiCK/nvim-wasm, with additional modifications and updates
| * build(wasm): use pthreads and correct uv_fs_write offset handlingrawan101012026-07-26
| |
* | build(deps): bundle tree-sitter-diff parser #40778Barrett Ruth2026-07-19
|/
* Merge pull request #40628 from Rawan10101/wasm-runtime-bundlingbfredl2026-07-12
|\ | | | | build(wasm): bundle runtime files into MEMFS
| * build(wasm): bundle runtime files into MEMFSrawan101012026-07-12
| |
* | Merge pull request #38546 from dchinmay2/push-pozrrzptmvnvbfredl2026-07-10
|\ \ | |/ |/| build(zig): add formatc and lintc steps
| * build(zig): add formatc and lintc stepsChinmay Dalal2026-06-17
| | | | | | | | | | problem: build.zig does not have formatc and lintc steps solution: add formatc and lintc step to build.zig
* | build(wasm): add smoke testrawan101012026-06-30
| |
* | build(wasm): add wasm_stubs for Emscripten buildrawan101012026-06-30
| |
* | fix: setjmp/longjmp and stack overflow handling for WASM buildRawan101012026-06-30
|/
* feat(build.zig): easier cross-complilationbfredl2026-06-04
| | | | invocation of cross-compilation changed, see news.txt blurb
* refactor(build.zig): no need to pass around b.graph.io next to bbfredl2026-06-04
|
* fix(build.zig): do not depend on b.install_path on configure timebfredl2026-06-04
| | | | | | | | | | | | | | This is in preparation of zig 0.17 where b.install_path is no longer known inside `pub fn build()`. Builds which should hardcode a runtime path into the binary has to specify it. We could use a nlua0 helper to encode the install path at build time but I think this is cleaner anyway. (like currently the appimage still encodes a temporary build path which is nonsensical, it is better to just include none) Similarily b.args will not be available anymore (there will just be an opaque pass-through)
* build: add wasm/emscripten build supportRawan101012026-06-01
| | | | | | | | | | | | | | | | - Add is_wasm detection for wasm32-emscripten target - Add -Demscripten-sysroot option and libc path setup - Default cross_compiling=true for wasm - Use lua5.1 instead of luajit for wasm (luajit unsupported) - Add emscripten include paths to all dependencies - Build nvim as static library for wasm target - Add emcc link step with Asyncify and SUPPORT_LONGJMP - Filter wasm_stubs.c from non-wasm builds Known limitation: setjmp/longjmp not yet fully functional due to Zig compiling dependencies outside emcc pipeline. build: fix wasm emscripten output path tracking
* feat(ui_client): "press ENTER" free nvim crash debuggingbfredl2026-05-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This feature might be a little silly and niche, but it is very useful for _my_ workflow (and open source is about mee) An issue which is never present on high quality RELEASE builds, but might occur on Debug builds is that the Nvim server crashes on some error in your unfinished PR code. If you compile your debug builds with sanitizers enabled, as you should, the ASAN/UBSAN runtime will print some useful info about your mistake to stderr or a log file, such as a stack trace. This can be used to jump to the error in the code. This allows the nvim server to install a signal hander in the ui client, which can load this log file in a good safe version of nvim and parse it using 'errorformat' This is inspired by the "press ENTER" free workflow of ui2 and applies it beyond the lifetime cycle of the nvim instance. example config: ```lua local asan = vim.env.ASAN_OPTIONS if asan ~= nil and string.match(asan, "log_path=/tmp/nvim_asan") then local myname = "/tmp/nvim_asan."..vim.uv.getpid() local args = {"--embed", "-n", "+set efm=%+A%*[^/]%f:%l:%c", "+silent cfile "..myname, "+silent cfirst", "+silent copen"} vim.api.nvim__set_restart_on_crash("nvim", args) end ``` and run your debug nvim like so ASAN_OPTIONS=handle_abort=1,handle_sigill=1,log_path=/tmp/nvim_asan ./build/bin/nvim
* fix(build.zig): reunify parser install pathbfredl2026-04-23
| | | | | | Both for tests and for system wide install, $PREFIX/lib/nvim/parser is a valid path for tree-sitter parsers. This also brings the build.zig behavior in line with how we set up the paths in CMakeLists.txt
* fix(build): more changes to make zig 0.16.0 workbfredl2026-04-21
|
* feat(build.zig): update to zig 0.16Chinmay Dalal2026-04-21
|
* 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
* Merge pull request #38688 from eamonburns/masterJustin M. Keyes2026-04-14
|\ | | | | fix(build.zig): remove runtime dependency on Windows SDK
| * fix(build.zig): call `build_libluv` with standard optimize modeEamon Burns2026-04-13
| |
| * fix(build.zig): remove runtime dependency on Windows SDKEamon Burns2026-04-01
| | | | | | | | Co-Authored-By: ntdiary <2471314@gmail.com>
* | build(zig): update versionChinmay Dalal2026-04-03
|/
* fix(build): build.zig: use luajit for windowsbfredl2026-02-23
| | | | | | | | | | | | | | These were disabled as they failed when tested with cross-compiling, but it works fine for windows natively on ci, so let's use that. mac os builds after disabling debug info, which currently triggers a bug in zig's MachO linker: natecraddock/ziglua#191 Tracking issue: https://codeberg.org/ziglang/zig/issues/30669 Unfortunately actually using the JIT of luajit still triggers issues on mac os, so we cannot use it yet. Also sync luajit version used via ziglua to a recent one like we use in cmake, see natecraddock/ziglua#196
* build: zig tee, drop old XXD_URL #37863Justin M. Keyes2026-02-14
| | | | | | | | | | | Problem: - tee was vendored in ceb7eb523049fbf96621a231f8f2f16c97fe41d0 but forgot to add it to `build.zig`. - xxd was vendored in 5bb8734fb63921bd2b970da882e0a54d03130966 but the old XXD_URL is still referenced. Solution: - update `build.zig` - remove XXD_URL
* fix(build): treesitter parsers are not ReleaseSafebfredl2026-01-15
|
* feat(build.zig): install parsers in install stepChinmay Dalal2026-01-14
| | | | | Problem: The install step does not install parsers Solution: Make the install step depend on installing parsers
* fix(build.zig): format build.zig to keep lines under 100 charsChinmay Dalal2026-01-13
|
* feat(build.zig): add option to use system dependenciesChinmay Dalal2026-01-13
| | | | | | | | | Problem: build.zig always downloads dependencies and statically links them, which is frowned upon by distro packagers. Solution: Add option to use system libraries.
* fix(build.zig): replace slashes in filepaths #37111Eamon Burns2026-01-08
| | | | | | | Problem: `zig build` fails if `b.install_path` and `b.lib_dir` contain backslashes (on Windows). Solution: Replace backslashes (\) with forward slashes (/).
* feat(build): support full runtime distribution workbfredl2025-12-09
| | | | | | | | | | | | | | | | | | | | Working towards making the build.zig build actually useful for users.. For building a full runtime distribution in /usr or /opt/nvim or whatever, use sudo zig build install -p /usr by default "zig build" will now work like "make" e.g. just build the binary and the generated parts of the runtime. This will work for development, but you need to use both parts of the runtime, just like with an "uninstalled" cmake build: zig build VIM=. ./zig-out/bin/nvim --clean --cmd "set rtp+=./zig-out/runtime" As a wrapper, `zig build run_dev` can be used
* fix(build): zig build can has git versionbfredl2025-12-03
|
* build(windows): vendor xxd.c #36746benarcher26912025-11-29
| | | | | | | | | | | | | Problem: Currently we fetch a prebuilt xxd.exe from neovim/deps for Windows, which is not ideal in terms of obviousness, misses updates, and is clumsy to update. Solution: Similar to tee.c (#36363), vendor xxd.c from Vim and build it as part of the Neovim build process. This makes the source obvious, enables analyzer checks, and simplifies updates. Fixes #36664
* feat(build): HAVE_UNIBILIUMbfredl2025-10-31
| | | | | | | | | | | | compile time features are hot again. Note: this changes the &term value for builtin definition from 'builtin_xterm' to just 'xterm'. It's an xterm regardless of we use an external definition or an internal. Prior to this commit the vast majority of POSIX users will have used external terminfo, so plugins and scripts are only going to have checked for &term == 'xterm' or 'tmux' or whatever. The status of external loading is still available in "nvim -V3" output.
* build(ci): bump zig to 0.15.1 and add more platformsbfredl2025-09-15
| | | | | | - Bump zig version to 0.15.1 and workaround zig fetch hang (ziglang/zig#24916) - add mac os zig build (currently without luajit, linker failure) - Add windows zig build, currently with very limited testing
* build: make build.zig generate helptags without running "nvim" binarybfredl2025-08-19
| | | | | | | | | This is matters for cross-compiling where we might not be able to run the "nvim" binary on the host. Instead reimplement the helptags extractor as a small lua script, which we can run on the host using the nlua0 helper already used for other generator scripts.
* refactor(build): remove INCLUDE_GENERATED_DECLARATIONS guardsbfredl2025-08-14
| | | | | | | | | These are not needed after #35129 but making uncrustify still play nice with them was a bit tricky. Unfortunately `uncrustify --update-config-with-doc` breaks strings with backslashes. This issue has been reported upstream, and in the meanwhile auto-update on every single run has been disabled.
* feat(build): build.zig windows supportbfredl2025-08-12
| | | | | | | | | | | | | | | Tested using cross-compiling from linux: zig build -Dcross=true -Dtarget=x86_64-windows nvim_bin Note: not fully functional without a runtime, which still has to be fuddled with manually Macos and windows builds require a recent zig 0.15+dev version As this zig master branch is currently too much in flux, we can't make our CI depend on zig master. Revisit CI after zig 0.15 release or at least feature freeze.
* fix(build): remove deprecated aliases in build.zig removed for zig 0.15bfredl2025-08-09
| | | | | This makes the zig build compatible with the upcoming zig 0.15 release, while still supporting the current stable 0.14 release still used in CI.
* refactor(build): don't use the preprocessor when generating headersbfredl2025-08-06
| | | | | | | | | | | | | | Using the preprocessor before generating prototypes provides some "niceties" but the places that rely on these are pretty few. Vastly simplifying the BUILD SYSTEM is a better trade-off. Unbalancing { } blocks due to the preprocessor is cringe anyway (think of the tree-sitter trees!), write these in a different way. Add some workarounds for plattform specific features. INCLUDE_GENERATED_DECLARATIONS flag is now technically redundant, but will be cleaned up in a follow-up PR as it is a big mess.
* feat(build): make build.zig run unittestsbfredl2025-05-24
|
* feat(build): make build.zig use luajit on main plattformsbfredl2025-05-24
|
* fix(tests): use correct include path for unittestbfredl2025-05-22
| | | | | | | Copy whatever was made to work for generated headers: (1) we need to consider all cmake targets not just main_lib (2) we need to add the sysroot for macOS
* fix(build): musl libc build.zigVlad Panazan2025-05-04
|
* fix(build): use correct cmake expression for $<CONFIG>bfredl2025-05-04
| | | | | | | | ${CONFIG} is an empty string even when configuration is known at configuration time. $<CONFIG> has to be used at "generation time" Currently zig's reimplementation of cmake config headers does not support $<CONFIG> so use a branch to pick the one which works.
* 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