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`.
close#27678
Return a userdata wrapper around the uv_req_t to allow it to be garbage collected before the program exits.
Previously, the returned userdata held a reference to itself in the Lua registry, meaning it would never be able to be garbage collected until the process ended.
This reverts commit 0e4a895, which attempted a workaround for the same underlying problem, but introduced a use-after-free.
```
Application Specific Information:
abort() called
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x18cde20dc __pthread_kill + 8
1 libsystem_pthread.dylib 0x18ce19cc0 pthread_kill + 288
2 libsystem_c.dylib 0x18cd25a40 abort + 180
3 libsystem_malloc.dylib 0x18cc3cb08 malloc_vreport + 908
4 libsystem_malloc.dylib 0x18cc403f4 malloc_report + 64
5 libsystem_malloc.dylib 0x18cc54ebc find_zone_and_free + 308
6 nvim 0x100eb13b8 uv__fs_scandir_cleanup + 84
7 nvim 0x100eb7e68 uv_fs_req_cleanup + 120
8 nvim 0x100e03634 luv_fs_gc + 132
9 nvim 0x100e42aec lj_BC_FUNCC + 44
10 nvim 0x100e44cc8 gc_call_finalizer + 148 (lj_gc.c:521)
11 nvim 0x100b7fdb4 nlua_push_Object + 320 (converter.c:781)
12 nvim 0x100b7fc48 nlua_push_Dictionary + 332 (converter.c:722)
13 nvim 0x100992228 nlua_api_nvim_get_mode + 160 (lua_api_c_bindings.generated.c:6379)
14 nvim 0x100e42aec lj_BC_FUNCC + 44
15 nvim 0x100e590b4 lua_pcall + 228 (lj_api.c:1150)
```
* Convert lua_pushlstring from a macro to a function
* strerror_r is not available on mingw
* Support getting io.popen results on file:close() on PUC-Rio Lua 5.1
* Fix missing closing parenthesis in preprocessor macro
* fix detection of LUA_USE_WINDOWS define
Also switch to new org
* fix: Use os_uname() to check for Linux by @cryptomilk in #686
* docs: typo in a table field name by @Bilal2453 in #689
* docs: most new_handle methods won't return fail by @Bilal2453 in #683
* test-tty: Don't depend on stdin/stdout handle type by @squeek502 in #688
* Bump/libuv by @zhaozg in #690
* Annotate .gitmodules with branch and tag by @creationix in #693
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.
- 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.
- 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.
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
Cmake 3.28+ will fail if two projects download the same file to prevent
scheduling problems. This can be circumvented by downloading luajit to a
unique location for each target. This is theoretically non-optimal since
we need to download the same file three times for universal builds, but
universal builds are rare and the convenience of this method outweighs
setting up the dependencies optimally. This fixes the currently broken
release workflow for mac.
Closes https://github.com/neovim/neovim/issues/26526.
- 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.
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.
- 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
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!
```
Ensure bundled libraries and include directories are always searched
first before any others. This will provide a more consistent experience
as the search order of the builtin find_ functions can vary depending on
system. This should make the build process faster when building with
bundled deps as we limit the search to only the .deps directory.
Separating the search between .deps and everything makes debugging
find_-related problems simpler if you need to check how dependencies are
found.
For libraries, we divide the search process into the following order:
1. Only search in .deps directory and only search for static libraries.
2. Only search in .deps directory and search for all libraries.
3. Search everywhere and search for all libraries.
Make an exception for FindLibintl.cmake as changing the search order
seems to break some tests on macos.
- simplify lua interpreter search
- fix incorrect variable name in BuildLua.cmake
- build PUC Lua with -O2
- silence non-mandatory find_package search for libuv
- simplify Find modules
- Prefer using the explicitly set CI_BUILD over relying on the
environment variable "CI".
Switch to a rolling release, so the `0-beta3` suffix is dropped in favor
of the date. Remove the custom UNIX command as the symlink is now
created by the LuaJIT Makefile.
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.