diff options
-rw-r--r-- | .github/workflows/ci.yml | 4 | ||||
-rwxr-xr-x | .github/workflows/env.sh | 11 | ||||
-rw-r--r-- | CONTRIBUTING.md | 14 |
3 files changed, 27 insertions, 2 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 ------ |