diff --git a/.builds/freebsd.yml b/.builds/freebsd.yml new file mode 100644 index 0000000000..36f44f236b --- /dev/null +++ b/.builds/freebsd.yml @@ -0,0 +1,44 @@ +image: freebsd/12.x + +packages: +- cmake +- gmake +- ninja +- libtool +- sha +- automake +- pkgconf +- unzip +- wget +- gettext +- python +- libffi + +sources: +- https://github.com/neovim/neovim + +environment: + SOURCEHUT: 1 + LANG: en_US.UTF-8 + CMAKE_EXTRA_FLAGS: -DTRAVIS_CI_BUILD=ON -DMIN_LOG_LEVEL=3 + +tasks: +- build-deps: | + cd neovim + gmake deps +- build: | + cd neovim + gmake CMAKE_BUILD_TYPE=Release CMAKE_EXTRA_FLAGS="${CMAKE_EXTRA_FLAGS}" nvim +- functionaltest: | + cd neovim + gmake functionaltest +- unittest: | + cd neovim + gmake unittest + +# Unfortunately, oldtest is tanking hard on sourcehut's FreeBSD instance +# and not producing any logs as a result. So don't do this task for now. +# Ref: https://github.com/neovim/neovim/pull/11477#discussion_r352095005. +# - test-oldtest: | +# cd neovim +# gmake oldtest diff --git a/.builds/openbsd.yml b/.builds/openbsd.yml index a8f6992e3f..5fa6556066 100644 --- a/.builds/openbsd.yml +++ b/.builds/openbsd.yml @@ -1,41 +1,43 @@ # sourcehut CI: https://builds.sr.ht/~jmk/neovim -image: openbsd/6.5 +image: openbsd/6.7 packages: - autoconf-2.69p2 - automake-1.15.1 - cmake -- gettext-0.19.8.1p3 -- gettext-tools-0.19.8.1 +- gettext-runtime-0.20.1p1 +- gettext-tools-0.20.1p3 - gmake - libtool -- ninja-1.8.2p0 -- unzip-6.0p11 +- ninja-1.10.0 +- unzip-6.0p13 sources: - https://github.com/neovim/neovim +environment: + SOURCEHUT: 1 + LC_CTYPE: en_US.UTF-8 + CMAKE_EXTRA_FLAGS: -DTRAVIS_CI_BUILD=ON -DMIN_LOG_LEVEL=3 + tasks: -- build: | +- build-deps: | export AUTOCONF_VERSION=2.69 export AUTOMAKE_VERSION=1.15 - cd neovim - mkdir .deps - cd .deps + mkdir neovim/.deps + cd neovim/.deps cmake -G Ninja ../third-party/ cmake --build . --config Debug - cd .. - mkdir build - cd build - cmake -G Ninja -DMIN_LOG_LEVEL=3 .. +- build: | + mkdir neovim/build + cd neovim/build + cmake -G Ninja $CMAKE_EXTRA_FLAGS .. cmake --build . --config Debug ./bin/nvim --version -- test: | - export LC_CTYPE=en_US.UTF-8 - # functional tests +- functionaltest: | cd neovim/build - # cmake --build . --config Debug --target functionaltest - # oldtests - cd .. + cmake --build . --config Debug --target functionaltest +- oldtest: | + cd neovim gmake oldtest diff --git a/.gitattributes b/.gitattributes index 15a5c58091..cb5934a2a1 100755 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,2 @@ *.h linguist-language=C +src/nvim/testdir/test42.in diff diff --git a/.github/ISSUE_TEMPLATE/lsp_bug_report.md b/.github/ISSUE_TEMPLATE/lsp_bug_report.md new file mode 100644 index 0000000000..0e5155c7ac --- /dev/null +++ b/.github/ISSUE_TEMPLATE/lsp_bug_report.md @@ -0,0 +1,46 @@ +--- +name: Language server client bug report +about: Report a built-in lsp problem in Nvim +title: '' +labels: bug, lsp + +--- + + + +- `nvim --version`: +- language server name/version: +- Operating system/version: + +
+nvim -c ":checkhealth nvim nvim_lsp" + + + +
+ +
+lsp.log + + + +
+ +### Steps to reproduce using `nvim -u NORC` + +``` +nvim -u NORC +``` + +### Actual behaviour + +### Expected behaviour + diff --git a/.gitignore b/.gitignore index 7db3d96e2b..699d493b59 100644 --- a/.gitignore +++ b/.gitignore @@ -10,7 +10,9 @@ compile_commands.json /dist/ /.deps/ /tmp/ +/.clangd/ +.DS_Store *.mo .*.sw? *~ @@ -42,6 +44,7 @@ tags /src/nvim/testdir/valgrind.* /src/nvim/testdir/.gdbinit /runtime/indent/testdir/*.out ++runtime/indent/testdir/*.fail # Generated by src/nvim/testdir/runnvim.sh. /src/nvim/testdir/*.tlog @@ -58,6 +61,8 @@ local.mk /runtime/doc/*.html /runtime/doc/tags.ref /runtime/doc/errors.log +# Don't include the mpack files. +/runtime/doc/*.mpack # CLion /.idea/ diff --git a/.luacheckrc b/.luacheckrc index b945835bba..a628daed80 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -1,7 +1,14 @@ -- vim: ft=lua tw=80 +stds.nvim = { + read_globals = { "jit" } +} +std = "lua51+nvim" + -- Ignore W211 (unused variable) with preload files. files["**/preload.lua"] = {ignore = { "211" }} +-- Allow vim module to modify itself, but only here. +files["src/nvim/lua/vim.lua"] = {ignore = { "122/vim" }} -- Don't report unused self arguments of methods. self = false diff --git a/.luacov b/.luacov new file mode 100644 index 0000000000..f8eb28e3f7 --- /dev/null +++ b/.luacov @@ -0,0 +1,22 @@ +-- Configuration file for LuaCov + +local source = require("lfs").currentdir() + +local function pesc(s) + assert(type(s) == 'string', s) + return s:gsub('[%(%)%.%%%+%-%*%?%[%]%^%$]', '%%%1') +end + +return { + include = { + -- Absolute paths (starting with source dir, not hidden (i.e. .deps)). + pesc(source) .. "[/\\][^.].+", + -- Relative (non-hidden) paths. + '^[^/\\.]', + }, + modules = { + ['vim'] = 'runtime/lua/vim/shared.lua' + }, +} + +-- vim: ft=lua tw=80 sw=2 et diff --git a/.travis.yml b/.travis.yml index 325b5e7b56..b920f70f45 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,19 @@ language: c env: global: + # Encrypted environment variables, see + # http://docs.travis-ci.com/user/encryption-keys/ + # + # SNAP_SECRET_KEY: generated by: + # travis encrypt SNAP_SECRET_KEY=xx --add + # https://github.com/neovim/neovim/pull/11428 + # snapcraft key expires after 1 year. Steps to refresh it: + # 1. snapcraft enable-ci travis --refresh + # 2. mv .snapcraft/travis_snapcraft.cfg ci/snap/travis_snapcraft.cfg + # 3. Copy after_success command to ci/snap/deploy.sh from .travis.yml + # 4. Undo changes to .travis.yml + - secure: hd0qn2u8ABbJg5Bx4pBRcUQbKYFmcSHoecyHIPTCnGJT+NI41Bvm/IkN/N5DhBF+LbD3Q2nmR/dzI5H/dqS7RxMFvEx1DuFLendFHHX3MYf0AuKpXYY3gwgMTmqx8p/v6srlU7RBGWNGzHCWqksAem+EIWCe3I7WvfdKo1/DV/Y= + # Set "false" to force rebuild of third-party dependencies. - CACHE_ENABLE=true # Build directory for Neovim. @@ -24,10 +37,6 @@ env: -DDEPS_PREFIX=$DEPS_BUILD_DIR/usr -DMIN_LOG_LEVEL=3" - DEPS_CMAKE_FLAGS="-DUSE_BUNDLED_GPERF=OFF" - # Additional CMake flags for 32-bit builds. - - CMAKE_FLAGS_32BIT="-DCMAKE_SYSTEM_LIBRARY_PATH=/lib32:/usr/lib32:/usr/local/lib32 - -DCMAKE_IGNORE_PATH=/lib:/usr/lib:/usr/local/lib - -DCMAKE_TOOLCHAIN_FILE=$TRAVIS_BUILD_DIR/cmake/i386-linux-gnu.toolchain.cmake" # Environment variables for Clang sanitizers. - ASAN_OPTIONS="detect_leaks=1:check_initialization_order=1:log_path=$LOG_DIR/asan" - TSAN_OPTIONS="log_path=$LOG_DIR/tsan" @@ -62,12 +71,12 @@ addons: - build-essential - clang - cmake + - cpanminus - cscope - gcc-multilib - gdb - gperf - language-pack-tr - - libc6-dev-i386 - libtool-bin - locales - ninja-build @@ -76,10 +85,14 @@ addons: - valgrind - xclip homebrew: - update: false + update: true + casks: + - powershell packages: - ccache + - cpanminus - ninja + - perl jobs: include: @@ -99,14 +112,19 @@ jobs: - GCOV=gcov-9 - CMAKE_FLAGS="$CMAKE_FLAGS -DUSE_GCOV=ON" - GCOV_ERROR_FILE="/tmp/libgcov-errors.log" + - USE_LUACOV=1 + - BUSTED_ARGS="--coverage" - *common-job-env addons: apt: sources: - sourceline: 'ppa:ubuntu-toolchain-r/test' + - sourceline: 'deb [arch=amd64] https://packages.microsoft.com/ubuntu/16.04/prod xenial main' + key_url: 'https://packages.microsoft.com/keys/microsoft.asc' packages: - *common-apt-packages - gcc-9 + - powershell - if: branch = master AND commit_message !~ /\[skip.lint\]/ name: lint os: linux @@ -136,15 +154,73 @@ jobs: compiler: gcc env: - BUILD_32BIT=ON + - CMAKE_FLAGS="$CMAKE_FLAGS -m32 -DCMAKE_TOOLCHAIN_FILE=$TRAVIS_BUILD_DIR/cmake/i386-linux-gnu.toolchain.cmake" + - DEPS_CMAKE_FLAGS="$DEPS_CMAKE_FLAGS -m32 -DCMAKE_TOOLCHAIN_FILE=$TRAVIS_BUILD_DIR/cmake/i386-linux-gnu.toolchain.cmake" # Minimum required CMake. - CMAKE_URL=https://cmake.org/files/v2.8/cmake-2.8.12-Linux-i386.sh - *common-job-env + - name: big-endian + os: linux + arch: s390x + compiler: gcc + env: + - FUNCTIONALTEST=functionaltest-lua + - CMAKE_FLAGS="$CMAKE_FLAGS -DPREFER_LUA=ON" + - DEPS_CMAKE_FLAGS="$DEPS_CMAKE_FLAGS -DUSE_BUNDLED_LUAJIT=OFF" + - *common-job-env + addons: + apt: + packages: + - *common-apt-packages + - gettext + - python-pip + - python3-pip + - python-setuptools + - python3-setuptools + - python-dev + - python3-dev - name: clang-tsan os: linux compiler: clang env: - CLANG_SANITIZER=TSAN - *common-job-env + - if: type != pull_request + name: snap + os: linux + env: + - LC_ALL: C.UTF-8 + - LANG: C.UTF-8 + - SNAPCRAFT_ENABLE_SILENT_REPORT: y + - SNAPCRAFT_ENABLE_DEVELOPER_DEBUG: y + addons: + snaps: + - name: snapcraft + channel: stable + classic: true + - name: http + - name: transfer + - name: lxd + channel: stable + # Override default before_install, before_cache. + before_install: /bin/true + before_cache: /bin/true + install: ci/snap/install.sh + before_script: echo "Building snap..." + script: ci/snap/script.sh + after_success: ci/snap/after_success.sh + deploy: + skip_cleanup: true + provider: script + script: ci/snap/deploy.sh + on: + branch: master + allow_failures: + - env: + - LC_ALL: C.UTF-8 + - LANG: C.UTF-8 + - SNAPCRAFT_ENABLE_SILENT_REPORT: y + - SNAPCRAFT_ENABLE_DEVELOPER_DEBUG: y fast_finish: true before_install: ci/before_install.sh diff --git a/CMakeLists.txt b/CMakeLists.txt index 9c3c20d23f..a4e49ccfc5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,6 +6,13 @@ cmake_minimum_required(VERSION 2.8.12) project(nvim C) +if(POLICY CMP0065) + cmake_policy(SET CMP0065 NEW) +endif() +if(POLICY CMP0060) + cmake_policy(SET CMP0060 NEW) +endif() + # Point CMake at any custom modules we may ship list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake") @@ -113,47 +120,32 @@ set_property(CACHE CMAKE_BUILD_TYPE PROPERTY # If not in a git repo (e.g., a tarball) these tokens define the complete # version string, else they are combined with the result of `git describe`. set(NVIM_VERSION_MAJOR 0) -set(NVIM_VERSION_MINOR 4) +set(NVIM_VERSION_MINOR 5) set(NVIM_VERSION_PATCH 0) -set(NVIM_VERSION_PRERELEASE "") # for package maintainers +set(NVIM_VERSION_PRERELEASE "-dev") # for package maintainers # API level -set(NVIM_API_LEVEL 6) # Bump this after any API change. +set(NVIM_API_LEVEL 7) # Bump this after any API change. set(NVIM_API_LEVEL_COMPAT 0) # Adjust this after a _breaking_ API change. -set(NVIM_API_PRERELEASE false) - -file(TO_CMAKE_PATH ${CMAKE_CURRENT_LIST_DIR}/.git FORCED_GIT_DIR) -include(GetGitRevisionDescription) -get_git_head_revision(GIT_REFSPEC NVIM_VERSION_COMMIT) -if(NVIM_VERSION_COMMIT) # is a git repo - git_describe(NVIM_VERSION_MEDIUM) - # `git describe` annotates the most recent tagged release; for pre-release - # builds we must replace that with the unreleased version. - string(REGEX REPLACE "^v[0-9]+\\.[0-9]+\\.[0-9]+" - "v${NVIM_VERSION_MAJOR}.${NVIM_VERSION_MINOR}.${NVIM_VERSION_PATCH}" - NVIM_VERSION_MEDIUM - ${NVIM_VERSION_MEDIUM}) -endif() +set(NVIM_API_PRERELEASE true) set(NVIM_VERSION_BUILD_TYPE "${CMAKE_BUILD_TYPE}") # NVIM_VERSION_CFLAGS set further below. set(CMAKE_EXPORT_COMPILE_COMMANDS ON) -# Minimize logging for release-type builds. -if(NOT CMAKE_C_FLAGS_RELEASE MATCHES DMIN_LOG_LEVEL) - set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DMIN_LOG_LEVEL=3") -endif() -if(NOT CMAKE_C_FLAGS_MINSIZEREL MATCHES DMIN_LOG_LEVEL) - set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} -DMIN_LOG_LEVEL=3") -endif() -if(NOT CMAKE_C_FLAGS_RELWITHDEBINFO MATCHES DMIN_LOG_LEVEL) - set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -DMIN_LOG_LEVEL=3") -endif() - # Log level (MIN_LOG_LEVEL in log.h) if("${MIN_LOG_LEVEL}" MATCHES "^$") - message(STATUS "MIN_LOG_LEVEL not specified, default is 1 (INFO)") + # Minimize logging for release-type builds. + if(CMAKE_BUILD_TYPE STREQUAL "Release" + OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo" + OR CMAKE_BUILD_TYPE STREQUAL "MinSizeRel") + message(STATUS "MIN_LOG_LEVEL not specified, default is 3 (ERROR) for release builds") + set(MIN_LOG_LEVEL 3) + else() + message(STATUS "MIN_LOG_LEVEL not specified, default is 1 (INFO)") + set(MIN_LOG_LEVEL 1) + endif() else() if(NOT MIN_LOG_LEVEL MATCHES "^[0-3]$") message(FATAL_ERROR "invalid MIN_LOG_LEVEL: " ${MIN_LOG_LEVEL}) @@ -309,11 +301,18 @@ if(UNIX) if(HAS_FSTACK_PROTECTOR_STRONG_FLAG) add_compile_options(-fstack-protector-strong) + link_libraries(-fstack-protector-strong) elseif(HAS_FSTACK_PROTECTOR_FLAG) add_compile_options(-fstack-protector --param ssp-buffer-size=4) + link_libraries(-fstack-protector --param ssp-buffer-size=4) endif() endif() +check_c_compiler_flag(-fno-common HAVE_FNO_COMMON) +if (HAVE_FNO_COMMON) + add_compile_options(-fno-common) +endif() + check_c_compiler_flag(-fdiagnostics-color=auto HAS_DIAG_COLOR_FLAG) if(HAS_DIAG_COLOR_FLAG) if(CMAKE_GENERATOR MATCHES "Ninja") @@ -323,10 +322,10 @@ if(HAS_DIAG_COLOR_FLAG) endif() endif() -option(TRAVIS_CI_BUILD "Travis/QuickBuild CI, extra flags will be set" OFF) +option(TRAVIS_CI_BUILD "Travis/sourcehut CI, extra flags will be set" OFF) if(TRAVIS_CI_BUILD) - message(STATUS "Travis/QuickBuild CI build enabled") + message(STATUS "Travis/sourcehut CI build enabled") add_compile_options(-Werror) if(DEFINED ENV{BUILD_32BIT}) # Get some test coverage for unsigned char @@ -454,17 +453,17 @@ if((CLANG_ASAN_UBSAN OR CLANG_MSAN OR CLANG_TSAN) AND NOT CMAKE_C_COMPILER_ID MA message(FATAL_ERROR "Sanitizers are only supported for Clang") endif() +if(ENABLE_LIBICONV) + find_package(Iconv REQUIRED) + include_directories(SYSTEM ${Iconv_INCLUDE_DIRS}) +endif() + if(ENABLE_LIBINTL) # LibIntl (not Intl) selects our FindLibIntl.cmake script. #8464 find_package(LibIntl REQUIRED) include_directories(SYSTEM ${LibIntl_INCLUDE_DIRS}) endif() -if(ENABLE_LIBICONV) - find_package(Iconv REQUIRED) - include_directories(SYSTEM ${Iconv_INCLUDE_DIRS}) -endif() - # Determine platform's threading library. Set CMAKE_THREAD_PREFER_PTHREAD # explicitly to indicate a strong preference for pthread. set(CMAKE_THREAD_PREFER_PTHREAD ON) @@ -486,18 +485,19 @@ include(LuaHelpers) set(LUA_DEPENDENCIES lpeg mpack bit) if(NOT LUA_PRG) foreach(CURRENT_LUA_PRG luajit lua5.1 lua5.2 lua) - # If LUA_PRG is set find_program() will not search - unset(LUA_PRG CACHE) + unset(_CHECK_LUA_PRG CACHE) unset(LUA_PRG_WORKS) - find_program(LUA_PRG ${CURRENT_LUA_PRG}) + find_program(_CHECK_LUA_PRG ${CURRENT_LUA_PRG}) - if(LUA_PRG) - check_lua_deps(${LUA_PRG} "${LUA_DEPENDENCIES}" LUA_PRG_WORKS) + if(_CHECK_LUA_PRG) + check_lua_deps(${_CHECK_LUA_PRG} "${LUA_DEPENDENCIES}" LUA_PRG_WORKS) if(LUA_PRG_WORKS) + set(LUA_PRG "${_CHECK_LUA_PRG}" CACHE FILEPATH "Path to a program.") break() endif() endif() endforeach() + unset(_CHECK_LUA_PRG CACHE) else() check_lua_deps(${LUA_PRG} "${LUA_DEPENDENCIES}" LUA_PRG_WORKS) endif() @@ -560,10 +560,7 @@ if(BUSTED_PRG) endif() set(UNITTEST_PREREQS nvim-test unittest-headers) - set(FUNCTIONALTEST_PREREQS nvim printargs-test shell-test streams-test ${GENERATED_HELP_TAGS}) - if(NOT WIN32) - list(APPEND FUNCTIONALTEST_PREREQS tty-test) - endif() + set(FUNCTIONALTEST_PREREQS nvim printenv-test printargs-test shell-test streams-test tty-test ${GENERATED_HELP_TAGS}) set(BENCHMARK_PREREQS nvim tty-test) # Useful for automated build systems, if they want to manually run the tests. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 607f1aae83..c7d8398bf0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -8,7 +8,7 @@ If you want to help but don't know where to start, here are some low-risk/isolated tasks: - [Merge a Vim patch]. -- Try a [complexity:low] issue. +- Try a [good first issue](../../labels/good%20first%20issue) or [complexity:low] issue. - Fix bugs found by [Clang](#clang-scan-build), [PVS](#pvs-studio) or [Coverity](#coverity). @@ -65,10 +65,11 @@ Pull requests (PRs) Pull requests have three stages: `[WIP]` (Work In Progress), `[RFC]` (Request For Comment) and `[RDY]` (Ready). -- `[RFC]` is assumed by default, i.e. you are requesting a review. -- Add `[WIP]` to the PR title if you are _not_ requesting feedback and the work - is still in flux. -- Add `[RDY]` if you are _done_ and only waiting on merge. +1. `[RFC]` is assumed by default, **do not** put "RFC" in the PR title (it adds + noise to merge commit messages). +2. Add `[WIP]` to the PR title if you are _not_ requesting feedback and the work + is still in flux. +3. Add `[RDY]` to the PR title if you are _done_ and only waiting on merge. ### Commit messages @@ -85,7 +86,7 @@ the VCS/git logs more valuable. ### Automated builds (CI) -Each pull request must pass the automated builds on [Travis CI], [QuickBuild] +Each pull request must pass the automated builds on [Travis CI], [sourcehut] and [AppVeyor]. - CI builds are compiled with [`-Werror`][gcc-warnings], so compiler warnings @@ -100,14 +101,19 @@ and [AppVeyor]. - The [lint](#lint) build checks modified lines _and their immediate neighbors_, to encourage incrementally updating the legacy style to meet our [style](#style). (See [#3174][3174] for background.) -- [How to investigate QuickBuild failures](https://github.com/neovim/neovim/pull/4718#issuecomment-217631350) - - QuickBuild uses this invocation: - ``` - mkdir -p build/${params.get("buildType")} \ - && cd build/${params.get("buildType")} \ - && cmake -G "Unix Makefiles" -DBUSTED_OUTPUT_TYPE=TAP -DCMAKE_BUILD_TYPE=${params.get("buildType")} - -DTRAVIS_CI_BUILD=ON ../.. && ${node.getAttribute("make", "make")} - VERBOSE=1 nvim unittest-prereqs functionaltest-prereqs +- CI for freebsd and openbsd runs on [sourcehut]. + - To get a backtrace on freebsd (after connecting via ssh): + ```sh + sudo pkg install tmux # If you want tmux. + lldb build/bin/nvim -c nvim.core + + # To get a full backtrace: + # 1. Rebuild with debug info. + rm -rf nvim.core build + gmake CMAKE_BUILD_TYPE=RelWithDebInfo CMAKE_EXTRA_FLAGS="-DTRAVIS_CI_BUILD=ON -DMIN_LOG_LEVEL=3" nvim + # 2. Run the failing test to generate a new core file. + TEST_FILE=test/functional/foo.lua gmake functionaltest + lldb build/bin/nvim -c nvim.core ``` ### Clang scan-build @@ -223,7 +229,7 @@ as context, use the `-W` argument as well. [review-checklist]: https://github.com/neovim/neovim/wiki/Code-review-checklist [3174]: https://github.com/neovim/neovim/issues/3174 [Travis CI]: https://travis-ci.org/neovim/neovim -[QuickBuild]: http://neovim-qb.szakmeister.net/dashboard +[sourcehut]: https://builds.sr.ht/~jmk [AppVeyor]: https://ci.appveyor.com/project/neovim/neovim [Merge a Vim patch]: https://github.com/neovim/neovim/wiki/Merging-patches-from-upstream-Vim [Clang report]: https://neovim.io/doc/reports/clang/ diff --git a/Makefile b/Makefile index 264ae8a470..39f42739ff 100644 --- a/Makefile +++ b/Makefile @@ -58,11 +58,15 @@ endif BUILD_CMD = $(BUILD_TOOL) -ifneq ($(VERBOSE),) - # Only need to handle Ninja here. Make will inherit the VERBOSE variable. - ifeq ($(BUILD_TYPE),Ninja) +# Only need to handle Ninja here. Make will inherit the VERBOSE variable, and the -j and -n flags. +ifeq ($(BUILD_TYPE),Ninja) + ifneq ($(VERBOSE),) BUILD_CMD += -v endif + BUILD_CMD += $(shell printf '%s' '$(MAKEFLAGS)' | grep -o -- '-j[0-9]\+') + ifeq (n,$(findstring n,$(firstword -$(MAKEFLAGS)))) + BUILD_CMD += -n + endif endif DEPS_CMAKE_FLAGS ?= @@ -119,8 +123,13 @@ oldtest: | nvim build/runtime/doc/tags ifeq ($(strip $(TEST_FILE)),) +$(SINGLE_MAKE) -C src/nvim/testdir NVIM_PRG="$(realpath build/bin/nvim)" $(MAKEOVERRIDES) else - +$(SINGLE_MAKE) -C src/nvim/testdir NVIM_PRG="$(realpath build/bin/nvim)" NEW_TESTS=$(TEST_FILE) SCRIPTS= $(MAKEOVERRIDES) + @# Handle TEST_FILE=test_foo{,.res,.vim}. + +$(SINGLE_MAKE) -C src/nvim/testdir NVIM_PRG="$(realpath build/bin/nvim)" SCRIPTS= $(MAKEOVERRIDES) $(patsubst %.vim,%,$(patsubst %.res,%,$(TEST_FILE))) endif +# Build oldtest by specifying the relative .vim filename. +.PHONY: phony_force +src/nvim/testdir/%.vim: phony_force + +$(SINGLE_MAKE) -C src/nvim/testdir NVIM_PRG="$(realpath build/bin/nvim)" SCRIPTS= $(MAKEOVERRIDES) $(patsubst src/nvim/testdir/%.vim,%,$@) build/runtime/doc/tags helptags: | nvim +$(BUILD_CMD) -C build runtime/doc/tags @@ -138,6 +147,14 @@ functionaltest-lua: | nvim lualint: | build/.ran-cmake deps $(BUILD_CMD) -C build lualint +shlint: + @shellcheck --version | head -n 2 + shellcheck scripts/vim-patch.sh + +_opt_shlint: + @command -v shellcheck && { $(MAKE) shlint; exit $$?; } \ + || echo "SKIP: shlint (shellcheck not found)" + pylint: flake8 contrib/ scripts/ src/ test/ @@ -158,6 +175,7 @@ clean: +test -d build && $(BUILD_CMD) -C build clean || true $(MAKE) -C src/nvim/testdir clean $(MAKE) -C runtime/doc clean + $(MAKE) -C runtime/indent clean distclean: rm -rf $(DEPS_BUILD_DIR) build @@ -187,16 +205,16 @@ appimage: appimage-%: bash scripts/genappimage.sh $* -lint: check-single-includes clint lualint _opt_pylint +lint: check-single-includes clint lualint _opt_pylint _opt_shlint # Generic pattern rules, allowing for `make build/bin/nvim` etc. # Does not work with "Unix Makefiles". ifeq ($(BUILD_TYPE),Ninja) -build/%: +build/%: phony_force $(BUILD_CMD) -C build $(patsubst build/%,%,$@) -$(DEPS_BUILD_DIR)/%: +$(DEPS_BUILD_DIR)/%: phony_force $(BUILD_CMD) -C $(DEPS_BUILD_DIR) $(patsubst $(DEPS_BUILD_DIR)/%,%,$@) endif -.PHONY: test lualint pylint functionaltest unittest lint clint clean distclean nvim libnvim cmake deps install appimage checkprefix +.PHONY: test lualint pylint shlint functionaltest unittest lint clint clean distclean nvim libnvim cmake deps install appimage checkprefix diff --git a/README.md b/README.md index 1bdf33d6bb..f9a9a7fe8b 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,7 @@ [![Neovim](https://raw.githubusercontent.com/neovim/neovim.github.io/master/logos/neovim-logo-300x87.png)](https://neovim.io) -[Wiki](https://github.com/neovim/neovim/wiki) | [Documentation](https://neovim.io/doc) | -[Chat/Discussion](https://gitter.im/neovim/neovim) | +[Chat](https://gitter.im/neovim/neovim) | [Twitter](https://twitter.com/Neovim) [![Travis build status](https://travis-ci.org/neovim/neovim.svg?branch=master)](https://travis-ci.org/neovim/neovim) @@ -15,6 +14,7 @@ [![Packages](https://repology.org/badge/tiny-repos/neovim.svg)](https://repology.org/metapackage/neovim) [![Debian CI](https://badges.debian.net/badges/debian/testing/neovim/version.svg)](https://buildd.debian.org/neovim) [![Downloads](https://img.shields.io/github/downloads/neovim/neovim/total.svg?maxAge=2592001)](https://github.com/neovim/neovim/releases/) +[![nvim](https://snapcraft.io//nvim/badge.svg)](https://snapcraft.io/nvim) Neovim is a project that seeks to aggressively refactor Vim in order to: @@ -67,7 +67,7 @@ To skip bundled (`third-party/*`) dependencies: 1. Install the dependencies using a package manager. ``` - sudo apt install gperf luajit luarocks libuv1-dev libluajit-5.1-dev libunibilium-dev libmsgpack-dev libtermkey-dev libvterm-dev + sudo apt install gperf luajit luarocks libuv1-dev libluajit-5.1-dev libunibilium-dev libmsgpack-dev libtermkey-dev libvterm-dev libutf8proc-dev sudo luarocks build mpack sudo luarocks build lpeg sudo luarocks build inspect @@ -113,17 +113,9 @@ Project layout License ------- -Neovim is licensed under the terms of the Apache 2.0 license, except for -parts that were contributed under the Vim license. - -- Contributions committed before [b17d96][license-commit] remain under the Vim - license. - -- Contributions committed after [b17d96][license-commit] are licensed under - Apache 2.0 unless those contributions were copied from Vim (identified in - the commit logs by the `vim-patch` token). - -See `LICENSE` for details. +Neovim contributions since [b17d96][license-commit] are licensed under the +Apache 2.0 license, except for contributions copied from Vim (identified by the +`vim-patch` token). See LICENSE for details. Vim is Charityware. You can use and copy it as much as you like, but you are encouraged to make a donation for needy children in Uganda. Please see the diff --git a/appveyor.yml b/appveyor.yml index 756c7fea2e..01ca16f930 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -22,9 +22,6 @@ init: #- ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) matrix: fast_finish: true -install: [] -before_build: -- ps: Install-Product node 8 build_script: - powershell ci\build.ps1 after_build: @@ -40,6 +37,3 @@ cache: artifacts: - path: build/Neovim.zip - path: build/bin/nvim.exe -branches: - only: - - master diff --git a/ci/before_install.sh b/ci/before_install.sh index 5cb6894b8c..1cf60edf73 100755 --- a/ci/before_install.sh +++ b/ci/before_install.sh @@ -3,10 +3,6 @@ set -e set -o pipefail -if [[ "${CI_TARGET}" == lint ]]; then - exit -fi - echo 'Python info:' ( set -x @@ -26,7 +22,7 @@ if [[ "${TRAVIS_OS_NAME}" != osx ]] && command -v pyenv; then echo 'Setting Python versions via pyenv' # Prefer Python 2 over 3 (more conservative). - pyenv global 2.7.15:3.7 + pyenv global 2.7.15:3.7.1 echo 'Updated Python info:' ( @@ -47,12 +43,11 @@ if [[ "${TRAVIS_OS_NAME}" == osx ]] || [ ! -f ~/.nvm/nvm.sh ]; then fi source ~/.nvm/nvm.sh -nvm install --lts -nvm use --lts +nvm install 10 if [[ -n "$CMAKE_URL" ]]; then echo "Installing custom CMake: $CMAKE_URL" - curl --retry 5 --silent --fail -o /tmp/cmake-installer.sh "$CMAKE_URL" + curl --retry 5 --silent --show-error --fail -o /tmp/cmake-installer.sh "$CMAKE_URL" mkdir -p "$HOME/.local/bin" /opt/cmake-custom bash /tmp/cmake-installer.sh --prefix=/opt/cmake-custom --skip-license ln -sfn /opt/cmake-custom/bin/cmake "$HOME/.local/bin/cmake" diff --git a/ci/before_script.sh b/ci/before_script.sh index 605ecdbf66..1759dbe942 100755 --- a/ci/before_script.sh +++ b/ci/before_script.sh @@ -10,6 +10,12 @@ fi CI_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" source "${CI_DIR}/common/build.sh" +# Enable ipv6 on Travis. ref: a39c8b7ce30d +if ! test "${TRAVIS_OS_NAME}" = osx ; then + echo "before_script.sh: enable ipv6" + sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=0 +fi + # Test some of the configuration variables. if [[ -n "${GCOV}" ]] && [[ ! $(type -P "${GCOV}") ]]; then echo "\$GCOV: '${GCOV}' is not executable." @@ -35,5 +41,10 @@ fi # Compile dependencies. build_deps +# Install cluacov for Lua coverage. +if [[ "$USE_LUACOV" == 1 ]]; then + "${DEPS_BUILD_DIR}/usr/bin/luarocks" install cluacov +fi + rm -rf "${LOG_DIR}" mkdir -p "${LOG_DIR}" diff --git a/ci/build.ps1 b/ci/build.ps1 index d533d7b4e0..36570be7ae 100644 --- a/ci/build.ps1 +++ b/ci/build.ps1 @@ -1,10 +1,12 @@ -$ErrorActionPreference = 'stop' -Set-PSDebug -Strict -Trace 1 +param([switch]$NoTests) +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' +$ProgressPreference = 'SilentlyContinue' $isPullRequest = ($env:APPVEYOR_PULL_REQUEST_HEAD_COMMIT -ne $null) $env:CONFIGURATION -match '^(?\w+)_(?32|64)(?:-(?