aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/ci.yml4
-rwxr-xr-x.github/workflows/env.sh11
-rw-r--r--CONTRIBUTING.md14
-rw-r--r--scripts/genvimvim.lua2
-rw-r--r--third-party/CMakeLists.txt5
5 files changed, 30 insertions, 6 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 72a6be304c..aa16a94802 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -29,6 +29,10 @@ jobs:
- cc: clang
runner: macos-10.15
os: osx
+ - flavor: functionaltest-lua
+ cc: gcc
+ runner: ubuntu-20.04
+ os: linux
runs-on: ${{ matrix.runner }}
if: github.event.pull_request.draft == false
env:
diff --git a/.github/workflows/env.sh b/.github/workflows/env.sh
index 459ed669eb..a30e06ae26 100755
--- a/.github/workflows/env.sh
+++ b/.github/workflows/env.sh
@@ -20,13 +20,13 @@ VALGRIND_LOG=$GITHUB_WORKSPACE/build/log/valgrind-%p.log
CACHE_NVIM_DEPS_DIR=$HOME/.cache/nvim-deps
CACHE_MARKER=$HOME/.cache/nvim-deps/.ci_cache_marker
CCACHE_BASEDIR=$GITHUB_WORKSPACE
-DEPS_CMAKE_FLAGS=-DUSE_BUNDLED_GPERF=OFF
-FUNCTIONALTEST=functionaltest
CCACHE_COMPRESS=1
CCACHE_SLOPPINESS=time_macros,file_macro
CCACHE_DIR=$HOME/.ccache
EOF
+DEPS_CMAKE_FLAGS=-DUSE_BUNDLED_GPERF=OFF
+FUNCTIONALTEST=functionaltest
BUILD_FLAGS="CMAKE_FLAGS=-DCI_BUILD=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX:PATH=$HOME/nvim-install -DBUSTED_OUTPUT_TYPE=nvim -DDEPS_PREFIX=$HOME/nvim-deps/usr -DMIN_LOG_LEVEL=3"
case "$FLAVOR" in
@@ -49,10 +49,17 @@ EOF
CI_TARGET=lint
EOF
;;
+ functionaltest-lua)
+ BUILD_FLAGS="$BUILD_FLAGS -DPREFER_LUA=ON"
+ FUNCTIONALTEST=functionaltest-lua
+ DEPS_CMAKE_FLAGS="$DEPS_CMAKE_FLAGS -DUSE_BUNDLED_LUAJIT=OFF"
+ ;;
*)
;;
esac
cat <<EOF >> "$GITHUB_ENV"
$BUILD_FLAGS
+DEPS_CMAKE_FLAGS=$DEPS_CMAKE_FLAGS
+FUNCTIONALTEST=$FUNCTIONALTEST
EOF
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 94c371b62d..27fd2b97bb 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -20,6 +20,7 @@ Reporting problems
- Update Neovim to the latest version to see if your problem persists.
- Disable plugins incrementally, to narrow down the cause of the issue.
- When reporting a crash, [include a stacktrace](https://github.com/neovim/neovim/wiki/FAQ#backtrace-linux).
+- Use [ASAN/UBSAN](#clang-sanitizers-asan-and-ubsan) to get detailed errors for segfaults and undefined behavior.
- [Bisect][git-bisect] to the cause of a regression, if you are able. This is _extremely_ helpful.
- Check `$NVIM_LOG_FILE`, if it exists.
- Include `cmake --system-information` for build-related issues.
@@ -172,7 +173,20 @@ master build. To view the defects, just request access; you will be approved.
```
git log --oneline --no-merges --grep coverity
```
+
+### Clang sanitizers (ASAN and UBSAN)
+ ASAN/UBSAN can be used to detect memory errors and other common forms of undefined behavior at runtime in debug builds.
+ To build neovim with sanitizers enabled, use
+ ```
+ rm -rf build && CMAKE_EXTRA_FLAGS="-DCMAKE_C_COMPILER=clang -DCLANG_ASAN_UBSAN=1" make
+ ```
+ When running neovim, use
+ ```
+ UBSAN_OPTIONS=print_stacktrace=1 ASAN_OPTIONS=log_path=/tmp/nvim_asan nvim args...
+ ```
+ If neovim exits unexpectedly, check `/tmp/nvim_asan.{PID}` (or your preferred `log_path`) for log files with error messages.
+
Coding
------
diff --git a/scripts/genvimvim.lua b/scripts/genvimvim.lua
index ccd5489fdc..2c3701bf0c 100644
--- a/scripts/genvimvim.lua
+++ b/scripts/genvimvim.lua
@@ -123,7 +123,7 @@ end
w('\n\nsyn case match')
local vimfun_start = 'syn keyword vimFuncName contained '
w('\n\n' .. vimfun_start)
-funcs = mpack.unpack(io.open(funcs_file):read("*all"))
+funcs = mpack.unpack(io.open(funcs_file, 'rb'):read("*all"))
local started = 0
for name, def in pairs(funcs) do
if name then
diff --git a/third-party/CMakeLists.txt b/third-party/CMakeLists.txt
index f9da7c497a..e8999bf1ed 100644
--- a/third-party/CMakeLists.txt
+++ b/third-party/CMakeLists.txt
@@ -209,9 +209,8 @@ set(LIBICONV_SHA256 ccf536620a45458d26ba83887a983b96827001e92a13847b45e4925cc891
set(TREESITTER_C_URL https://github.com/tree-sitter/tree-sitter-c/archive/5aa0bbb.tar.gz)
set(TREESITTER_C_SHA256 a5dcb37460d83002dfae7f9a208170ddbc9a047f231b9d6b75da7d36d707db2f)
-# This is a bit after 0.19.5 because it fixes issues with queries
-set(TREESITTER_URL https://github.com/tree-sitter/tree-sitter/archive/6ed42747a4e0faee9b65edbbacc86ed0caeae05c.zip)
-set(TREESITTER_SHA256 07b8d090ae856d4ea8a494c08900271545d44af2558278a27693f9a47d9e75e3)
+set(TREESITTER_URL https://github.com/tree-sitter/tree-sitter/archive/v0.20.0.tar.gz)
+set(TREESITTER_SHA256 4a8070b9de17c3b8096181fe8530320ab3e8cca685d8bee6a3e8d164b5fb47da)
if(USE_BUNDLED_UNIBILIUM)
include(BuildUnibilium)