Compare commits

..

55 Commits

Author SHA1 Message Date
Justin M. Keyes
0159e4daae NVIM v0.5.1
BREAKING CHANGES:
d83df7f7b5 feat(lua)!: register_keystroke_callback => on_key
cd8f6c5fb7 feat(lsp)!: change handler signature #15504

FEATURES:
915dda3f96 feat(jobstart): add parameter to close stdin

FIXES:
f8e0011534 #15732 fix(inccommand): ignore trailing commands only for *previewed* command
2132c063af backport: fix(windowing): positioning of relative floats
51d6b26729 #15495 backport: tests(lua/on_yank): assert conditions that fail correctly
f7002337c0 #15482 backport: fix(lua): verify buffer in highlight.on_yank
6bda2f56eb #15454 backport: fix(window.c): win_close from other tabpage
be58ba250e #15372 backport: fix(autocmd.c): fix conditions in block_autocmds, unblock_autocmds
d0e9a11e39 backport: refactor(sign): include longer sign column option
5c42376c15 backport: fix(sign): reset auto sign column with minimum in float win minimal style
41f761130e backport: fix(decorations): crash when :bdelete (extmark_free_all) after clear_namespace
cf62554e5a #15111 backport: fix(:source): copy curbuf lines to memory before sourcing
6436100b6e #14809 backport: fix(:source, nvim_exec): handle Vimscript line continuations
917f306666 #15043 backport: test/memory_usage_spec: skip on MacOS
a9cca1b050 #14984 backport: fixup(clipboard): Fix error not properly handled
ae89330ec0 #14982 backport: fix(vim.opt): vimL map string values not trimmed
2229e99ef9 #14962 backport: fixup(clipboard): Use case matching
b6b12ea7c3 #15489 fix(man.vim): filetype=man is too eager
6f965f41df build: use RelWithDebInfo build for nightlies, Release for releases
f027c5e1e4 build: update appdata.xml version in release commit
8336488ce1 test(treesitter): skip all parsers tests if parsers aren't installed
008b83f5a2 Rename stdin to stdin_mode (fixes Windows build)

FIXES (LSP):
132053c1d2 #15523 backport: fix(lsp): resolve bufnr in buf_is_attached
a265201307 backport: fix(lsp): Ensure human readable errors are printed
33000bd9cf backport: fix(lsp): Ensure users get feedback on references/symbols errors or empty results
9f73b7c214 #14954 backport: fix(lsp): correctly check for windows in lsp logger
eaa1c47377 #15023 backport: fix(lsp): restore diagnostics extmarks that were moved to the last edit line
989ccb8222 #15011 backport: fix(lsp): restore diagnostics extmarks on buffer changes
2ae4c96d91 backport: fix(lsp): prevent double <text> for cached plaintext markup
7b0ae589f0 feat(lsp): allow root_dir to be nil (#15430) (Mathias Fußenegger)
8ec5bc9126 lsp(start_client): Allow passing custom workspaceFolders to the LSP (#15132) (sim)
959cf5e53c fix(lsp): check if buffer is valid in changetracking (#15505) (Jose Alvarez)
dc15b3a92c fix(lsp): avoid ipairs on non-sequential tables (#15059) (Michael Lingelbach)
18375c6df6 feat(lsp): improve vim.lsp.util.apply_text_edits (#15561) (hrsh7th)
7b1315fe61 feat(lsp): improve logging (#15636) (Michael Lingelbach)
2021-09-26 15:15:30 -07:00
Justin M. Keyes
c9e4f86b75 fix(release.sh): ignore failed "rm" 2021-09-26 15:15:30 -07:00
Justin M. Keyes
14cdaca6a8 fix(lsp): fix handler signature, tests
- not necessary on master: got lost in the vim.lsp.diagnostic => vim.diagnostic migration
- fix tests which accidentally depended on previous session
- ref #15504
2021-09-26 15:15:03 -07:00
Mathias Fußenegger
7b0ae589f0 feat(lsp): allow root_dir to be nil (#15430)
According to the protocol definition `rootPath`, `rootUri` and
`workspaceFolders` are allowed to be null.

Some language servers utilize this to provide "single file" support.
If all three are null, they don't attempt to index a directory but
instead only provide capabilities for a single file.
2021-09-26 11:28:28 -07:00
sim
8ec5bc9126 lsp(start_client): Allow passing custom workspaceFolders to the LSP (#15132)
Some language servers *cough*rust-analyzer*cough* need an empty/custom
workspaceFolders for certain usecases. For example, rust-analyzer
needs an empty workspaceFolders table for standalone file support
(See https://github.com/rust-analyzer/rust-analyzer/pull/8955).

This can also be useful for other languages that need to commonly
open a certain directory (like flutter or lua), which would help
prevent spinning up a new language server altogether.

In case no workspaceFolders are passed, we fallback to what we had
before.
2021-09-26 11:28:28 -07:00
Jose Alvarez
959cf5e53c fix(lsp): check if buffer is valid in changetracking (#15505) 2021-09-26 11:28:28 -07:00
Michael Lingelbach
dc15b3a92c fix(lsp): avoid ipairs on non-sequential tables (#15059)
ipairs terminates on the first nil index when iterating over table keys:

for i,k in ipairs( {[1] = 'test', [3] = 'test'} ) do
  print(i, k)
end

prints:
1 test

Instead, use pairs which continues iterating over the entire table:

for i,k in pairs( {[1] = 'test', [3] = 'test'} ) do
  print(i, k)
end

prints:
1 test
3 test
2021-09-26 11:28:28 -07:00
hrsh7th
18375c6df6 feat(lsp): improve vim.lsp.util.apply_text_edits (#15561)
- Fix the cursor position after applying TextEdits
- Support reversed range of TextEdit
- Invoke nvim_buf_set_text one by one
2021-09-26 11:28:28 -07:00
Michael Lingelbach
7b1315fe61 feat(lsp): improve logging (#15636)
* Simplify rpc encode/decode messages to rpc.send/rcp.receive
* Make missing handlers message throw a warning
* Clean up formatting style in log
* Move all non-RPC loop messages to trace instead of debug
* Add format func option to log to allow newlines in per log entry
2021-09-26 11:28:28 -07:00
Mathias Fußenegger
27bac13be6 fix(lsp): update lsp-handler signature in call_hierarchy (#15738)
This fixes the handler signature and also prevents n+1 requests firing
if there are multiple clients.

(The first `prepareCallHierarchy` handler is called once per client,
each invocation used `buf_request` to make more requests using *all*
clients)
2021-09-26 10:25:17 -07:00
Mathias Fußenegger
d26d489e2e fix(lsp): adapt codelens resolve to handler signature change (#15578)
Follow up to https://github.com/neovim/neovim/pull/15504
2021-09-26 10:25:17 -07:00
Jose Alvarez
a6eab6e25e fix(lsp): update workspace/applyEdit handler signature (#15573) 2021-09-26 10:25:17 -07:00
Michael Lingelbach
cd8f6c5fb7 feat(lsp)!: change handler signature #15504 2021-09-26 10:25:17 -07:00
Justin M. Keyes
f8e0011534 fix(inccommand): ignore trailing commands only for *previewed* command #15732
Since the `State` is global, other scripts are unexpectedly affected during the
'inccommand' preview. This commit introduces a new flag for `do_cmdline`, in
order to ignore trailing '|'-separated commands only for the command invoking
the preview.

fix #8796, update #7494

Co-authored-by: itchyny <itchyny@hatena.ne.jp>
2021-09-20 08:42:18 -07:00
Justin M. Keyes
7d67bd5865 Merge #15677 release-0.5: backports 2021-09-16 12:00:13 -07:00
andrew-pa
2132c063af backport: fix(windowing): positioning of relative floats
Fix relative floating windows so that they open in the correct position
relative to each other. Also make sure that their positions are correct
immediately after creation without a redraw.
2021-09-16 15:00:31 +01:00
Jose Alvarez
132053c1d2 backport: fix(lsp): resolve bufnr in buf_is_attached (#15523) 2021-09-16 14:53:45 +01:00
notomo
51d6b26729 backport: tests(lua/on_yank): assert conditions that fail correctly #15495
The test added in 274a3504a7
does not fail if the code changes are reverted.
2021-09-16 14:46:52 +01:00
notomo
f7002337c0 backport: fix(lua): verify buffer in highlight.on_yank (#15482)
Resolve an issue with deferred clearing of highlight failing if the
buffer is deleted before the timeout by checking whether the
buffer is valid first.
2021-09-16 14:46:27 +01:00
notomo
6bda2f56eb backport: fix(window.c): win_close from other tabpage #15454
Fix #15313
2021-09-16 14:44:59 +01:00
gmntroll
be58ba250e backport: fix(autocmd.c): fix conditions in block_autocmds, unblock_autocmds #15372
Logic got swapped in 7574918dc7.
We didn't notice it since v:termresponse isn't really used yet. #6279
2021-09-16 14:43:36 +01:00
Sirisak Lueangsaksri
d0e9a11e39 backport: refactor(sign): include longer sign column option 2021-09-16 14:42:22 +01:00
Sirisak Lueangsaksri
5c42376c15 backport: fix(sign): reset auto sign column with minimum in float win minimal style 2021-09-16 14:42:06 +01:00
Björn Linse
41f761130e backport: fix(decorations): crash when :bdelete (extmark_free_all) after clear_namespace
fixes #15212
2021-09-16 14:40:32 +01:00
Mathias Fussenegger
a265201307 backport: fix(lsp): Ensure human readable errors are printed
`return err_message(tostring(err))` caused errors to be printed as
`table: 0x123456789` instead of showing the error code and error
message.

This also removes some `if err` blocks that never got called because at
the end of `handlers.lua` all the handlers are wrapped with logic that
adds generic error handling.
2021-09-16 14:37:20 +01:00
Mathias Fussenegger
33000bd9cf backport: fix(lsp): Ensure users get feedback on references/symbols errors or empty results
Relates to https://github.com/neovim/neovim/issues/15050

Users should get some indication if there was an error or an empty
result.
2021-09-16 14:36:49 +01:00
Oliver Marriott
9f73b7c214 backport: fix(lsp): correctly check for windows in lsp logger (#14954) 2021-09-16 14:31:49 +01:00
Folke Lemaitre
eaa1c47377 backport: fix(lsp): restore diagnostics extmarks that were moved to the last edit line (#15023) 2021-09-16 14:26:05 +01:00
Justin M. Keyes
942b16adf7 Merge #15671 backport: :source and nvim_exec fixes 2021-09-15 06:10:48 -07:00
Sean Dewar
cf62554e5a backport: fix(:source): copy curbuf lines to memory before sourcing #15111
It's possible for weirdness to happen if curbuf is modified while
sourcing from it via :source (with no arguments). For example:

- Deleting lines from or wiping curbuf can cause internal error E315 to
  be thrown from ml_get.
- Changing the curbuf to another buffer while sourcing can cause lines
  from the new curbuf to then be sourced instead.
2021-09-15 13:34:59 +01:00
Sean Dewar
6436100b6e backport: fix(:source, nvim_exec): handle Vimscript line continuations #14809
Problem:
Anonymous :source (no args) and nvim_exec() don't support Vimscript line continuations.

Solution:
Factor out the concat logic into concat_continued_line() and a
CONCAT_CONTINUED_LINES macro for simple concatenations where lines are
fetched individually.

Closes #14807
2021-09-15 13:34:54 +01:00
Justin M. Keyes
04cde576ed Merge #15667 release-0.5: backports 2021-09-14 09:22:31 -07:00
James McCoy
cd864748d3 test: use $TEST_TIMEOUT to specify timeout 2021-09-14 07:52:33 -07:00
Justin M. Keyes
09ff3146f3 test: timeout at 20 minutes #15597
Set a maximum test run-time of 20 minutes to:
- fail faster
- avoid wasting CI resources
- set a bound on the test time (if tests take longer than 20 minutes we
  need to invest in parallelizing them...)

Timeout looks like:

    -- Tests exited non-zero: Process terminated due to timeout
    -- No output to stderr.
    CMake Error at /…/neovim/cmake/RunTests.cmake:86
    (message):
      functional tests failed with error: Process terminated due to timeout
2021-09-14 07:52:27 -07:00
Justin M. Keyes
f809664f89 ci: skip "cancels stale events on channel close" #15278
- ref #14083 #15251
- also: docs: naming conventions
2021-09-14 07:51:01 -07:00
Justin M. Keyes
d83df7f7b5 feat(lua)!: register_keystroke_callback => on_key
Analogous to nodejs's `on('data', …)` interface, here on_key is the "add
listener" interface.

ref 3ccdbc570d #12536

BREAKING_CHANGE: vim.register_keystroke_callback() is now an error.
2021-09-14 07:29:46 -07:00
hrsh7th
64dc7a1b55 fix(lsp): correctly parse LSP snippets #15579
Fixes #15522
2021-09-14 07:11:40 -07:00
Justin M. Keyes
5a813160ae Merge #15664 backport PRs
backport: PRs #14962, #14982, #14984, #14989, #15011, #15043
2021-09-14 07:02:06 -07:00
Daniel Steinberg
917f306666 backport: test/memory_usage_spec: skip on MacOS #15043
Memory compression could complicate the measurements.
2021-09-14 14:41:25 +01:00
Shadman
a9cca1b050 backport: fixup(clipboard): Fix error not properly handled #14984
fixes #14967
2021-09-14 13:15:39 +01:00
Folke Lemaitre
989ccb8222 backport: fix(lsp): restore diagnostics extmarks on buffer changes (#15011) 2021-09-14 13:15:38 +01:00
Folke Lemaitre
2ae4c96d91 backport: fix(lsp): prevent double <text> for cached plaintext markup 2021-09-14 13:15:38 +01:00
jadedpasta
ae89330ec0 backport: fix(vim.opt): vimL map string values not trimmed (#14982)
Options formatted as a list of comma-separated key-value pairs may have
values that contain leading and trailing whitespace characters. For
example, the `listchars` option has a default value of
`"tab:> ,trail:-,nbsp:+"`. When converting this value to a lua table,
leading and trailing whitespace should not be trimmed.

Co-authored-by: Robert Hrusecky <robert.hrusecky@utexas.edu>
2021-09-14 13:15:38 +01:00
Shadman
2229e99ef9 backport: fixup(clipboard): Use case matching #14962
Context: https://github.com/neovim/neovim/pull/14848#discussion_r663203173
2021-09-14 13:15:37 +01:00
James McCoy
88336851ee Merge pull request #15496 from jamessan/stdin_closed_backport
backport: feat(job): add parameter to close stdin
2021-08-27 07:26:32 -04:00
Gregory Anders
3a0543bd61 Add test case for 'null' stdin mode 2021-08-26 21:57:25 -04:00
Gregory Anders
008b83f5a2 Rename stdin to stdin_mode
stdin is a macro in Windows builds.
2021-08-26 21:57:11 -04:00
Gregory Anders
915dda3f96 feat(job): add parameter to close stdin
Some programs behave differently when they detect that stdin is being
piped. This can be problematic when these programs are used with the job
control API where stdin is attached, but not typically used. It is
possible to run the job using a PTY which circumvents this problem, but
that includes a lot of overhead when simply closing the stdin pipe would
suffice.

To enable this behavior, add a new parameter to the jobstart options
dict called "stdin" with two valid values: "pipe" (the default)
implements the existing behavior of opening a channel for stdin and
"null" which disconnects stdin (or, if you prefer, connects it to
/dev/null). This is extensible so that other modes can be added in the
future.
2021-08-26 21:56:45 -04:00
Justin M. Keyes
b6b12ea7c3 fix(man.vim): filetype=man is too eager #15489
Problem:
"set filetype=man" assumes the user wants :Man features, this does extra
stuff like renaming the buffer as "man://".

Solution:
- old entrypoint was ":set filetype=man", but this is too presumptuous #15487
- make the entrypoints more explicit:
  1. when the ":Man" command is run
  2. when a "man://" buffer is opened
- remove the tricky b:man_sect checks in ftplugin/man.vim and syntax/man.vim
- MANPAGER is supported via ":Man!", as documented.

fixes #15487
2021-08-26 02:50:30 -07:00
James McCoy
502a56867d Merge pull request #15445 from jamessan/appdata-version
fix: add 0.5.0 release to appdata
2021-08-21 15:21:45 -04:00
James McCoy
78482138ae fix: add 0.5.0 release to appdata
[skip ci]
2021-08-21 14:36:12 -04:00
James McCoy
fe815244f0 Merge pull request #15389 from jamessan/32-bit-revert
[release-0.5] Revert "tests: unit: fix preprocess: pass -m32 for 32bit ABI (#11073)"
2021-08-16 07:55:38 -04:00
James McCoy
56d86970b0 Merge pull request #15375 from jamessan/fragility
[release-0.5] test(lsp): disable finicky test when TEST_SKIP_FRAGILE is set
2021-08-14 22:11:01 -04:00
James McCoy
6c4f66f381 Merge pull request #15376 from jamessan/release-fixes
[release-0.5] Clean up release handling
2021-08-14 21:46:38 -04:00
James McCoy
f589c2619b Merge pull request #15289 from jamessan/pending-c-parsers
[release-0.5] test(treesitter): skip all parsers tests if parsers aren't installed
2021-08-06 07:24:19 -04:00
1817 changed files with 189165 additions and 318551 deletions

44
.builds/freebsd.yml Normal file
View File

@@ -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: -DCI_BUILD=ON -DMIN_LOG_LEVEL=3
tasks:
- build-deps: |
cd neovim
gmake deps
- build: |
cd neovim
gmake CMAKE_BUILD_TYPE=RelWithDebInfo 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

43
.builds/openbsd.yml Normal file
View File

@@ -0,0 +1,43 @@
# sourcehut CI: https://builds.sr.ht/~jmk/neovim
image: openbsd/6.9
packages:
- autoconf-2.71
- automake-1.16.3
- cmake
- gettext-runtime-0.21p1
- gettext-tools-0.21p1
- gmake
- libtool
- ninja-1.10.2p0
- unzip-6.0p14
sources:
- https://github.com/neovim/neovim
environment:
SOURCEHUT: 1
LC_CTYPE: en_US.UTF-8
CMAKE_EXTRA_FLAGS: -DCI_BUILD=ON -DMIN_LOG_LEVEL=3
tasks:
- build-deps: |
export AUTOCONF_VERSION=2.71
export AUTOMAKE_VERSION=1.16
mkdir neovim/.deps
cd neovim/.deps
cmake -G Ninja ../third-party/
cmake --build . --config RelWithDebInfo
- build: |
mkdir neovim/build
cd neovim/build
cmake -G Ninja $CMAKE_EXTRA_FLAGS ..
cmake --build . --config RelWithDebInfo
./bin/nvim --version
- functionaltest: |
cd neovim/build
cmake --build . --config RelWithDebInfo --target functionaltest
- oldtest: |
cd neovim
gmake oldtest

View File

@@ -1,29 +0,0 @@
env:
CIRRUS_CLONE_DEPTH: '2'
LANG: en_US.UTF-8
CMAKE_EXTRA_FLAGS: -DCI_BUILD=ON -DMIN_LOG_LEVEL=3
freebsd_task:
name: FreeBSD
only_if: $BRANCH != "master"
freebsd_instance:
image_family: freebsd-13-1
timeout_in: 30m
install_script:
- pkg update -f
- pkg install -y cmake gmake ninja libtool automake pkgconf unzip wget gettext python libffi git
build_deps_script:
- gmake deps
build_script:
- gmake CMAKE_EXTRA_FLAGS="${CMAKE_EXTRA_FLAGS}" nvim
workaround_script:
# Run tests as user "cirrus" instead of root. This is required for the
# permission-related tests to work correctly.
- pw useradd cirrus -m
- chown -R cirrus:cirrus .
functionaltest_script:
- sudo -u cirrus gmake functionaltest
unittest_script:
- sudo -u cirrus gmake unittest
oldtest_script:
- sudo -u cirrus gmake oldtest

View File

@@ -1,11 +1,11 @@
BasedOnStyle: Google BasedOnStyle: Google
Language: Cpp Language: Cpp
ColumnLimit: 100 ColumnLimit: 80
IndentWidth: 2 IndentWidth: 2
TabWidth: 8 TabWidth: 2
UseTab: Never UseTab: Never
IndentCaseLabels: false IndentCaseLabels: true
BreakBeforeBraces: Custom BreakBeforeBraces: Linux
AlignEscapedNewlinesLeft: false AlignEscapedNewlinesLeft: false
AllowShortFunctionsOnASingleLine: false AllowShortFunctionsOnASingleLine: false
AlignTrailingComments: true AlignTrailingComments: true
@@ -17,51 +17,4 @@ AllowShortLoopsOnASingleLine: false
BinPackParameters: false BinPackParameters: false
BreakBeforeBinaryOperators: true BreakBeforeBinaryOperators: true
BreakBeforeTernaryOperators: true BreakBeforeTernaryOperators: true
ContinuationIndentWidth: 2 ContinuationIndentWidth: 4
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: No
AlwaysBreakTemplateDeclarations: No
AlignEscapedNewlines: DontAlign
BinPackArguments: false
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: true
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
PointerAlignment: Right
SortIncludes: true
Cpp11BracedListStyle: false
IncludeCategories:
- Regex: '<[/[:alnum:].]+>'
Priority: 0
- Regex: '^"(nvim|vim)/'
Priority: 1
SortPriority: 1
CaseSensitive: false
AlignConsecutiveMacros: AcrossEmptyLines
IndentPPDirectives: AfterHash
SpaceBeforeParens: ControlStatementsExceptControlMacros
PPIndentWidth: 1
ForEachMacros:
- FOR_ALL_AUEVENTS
- FOR_ALL_AUPATS_IN_EVENT
- FOR_ALL_BUFFERS
- FOR_ALL_BUFFERS_BACKWARDS
- FOR_ALL_FRAMES
- FOR_ALL_QFL_ITEMS
- FOR_ALL_SIGNS_IN_BUF
- FOR_ALL_TABS
- FOR_ALL_TAB_WINDOWS
- FOR_ALL_WINDOWS_IN_TAB
- RBUFFER_EACH
- RBUFFER_EACH_REVERSE
- RBUFFER_UNTIL_EMPTY
- RBUFFER_UNTIL_FULL
- kl_iter

View File

@@ -6,9 +6,7 @@ indent_size = 2
tab_width = 8 tab_width = 8
end_of_line = lf end_of_line = lf
insert_final_newline = true insert_final_newline = true
charset = utf-8
[*.{c,h,in,lua}]
max_line_length = 100
[{Makefile,**/Makefile,runtime/doc/*.txt}] [{Makefile,**/Makefile,runtime/doc/*.txt}]
indent_style = tab indent_style = tab

2
.flake8 Normal file
View File

@@ -0,0 +1,2 @@
[flake8]
max-line-length = 88

View File

@@ -1,62 +0,0 @@
# To use this file (requires git 2.23):
# git config blame.ignoreRevsFile .git-blame-ignore-revs
# eval.c: factor out eval/funcs.c #11828
# - This is a move/rename. git 2.33 doesn't know how to ignore it.
# It is here anyway, (1) in case git improves later, and (2) to
# save you the trouble of attempting this.
6c5bbf07d988ef55e5e8ba8d70b62c1f0885261b
# symbol renames
6186df3562e33e92f04ed8c850204ceabc4746e1
# style (uncrustify, etc.)
2d240024acbd68c2d3f82bc72cb12b1a4928c6bf
61178778230e609d68b271ffd53ffd993cd23c42
15af08ad176339d1f269ce264bb0efea283c9536
47f99d66440ae8be26b34531989ac61edc1ad9fe
1e49a1c888a3d9a581f4aa409a26ada3ac2417cb
3b3dbcf7b7ba5466e6ab643e256f2374b520a6b2
e8067d1490a31ff76143d576dc9948b4f09c6c55
d5b66e88601b4d2fde5d905f9d12847126ba4449
07715044887d82f74254e64c4c32fa49b0501bea
6ed43f8f1caad702f9590d174c5ec142f3d85b18
0a83017fe95df0290adb98ec6bf457b96a3fab17
867e8885991ae450019c18aa5e42546bd4b62c2c
1f49268c46fcbe65f7e2e2cb620e6f51c059cf9e
51a98aa0c2fe3231a0ffc8a78189bc6fafd6abf6
853346a94d6aa78c97314a3b217fb5a5408a47f1
30fefee684e641a0c6867446c6de30efa2f0a126
f4ca3a29ddcb0c98e8e09c45a6342af709f8cc45
48e67b229415b4e2b3315bd00b817e5f9ab970c8
7a26eb8a567cbc831d4f629f9eccb767a44436b8
2f9b9e61d7417183f2d9f36d804247c0926be9d4
c0767bd4f3ce7b34bb77da0657c49ba10ba1b32e
d90fb1c0bfc1e64c783c385a79e7de87013dadba
9c268263b1792d00b3ffdfd7495af2575862656e
8c74c895b300bcee5fa937a2329d1d4756567b42
40be47e0faef7aa015eb4ba44ceb1ee1a03e97cf
4472c56d54f447040f6e8610b261b7efa0d04eb6
a68faed02dc8e37b8f10da14dc02e33e6ed93947
725cbe7d414f609e769081276f2a034e32a4337b
7e3bdc75e44b9139d8afaea4381b53ae78b15746
4ba12b3dda34472c193c9fa8ffd7d3bd5b6c04d6
849f104c2789c884428fd45501912c6591a78e12
38dd53c525054daf83dba27d7d46e90e8b41fa50
6059784770c4c88fb6fe528b9f7634192fa1164e
ee031eb5256bb83e0d6add2bae6fd943a4186ffe
69e11b58b4db0952f11a5ff85aa7150b5f5b8db8
271bb32855853b011fceaf0ad2f829bce66b2a19
aefdc6783cb77f09786542c90901a9e7120bea42
aa4f9c5341f5280f16cce0630ea54b84eef717b3
0adc66171a355a12494d87ebb767d509540c7ef9
93f24403f8cc760ff47979c596976b53a8b16358
1ffd527c837fb2465c9659273bbe5447a1352db2
2498e9feb025361576603a0101c86393d211e31e
# typos
d238b8f6003d34cae7f65ff7585b48a2cd9449fb
4547137aaff32b20172870a549d3a28a3c7adf1c
# generated docs
ea333badd24f691c753d8048f911d1db349bc2cd

17
.gitattributes vendored
View File

@@ -1,16 +1,7 @@
*.h.in linguist-language=C *.h linguist-language=C
*.c.in linguist-language=C
*CMakeLists.txt linguist-language=CMake
runtime/doc/* linguist-documentation
src/xdiff/** linguist-vendored
src/cjson/** linguist-vendored
src/unicode/** linguist-vendored
src/nvim/testdir/test42.in diff src/nvim/testdir/test42.in diff
.github/ export-ignore
.github/ export-ignore ci/ export-ignore
.travis.yml export-ignore .travis.yml export-ignore
codecov.yml export-ignore codecov.yml export-ignore
.builds/ export-ignore .builds/ export-ignore

34
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@@ -0,0 +1,34 @@
---
name: Bug report
about: Report a problem in Nvim
title: ''
labels: bug
---
<!-- Before reporting: search existing issues and check the FAQ. -->
- `nvim --version`:
- Operating system/version:
- Terminal name/version:
- `$TERM`:
<!--
If this report is about different behaviour between Nvim and Vim, make sure to
read `:h vim-differences` first. Otherwise remove the next line.
-->
[ ] `vim -u DEFAULTS` (version: ) behaves differently
### Steps to reproduce using `nvim -u NORC`
```
nvim -u NORC
# Alternative for shell-related problems:
# env -i TERM=ansi-256color "$(which nvim)"
```
### Actual behaviour
### Expected behaviour

View File

@@ -1,75 +0,0 @@
name: Bug Report
description: Report a problem in Neovim
labels: [bug]
body:
- type: markdown
attributes:
value: |
_Before reporting:_ search [existing issues](https://github.com/neovim/neovim/issues?q=is%3Aissue+is%3Aopen+label%3Abug) and check the [FAQ](https://github.com/neovim/neovim/wiki/FAQ). Usage questions such as "How do I...?" belong on the [Neovim Discourse](https://neovim.discourse.group/c/7-category/7) and will be closed.
- type: input
attributes:
label: "Neovim version (nvim -v)"
placeholder: "0.6.0 commit db1b0ee3b30f"
validations:
required: true
- type: input
attributes:
label: "Vim (not Nvim) behaves the same?"
description: "Does `vim -u DEFAULTS` have the same issue? Note the exact Vim version (`8.x.yyyy`)."
placeholder: "no, vim 7.3.432"
validations:
required: true
- type: input
attributes:
label: "Operating system/version"
placeholder: "macOS 11.5"
validations:
required: true
- type: input
attributes:
label: "Terminal name/version"
placeholder: "xterm 3.1"
validations:
required: true
- type: input
attributes:
label: "$TERM environment variable"
placeholder: "xterm-256color"
validations:
required: true
- type: input
attributes:
label: "Installation"
description: "How did you install neovim: build from repo / system package manager / appimage / homebrew / snap / chocolatey / other (describe)?"
placeholder: "Arch User Repository (AUR)"
validations:
required: true
- type: textarea
attributes:
label: "How to reproduce the issue"
description: |
- Steps to reproduce using `nvim --clean` ("factory defaults").
- For build failures: list the exact steps including CMake flags (if any).
- For shell-related problems: try `env -i TERM=ansi-256color "$(which nvim)"`.
placeholder: |
nvim --clean
:edit foo
yiwp
validations:
required: true
- type: textarea
attributes:
label: "Expected behavior"
description: "Describe the behavior you expect. May include logs, images, or videos."
validations:
required: true
- type: textarea
attributes:
label: "Actual behavior"
validations:
required: true

View File

@@ -1,5 +0,0 @@
blank_issues_enabled: false
contact_links:
- name: Question
url: https://neovim.discourse.group/
about: Ask questions about configuration and usage of Neovim

View File

@@ -0,0 +1,27 @@
---
name: Feature request
about: Request an enhancement for Nvim
title: ''
labels: enhancement
---
<!-- Before reporting: search existing issues and check the FAQ. -->
- `nvim --version`:
- `vim -u DEFAULTS` (version: ) behaves differently?
- Operating system/version:
- Terminal name/version:
- `$TERM`:
### Steps to reproduce using `nvim -u NORC`
```
nvim -u NORC
```
### Actual behaviour
### Expected behaviour

View File

@@ -1,21 +0,0 @@
name: Feature request
description: Request an enhancement for Neovim
labels: [enhancement]
body:
- type: markdown
attributes:
value: |
Before requesting: search [existing issues](https://github.com/neovim/neovim/labels/enhancement) and check the [FAQ](https://github.com/neovim/neovim/wiki/FAQ).
- type: input
attributes:
label: "Feature already in Vim?"
description: "Does the feature already exist in Vim? If possible, specify which version (or commit) that introduced it."
placeholder: "Yes, Vim 7.3.432"
- type: textarea
attributes:
label: "Feature description"
validations:
required: true

View File

@@ -0,0 +1,58 @@
---
name: Language server client bug report
about: Report a built-in lsp problem in Nvim
title: ''
labels: bug, lsp
---
<!--
Before reporting: search existing issues and check the FAQ. Usage questions
such as "How do I...?" or "Why isn't X language server/feature working?" belong
on the [Neovim Discourse](https://neovim.discourse.group/c/7-category/7) and will
be closed.
-->
- `nvim --version`:
- language server name/version:
- Operating system/version:
<details>
<summary>nvim -c ":checkhealth nvim lspconfig"</summary>
<!-- Paste the results from `nvim -c ":checkhealth nvim lspconfig"` here. -->
</details>
<details>
<summary>lsp.log</summary>
<!--
Please paste the lsp log before and after the problem.
You can set log level like this.
`:lua vim.lsp.set_log_level("debug")`
You can find the location of the log with the following command.
`:lua print(vim.lsp.get_log_path())`
-->
</details>
### Steps to reproduce using nvim -u minimal_init.lua
<!--
Note, if the issue is with an autocompletion or other LSP plugin, please
report to the upstream tracker. Download the minmal config with
wget https://raw.githubusercontent.com/neovim/nvim-lspconfig/master/test/minimal_init.lua
and modify it to include any specific commands or servers pertaining to your issues.
-->
```
nvim -u minimal_init.lua
```
### Actual behaviour
### Expected behaviour

View File

@@ -1,54 +0,0 @@
name: Language server (LSP) client bug
description: Report an issue with Neovim LSP
labels: [bug, lsp]
body:
- type: markdown
attributes:
value: |
_Before reporting:_ search [existing issues](https://github.com/neovim/neovim/issues?q=is%3Aissue+is%3Aopen+label%3Abug) and check the [FAQ](https://github.com/neovim/neovim/wiki/FAQ). Usage questions such as "How do I...?" or "Why isn't X language server/feature working?" belong on the [Neovim Discourse](https://neovim.discourse.group/c/7-category/7) and will be closed.
- type: input
attributes:
label: "Neovim version (nvim -v)"
placeholder: "0.6.0 commit db1b0ee3b30f"
validations:
required: true
- type: input
attributes:
label: "Language server name/version"
placeholder: "rls 0.5.2"
validations:
required: true
- type: input
attributes:
label: "Operating system/version"
placeholder: "emacs 23"
validations:
required: true
- type: textarea
attributes:
label: 'Steps to reproduce using "nvim -u minimal_init.lua"'
description: |
- Download the minimal config with `curl -LO https://raw.githubusercontent.com/neovim/nvim-lspconfig/master/test/minimal_init.lua` and modify it to include any specific commands or servers pertaining to your issues.
- _Note_: if the issue is with an autocompletion or other LSP plugin, report to that plugin's issue tracker.
validations:
required: true
- type: textarea
attributes:
label: "Expected behavior"
description: "Describe the behavior you expect. May include logs, images, or videos."
- type: textarea
attributes:
label: "Actual behavior"
- type: input
attributes:
label: "Log file"
placeholder: "https://gist.github.com/prakhar1989/1b0a2c9849b2e1e912fb"
description: |
- Upload `lsp.log` before and after the problem in a [secret gist](https://gist.github.com/). Paste the URL to the gist.
- You can set the log level by adding `vim.lsp.set_log_level("debug")` after setting up LSP in your config.
- You can find the location of the log with `:lua print(vim.lsp.get_log_path())`

44
.github/labeler.yml vendored
View File

@@ -4,7 +4,7 @@
"lua": "lua":
- runtime/lua/**/* - runtime/lua/**/*
- src/nvim/lua/* - src/nvim/lua
"tui": "tui":
- src/nvim/tui/tui.* - src/nvim/tui/tui.*
@@ -13,53 +13,37 @@
- src/nvim/lua/treesitter.* - src/nvim/lua/treesitter.*
- runtime/lua/vim/treesitter.lua - runtime/lua/vim/treesitter.lua
- runtime/lua/vim/treesitter/* - runtime/lua/vim/treesitter/*
- runtime/queries/**/*
"diagnostic":
- runtime/lua/vim/diagnostic.lua
"dependencies": "dependencies":
- cmake.deps/**/* - third-party/**/*
"spell": "topic: spell":
- src/nvim/spell* - src/nvim/spell*
"terminal": "topic: :terminal":
- src/nvim/terminal.* - src/nvim/terminal.*
"column": "topic: column":
- src/nvim/mark.h
- src/nvim/mark.c
- src/nvim/sign* - src/nvim/sign*
"folds": "topic: folds":
- src/nvim/fold* - src/nvim/fold*
"mouse": "topic: mouse":
- src/nvim/mouse* - src/nvim/mouse*
"documentation": "topic: documentation":
- all: ["runtime/doc/*"] - runtime/doc/*
- all: ["**/*.md"]
"clipboard": "topic: clipboard":
- runtime/autoload/provider/clipboard.vim - runtime/autoload/provider/clipboard.vim
"diff": "topic: diff":
- src/nvim/diff.* - src/nvim/diff.*
"build": "topic: build":
- CMakeLists.txt - CMakeLists.txt
- "**/CMakeLists.txt" - "**/CMakeLists.txt"
- "**/Makefile"
- "**/*.cmake" - "**/*.cmake"
"test":
- all: ["test/**/*"]
"ci":
- .github/labeler.yml
- .github/workflows/**/*
- .builds/*
- ci/**/*
"filetype":
- runtime/lua/vim/filetype.lua

View File

@@ -1,16 +0,0 @@
module.exports = async ({github, context}) => {
const requestedReviewers = await github.rest.pulls.listRequestedReviewers({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number
});
const reviewers = requestedReviewers.data.users.map(e => e.login)
github.rest.pulls.removeRequestedReviewers({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number,
reviewers: reviewers
});
}

View File

@@ -1,92 +0,0 @@
module.exports = async ({github, context}) => {
const pr_data = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number
})
const labels = pr_data.data.labels.map(e => e.name)
const reviewers = new Set()
if (labels.includes('api')) {
reviewers.add("bfredl")
reviewers.add("muniter")
}
if (labels.includes('build')) {
reviewers.add("jamessan")
reviewers.add("justinmk")
}
if (labels.includes('ci')) {
reviewers.add("dundargoc")
reviewers.add("jamessan")
}
if (labels.includes('column')) {
reviewers.add("lewis6991")
}
if (labels.includes('diagnostic')) {
reviewers.add("gpanders")
}
if (labels.includes('diff')) {
reviewers.add("lewis6991")
}
if (labels.includes('dependencies')) {
reviewers.add("jamessan")
}
if (labels.includes('distribution')) {
reviewers.add("jamessan")
}
if (labels.includes('documentation')) {
reviewers.add("clason")
}
if (labels.includes('extmarks')) {
reviewers.add("bfredl")
}
if (labels.includes('filetype')) {
reviewers.add("clason")
reviewers.add("gpanders")
}
if (labels.includes('lsp')) {
reviewers.add("mfussenegger")
reviewers.add("glepnir")
}
if (labels.includes('treesitter')) {
reviewers.add("bfredl")
reviewers.add("clason")
reviewers.add("vigoux")
}
if (labels.includes('typo')) {
reviewers.add("dundargoc")
}
if (labels.includes('ui')) {
reviewers.add("bfredl")
}
if (labels.includes('vim-patch')) {
reviewers.add("seandewar")
reviewers.add("zeertzjq")
}
// Remove person that opened the PR since they can't review themselves
const pr_opener = pr_data.data.user.login
reviewers.delete(pr_opener)
github.rest.pulls.requestReviewers({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number,
reviewers: Array.from(reviewers)
});
}

View File

@@ -1,18 +0,0 @@
name: Missing API docs
on:
pull_request:
branches-ignore:
- 'marvim/api-doc-update**'
paths:
- 'src/nvim/api/*.[ch]'
- 'runtime/lua/**.lua'
- 'runtime/doc/**'
jobs:
call-regen-api-docs:
permissions:
contents: write
pull-requests: write
uses: ./.github/workflows/api-docs.yml
with:
check_only: true

View File

@@ -1,38 +1,26 @@
# Autogenerate the API docs on new commit to important branches
# Also work as a check for PR's to not forget committing their doc changes
# called from api-docs-check.yml
name: Autogenerate API docs name: Autogenerate API docs
on: on:
push: push:
paths: paths:
- 'src/nvim/api/*.[ch]' - 'src/nvim/api/*.[ch]'
- 'src/nvim/**.lua'
- 'runtime/lua/**.lua' - 'runtime/lua/**.lua'
- 'runtime/doc/**'
branches: branches:
- 'master' - 'master'
- 'release-[0-9]+.[0-9]+' - 'release-[0-9]+.[0-9]+'
workflow_dispatch: workflow_dispatch:
workflow_call:
inputs:
check_only:
type: boolean
default: false
required: false
jobs: jobs:
regen-api-docs: regen-api-docs:
runs-on: ubuntu-22.04 runs-on: ubuntu-20.04
permissions: permissions:
contents: write contents: write
pull-requests: write pull-requests: write
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v2
with: with:
# Fetch depth 0 is required if called through workflow_call. In order
# to create a PR we need to access other branches, which requires a
# full clone.
fetch-depth: 0 fetch-depth: 0
- name: Install dependencies - name: Install dependencies
@@ -52,19 +40,12 @@ jobs:
run: | run: |
git checkout -b ${DOC_BRANCH} git checkout -b ${DOC_BRANCH}
python3 scripts/gen_vimdoc.py python3 scripts/gen_vimdoc.py
printf 'UPDATED_DOCS=%s\n' $([ -z "$(git diff)" ]; echo $?) >> $GITHUB_OUTPUT printf '::set-output name=UPDATED_DOCS::%s\n' $([ -z "$(git diff)" ]; echo $?)
- name: FAIL, PR has not committed doc changes
if: ${{ steps.docs.outputs.UPDATED_DOCS != 0 && inputs.check_only }}
run: |
echo "Job failed, run ./scripts/gen_vimdoc.py and commit your doc changes"
echo "The doc generation produces the following changes:"
git diff --color --exit-code
- name: Automatic PR - name: Automatic PR
if: ${{ steps.docs.outputs.UPDATED_DOCS != 0 && !inputs.check_only }} if: ${{ steps.docs.outputs.UPDATED_DOCS != 0 }}
run: | run: |
git add -u git add -u
git commit -m 'docs: regenerate [skip ci]' git commit -m 'docs: regenerate'
git push --force https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY} ${DOC_BRANCH} git push --force https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY} ${DOC_BRANCH}
gh pr create --draft --fill --base ${GITHUB_REF#refs/heads/} --head ${DOC_BRANCH} || true gh pr create --fill --base ${GITHUB_REF#refs/heads/} --head ${DOC_BRANCH} || true

View File

@@ -1,27 +0,0 @@
name: Backport
on:
pull_request_target:
types: [closed, labeled]
jobs:
backport:
permissions:
contents: write
pull-requests: write
name: Backport Pull Request
if: >
github.repository_owner == 'neovim' && (
github.event_name == 'pull_request_target' &&
github.event.pull_request.merged
)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
# required to find all branches
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- name: Create backport PRs
uses: zeebe-io/backport-action@v0.0.8
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
github_workspace: ${{ github.workspace }}

View File

@@ -1,358 +1,116 @@
name: CI name: CI
on: on:
push: push:
branches: branches: '**'
- 'master'
- 'release-[0-9]+.[0-9]+'
pull_request: pull_request:
branches: branches:
- 'master' - 'master'
- 'release-[0-9]+.[0-9]+' - 'release-[0-9]+.[0-9]+'
paths-ignore:
- 'runtime/doc/*'
# Cancel any in-progress CI runs for a PR if it is updated
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true
jobs: jobs:
lint: unixish:
if: (github.event_name == 'pull_request' && github.base_ref == 'master') || (github.event_name == 'push' && github.ref == 'refs/heads/master') name: ${{ matrix.os }} ${{ matrix.flavor }} (cc=${{ matrix.cc }})
runs-on: ubuntu-20.04
timeout-minutes: 10
env:
CC: gcc
steps:
- uses: actions/checkout@v3
- name: Setup common environment variables
run: ./.github/workflows/env.sh lint
- name: Install apt packages
run: |
sudo add-apt-repository ppa:neovim-ppa/stable
sudo apt-get update
sudo apt-get install -y \
autoconf \
automake \
build-essential \
cmake \
flake8 \
gettext \
libluajit-5.1-dev \
libmsgpack-dev \
libtermkey-dev \
libtool-bin \
libtree-sitter-dev \
libunibilium-dev \
libuv1-dev \
libvterm-dev \
locales \
lua-busted \
lua-check \
lua-filesystem \
lua-inspect \
lua-lpeg \
lua-luv-dev \
lua-nvim \
luajit \
ninja-build \
pkg-config
- name: Cache uncrustify
id: cache-uncrustify
uses: actions/cache@v3
with:
path: ${{ env.CACHE_UNCRUSTIFY }}
key: ${{ env.UNCRUSTIFY_VERSION }}
- name: Clone uncrustify
if: steps.cache-uncrustify.outputs.cache-hit != 'true'
uses: actions/checkout@v3
with:
repository: uncrustify/uncrustify
ref: ${{ env.UNCRUSTIFY_VERSION }}
path: uncrustify
- name: Install uncrustify
if: steps.cache-uncrustify.outputs.cache-hit != 'true'
run: |
source_dir=uncrustify
build_dir=uncrustify/build
cmake -S $source_dir -B $build_dir -G Ninja -DCMAKE_BUILD_TYPE=Release
cmake --build $build_dir
mkdir -p $HOME/.cache
cp $build_dir/uncrustify ${{ env.CACHE_UNCRUSTIFY }}
- name: Cache artifacts
uses: actions/cache@v3
with:
path: |
${{ env.CACHE_NVIM_DEPS_DIR }}
key: lint-${{ hashFiles('cmake/*', '**/CMakeLists.txt', '!cmake.deps/**CMakeLists.txt') }}-${{ github.base_ref }}
- name: Build third-party deps
run: ./ci/before_script.sh
- if: "!cancelled()"
name: lintstylua
uses: JohnnyMorganz/stylua-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --check runtime/
- if: "!cancelled()"
name: lintlua
run: make lintlua
- if: "!cancelled()"
name: lintpy
run: make lintpy
- if: "!cancelled()"
name: lintsh
run: make lintsh
- if: "!cancelled()"
name: uncrustify
run: |
${{ env.CACHE_UNCRUSTIFY }} -c ./src/uncrustify.cfg -q --replace --no-backup $(find ./src/nvim -name "*.[ch]")
- if: "!cancelled()"
name: suggester / uncrustify
uses: reviewdog/action-suggester@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
tool_name: uncrustify
cleanup: false
- if: "!cancelled()"
name: check uncrustify
run: |
git diff --color --exit-code
- name: Cache dependencies
run: ./ci/before_cache.sh
lintc:
# This job tests two things: it lints the code but also builds neovim using
# system dependencies instead of bundled dependencies. This is to make sure
# we are able to build neovim without pigeonholing ourselves into specifics
# of the bundled dependencies.
if: (github.event_name == 'pull_request' && github.base_ref == 'master') || (github.event_name == 'push' && github.ref == 'refs/heads/master')
runs-on: ubuntu-20.04
timeout-minutes: 10
env:
CC: gcc
steps:
- uses: actions/checkout@v3
- name: Setup common environment variables
run: ./.github/workflows/env.sh lint
- name: Install apt packages
run: |
sudo add-apt-repository ppa:neovim-ppa/stable
sudo apt-get update
sudo apt-get install -y \
autoconf \
automake \
build-essential \
cmake \
gettext \
libluajit-5.1-dev \
libmsgpack-dev \
libtermkey-dev \
libtool-bin \
libtree-sitter-dev \
libunibilium-dev \
libuv1-dev \
libvterm-dev \
locales \
lua-busted \
lua-check \
lua-filesystem \
lua-inspect \
lua-lpeg \
lua-luv-dev \
lua-nvim \
luajit \
ninja-build \
pkg-config
- name: Cache artifacts
uses: actions/cache@v3
with:
path: |
${{ env.CACHE_NVIM_DEPS_DIR }}
key: lint-${{ hashFiles('cmake/*', '**/CMakeLists.txt', '!cmake.deps/**CMakeLists.txt') }}-${{ github.base_ref }}
- name: Build third-party deps
run: ./ci/before_script.sh
- name: Build nvim
run: ./ci/run_tests.sh build_nvim
- if: "!cancelled()"
name: lintc
run: make lintc
- if: "!cancelled()"
name: check-single-includes
run: make check-single-includes
- name: Cache dependencies
run: ./ci/before_cache.sh
posix:
name: ${{ matrix.runner }} ${{ matrix.flavor }} (cc=${{ matrix.cc }})
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
include: include:
- flavor: asan - flavor: asan
cc: clang-13 cc: clang-12
runner: ubuntu-20.04 runner: ubuntu-20.04
os: linux os: linux
- flavor: tsan - flavor: lint
cc: clang-13
runner: ubuntu-20.04
os: linux
- flavor: uchar
cc: gcc cc: gcc
runner: ubuntu-20.04 runner: ubuntu-20.04
os: linux os: linux
- flavor: tsan
cc: clang-12
runner: ubuntu-20.04
os: linux
- cc: clang - cc: clang
runner: macos-11 runner: macos-10.15
os: osx os: osx
# functionaltest-lua is our dumping ground for non-mainline configurations.
# 1. Check that the tests pass with PUC Lua instead of LuaJIT.
# 2. Use as oldest/minimum versions of dependencies/build tools we
# still explicitly support so we don't accidentally rely on
# features that is only available on later versions.
# 3. No treesitter parsers installed.
- flavor: functionaltest-lua - flavor: functionaltest-lua
cc: gcc cc: gcc
runner: ubuntu-20.04 runner: ubuntu-20.04
os: linux os: linux
cmake: minimum_required
runs-on: ${{ matrix.runner }} runs-on: ${{ matrix.runner }}
timeout-minutes: 45 if: github.event.pull_request.draft == false
env: env:
CC: ${{ matrix.cc }} CC: ${{ matrix.cc }}
CI_OS_NAME: ${{ matrix.os }} CI_OS_NAME: ${{ matrix.os }}
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v2
- name: Setup common environment variables - name: Setup commom environment variables
run: ./.github/workflows/env.sh ${{ matrix.flavor }} run: ./.github/workflows/env.sh ${{ matrix.flavor }}
- name: Install apt packages - name: Install apt packages
if: matrix.os == 'linux' if: matrix.os == 'linux'
run: | run: |
sudo apt-get update sudo apt-get update
sudo apt-get install -y autoconf automake build-essential cmake cpanminus cscope gcc-multilib gdb gettext language-pack-tr libtool-bin locales ninja-build pkg-config python3 python3-pip python3-setuptools unzip valgrind xclip sudo apt-get install -y autoconf automake build-essential ccache cmake cpanminus cscope gcc-multilib gdb gettext gperf language-pack-tr libtool-bin locales ninja-build pkg-config python3 python3-pip python3-setuptools unzip valgrind xclip
- name: Install minimum required version of cmake
if: matrix.cmake == 'minimum_required'
env:
CMAKE_URL: 'https://cmake.org/files/v3.10/cmake-3.10.0-Linux-x86_64.sh'
CMAKE_VERSION: '3.10.0'
shell: bash
run: |
curl --retry 5 --silent --show-error --fail -o /tmp/cmake-installer.sh "$CMAKE_URL"
mkdir -p "$HOME/.local/bin" /opt/cmake-custom
chmod a+x /tmp/cmake-installer.sh
/tmp/cmake-installer.sh --prefix=/opt/cmake-custom --skip-license
ln -sfn /opt/cmake-custom/bin/cmake "$HOME/.local/bin/cmake"
cmake_version="$(cmake --version | head -1)"
echo "$cmake_version" | grep -qF "cmake version $CMAKE_VERSION" || {
echo "Unexpected CMake version: $cmake_version"
exit 1
}
- name: Install new clang - name: Install new clang
if: matrix.flavor == 'asan' || matrix.flavor == 'tsan' if: matrix.flavor == 'asan' || matrix.flavor == 'tsan'
run: | run: |
wget https://apt.llvm.org/llvm.sh wget https://apt.llvm.org/llvm.sh
chmod a+x llvm.sh chmod a+x llvm.sh
sudo ./llvm.sh 13 sudo ./llvm.sh 12
rm llvm.sh rm llvm.sh
- name: Install brew packages - name: Install brew packages
if: matrix.os == 'osx' if: matrix.os == 'osx'
run: | run: |
brew update --quiet # Workaround brew issues
brew install automake cpanminus ninja rm -f /usr/local/bin/2to3
brew update >/dev/null
brew upgrade
brew install automake ccache perl cpanminus ninja
- name: Setup interpreter packages - name: Setup interpreter packages
run: ./ci/install.sh run: |
./ci/before_install.sh
./ci/install.sh
- name: Cache dependencies - name: Cache dependencies
uses: actions/cache@v3 uses: actions/cache@v2
with: with:
path: | path: |
${{ env.CACHE_NVIM_DEPS_DIR }} ${{ env.CACHE_NVIM_DEPS_DIR }}
key: ${{ matrix.runner }}-${{ matrix.flavor }}-${{ matrix.cc }}-${{ hashFiles('cmake/*', 'cmake.deps/**', '**/CMakeLists.txt') }}-${{ github.base_ref }} ~/.ccache
key: ${{ runner.os }}-${{ matrix.flavor }}-${{ matrix.cc }}-${{ hashFiles('cmake/*', 'third-party/**', '**/CMakeLists.txt') }}-${{ github.base_ref }}
- name: Build third-party deps - name: Build third-party
run: ./ci/before_script.sh run: ./ci/before_script.sh
- name: Build - name: Build and test
run: ./ci/run_tests.sh build_nvim run: ./ci/script.sh
- if: matrix.flavor != 'tsan' && matrix.flavor != 'functionaltest-lua' && !cancelled()
name: Unittests
run: ./ci/run_tests.sh unittests
- if: matrix.flavor != 'tsan' && !cancelled()
name: Functionaltests
run: ./ci/run_tests.sh functionaltests
- if: "!cancelled()"
name: Oldtests
run: ./ci/run_tests.sh oldtests
- if: "!cancelled()"
name: Install nvim
run: ./ci/run_tests.sh install_nvim
- name: Cache dependencies - name: Cache dependencies
if: ${{ success() }}
run: ./ci/before_cache.sh run: ./ci/before_cache.sh
windows: windows:
runs-on: windows-2019 runs-on: windows-2016
timeout-minutes: 45 if: github.event.pull_request.draft == false
env: env:
DEPS_BUILD_DIR: ${{ format('{0}/nvim-deps', github.workspace) }} DEPS_BUILD_DIR: ${{ format('{0}/nvim-deps', github.workspace) }}
DEPS_PREFIX: ${{ format('{0}/nvim-deps/usr', github.workspace) }} DEPS_PREFIX: ${{ format('{0}/nvim-deps/usr', github.workspace) }}
CMAKE_BUILD_TYPE: "RelWithDebInfo"
name: windows (MSVC_64)
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3 strategy:
fail-fast: false
matrix:
config: [ MINGW_64-gcov, MINGW_32, MSVC_64, MSVC_32 ]
name: windows (${{ matrix.config }})
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with: with:
path: ${{ env.DEPS_BUILD_DIR }} path: ${{ env.DEPS_BUILD_DIR }}
key: ${{ hashFiles('cmake.deps\**') }} key: ${{ matrix.config }}-${{ hashFiles('third-party\**') }}
- name: Build deps - name: Run CI
run: .\ci\build.ps1 -BuildDeps run: powershell ci\build.ps1
env:
- name: Build nvim CONFIGURATION: ${{ matrix.config }}
run: .\ci\build.ps1 -Build
- name: Install test deps
continue-on-error: false
run: .\ci\build.ps1 -EnsureTestDeps
- if: "!cancelled()"
name: Run tests
run: .\ci\build.ps1 -Test
- if: "!cancelled()"
name: Run old tests
run: .\ci\build.ps1 -TestOld

View File

@@ -1,42 +0,0 @@
name: "CodeQL"
on:
schedule:
- cron: '42 0 * * 0'
workflow_dispatch:
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ 'cpp', 'python' ]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup common environment variables
run: ./.github/workflows/env.sh
- name: Install apt packages
run: |
sudo apt-get update
sudo apt-get install -y autoconf automake build-essential cmake cpanminus cscope gcc-multilib gdb gettext language-pack-tr libtool-bin locales ninja-build pkg-config python3 python3-pip python3-setuptools unzip valgrind xclip
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
- if: matrix.language == 'cpp'
run: make
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2

View File

@@ -1,23 +0,0 @@
name: "Commit Linter"
on:
# Only pull_request and push honor [skip ci]. Since this workflow must pass
# to merge a PR, it can't be skipped, so use pull_request_target
pull_request_target:
types: [opened, synchronize, reopened, ready_for_review]
branches:
- 'master'
jobs:
lint-commits:
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
path: pr_nvim
- uses: rhysd/action-setup-vim@v1
with:
neovim: true
- run: wget https://raw.githubusercontent.com/neovim/neovim/master/scripts/lintcommit.lua
- run: nvim --clean -es +"cd pr_nvim" +"lua dofile('../lintcommit.lua').main({trace=true})"

View File

@@ -1,19 +1,19 @@
name: Coverity name: Coverity
on: on:
schedule: schedule:
- cron: '10 0 * * *' # Run every day at 00:10 - cron: '0 10 * * 1' # Run every Monday at 00:10
workflow_dispatch: workflow_dispatch:
jobs: jobs:
scan: scan:
runs-on: ubuntu-latest runs-on: ubuntu-18.04
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v2
- name: Install dependencies - name: Install dependencies
run: | run: |
sudo apt-get update sudo apt-get update
sudo apt-get install -y autoconf automake build-essential cmake gettext libtool-bin locales ninja-build pkg-config unzip sudo apt-get install -y autoconf automake build-essential cmake gettext gperf libtool-bin locales ninja-build pkg-config unzip
- name: Download Coverity - name: Download Coverity
run: | run: |

View File

@@ -8,6 +8,8 @@ $HOME/.local/bin
EOF EOF
cat <<EOF >> "$GITHUB_ENV" cat <<EOF >> "$GITHUB_ENV"
CACHE_ENABLE=true
CI_TARGET=tests
CI_BUILD_DIR=$GITHUB_WORKSPACE CI_BUILD_DIR=$GITHUB_WORKSPACE
BUILD_DIR=$GITHUB_WORKSPACE/build BUILD_DIR=$GITHUB_WORKSPACE/build
DEPS_BUILD_DIR=$HOME/nvim-deps DEPS_BUILD_DIR=$HOME/nvim-deps
@@ -17,11 +19,13 @@ NVIM_LOG_FILE=$GITHUB_WORKSPACE/build/.nvimlog
VALGRIND_LOG=$GITHUB_WORKSPACE/build/log/valgrind-%p.log VALGRIND_LOG=$GITHUB_WORKSPACE/build/log/valgrind-%p.log
CACHE_NVIM_DEPS_DIR=$HOME/.cache/nvim-deps CACHE_NVIM_DEPS_DIR=$HOME/.cache/nvim-deps
CACHE_MARKER=$HOME/.cache/nvim-deps/.ci_cache_marker CACHE_MARKER=$HOME/.cache/nvim-deps/.ci_cache_marker
CACHE_UNCRUSTIFY=$HOME/.cache/uncrustify CCACHE_BASEDIR=$GITHUB_WORKSPACE
UNCRUSTIFY_VERSION=uncrustify-0.75.0 CCACHE_COMPRESS=1
CCACHE_SLOPPINESS=time_macros,file_macro
CCACHE_DIR=$HOME/.ccache
EOF EOF
DEPS_CMAKE_FLAGS= DEPS_CMAKE_FLAGS=-DUSE_BUNDLED_GPERF=OFF
FUNCTIONALTEST=functionaltest 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" 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"
@@ -30,28 +34,19 @@ case "$FLAVOR" in
BUILD_FLAGS="$BUILD_FLAGS -DPREFER_LUA=ON" BUILD_FLAGS="$BUILD_FLAGS -DPREFER_LUA=ON"
cat <<EOF >> "$GITHUB_ENV" cat <<EOF >> "$GITHUB_ENV"
CLANG_SANITIZER=ASAN_UBSAN CLANG_SANITIZER=ASAN_UBSAN
SYMBOLIZER=asan_symbolize-13 SYMBOLIZER=asan_symbolize-12
ASAN_OPTIONS=detect_leaks=1:check_initialization_order=1:log_path=$GITHUB_WORKSPACE/build/log/asan:intercept_tls_get_addr=0 ASAN_OPTIONS=detect_leaks=1:check_initialization_order=1:log_path=$GITHUB_WORKSPACE/build/log/asan
UBSAN_OPTIONS=print_stacktrace=1 log_path=$GITHUB_WORKSPACE/build/log/ubsan UBSAN_OPTIONS=print_stacktrace=1 log_path=$GITHUB_WORKSPACE/build/log/ubsan
EOF EOF
;; ;;
tsan) tsan)
cat <<EOF >> "$GITHUB_ENV" cat <<EOF >> "$GITHUB_ENV"
TSAN_OPTIONS=log_path=$GITHUB_WORKSPACE/build/log/tsan TSAN_OPTIONS=log_path=$GITHUB_WORKSPACE/build/log/tsan
CLANG_SANITIZER=TSAN
EOF
;;
uchar)
cat <<EOF >> "$GITHUB_ENV"
BUILD_UCHAR=1
EOF EOF
;; ;;
lint) lint)
# Re-enable once system deps are available
# BUILD_FLAGS="$BUILD_FLAGS -DLIBLUV_LIBRARY:FILEPATH=/usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)/lua/5.1/luv.so -DLIBLUV_INCLUDE_DIR:PATH=/usr/include/lua5.1"
DEPS_CMAKE_FLAGS="$DEPS_CMAKE_FLAGS -DUSE_BUNDLED_LUV=ON"
cat <<EOF >> "$GITHUB_ENV" cat <<EOF >> "$GITHUB_ENV"
USE_BUNDLED=OFF CI_TARGET=lint
EOF EOF
;; ;;
functionaltest-lua) functionaltest-lua)

View File

@@ -1,49 +1,13 @@
name: "Pull Request Labeler" name: "Pull Request Labeler"
on: on:
pull_request_target: - pull_request_target
types: [opened]
jobs: jobs:
triage: triage:
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions: permissions:
contents: read contents: read
pull-requests: write pull-requests: write
steps: steps:
- uses: actions/labeler@v4 - uses: actions/labeler@main
with: with:
repo-token: "${{ secrets.GITHUB_TOKEN }}" repo-token: "${{ secrets.GITHUB_TOKEN }}"
sync-labels: ""
type-scope:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
PR_NUMBER: ${{ github.event.pull_request.number }}
PR_TITLE: ${{ github.event.pull_request.title }}
steps:
- name: "Extract commit type and add as label"
run: gh pr edit "$PR_NUMBER" --add-label "$(echo "$PR_TITLE" | sed -E 's|([[:alpha:]]+)(\(.*\))?!?:.*|\1|')" || true
- name: "Extract commit scope and add as label"
run: gh pr edit "$PR_NUMBER" --add-label "$(echo "$PR_TITLE" | sed -E 's|[[:alpha:]]+\((.+)\)!?:.*|\1|')" || true
- name: "Extract if the PR is a breaking change and add it as label"
run: gh pr edit "$PR_NUMBER" --add-label "$(echo "$PR_TITLE" | sed -E 's|[[:alpha:]]+(\(.*\))?!:.*|breaking-change|')" || true
request-reviewer:
if: github.event.pull_request.state == 'open' && github.event.pull_request.draft == false
runs-on: ubuntu-latest
needs: ["triage", "type-scope"]
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v3
- name: 'Request reviewers'
uses: actions/github-script@v6
with:
script: |
const script = require('./.github/scripts/reviews.js')
await script({github, context})

View File

@@ -1,65 +0,0 @@
```
${NVIM_VERSION}
```
## Install
### Windows
#### Zip
1. Download **nvim-win64.zip**
2. Extract the zip.
3. Run `nvim-qt.exe`
#### MSI
1. Download **nvim-win64.msi**
2. Run the MSI
3. Search and run `nvim-qt.exe` or run `nvim.exe` on your CLI of choice.
### macOS
1. Download **nvim-macos.tar.gz**
2. Run `xattr -c ./nvim-macos.tar.gz` (to avoid "unknown developer" warning)
3. Extract: `tar xzvf nvim-macos.tar.gz`
4. Run `./nvim-macos/bin/nvim`
### Linux (x64)
#### Tarball
1. Download **nvim-linux64.tar.gz**
2. Extract: `tar xzvf nvim-linux64.tar.gz`
3. Run `./nvim-linux64/bin/nvim`
#### Debian Package
1. Download **nvim-linux64.deb**
2. Install the package using `sudo apt install ./nvim-linux64.deb`
3. Run `nvim`
#### AppImage
1. Download **nvim.appimage**
2. Run `chmod u+x nvim.appimage && ./nvim.appimage`
- If your system does not have FUSE you can [extract the appimage](https://github.com/AppImage/AppImageKit/wiki/FUSE#type-2-appimage):
```
./nvim.appimage --appimage-extract
./squashfs-root/usr/bin/nvim
```
### Other
- Install by [package manager](https://github.com/neovim/neovim/wiki/Installing-Neovim)
## SHA256 Checksums
```
${SHA_LINUX_64_TAR}
${SHA_LINUX_64_DEB}
${SHA_APP_IMAGE}
${SHA_APP_IMAGE_ZSYNC}
${SHA_MACOS}
${SHA_WIN_64_ZIP}
${SHA_WIN_64_MSI}
```

View File

@@ -13,21 +13,21 @@ on:
- v[0-9]+.[0-9]+.[0-9]+ - v[0-9]+.[0-9]+.[0-9]+
# Build on the oldest supported images, so we have broader compatibility # Build on the oldest supported images, so we have broader compatibility
# Build with gcc-10 to prevent triggering #14150 (default is still gcc-9 on 20.04) # Upgrade to gcc-11 to prevent it from using its builtins (#14150)
jobs: jobs:
linux: linux:
runs-on: ubuntu-20.04 runs-on: ubuntu-18.04
outputs: outputs:
version: ${{ steps.build.outputs.version }} version: ${{ steps.build.outputs.version }}
release: ${{ steps.build.outputs.release }} release: ${{ steps.build.outputs.release }}
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v2
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Install dependencies - name: Install dependencies
run: | run: |
sudo apt-get update sudo apt-get update
sudo apt-get install -y autoconf automake build-essential cmake gettext libtool-bin locales ninja-build pkg-config unzip sudo apt-get install -y autoconf automake build-essential cmake gcc-11 gettext gperf libtool-bin locales ninja-build pkg-config unzip
- if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name != 'nightly') - if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name != 'nightly')
run: printf 'NVIM_BUILD_TYPE=Release\n' >> $GITHUB_ENV run: printf 'NVIM_BUILD_TYPE=Release\n' >> $GITHUB_ENV
- if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly') - if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly')
@@ -35,158 +35,120 @@ jobs:
- name: Build release - name: Build release
id: build id: build
run: | run: |
CC=gcc-10 make CMAKE_BUILD_TYPE=${NVIM_BUILD_TYPE} CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX:PATH=" CC=gcc-11 make CMAKE_BUILD_TYPE=${NVIM_BUILD_TYPE} CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX:PATH="
printf 'version<<END\n' >> $GITHUB_OUTPUT printf '::set-output name=version::%s\n' "$(./build/bin/nvim --version | head -n 3 | sed -z 's/\n/%0A/g')"
./build/bin/nvim --version | head -n 3 >> $GITHUB_OUTPUT printf '::set-output name=release::%s\n' "$(./build/bin/nvim --version | head -n 1)"
printf 'END\n' >> $GITHUB_OUTPUT
printf 'release=%s\n' "$(./build/bin/nvim --version | head -n 1)" >> $GITHUB_OUTPUT
make DESTDIR="$GITHUB_WORKSPACE/build/release/nvim-linux64" install make DESTDIR="$GITHUB_WORKSPACE/build/release/nvim-linux64" install
cd "$GITHUB_WORKSPACE/build/" cd "$GITHUB_WORKSPACE/build/release"
cpack -C $NVIM_BUILD_TYPE tar cfz nvim-linux64.tar.gz nvim-linux64
- uses: actions/upload-artifact@v3 - uses: actions/upload-artifact@v2
with: with:
name: nvim-linux64 name: nvim-linux64
path: | path: build/release/nvim-linux64.tar.gz
build/nvim-linux64.tar.gz
build/nvim-linux64.deb
retention-days: 1 retention-days: 1
appimage: appimage:
runs-on: ubuntu-20.04 runs-on: ubuntu-18.04
container:
image: ubuntu:18.04
options: --privileged # Privileged mode is needed to load fuse module.
steps: steps:
- name: Prepare container - uses: actions/checkout@v2
run: |
apt-get update
apt-get install -y software-properties-common
add-apt-repository -y ppa:ubuntu-toolchain-r/test # For gcc-10.
add-apt-repository -y ppa:git-core/ppa # For git>=2.18.
apt-get update
apt-get install -y git gcc-10
apt-get install -y fuse libfuse2 # For linuxdeploy.
# Workaround for https://github.com/actions/checkout/issues/766.
git config --global --add safe.directory "$GITHUB_WORKSPACE"
- uses: actions/checkout@v3
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Install dependencies - name: Install dependencies
run: | run: |
apt-get update sudo apt-get update
apt-get install -y autoconf automake build-essential cmake gettext libtool-bin locales ninja-build pkg-config unzip sudo apt-get install -y autoconf automake build-essential cmake gcc-11 gettext gperf libtool-bin locales ninja-build pkg-config unzip
- if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name != 'nightly') - if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name != 'nightly')
run: CC=gcc-10 make appimage-latest run: CC=gcc-11 make appimage-latest
- if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly') - if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly')
run: CC=gcc-10 make appimage-nightly run: CC=gcc-11 make appimage-nightly
- uses: actions/upload-artifact@v3 - uses: actions/upload-artifact@v2
with: with:
name: appimage name: appimage
path: | path: build/bin/nvim.appimage
build/bin/nvim.appimage retention-days: 1
build/bin/nvim.appimage.zsync - uses: actions/upload-artifact@v2
with:
name: appimage
path: build/bin/nvim.appimage.zsync
retention-days: 1 retention-days: 1
macOS: macOS:
runs-on: macos-11 runs-on: macos-10.15
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v2
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Install brew packages - name: Install brew packages
run: | run: |
brew update --quiet rm -f /usr/local/bin/2to3
brew update >/dev/null
brew upgrade
brew install automake ninja brew install automake ninja
- if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name != 'nightly') - if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name != 'nightly')
run: printf 'NVIM_BUILD_TYPE=Release\n' >> $GITHUB_ENV run: printf 'NVIM_BUILD_TYPE=Release\n' >> $GITHUB_ENV
- if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly') - if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly')
run: printf 'NVIM_BUILD_TYPE=RelWithDebInfo\n' >> $GITHUB_ENV run: printf 'NVIM_BUILD_TYPE=RelWithDebInfo\n' >> $GITHUB_ENV
- name: Provision universal `libintl`
run: |
GETTEXT_PREFIX="$(brew --prefix gettext)"
printf 'GETTEXT_PREFIX=%s\n' "$GETTEXT_PREFIX" >> $GITHUB_ENV
bottle_tag="arm64_big_sur"
brew fetch --bottle-tag="$bottle_tag" gettext
cd "$(mktemp -d)"
tar xf "$(brew --cache)"/**/*gettext*${bottle_tag}*.tar.gz
lipo gettext/*/lib/libintl.a "${GETTEXT_PREFIX}/lib/libintl.a" -create -output libintl.a
mv -f libintl.a /usr/local/lib/
- name: Ensure static linkage to `libintl`
run: |
# We're about to mangle `gettext`, so let's remove any potentially broken
# installs (e.g. curl, git) as those could interfere with our build.
brew uninstall $(brew uses --installed --recursive gettext)
brew unlink gettext
ln -sf "$(brew --prefix)/opt/$(readlink "${GETTEXT_PREFIX}")/bin"/* /usr/local/bin/
ln -sf "$(brew --prefix)/opt/$(readlink "${GETTEXT_PREFIX}")/include"/* /usr/local/include/
rm -f "$GETTEXT_PREFIX"
- name: Build release - name: Build release
run: | run: |
export MACOSX_DEPLOYMENT_TARGET="$(sw_vers -productVersion | cut -f1 -d.)" make CMAKE_BUILD_TYPE=${NVIM_BUILD_TYPE} CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX:PATH= -DCMAKE_OSX_DEPLOYMENT_TARGET=10.11"
OSX_FLAGS="-DCMAKE_OSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} -DCMAKE_OSX_ARCHITECTURES=arm64\;x86_64" make DESTDIR="$GITHUB_WORKSPACE/build/release/nvim-osx64" install
make CMAKE_BUILD_TYPE=${NVIM_BUILD_TYPE} \ - name: Create package
CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX:PATH= $OSX_FLAGS" \ run: |
DEPS_CMAKE_FLAGS="$OSX_FLAGS" cd "$GITHUB_WORKSPACE/build/release"
make DESTDIR="$GITHUB_WORKSPACE/build/release/nvim-macos" install mkdir -p nvim-osx64/libs
cd "$GITHUB_WORKSPACE/build/" libs=($(otool -L nvim-osx64/bin/nvim | sed 1d | sed -E -e 's|^[[:space:]]*||' -e 's| .*||'))
# Make sure we build everything for M1 as well echo "libs:"
for macho in bin/* lib/nvim/parser/*.so for lib in "${libs[@]}"; do
do if echo "$lib" | grep -q -E 'libSystem|CoreFoundation' 2>/dev/null; then
lipo -info "$macho" | grep -q arm64 || exit 1 echo " [skipped] $lib"
else
echo " $lib"
relname="libs/${lib##*/}"
cp -L "$lib" "nvim-osx64/$relname"
install_name_tool -change "$lib" "@executable_path/../$relname" nvim-osx64/bin/nvim
fi
done done
cpack -C "$NVIM_BUILD_TYPE" tar cfz nvim-macos.tar.gz nvim-osx64
- uses: actions/upload-artifact@v3 - uses: actions/upload-artifact@v2
with: with:
name: nvim-macos name: nvim-macos
path: build/nvim-macos.tar.gz path: build/release/nvim-macos.tar.gz
retention-days: 1 retention-days: 1
windows: windows:
runs-on: windows-2019 runs-on: windows-2016
env: env:
DEPS_BUILD_DIR: ${{ format('{0}/nvim-deps', github.workspace) }} DEPS_BUILD_DIR: ${{ format('{0}/nvim-deps', github.workspace) }}
DEPS_PREFIX: ${{ format('{0}/nvim-deps/usr', github.workspace) }} DEPS_PREFIX: ${{ format('{0}/nvim-deps/usr', github.workspace) }}
CMAKE_BUILD_TYPE: "RelWithDebInfo"
strategy: strategy:
matrix: matrix:
include: include:
- config: MSVC_64 - config: MSVC_64
archive: nvim-win64 archive: nvim-win64
- config: MSVC_32
archive: nvim-win32
name: windows (${{ matrix.config }}) name: windows (${{ matrix.config }})
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v2
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Build deps - run: powershell ci\build.ps1 -NoTests
run: .\ci\build.ps1 -BuildDeps env:
- name: build package CONFIGURATION: ${{ matrix.config }}
run: .\ci\build.ps1 -Package - run: move build\Neovim.zip build\${{ matrix.archive }}.zip
- uses: actions/upload-artifact@v3 - uses: actions/upload-artifact@v2
with: with:
name: ${{ matrix.archive }} name: ${{ matrix.archive }}
path: | path: build/${{ matrix.archive }}.zip
build/${{ matrix.archive }}.msi
build/${{ matrix.archive }}.zip
retention-days: 1 retention-days: 1
publish: publish:
needs: [linux, appimage, macOS, windows] needs: [linux, appimage, macOS, windows]
runs-on: ubuntu-latest runs-on: ubuntu-20.04
env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
permissions: permissions:
contents: write contents: write
steps: steps:
# Must perform checkout first, since it deletes the target directory - uses: actions/download-artifact@v2
# before running, and would therefore delete the downloaded artifacts
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y gettext-base
- if: github.event_name == 'workflow_dispatch' - if: github.event_name == 'workflow_dispatch'
run: echo "TAG_NAME=${{ github.event.inputs.tag_name }}" >> $GITHUB_ENV run: echo "TAG_NAME=${{ github.event.inputs.tag_name }}" >> $GITHUB_ENV
- if: github.event_name == 'schedule' - if: github.event_name == 'schedule'
@@ -196,26 +158,23 @@ jobs:
TAG_NAME=${{ github.ref }} TAG_NAME=${{ github.ref }}
echo "TAG_NAME=${TAG_NAME#refs/tags/}" >> $GITHUB_ENV echo "TAG_NAME=${TAG_NAME#refs/tags/}" >> $GITHUB_ENV
- if: env.TAG_NAME == 'nightly' - if: env.TAG_NAME == 'nightly'
run: | run: echo 'SUBJECT=Nvim development (prerelease) build' >> $GITHUB_ENV
(echo 'SUBJECT=Nvim development (prerelease) build';
echo 'PRERELEASE=--prerelease') >> $GITHUB_ENV
gh release delete nightly --yes || true
git push origin :nightly || true
- if: env.TAG_NAME != 'nightly' - if: env.TAG_NAME != 'nightly'
run: | run: echo 'SUBJECT=Nvim release build' >> $GITHUB_ENV
(echo 'SUBJECT=Nvim release build'; - if: env.TAG_NAME == 'nightly'
echo 'PRERELEASE=') >> $GITHUB_ENV uses: dev-drprasad/delete-tag-and-release@v0.1.2
gh release delete stable --yes || true env:
git push origin :stable || true GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
delete_release: true
tag_name: nightly
# `sha256sum` outputs <sha> <path>, so we cd into each dir to drop the # `sha256sum` outputs <sha> <path>, so we cd into each dir to drop the
# containing folder from the output. # containing folder from the output.
- name: Generate Linux64 SHA256 checksums - name: Generate Linux64 SHA256 checksums
run: | run: |
cd ./nvim-linux64 cd ./nvim-linux64
sha256sum nvim-linux64.tar.gz > nvim-linux64.tar.gz.sha256sum sha256sum nvim-linux64.tar.gz > nvim-linux64.tar.gz.sha256sum
echo "SHA_LINUX_64_TAR=$(cat nvim-linux64.tar.gz.sha256sum)" >> $GITHUB_ENV echo "SHA_LINUX_64=$(cat nvim-linux64.tar.gz.sha256sum)" >> $GITHUB_ENV
sha256sum nvim-linux64.deb > nvim-linux64.deb.sha256sum
echo "SHA_LINUX_64_DEB=$(cat nvim-linux64.deb.sha256sum)" >> $GITHUB_ENV
- name: Generate App Image SHA256 checksums - name: Generate App Image SHA256 checksums
run: | run: |
cd ./appimage cd ./appimage
@@ -231,48 +190,77 @@ jobs:
cd ./nvim-macos cd ./nvim-macos
sha256sum nvim-macos.tar.gz > nvim-macos.tar.gz.sha256sum sha256sum nvim-macos.tar.gz > nvim-macos.tar.gz.sha256sum
echo "SHA_MACOS=$(cat nvim-macos.tar.gz.sha256sum)" >> $GITHUB_ENV echo "SHA_MACOS=$(cat nvim-macos.tar.gz.sha256sum)" >> $GITHUB_ENV
- name: Generate Win32 SHA256 checksums
run: |
cd ./nvim-win32
sha256sum nvim-win32.zip > nvim-win32.zip.sha256sum
echo "SHA_WIN_32=$(cat nvim-win32.zip.sha256sum)" >> $GITHUB_ENV
- name: Generate Win64 SHA256 checksums - name: Generate Win64 SHA256 checksums
run: | run: |
cd ./nvim-win64 cd ./nvim-win64
sha256sum nvim-win64.zip > nvim-win64.zip.sha256sum sha256sum nvim-win64.zip > nvim-win64.zip.sha256sum
echo "SHA_WIN_64_ZIP=$(cat nvim-win64.zip.sha256sum)" >> $GITHUB_ENV echo "SHA_WIN_64=$(cat nvim-win64.zip.sha256sum)" >> $GITHUB_ENV
sha256sum nvim-win64.msi > nvim-win64.msi.sha256sum - uses: meeDamian/github-release@2.0
echo "SHA_WIN_64_MSI=$(cat nvim-win64.msi.sha256sum)" >> $GITHUB_ENV with:
- name: Publish release token: ${{ secrets.GITHUB_TOKEN }}
env: tag: ${{ env.TAG_NAME }}
NVIM_VERSION: ${{ needs.linux.outputs.version }} name: ${{ needs.linux.outputs.release }}
DEBUG: api prerelease: ${{ env.TAG_NAME == 'nightly' }}
run: | commitish: ${{ github.sha }}
envsubst < "$GITHUB_WORKSPACE/.github/workflows/notes.md" > "$RUNNER_TEMP/notes.md" gzip: false
gh release create $TAG_NAME $PRERELEASE --notes-file "$RUNNER_TEMP/notes.md" --title "$SUBJECT" --target $GITHUB_SHA nvim-macos/* nvim-linux64/* appimage/* nvim-win64/* allow_override: ${{ env.TAG_NAME == 'nightly' }}
if [ "$TAG_NAME" != "nightly" ]; then files: |
gh release create stable $PRERELEASE --notes-file "$RUNNER_TEMP/notes.md" --title "$SUBJECT" --target $GITHUB_SHA nvim-macos/* nvim-linux64/* appimage/* nvim-win64/* nvim-macos.tar.gz:./nvim-macos/nvim-macos.tar.gz
fi nvim-macos.tar.gz.sha256sum:./nvim-macos/nvim-macos.tar.gz.sha256sum
nvim-linux64.tar.gz:./nvim-linux64/nvim-linux64.tar.gz
nvim-linux64.tar.gz.sha256sum:./nvim-linux64/nvim-linux64.tar.gz.sha256sum
nvim.appimage:./appimage/nvim.appimage
nvim.appimage.sha256sum:./appimage/nvim.appimage.sha256sum
nvim.appimage.zsync:./appimage/nvim.appimage.zsync
nvim.appimage.zsync.sha256sum:./appimage/nvim.appimage.zsync.sha256sum
nvim-win32.zip:./nvim-win32/nvim-win32.zip
nvim-win32.zip.sha256sum:./nvim-win32/nvim-win32.zip.sha256sum
nvim-win64.zip:./nvim-win64/nvim-win64.zip
nvim-win64.zip.sha256sum:./nvim-win64/nvim-win64.zip.sha256sum
body: |
${{ env.SUBJECT }}
```
${{ needs.linux.outputs.version }}```
publish-winget: ## Install
needs: publish
runs-on: windows-latest ### Windows
steps:
- if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name != 'nightly') 1. Extract **nvim-win64.zip** (or **nvim-win32.zip**)
name: Publish stable 2. Run `nvim-qt.exe`
uses: vedantmgoyal2009/winget-releaser@v1
with: ### macOS
identifier: Neovim.Neovim
release-tag: ${{ github.event.inputs.tag_name || github.ref_name }} 1. Download **nvim-macos.tar.gz**
token: ${{ secrets.WINGET_TOKEN }} 2. Extract: `tar xzvf nvim-macos.tar.gz`
- if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly') 3. Run `./nvim-osx64/bin/nvim`
name: Get nightly version
id: get-version ### Linux (x64)
run: |
Invoke-WebRequest https://github.com/neovim/neovim/releases/download/nightly/nvim-win64.msi -OutFile setup.msi 1. Download **nvim.appimage**
Install-Module -Name 'Carbon.Windows.Installer' -Force 2. Run `chmod u+x nvim.appimage && ./nvim.appimage`
$VERSION = (Get-CMsi (Resolve-Path .\setup.msi).Path).ProductVersion - If your system does not have FUSE you can [extract the appimage](https://github.com/AppImage/AppImageKit/wiki/FUSE#type-2-appimage):
"version=$VERSION" >> $env:GITHUB_OUTPUT ```
- if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly') ./nvim.appimage --appimage-extract
name: Publish nightly ./squashfs-root/usr/bin/nvim
uses: vedantmgoyal2009/winget-releaser@v1 ```
with:
identifier: Neovim.Neovim.Nightly ### Other
version: ${{ steps.get-version.outputs.version }}
release-tag: nightly - Install by [package manager](https://github.com/neovim/neovim/wiki/Installing-Neovim)
token: ${{ secrets.WINGET_TOKEN }}
## SHA256 Checksums
```
${{ env.SHA_LINUX_64 }}
${{ env.SHA_APP_IMAGE }}
${{ env.SHA_APP_IMAGE_ZSYNC }}
${{ env.SHA_MACOS }}
${{ env.SHA_WIN_64 }}
${{ env.SHA_WIN_32 }}
```

View File

@@ -1,17 +0,0 @@
name: "Remove reviewers"
on:
pull_request_target:
types: [converted_to_draft, closed]
jobs:
remove-reviewers:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v3
- name: 'Remove reviewers'
uses: actions/github-script@v6
with:
script: |
const script = require('./.github/scripts/remove-reviewers.js')
await script({github, context})

View File

@@ -1,18 +0,0 @@
name: "Request reviews"
on:
pull_request_target:
types: [labeled, ready_for_review]
jobs:
request-reviewer:
if: github.event.pull_request.state == 'open' && github.event.pull_request.draft == false
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v3
- name: 'Request reviewers'
uses: actions/github-script@v6
with:
script: |
const script = require('./.github/scripts/reviews.js')
await script({github, context})

View File

@@ -5,7 +5,7 @@ on:
jobs: jobs:
update-vim-patches: update-vim-patches:
runs-on: ubuntu-latest runs-on: ubuntu-20.04
permissions: permissions:
contents: write contents: write
pull-requests: write pull-requests: write
@@ -14,11 +14,11 @@ jobs:
VERSION_BRANCH: marvim/ci-version-update VERSION_BRANCH: marvim/ci-version-update
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v2
with: with:
fetch-depth: 0 fetch-depth: 0
- uses: actions/checkout@v3 - uses: actions/checkout@v2
with: with:
repository: vim/vim repository: vim/vim
path: ${{ env.VIM_SOURCE_DIR }} path: ${{ env.VIM_SOURCE_DIR }}
@@ -40,8 +40,8 @@ jobs:
id: update-version id: update-version
run: | run: |
git checkout -b ${VERSION_BRANCH} git checkout -b ${VERSION_BRANCH}
nvim -V1 -es -i NONE +'luafile scripts/vimpatch.lua' +q nvim -i NONE -u NONE --headless +'luafile scripts/vimpatch.lua' +q
printf 'NEW_PATCHES=%s\n' $([ -z "$(git diff)" ]; echo $?) >> $GITHUB_OUTPUT printf '::set-output name=NEW_PATCHES::%s\n' $([ -z "$(git diff)" ]; echo $?)
- name: Automatic PR - name: Automatic PR
if: ${{ steps.update-version.outputs.NEW_PATCHES != 0 }} if: ${{ steps.update-version.outputs.NEW_PATCHES != 0 }}
@@ -49,4 +49,4 @@ jobs:
git add -u git add -u
git commit -m 'version.c: update [skip ci]' git commit -m 'version.c: update [skip ci]'
git push --force https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY} ${VERSION_BRANCH} git push --force https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY} ${VERSION_BRANCH}
gh pr create --draft --fill --label vim-patch --base ${GITHUB_REF#refs/heads/} --head ${VERSION_BRANCH} || true gh pr create --fill --label vim-patch --base ${GITHUB_REF#refs/heads/} --head ${VERSION_BRANCH} || true

5
.gitignore vendored
View File

@@ -1,7 +1,6 @@
# Tools # Tools
/venv/ /venv/
compile_commands.json compile_commands.json
/.luarc.json
# IDEs # IDEs
/.vs/ /.vs/
@@ -14,8 +13,6 @@ compile_commands.json
/tmp/ /tmp/
/.clangd/ /.clangd/
/.cache/clangd/ /.cache/clangd/
/.ccls-cache/
/.clang-tidy
.DS_Store .DS_Store
*.mo *.mo
@@ -73,5 +70,3 @@ tags
# vim patches # vim patches
/vim-*.patch /vim-*.patch
/CMakeUserPresets.json

View File

@@ -25,18 +25,3 @@ ignore = {
read_globals = { read_globals = {
"vim", "vim",
} }
globals = {
"vim.g",
"vim.b",
"vim.w",
"vim.o",
"vim.bo",
"vim.wo",
"vim.go",
"vim.env"
}
exclude_files = {
'test/functional/fixtures/lua/syntax_error.lua',
}

137
.mailmap
View File

@@ -1,137 +0,0 @@
Abdelhakeem <abdelhakeem.osama@hotmail.com> Abdelhakeem Osama
Alvaro Muñoz <alvaro@pwntester.com> Alvaro Muñoz
Andreas Johansson <andreas@ndrs.xyz> <ndreas@users.noreply.github.com>
Andrew Pyatkov <mrbiggfoot@gmail.com> <mrbiggfoot@users.noreply.github.com>
Anmol Sethi <hi@nhooyr.io> <anmol@aubble.com>
Anmol Sethi <hi@nhooyr.io> <me@anmol.io>
Anmol Sethi <hi@nhooyr.io> <nhooyr@users.noreply.github.com>
BK1603 <chouhan.shreyansh2702@gmail.com> Shreyansh Chouhan
Billy Su <g4691821@gmail.com> Billy SU
Billy Vong <billyvg@gmail.com> <billyvg@users.noreply.github.com>
bfredl <bjorn.linse@gmail.com>
Carlos Hernandez <carlos@techbyte.ca> <hurricanehrndz@users.noreply.github.com>
Chris Kipp <ckipp@pm.me> ckipp01
Christian Clason <c.clason@uni-graz.at> <christian.clason@uni-due.de>
Cédric Barreteau <> <cbarrete@users.noreply.github.com>
Dan Aloni <alonid@gmail.com> <dan@kernelim.com>
Daniel Hahler <git@thequod.de> <github@thequod.de>
dundargoc <gocdundar@gmail.com> <33953936+dundargoc@users.noreply.github.com>
dundargoc <gocdundar@gmail.com> Dundar Goc
Eisuke Kawashima <e-kwsm@users.noreply.github.com> E Kawashima
ElPiloto <luis.r.piloto@gmail.com> Luis Piloto
Eliseo Martínez <eliseomarmol@gmail.com> Eliseo Martínez
Fabian Viöl <f.vioel@googlemail.com> Fabian
Florian Walch <florian@fwalch.com> <fwalch@users.noreply.github.com>
Gabriel Cruz <gabs.oficial98@gmail.com> <LTKills@users.noreply.github.com>
Gaelan Steele <gbs@canishe.com> Gaelan
Gavin D. Howard <gavin@schedmd.com> <yzena.tech@gmail.com>
George Zhao <zhaozg@gmail.com> <zhaozg@aliyun.com>
George Zhao <zhaozg@gmail.com> George Zhao
Gregory Anders <greg@gpanders.com> <8965202+gpanders@users.noreply.github.com>
Gregory Anders <greg@gpanders.com> Greg Anders
Grzegorz Milka <grzegorzmilka@gmail.com> Grzegorz
Harm te Hennepe <dhtehennepe@gmail.com> <d.h.tehennepe@student.utwente.nl>
Harm te Hennepe <dhtehennepe@gmail.com> <harm@tehennepe.org>
Hirokazu Hata <h.hata.ai.t@gmail.com> <h-michael@users.noreply.github.com>
Ihor Antonov <ngortheone@gmail.com> <ngortheone@users.noreply.github.com>
J Phani Mahesh <phanimahesh@gmail.com> <github@phanimahesh.me>
Jack Bracewell <FriedSock@users.noreply.github.com> <jack.bracewell@unboxedconsulting.com>
Jack Bracewell <FriedSock@users.noreply.github.com> <jbtwentythree@gmail.com>
Jacques Germishuys <jacquesg@striata.com> <jacquesg@users.noreply.github.com>
Jakub Łuczyński <doubleloop@o2.pl> <doubleloop@users.noreply.github.com>
James McCoy <jamessan@jamessan.com> <vega.james@gmail.com>
Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> <janedmundlazo@hotmail.com>
Jan Viljanen <jan.a.viljanen@gmail.com> <jan.viljanen@greenpeace.org>
Javier Lopez <graulopezjavier@gmail.com> Javier López
Jit Yao Yap <jityao@gmail.com> <jityao+github@gmail.com>
Jit Yao Yap <jityao@gmail.com> Jit
John Gehrig <jdg.gehrig@gmail.com> <jgehrig@users.noreply.github.com>
John Schmidt <john.schmidt.h@gmail.com> John
John Szakmeister <john@szakmeister.net> <jszakmeister@users.noreply.github.com>
Jonathan de Boyne Pollard <J.deBoynePollard-newsgroups@NTLWorld.com> <jdebp@users.noreply.github.com>
Jonathan de Boyne Pollard <J.deBoynePollard-newsgroups@NTLWorld.com> <postmaster@localhost>
Jurica Bradaric <jbradaric@gmail.com> <jbradaric@users.noreply.github.com>
Jurica Bradaric <jbradaric@gmail.com> <jurica.bradaric@avl.com>
KillTheMule <KillTheMule@users.noreply.github.com> <github@pipsfrank.de>
Kwon-Young Choi <kwon-young.choi@hotmail.fr> Kwon-Young
Lewis Russell <lewis6991@gmail.com> <me@lewisr.dev>
Lucas Hoffmann <l-m-h@web.de> <lucc@posteo.de>
Lucas Hoffmann <l-m-h@web.de> <lucc@users.noreply.github.com>
Marco Hinz <mh.codebro@gmail.com> <mh.codebro+github@gmail.com>
Marvim the Paranoid Android <marvim@users.noreply.github.com> marvim
Mateusz Czapliński <czapkofan@gmail.com> Mateusz Czaplinski
Mathias Fussenegger <f.mathias@zignar.net> <mfussenegger@users.noreply.github.com>
Mathias Fussenegger <f.mathias@zignar.net> Mathias Fußenegger
Matt Wozniski <godlygeek@gmail.com> <godlygeek+git@gmail.com>
Matthieu Coudron <mattator@gmail.com> <coudron@iij.ad.jp>
Matthieu Coudron <mattator@gmail.com> <matthieu.coudron@upmc.fr>
Matthieu Coudron <mattator@gmail.com> <mcoudron@hotmail.com>
Matthieu Coudron <mattator@gmail.com> <teto@users.noreply.github.com>
MichaHoffmann <michoffmann.potsdam@gmail.com> Michael Hoffmann
MichaHoffmann <michoffmann.potsdam@gmail.com> micha
Michael Ennen <mike.ennen@gmail.com> <brcolow@users.noreply.github.com>
Michael Ennen <mike.ennen@gmail.com> brcolow
Michael Reed <m.reed@mykolab.com> <Pyrohh@users.noreply.github.com>
Michael Schupikov <michael@schupikov.de> <DarkDeepBlue@users.noreply.github.com>
Nicolas Hillegeer <nicolas@hillegeer.com> <nicolashillegeer@gmail.com>
Panashe M. Fundira <fundirap@gmail.com> Panashe Fundira
Patrice Peterson <patrice.peterson@mailbox.org> runiq
Pavel Platto <hinidu@gmail.com> Hinidu
Petter Wahlman <petter@wahlman.no> <pwahlman@cisco.com>
Poh Zi How <poh.zihow@gmail.com> pohzipohzi
Rich Wareham <rjw57@cam.ac.uk> <rjw57@cantab.net>
Rui Abreu Ferreira <equalsraf@users.noreply.github.com> @equalsraf
Rui Abreu Ferreira <raf-ep@gmx.com> <equalsraf@users.noreply.github.com>
Rui Abreu Ferreira <raf-ep@gmx.com> <rap-ep@gmx.com>
Sam Wilson <tecywiz121@hotmail.com> <sawilson@akamai.com>
Sander Bosma <sanderbosma@gmail.com> sander2
Santos Gallegos <stsewd@protonmail.com> <santos_g@outlook.com>
Sebastian Parborg <darkdefende@gmail.com> DarkDefender
Shirasaka <tk.shirasaka@gmail.com> tk-shirasaka
Shota <shotat@users.noreply.github.com> shotat
Shougo Matsushita <Shougo.Matsu@gmail.com> Shougo
Stephan Seitz <stephan.seitz@fau.de> <stephan.lauf@yahoo.de>
Steven Sojka <Steven.Sojka@tdameritrade.com> <steelsojka@gmail.com>
Steven Sojka <steelsojka@gmail.com> <steelsojka@users.noreply.github.com>
TJ DeVries <devries.timothyj@gmail.com> <timothydvrs1234@gmail.com>
Thomas Fehér <thomas.feher@yahoo.de> <thomasfeher@web.de>
Thomas Vigouroux <thomas.vigouroux@protonmail.com> <tomvig38@gmail.com> <39092278+vigoux@users.noreply.github.com>
Utkarsh Maheshwari <UtkarshME96@gmail.com> UTkarsh Maheshwari
Utkarsh Maheshwari <utkarshme96@gmail.com> <UtkarshME96@gmail.com>
VVKot <volodymyr.kot.ua@gmail.com> Volodymyr Kot
Victor Adam <victor.adam@cofelyineo-gdfsuez.com> <Victor.Adam@derpymail.org>
Wang Shidong <wsdjeg@outlook.com> <wsdjeg@users.noreply.github.com>
Wei Huang <daviseago@gmail.com> davix
Xu Cheng <xucheng@me.com> <xu-cheng@users.noreply.github.com>
Yamakaky <yamakaky@gmail.com> <yamakaky@yamaworld.fr>
Yegappan Lakshmanan <yegappan@yahoo.com> <4298407+yegappan@users.noreply.github.com>
Yichao Zhou <broken.zhoug@gmail.com> Yichao Zhou <broken.zhou@gmail.com>
Yichao Zhou <broken.zhoug@gmail.com> zhou13 <broken.zhou@gmail.com>
Yorick Peterse <git@yorickpeterse.com> <yorick@yorickpeterse.com>
ZyX <kp-pav@yandex.ru> <kp-pav@ya.ru>
ZyX <kp-pav@yandex.ru> Nikolai Aleksandrovich Pavlov
aph <a.hewson@gmail.com> Ashley Hewson
butwerenotthereyet <58348703+butwerenotthereyet@users.noreply.github.com> We're Yet
chemzqm <chemzqm@gmail.com> Qiming zhao
chentau <tchen1998@gmail.com> Tony Chen
dedmass <carlo.abelli@gmail.com> Carlo Abelli
equal-l2 <eng.equall2@gmail.com> <equal-l2@users.noreply.github.com>
francisco souza <fsouza@users.noreply.github.com> <108725+fsouza@users.noreply.github.com>
glacambre <code@lacamb.re> <me@r4>
glacambre <code@lacamb.re> Ghjuvan Lacambre
ii14 <ii14@users.noreply.github.com> <59243201+ii14@users.noreply.github.com>
jdrouhard <john@jmdtech.org> <github@jmdtech.org>
kuuote <znmxodq1@gmail.com> <36663503+kuuote@users.noreply.github.com>
matveyt <matthewtarasov@gmail.com> <35012635+matveyt@users.noreply.github.com>
nate <nateozemon@gmail.com> nateozem
ray-x <rayx.cn@gmail.com> rayx
relnod <mail@paul-schiffers.de> <relnod@users.noreply.github.com>
rockerBOO <rockerboo@gmail.com> Dave Lage
rpigott <rpigott@berkeley.edu> Ronan Pigott
sach1t <sach0010t@gmail.com> <sach1t@users.noreply.github.com>
shade-of-noon <73705427+shade-of-noon@users.noreply.github.com> Edwin Pujols
shadmansaleh <shadmansaleh3@gmail.com> <13149513+shadmansaleh@users.noreply.github.com>
shadmansaleh <shadmansaleh3@gmail.com> Shadman
sohnryang <loop.infinitely@gmail.com> 손량
timeyyy <timeyyy_da_man@hotmail.com> Timothy C Eichler
timeyyy <timeyyy_da_man@hotmail.com> timothy eichler

View File

@@ -1,6 +0,0 @@
column_width = 100
line_endings = "Unix"
indent_type = "Spaces"
indent_width = 2
quote_style = "AutoPreferSingle"
call_parentheses = "Always"

View File

@@ -1,3 +0,0 @@
/scripts
/src
/test

222
.travis.yml Normal file
View File

@@ -0,0 +1,222 @@
dist: bionic
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=
- PATH="$HOME/.local/bin:$PATH"
# Set "false" to force rebuild of third-party dependencies.
- CACHE_ENABLE=true
# Build directory for Neovim.
- BUILD_DIR="$TRAVIS_BUILD_DIR/build"
# Build directory for third-party dependencies.
- DEPS_BUILD_DIR="$HOME/nvim-deps"
# Install directory for Neovim.
- INSTALL_PREFIX="$HOME/nvim-install"
# Log directory for Clang sanitizers and Valgrind.
- LOG_DIR="$BUILD_DIR/log"
# Nvim log file.
- NVIM_LOG_FILE="$BUILD_DIR/.nvimlog"
# Default CMake flags.
- CMAKE_FLAGS="-DCI_BUILD=ON
-DCMAKE_BUILD_TYPE=Debug
-DCMAKE_INSTALL_PREFIX:PATH=$INSTALL_PREFIX
-DBUSTED_OUTPUT_TYPE=nvim
-DDEPS_PREFIX=$DEPS_BUILD_DIR/usr
-DMIN_LOG_LEVEL=3"
- DEPS_CMAKE_FLAGS="-DUSE_BUNDLED_GPERF=OFF"
# 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"
- UBSAN_OPTIONS="print_stacktrace=1 log_path=$LOG_DIR/ubsan"
# Environment variables for Valgrind.
- VALGRIND_LOG="$LOG_DIR/valgrind-%p.log"
- CACHE_NVIM_DEPS_DIR="$HOME/.cache/nvim-deps"
# If this file exists, the cache is valid (compile was successful).
- CACHE_MARKER="$CACHE_NVIM_DEPS_DIR/.ci_cache_marker"
# default target name for functional tests
- FUNCTIONALTEST=functionaltest
- CI_TARGET=tests
# Environment variables for ccache
- CCACHE_COMPRESS=1
- CCACHE_SLOPPINESS=time_macros,file_macro
- CCACHE_BASEDIR="$TRAVIS_BUILD_DIR"
- CI_OS_NAME="$TRAVIS_OS_NAME"
anchors:
envs: &common-job-env
# Do not fall back to cache for "master" for PR on "release" branch:
# adds the target branch to the cache key.
FOR_TRAVIS_CACHE=v1-$TRAVIS_BRANCH
addons:
apt:
packages: &common-apt-packages
- apport
- autoconf
- automake
- build-essential
- clang
- cmake
- cpanminus
- cscope
- gcc-multilib
- gdb
- gperf
- language-pack-tr
- libtool-bin
- locales
- ninja-build
- pkg-config
- unzip
- valgrind
- xclip
homebrew:
update: true
casks:
- powershell
packages:
- ccache
- cpanminus
- ninja
- perl
jobs:
include:
- name: gcc-coverage (gcc 9)
os: linux
compiler: gcc-9
env:
- 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:
snaps:
- name: powershell
confinement: classic
apt:
sources:
- sourceline: 'ppa:ubuntu-toolchain-r/test'
packages:
- *common-apt-packages
- gcc-9
- name: gcc-functionaltest-lua
os: linux
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
- name: gcc-32bit
os: linux
# Travis creates a cache per compiler. Set a different value here to
# store 32-bit dependencies in a separate cache.
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
- 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
- SNAPCRAFT_BUILD_ENVIRONMENT: lxd
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
- SNAPCRAFT_BUILD_ENVIRONMENT: lxd
fast_finish: true
before_install: ci/before_install.sh
install: ci/install.sh
before_script: ci/before_script.sh
script: ci/script.sh
before_cache: ci/before_cache.sh
branches:
only:
- master
- /^release-\d+\.\d+$/
cache:
apt: true
ccache: true
directories:
- "$CACHE_NVIM_DEPS_DIR"
git:
quiet: true
notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/b5c38c99f9677aa3d031

View File

@@ -1,14 +1,16 @@
# CMAKE REFERENCE # CMAKE REFERENCE
# intro: https://codingnest.com/basic-cmake/ # intro: https://codingnest.com/basic-cmake/
# best practices (3.0+): https://gist.github.com/mbinna/c61dbb39bca0e4fb7d1f73b0d66a4fd1 # best practices (3.0+): https://gist.github.com/mbinna/c61dbb39bca0e4fb7d1f73b0d66a4fd1
# pitfalls: https://izzys.casa/2019/02/everything-you-never-wanted-to-know-about-cmake/
# Version should match the tested CMAKE_URL in .github/workflows/ci.yml. # Version should match the tested CMAKE_URL in .travis.yml.
cmake_minimum_required(VERSION 3.10) cmake_minimum_required(VERSION 2.8.12)
project(nvim C) project(nvim C)
if(POLICY CMP0075) if(POLICY CMP0065)
cmake_policy(SET CMP0075 NEW) cmake_policy(SET CMP0065 NEW)
endif()
if(POLICY CMP0060)
cmake_policy(SET CMP0060 NEW)
endif() endif()
# Point CMake at any custom modules we may ship # Point CMake at any custom modules we may ship
@@ -16,9 +18,6 @@ list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
# We don't support building in-tree. # We don't support building in-tree.
include(PreventInTreeBuilds) include(PreventInTreeBuilds)
include(Util)
set(TOUCHES_DIR ${PROJECT_BINARY_DIR}/touches)
set_property(GLOBAL PROPERTY USE_FOLDERS ON) set_property(GLOBAL PROPERTY USE_FOLDERS ON)
@@ -28,7 +27,7 @@ if(DEFINED ENV{DEPS_BUILD_DIR})
# pkg-config 29.2 has a bug on OpenBSD which causes it to drop any paths that # pkg-config 29.2 has a bug on OpenBSD which causes it to drop any paths that
# *contain* system include paths. To avoid this, we prefix what would be # *contain* system include paths. To avoid this, we prefix what would be
# "/usr/include" as "/_usr/include". # "/usr/include" as "/_usr/include".
# This check is also performed in the cmake.deps/CMakeLists.txt and in the # This check is also performed in the third-party/CMakeLists.txt and in the
# else clause following here. # else clause following here.
# https://github.com/neovim/neovim/pull/14745#issuecomment-860201794 # https://github.com/neovim/neovim/pull/14745#issuecomment-860201794
set(DEPS_PREFIX "$ENV{DEPS_BUILD_DIR}/_usr" CACHE PATH "Path prefix for finding dependencies") set(DEPS_PREFIX "$ENV{DEPS_BUILD_DIR}/_usr" CACHE PATH "Path prefix for finding dependencies")
@@ -60,7 +59,7 @@ else()
-DCMAKE_C_FLAGS_RELWITHDEBINFO=${CMAKE_C_FLAGS_RELWITHDEBINFO} -DCMAKE_C_FLAGS_RELWITHDEBINFO=${CMAKE_C_FLAGS_RELWITHDEBINFO}
-DCMAKE_C_FLAGS_RELEASE=${CMAKE_C_FLAGS_RELEASE} -DCMAKE_C_FLAGS_RELEASE=${CMAKE_C_FLAGS_RELEASE}
-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM} -DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}
${PROJECT_SOURCE_DIR}/cmake.deps ${PROJECT_SOURCE_DIR}/third-party
WORKING_DIRECTORY ${DEPS_BUILD_DIR}) WORKING_DIRECTORY ${DEPS_BUILD_DIR})
execute_process( execute_process(
COMMAND ${CMAKE_COMMAND} --build ${DEPS_BUILD_DIR} COMMAND ${CMAKE_COMMAND} --build ${DEPS_BUILD_DIR}
@@ -69,8 +68,13 @@ else()
endif() endif()
endif() endif()
list(INSERT CMAKE_PREFIX_PATH 0 ${DEPS_PREFIX}) if(CMAKE_CROSSCOMPILING AND NOT UNIX)
set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:${DEPS_PREFIX}/lib/pkgconfig") list(INSERT CMAKE_FIND_ROOT_PATH 0 ${DEPS_PREFIX})
list(INSERT CMAKE_PREFIX_PATH 0 ${DEPS_PREFIX}/../host/bin)
else()
list(INSERT CMAKE_PREFIX_PATH 0 ${DEPS_PREFIX})
set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:${DEPS_PREFIX}/lib/pkgconfig")
endif()
# used for check_c_compiler_flag # used for check_c_compiler_flag
include(CheckCCompilerFlag) include(CheckCCompilerFlag)
@@ -84,20 +88,10 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
# them be included as one of the first places to look for dependencies. # them be included as one of the first places to look for dependencies.
list(APPEND CMAKE_PREFIX_PATH /sw /opt/local) list(APPEND CMAKE_PREFIX_PATH /sw /opt/local)
# If the macOS deployment target is not set manually (via $MACOSX_DEPLOYMENT_TARGET),
# fall back to local system version. Needs to be done both here and in cmake.deps.
if(NOT CMAKE_OSX_DEPLOYMENT_TARGET)
execute_process(COMMAND sw_vers -productVersion
OUTPUT_VARIABLE MACOS_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE)
set(CMAKE_OSX_DEPLOYMENT_TARGET "${MACOS_VERSION}")
endif()
message("Using deployment target ${CMAKE_OSX_DEPLOYMENT_TARGET}")
# Work around some old, broken detection by CMake for knowing when to use the # Work around some old, broken detection by CMake for knowing when to use the
# isystem flag. Apple's compilers have supported this for quite some time # isystem flag. Apple's compilers have supported this for quite some time
# now. # now.
if(CMAKE_C_COMPILER_ID MATCHES "GNU") if(CMAKE_COMPILER_IS_GNUCC)
set(CMAKE_INCLUDE_SYSTEM_FLAG_C "-isystem ") set(CMAKE_INCLUDE_SYSTEM_FLAG_C "-isystem ")
endif() endif()
endif() endif()
@@ -122,22 +116,32 @@ endif()
message(STATUS "CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}") message(STATUS "CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}")
set_default_buildtype() # Build type.
if(NOT CMAKE_BUILD_TYPE)
message(STATUS "CMAKE_BUILD_TYPE not specified, default is 'Debug'")
set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Choose the type of build" FORCE)
else()
message(STATUS "CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}")
endif()
if(CMAKE_BUILD_TYPE MATCHES Debug) if(CMAKE_BUILD_TYPE MATCHES Debug)
set(DEBUG 1) set(DEBUG 1)
else() else()
set(DEBUG 0) set(DEBUG 0)
endif() endif()
# Set available build types for CMake GUIs.
# Other build types can still be set by -DCMAKE_BUILD_TYPE=...
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY
STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
# If not in a git repo (e.g., a tarball) these tokens define the complete # 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`. # version string, else they are combined with the result of `git describe`.
set(NVIM_VERSION_MAJOR 0) set(NVIM_VERSION_MAJOR 0)
set(NVIM_VERSION_MINOR 8) set(NVIM_VERSION_MINOR 5)
set(NVIM_VERSION_PATCH 4) set(NVIM_VERSION_PATCH 1)
set(NVIM_VERSION_PRERELEASE "-dev") # for package maintainers set(NVIM_VERSION_PRERELEASE "") # for package maintainers
# API level # API level
set(NVIM_API_LEVEL 10) # 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_LEVEL_COMPAT 0) # Adjust this after a _breaking_ API change.
set(NVIM_API_PRERELEASE false) set(NVIM_API_PRERELEASE false)
@@ -171,7 +175,7 @@ if(CMAKE_C_FLAGS_RELEASE MATCHES "-O3")
string(REPLACE "-O3" "-O2" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}") string(REPLACE "-O3" "-O2" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
endif() endif()
if(CMAKE_C_COMPILER_ID MATCHES "GNU") if(CMAKE_COMPILER_IS_GNUCC)
check_c_compiler_flag(-Og HAS_OG_FLAG) check_c_compiler_flag(-Og HAS_OG_FLAG)
else() else()
set(HAS_OG_FLAG 0) set(HAS_OG_FLAG 0)
@@ -269,18 +273,14 @@ int main(void)
} }
" HAVE_BUILTIN_ADD_OVERFLOW) " HAVE_BUILTIN_ADD_OVERFLOW)
option(ENABLE_COMPILER_SUGGESTIONS "Enable -Wsuggest compiler warnings" OFF)
if(MSVC) if(MSVC)
# XXX: /W4 gives too many warnings. #3241 # XXX: /W4 gives too many warnings. #3241
add_compile_options(/W3) add_compile_options(/W3)
add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE) add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE)
add_definitions(-DMSWIN) add_definitions(-DWIN32)
else() else()
add_compile_options(-Wall -Wextra -pedantic -Wno-unused-parameter add_compile_options(-Wall -Wextra -pedantic -Wno-unused-parameter
-Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion
-Wdouble-promotion
-Wmissing-noreturn
-Wmissing-format-attribute
-Wmissing-prototypes) -Wmissing-prototypes)
check_c_compiler_flag(-Wimplicit-fallthrough HAVE_WIMPLICIT_FALLTHROUGH_FLAG) check_c_compiler_flag(-Wimplicit-fallthrough HAVE_WIMPLICIT_FALLTHROUGH_FLAG)
@@ -288,29 +288,6 @@ else()
add_compile_options(-Wimplicit-fallthrough) add_compile_options(-Wimplicit-fallthrough)
endif() endif()
if(ENABLE_COMPILER_SUGGESTIONS)
# Clang doesn't have -Wsuggest-attribute so check for each one.
check_c_compiler_flag(-Wsuggest-attribute=pure HAVE_WSUGGEST_ATTRIBUTE_PURE)
if(HAVE_WSUGGEST_ATTRIBUTE_PURE)
add_compile_options(-Wsuggest-attribute=pure)
endif()
check_c_compiler_flag(-Wsuggest-attribute=const HAVE_WSUGGEST_ATTRIBUTE_CONST)
if(HAVE_WSUGGEST_ATTRIBUTE_CONST)
add_compile_options(-Wsuggest-attribute=const)
endif()
check_c_compiler_flag(-Wsuggest-attribute=malloc HAVE_WSUGGEST_ATTRIBUTE_MALLOC)
if(HAVE_WSUGGEST_ATTRIBUTE_MALLOC)
add_compile_options(-Wsuggest-attribute=malloc)
endif()
check_c_compiler_flag(-Wsuggest-attribute=cold HAVE_WSUGGEST_ATTRIBUTE_COLD)
if(HAVE_WSUGGEST_ATTRIBUTE_COLD)
add_compile_options(-Wsuggest-attribute=cold)
endif()
endif()
# On FreeBSD 64 math.h uses unguarded C11 extension, which taints clang # On FreeBSD 64 math.h uses unguarded C11 extension, which taints clang
# 3.4.1 used there. # 3.4.1 used there.
if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" AND CMAKE_C_COMPILER_ID MATCHES "Clang") if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" AND CMAKE_C_COMPILER_ID MATCHES "Clang")
@@ -321,7 +298,6 @@ endif()
if(MINGW) if(MINGW)
# Use POSIX compatible stdio in Mingw # Use POSIX compatible stdio in Mingw
add_definitions(-D__USE_MINGW_ANSI_STDIO) add_definitions(-D__USE_MINGW_ANSI_STDIO)
add_definitions(-DMSWIN)
endif() endif()
if(WIN32) if(WIN32)
# Windows Vista is the minimum supported version # Windows Vista is the minimum supported version
@@ -367,7 +343,7 @@ option(CI_BUILD "CI, extra flags will be set" OFF)
if(CI_BUILD) if(CI_BUILD)
message(STATUS "CI build enabled") message(STATUS "CI build enabled")
add_compile_options(-Werror) add_compile_options(-Werror)
if(DEFINED ENV{BUILD_UCHAR}) if(DEFINED ENV{BUILD_32BIT})
# Get some test coverage for unsigned char # Get some test coverage for unsigned char
add_compile_options(-funsigned-char) add_compile_options(-funsigned-char)
endif() endif()
@@ -402,7 +378,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT P
"${CMAKE_MODULE_LINKER_FLAGS} -image_base 100000000") "${CMAKE_MODULE_LINKER_FLAGS} -image_base 100000000")
endif() endif()
include_directories("${PROJECT_BINARY_DIR}/cmake.config") include_directories("${PROJECT_BINARY_DIR}/config")
include_directories("${PROJECT_SOURCE_DIR}/src") include_directories("${PROJECT_SOURCE_DIR}/src")
find_package(LibUV 1.28.0 REQUIRED) find_package(LibUV 1.28.0 REQUIRED)
@@ -411,7 +387,7 @@ include_directories(SYSTEM ${LIBUV_INCLUDE_DIRS})
find_package(Msgpack 1.0.0 REQUIRED) find_package(Msgpack 1.0.0 REQUIRED)
include_directories(SYSTEM ${MSGPACK_INCLUDE_DIRS}) include_directories(SYSTEM ${MSGPACK_INCLUDE_DIRS})
find_package(LibLUV 1.43.0 REQUIRED) find_package(LibLUV 1.30.0 REQUIRED)
include_directories(SYSTEM ${LIBLUV_INCLUDE_DIRS}) include_directories(SYSTEM ${LIBLUV_INCLUDE_DIRS})
find_package(TreeSitter REQUIRED) find_package(TreeSitter REQUIRED)
@@ -432,25 +408,12 @@ main(void)
if(TS_HAS_SET_MATCH_LIMIT) if(TS_HAS_SET_MATCH_LIMIT)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DNVIM_TS_HAS_SET_MATCH_LIMIT") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DNVIM_TS_HAS_SET_MATCH_LIMIT")
endif() endif()
check_c_source_compiles("
#include <stdlib.h>
#include <tree_sitter/api.h>
int
main(void)
{
ts_set_allocator(malloc, calloc, realloc, free);
return 0;
}
" TS_HAS_SET_ALLOCATOR)
if(TS_HAS_SET_ALLOCATOR)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DNVIM_TS_HAS_SET_ALLOCATOR")
endif()
# The unit test lib requires LuaJIT; it will be skipped if LuaJIT is missing. # Note: The test lib requires LuaJIT; it will be skipped if LuaJIT is missing.
option(PREFER_LUA "Prefer Lua over LuaJIT in the nvim executable." OFF) option(PREFER_LUA "Prefer Lua over LuaJIT in the nvim executable." OFF)
if(PREFER_LUA) if(PREFER_LUA)
find_package(Lua 5.1 EXACT REQUIRED) find_package(Lua 5.1 REQUIRED)
set(LUA_PREFERRED_INCLUDE_DIRS ${LUA_INCLUDE_DIR}) set(LUA_PREFERRED_INCLUDE_DIRS ${LUA_INCLUDE_DIR})
set(LUA_PREFERRED_LIBRARIES ${LUA_LIBRARIES}) set(LUA_PREFERRED_LIBRARIES ${LUA_LIBRARIES})
# Passive (not REQUIRED): if LUAJIT_FOUND is not set, nvim-test is skipped. # Passive (not REQUIRED): if LUAJIT_FOUND is not set, nvim-test is skipped.
@@ -490,7 +453,6 @@ if(FEAT_TUI)
int int
main(void) main(void)
{ {
unibi_str_from_var(unibi_var_from_str(\"\"));
return unibi_num_from_var(unibi_var_from_num(0)); return unibi_num_from_var(unibi_var_from_num(0));
} }
" UNIBI_HAS_VAR_FROM) " UNIBI_HAS_VAR_FROM)
@@ -500,13 +462,18 @@ if(FEAT_TUI)
add_definitions(-DNVIM_UNIBI_HAS_VAR_FROM) add_definitions(-DNVIM_UNIBI_HAS_VAR_FROM)
endif() endif()
find_package(LibTermkey 0.22 REQUIRED) find_package(LibTermkey 0.18 REQUIRED)
include_directories(SYSTEM ${LIBTERMKEY_INCLUDE_DIRS}) include_directories(SYSTEM ${LIBTERMKEY_INCLUDE_DIRS})
endif() endif()
find_package(LIBVTERM 0.3 REQUIRED) find_package(LIBVTERM 0.1 REQUIRED)
include_directories(SYSTEM ${LIBVTERM_INCLUDE_DIRS}) include_directories(SYSTEM ${LIBVTERM_INCLUDE_DIRS})
if(WIN32)
find_package(Winpty 0.4.3 REQUIRED)
include_directories(SYSTEM ${WINPTY_INCLUDE_DIRS})
endif()
option(CLANG_ASAN_UBSAN "Enable Clang address & undefined behavior sanitizer for nvim binary." OFF) option(CLANG_ASAN_UBSAN "Enable Clang address & undefined behavior sanitizer for nvim binary." OFF)
option(CLANG_MSAN "Enable Clang memory sanitizer for nvim binary." OFF) option(CLANG_MSAN "Enable Clang memory sanitizer for nvim binary." OFF)
option(CLANG_TSAN "Enable Clang thread sanitizer for nvim binary." OFF) option(CLANG_TSAN "Enable Clang thread sanitizer for nvim binary." OFF)
@@ -576,29 +543,6 @@ endif()
message(STATUS "Using Lua interpreter: ${LUA_PRG}") message(STATUS "Using Lua interpreter: ${LUA_PRG}")
option(COMPILE_LUA "Pre-compile Lua sources into bytecode (for sources that are included in the binary)" ON)
if(COMPILE_LUA AND NOT WIN32)
if(PREFER_LUA)
foreach(CURRENT_LUAC_PRG luac5.1 luac)
find_program(_CHECK_LUAC_PRG ${CURRENT_LUAC_PRG})
if(_CHECK_LUAC_PRG)
set(LUAC_PRG "${_CHECK_LUAC_PRG} -s -o - %s" CACHE STRING "Format for compiling to Lua bytecode")
break()
endif()
endforeach()
elseif(LUA_PRG MATCHES "luajit")
check_lua_module(${LUA_PRG} "jit.bcsave" LUAJIT_HAS_JIT_BCSAVE)
if(LUAJIT_HAS_JIT_BCSAVE)
set(LUAC_PRG "${LUA_PRG} -b -s %s -" CACHE STRING "Format for compiling to Lua bytecode")
endif()
endif()
endif()
if(LUAC_PRG)
message(STATUS "Using Lua compiler: ${LUAC_PRG}")
endif()
# Setup busted. # Setup busted.
find_program(BUSTED_PRG NAMES busted busted.bat) find_program(BUSTED_PRG NAMES busted busted.bat)
find_program(BUSTED_LUA_PRG busted-lua) find_program(BUSTED_LUA_PRG busted-lua)
@@ -606,78 +550,17 @@ if(NOT BUSTED_OUTPUT_TYPE)
set(BUSTED_OUTPUT_TYPE "nvim") set(BUSTED_OUTPUT_TYPE "nvim")
endif() endif()
#
# Lint
#
find_program(LUACHECK_PRG luacheck) find_program(LUACHECK_PRG luacheck)
find_program(STYLUA_PRG stylua)
find_program(FLAKE8_PRG flake8) find_program(FLAKE8_PRG flake8)
find_program(UNCRUSTIFY_PRG uncrustify) find_program(GPERF_PRG gperf)
find_program(SHELLCHECK_PRG shellcheck)
add_glob_targets(
REQUIRED
TARGET lintlua-luacheck
COMMAND ${LUACHECK_PRG}
FLAGS -q
GLOB_DIRS runtime/ scripts/ src/ test/
GLOB_PAT *.lua
TOUCH_STRATEGY SINGLE
)
add_glob_targets(
TARGET lintlua-stylua
COMMAND ${STYLUA_PRG}
FLAGS --color=always --check
GLOB_DIRS runtime/
GLOB_PAT *.lua
TOUCH_STRATEGY SINGLE
)
add_custom_target(lintlua)
add_dependencies(lintlua lintlua-luacheck lintlua-stylua)
include(InstallHelpers) include(InstallHelpers)
add_glob_targets(
TARGET lintpy
COMMAND ${FLAKE8_PRG}
FLAGS --max-line-length 100
GLOB_DIRS contrib scripts src test
GLOB_PAT *.py
TOUCH_STRATEGY SINGLE
)
add_glob_targets(
TARGET lintsh
COMMAND ${SHELLCHECK_PRG}
FILES scripts/vim-patch.sh
TOUCH_STRATEGY SINGLE
)
add_custom_target(lintcommit
COMMAND ${PROJECT_BINARY_DIR}/bin/nvim -u NONE -es -c [[lua require('scripts.lintcommit').main({trace=false})]]
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
VERBATIM)
add_dependencies(lintcommit nvim)
add_custom_target(lint)
add_dependencies(lint check-single-includes lintc lintlua lintpy lintsh lintcommit lintuncrustify)
#
# Format
#
add_custom_target(formatlua
COMMAND ${CMAKE_COMMAND}
-D FORMAT_PRG=${STYLUA_PRG}
-D LANG=lua
-P ${PROJECT_SOURCE_DIR}/cmake/Format.cmake
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
add_custom_target(format)
add_dependencies(format formatc formatlua)
file(GLOB MANPAGES
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
man/nvim.1)
install_helper( install_helper(
FILES ${CMAKE_SOURCE_DIR}/src/man/nvim.1 FILES ${MANPAGES}
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
# #
@@ -687,7 +570,7 @@ install_helper(
add_subdirectory(src/nvim) add_subdirectory(src/nvim)
get_directory_property(NVIM_VERSION_CFLAGS DIRECTORY src/nvim DEFINITION NVIM_VERSION_CFLAGS) get_directory_property(NVIM_VERSION_CFLAGS DIRECTORY src/nvim DEFINITION NVIM_VERSION_CFLAGS)
add_subdirectory(test/includes) add_subdirectory(test/includes)
add_subdirectory(cmake.config) add_subdirectory(config)
add_subdirectory(test/functional/fixtures) # compile test programs add_subdirectory(test/functional/fixtures) # compile test programs
add_subdirectory(runtime) add_subdirectory(runtime)
get_directory_property(GENERATED_HELP_TAGS DIRECTORY runtime DEFINITION GENERATED_HELP_TAGS) get_directory_property(GENERATED_HELP_TAGS DIRECTORY runtime DEFINITION GENERATED_HELP_TAGS)
@@ -707,12 +590,25 @@ if(BUSTED_PRG)
# console pool: to do so we need to use the USES_TERMINAL # console pool: to do so we need to use the USES_TERMINAL
# option, but this is only available in CMake 3.2 # option, but this is only available in CMake 3.2
set(TEST_TARGET_ARGS) set(TEST_TARGET_ARGS)
list(APPEND TEST_TARGET_ARGS "USES_TERMINAL") if(NOT (${CMAKE_VERSION} VERSION_LESS 3.2.0))
list(APPEND TEST_TARGET_ARGS "USES_TERMINAL")
endif()
set(UNITTEST_PREREQS nvim-test unittest-headers) set(UNITTEST_PREREQS nvim-test unittest-headers)
set(FUNCTIONALTEST_PREREQS nvim printenv-test printargs-test shell-test pwsh-test streams-test tty-test ${GENERATED_HELP_TAGS}) set(FUNCTIONALTEST_PREREQS nvim printenv-test printargs-test shell-test streams-test tty-test ${GENERATED_HELP_TAGS})
set(BENCHMARK_PREREQS nvim tty-test) set(BENCHMARK_PREREQS nvim tty-test)
# Useful for automated build systems, if they want to manually run the tests.
add_custom_target(unittest-prereqs
DEPENDS ${UNITTEST_PREREQS})
set_target_properties(unittest-prereqs PROPERTIES FOLDER test)
add_custom_target(functionaltest-prereqs
DEPENDS ${FUNCTIONALTEST_PREREQS})
add_custom_target(benchmark-prereqs
DEPENDS ${BENCHMARK_PREREQS})
check_lua_module(${LUA_PRG} "ffi" LUA_HAS_FFI) check_lua_module(${LUA_PRG} "ffi" LUA_HAS_FFI)
if(LUA_HAS_FFI) if(LUA_HAS_FFI)
add_custom_target(unittest add_custom_target(unittest
@@ -738,11 +634,11 @@ if(BUSTED_PRG)
set(TEST_LIBNVIM_PATH "") set(TEST_LIBNVIM_PATH "")
endif() endif()
configure_file( configure_file(
${CMAKE_SOURCE_DIR}/test/cmakeconfig/paths.lua.in ${CMAKE_SOURCE_DIR}/test/config/paths.lua.in
${CMAKE_BINARY_DIR}/test/cmakeconfig/paths.lua.gen) ${CMAKE_BINARY_DIR}/test/config/paths.lua.gen)
file(GENERATE file(GENERATE
OUTPUT ${CMAKE_BINARY_DIR}/test/cmakeconfig/paths.lua OUTPUT ${CMAKE_BINARY_DIR}/test/config/paths.lua
INPUT ${CMAKE_BINARY_DIR}/test/cmakeconfig/paths.lua.gen) INPUT ${CMAKE_BINARY_DIR}/test/config/paths.lua.gen)
add_custom_target(functionaltest add_custom_target(functionaltest
COMMAND ${CMAKE_COMMAND} COMMAND ${CMAKE_COMMAND}
@@ -757,7 +653,8 @@ if(BUSTED_PRG)
-P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake -P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake
DEPENDS ${FUNCTIONALTEST_PREREQS} DEPENDS ${FUNCTIONALTEST_PREREQS}
${TEST_TARGET_ARGS}) ${TEST_TARGET_ARGS})
set_target_properties(functionaltest PROPERTIES FOLDER test) set_target_properties(functionaltest functionaltest-prereqs
PROPERTIES FOLDER test)
add_custom_target(benchmark add_custom_target(benchmark
COMMAND ${CMAKE_COMMAND} COMMAND ${CMAKE_COMMAND}
@@ -772,7 +669,7 @@ if(BUSTED_PRG)
-P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake -P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake
DEPENDS ${BENCHMARK_PREREQS} DEPENDS ${BENCHMARK_PREREQS}
${TEST_TARGET_ARGS}) ${TEST_TARGET_ARGS})
set_target_properties(benchmark PROPERTIES FOLDER test) set_target_properties(benchmark benchmark-prereqs PROPERTIES FOLDER test)
endif() endif()
if(BUSTED_LUA_PRG) if(BUSTED_LUA_PRG)
@@ -792,9 +689,34 @@ if(BUSTED_LUA_PRG)
set_target_properties(functionaltest-lua PROPERTIES FOLDER test) set_target_properties(functionaltest-lua PROPERTIES FOLDER test)
endif() endif()
add_custom_target(uninstall if(LUACHECK_PRG)
COMMAND ${CMAKE_COMMAND} -P ${PROJECT_SOURCE_DIR}/cmake/UninstallHelper.cmake) add_custom_target(lualint
COMMAND ${LUACHECK_PRG} -q runtime/ src/ test/ --exclude-files test/functional/fixtures/lua/syntax_error.lua
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}) WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
add_subdirectory(cmake.packaging) else()
add_custom_target(lualint false
COMMENT "lualint: LUACHECK_PRG not defined")
endif()
set(CPACK_PACKAGE_NAME "Neovim")
set(CPACK_PACKAGE_VENDOR "neovim.io")
set(CPACK_PACKAGE_VERSION ${NVIM_VERSION_MEDIUM})
set(CPACK_PACKAGE_INSTALL_DIRECTORY "Neovim")
# Set toplevel directory/installer name as Neovim
set(CPACK_PACKAGE_FILE_NAME "Neovim")
set(CPACK_TOPLEVEL_TAG "Neovim")
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE")
set(CPACK_NSIS_MODIFY_PATH ON)
set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON)
include(CPack)
#add uninstall target
if(NOT TARGET uninstall)
configure_file(
"cmake/UninstallHelper.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/UninstallHelper.cmake"
IMMEDIATE @ONLY)
add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/UninstallHelper.cmake)
endif() endif()

View File

@@ -1,95 +0,0 @@
{
"version": 3,
"configurePresets": [
{
"name": "base",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build",
"hidden": true
},
{
"name": "default",
"displayName": "RelWithDebInfo",
"description": "Enables optimizations (-Og or -O2) with debug information",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
},
"inherits": [
"base"
]
},
{
"name": "debug",
"displayName": "Debug",
"description": "Disables optimizations (-O0), enables debug information",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
},
"inherits": [
"base"
]
},
{
"name": "release",
"displayName": "Release",
"description": "Same as RelWithDebInfo, but disables debug information",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
},
"inherits": [
"base"
]
},
{
"name": "windows-default",
"displayName": "Windows x64 RelWithDebInfo",
"description": "Sets Ninja generator, enables optimizations with debug information for x64",
"generator": "Ninja",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
},
"architecture": {
"value": "x64",
"strategy": "external"
},
"vendor": {
"microsoft.com/VisualStudioSettings/CMake/1.0": {
"hostOS": [
"Windows"
]
}
},
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
},
"inherits": [
"base"
]
}
],
"buildPresets": [
{
"name": "default",
"configurePreset": "default"
},
{
"name": "debug",
"configurePreset": "debug"
},
{
"name": "release",
"configurePreset": "release"
},
{
"name": "windows-default",
"configurePreset": "windows-default",
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
}
}
]
}

View File

@@ -7,14 +7,10 @@ Getting started
If you want to help but don't know where to start, here are some If you want to help but don't know where to start, here are some
low-risk/isolated tasks: low-risk/isolated tasks:
- Try a [complexity:low] issue. - [Merge a Vim patch].
- 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 - Fix bugs found by [Clang](#clang-scan-build), [PVS](#pvs-studio) or
[Coverity](#coverity). [Coverity](#coverity).
- [Improve documentation](#documenting)
- [Merge a Vim patch] (requires strong familiarity with Vim)
- NOTE: read the above link before sending improvements to "runtime files" (anything in `runtime/`).
- Vimscript and documentation files are (mostly) maintained by [Vim](https://github.com/vim/vim), not Nvim.
- Lua files are maintained by Nvim.
Reporting problems Reporting problems
------------------ ------------------
@@ -22,67 +18,65 @@ Reporting problems
- [Check the FAQ][wiki-faq]. - [Check the FAQ][wiki-faq].
- [Search existing issues][github-issues] (including closed!) - [Search existing issues][github-issues] (including closed!)
- Update Neovim to the latest version to see if your problem persists. - Update Neovim to the latest version to see if your problem persists.
- Try to reproduce with `nvim --clean` ("factory defaults"). - Disable plugins incrementally, to narrow down the cause of the issue.
- [Bisect](https://neovim.io/doc/user/starting.html#bisect) your config: disable plugins incrementally, to narrow down the cause of the issue.
- [Bisect][git-bisect] Neovim's source code to find the cause of a regression, if you can. This is _extremely_ helpful.
- When reporting a crash, [include a stacktrace](https://github.com/neovim/neovim/wiki/FAQ#backtrace-linux). - 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. - Use [ASAN/UBSAN](#clang-sanitizers-asan-and-ubsan) to get detailed errors for segfaults and undefined behavior.
- Check the logs. `:edit $NVIM_LOG_FILE` - [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. - Include `cmake --system-information` for build-related issues.
Developer guidelines Developer guidelines
-------------------- --------------------
- Read [:help dev](https://neovim.io/doc/user/develop.html#dev) if you are working on Nvim core. - Read `:help dev` if you are working on Nvim core.
- Read [:help dev-ui](https://neovim.io/doc/user/develop.html#dev-ui) if you are developing a UI. - Read `:help dev-ui` if you are developing a UI.
- Read [:help dev-api-client](https://neovim.io/doc/user/develop.html#dev-api-client) if you are developing an API client. - Read `:help dev-api-client` if you are developing an API client.
- Install `ninja` for faster builds of Nvim. - Install `ninja` for faster builds of Nvim.
``` ```
sudo apt-get install ninja-build sudo apt-get install ninja-build
make distclean make distclean
make # Nvim build system uses ninja automatically, if available. make # Nvim build system uses ninja automatically, if available.
``` ```
- [Improve documentation][wiki-contribute-help]
Pull requests (PRs) Pull requests (PRs)
--------------------- ---------------------
- To avoid duplicate work, create a draft pull request. - To avoid duplicate work, create a `[WIP]` pull request as soon as possible.
- Your PR must include [test coverage][run-tests]. - Your PR must include **test coverage.** See [test/README.md][run-tests].
- Avoid cosmetic changes to unrelated files in the same commit. - Avoid cosmetic changes to unrelated files in the same commit.
- Use a [feature branch][git-feature-branch] instead of the master branch. - Use a [feature branch][git-feature-branch] instead of the master branch.
- Use a _rebase workflow_ for small PRs. - Use a **rebase workflow** for small PRs.
- After addressing review comments, it's fine to force-push. - After addressing review comments, it's fine to rebase and force-push.
- Use a _merge workflow_ (as opposed to "rebase") for big, high-risk PRs. - Use a **merge workflow** for big, high-risk PRs.
- Merge `master` into your PR when there are conflicts or when master - Merge `master` into your PR when there are conflicts or when master
introduces breaking changes. introduces breaking changes.
- Use the `ri` git alias:
```
[alias]
ri = "!sh -c 't=\"${1:-master}\"; s=\"${2:-HEAD}\"; mb=\"$(git merge-base \"$t\" \"$s\")\"; if test \"x$mb\" = x ; then o=\"$t\"; else lm=\"$(git log -n1 --merges \"$t..$s\" --pretty=%H)\"; if test \"x$lm\" = x ; then o=\"$mb\"; else o=\"$lm\"; fi; fi; test $# -gt 0 && shift; test $# -gt 0 && shift; git rebase --interactive \"$o\" \"$@\"'"
```
This avoids unnecessary rebases yet still allows you to combine related
commits, separate monolithic commits, etc.
- Do not edit commits that come before the merge commit. - Do not edit commits that come before the merge commit.
- During a squash/fixup, use `exec make -C build unittest` between each
pick/edit/reword.
### Merging to master ### Stages: WIP, RFC, RDY
For maintainers: when a PR is ready to merge to master, Pull requests have three stages: `[WIP]` (Work In Progress), `[RFC]` (Request
For Comment) and `[RDY]` (Ready).
- prefer _Squash Merge_ for "single-commit PRs" (when the PR has only one meaningful commit). 1. `[RFC]` is assumed by default, **do not** put "RFC" in the PR title (it adds
- prefer _Merge_ for "multi-commit PRs" (when the PR has multiple meaningful commits). noise to merge commit messages).
2. Add `[WIP]` to the PR title if you are _not_ requesting feedback and the work
### Stages: Draft and Ready for review is still in flux.
3. Add `[RDY]` to the PR title if you are _done_ and only waiting on merge.
Pull requests have two stages: Draft and Ready for review.
1. [Create a Draft PR][pr-draft] while you are _not_ requesting feedback as
you are still working on the PR.
- You can skip this if your PR is ready for review.
2. [Change your PR to ready][pr-ready] when the PR is ready for review.
- You can convert back to Draft at any time.
Do __not__ add labels like `[RFC]` or `[WIP]` in the title to indicate the
state of your PR: this just adds noise. Non-Draft PRs are assumed to be open
for comments; if you want feedback from specific people, `@`-mention them in
a comment.
### Commit messages ### Commit messages
Follow the [conventional commits guidelines][conventional_commits] to *make reviews easier* and to make Follow the [convential commits guidelines][conventional_commits] to *make reviews easier* and to make
the VCS/git logs more valuable. The general structure of a commit message is: the VCS/git logs more valuable. The general structure of a commit message is as follows:
``` ```
<type>([optional scope]): <description> <type>([optional scope]): <description>
@@ -92,27 +86,21 @@ the VCS/git logs more valuable. The general structure of a commit message is:
[optional footer(s)] [optional footer(s)]
``` ```
- Prefix the commit subject with one of these [_types_](https://github.com/commitizen/conventional-commit-types/blob/master/index.json): - **Prefix the commit subject with a _type_:** `doc:`, `test:`
- `build`, `ci`, `docs`, `feat`, `fix`, `perf`, `refactor`, `revert`, `test`, `vim-patch`, `dist` `runtime:`, ...
- You can **ignore this for "fixup" commits** or any commits you expect to be squashed. - Subject line for commits with only style/lint changes can be a single
- Append optional scope to _type_ such as `(lsp)`, `(treesitter)`, `(float)`, … word: `style` or `lint`.
- _Description_ shouldn't start with a capital letter or end in a period. - **Add the optional scope following <type> if possible:** `(lsp)`, `(treesitter)`, `(multigrid)`, ...
- Use the _imperative voice_: "Fix bug" rather than "Fixed bug" or "Fixes bug."
- Try to keep the first line under 72 characters. - Try to keep the first line under 72 characters.
- A blank line must follow the subject. - A blank line must separate the subject from the description.
- Breaking API changes must be indicated by - Breaking changes must be indicated at the very beginning of the footer or body section of a commit. A breaking change must consist of the uppercase text BREAKING CHANGE, followed by a colon, a space, and a description of what has changed about the API.
1. "!" after the type/scope, and - Check your commit message for spelling and grammatical mistakes.
2. a "BREAKING CHANGE" footer describing the change. - Use the _imperative voice_: "Fix bug" rather than "Fixed bug" or "Fixes bug."
Example:
```
refactor(provider)!: drop support for Python 2
BREAKING CHANGE: refactor to use Python 3 features since Python 2 is no longer supported.
```
### Automated builds (CI) ### Automated builds (CI)
Each pull request must pass the automated builds on [Cirrus CI] and [GitHub Actions]. 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 - CI builds are compiled with [`-Werror`][gcc-warnings], so compiler warnings
will fail the build. will fail the build.
@@ -126,7 +114,20 @@ Each pull request must pass the automated builds on [Cirrus CI] and [GitHub Acti
- The [lint](#lint) build checks modified lines _and their immediate - The [lint](#lint) build checks modified lines _and their immediate
neighbors_, to encourage incrementally updating the legacy style to meet our neighbors_, to encourage incrementally updating the legacy style to meet our
[style](#style). (See [#3174][3174] for background.) [style](#style). (See [#3174][3174] for background.)
- CI for FreeBSD runs on [Cirrus CI]. - 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="-DCI_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 ### Clang scan-build
@@ -150,7 +151,7 @@ see potential bugs found by [PVS Studio](https://www.viva64.com/en/pvs-studio/).
- Use this format for commit messages (where `{id}` is the PVS warning-id)): - Use this format for commit messages (where `{id}` is the PVS warning-id)):
``` ```
fix(PVS/V{id}): {description} PVS/V{id}: {description}
``` ```
- Search the Neovim commit history to find examples: - Search the Neovim commit history to find examples:
``` ```
@@ -166,27 +167,26 @@ master build. To view the defects, just request access; you will be approved.
- Use this format for commit messages (where `{id}` is the CID (Coverity ID); - Use this format for commit messages (where `{id}` is the CID (Coverity ID);
([example](https://github.com/neovim/neovim/pull/804))): ([example](https://github.com/neovim/neovim/pull/804))):
``` ```
fix(coverity/{id}): {description} coverity/{id}: {description}
``` ```
- Search the Neovim commit history to find examples: - Search the Neovim commit history to find examples:
``` ```
git log --oneline --no-merges --grep coverity git log --oneline --no-merges --grep coverity
``` ```
### Clang sanitizers (ASAN and UBSAN) ### 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. 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
- To build Neovim with sanitizers enabled, use
``` ```
rm -rf build && CMAKE_EXTRA_FLAGS="-DCMAKE_C_COMPILER=clang -DCLANG_ASAN_UBSAN=1" make rm -rf build && CMAKE_EXTRA_FLAGS="-DCMAKE_C_COMPILER=clang -DCLANG_ASAN_UBSAN=1" make
``` ```
- When running Neovim, use When running neovim, use
``` ```
UBSAN_OPTIONS=print_stacktrace=1 ASAN_OPTIONS=log_path=/tmp/nvim_asan nvim args... 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. If neovim exits unexpectedly, check `/tmp/nvim_asan.{PID}` (or your preferred `log_path`) for log files with error messages.
Coding Coding
------ ------
@@ -206,88 +206,21 @@ You can lint a single file (but this will _not_ exclude legacy errors):
### Style ### Style
- You can format files by using: The repo includes a `.clang-format` config file which (mostly) matches the
``` [style-guide]. You can use `clang-format` to format code with the `gq`
make format operator in Nvim:
```
This will format changed Lua and C files with all appropriate flags set. if !empty(findfile('.clang-format', ';'))
- Style rules are (mostly) defined by `src/uncrustify.cfg` which tries to match setlocal formatprg=clang-format\ -style=file
the [style-guide]. To use the Nvim `gq` command with `uncrustify`: endif
```
if !empty(findfile('src/uncrustify.cfg', ';'))
setlocal formatprg=uncrustify\ -q\ -l\ C\ -c\ src/uncrustify.cfg\ --no-backup
endif
```
The required version of `uncrustify` is specified in `uncrustify.cfg`.
- There is also `.clang-format` which has drifted from the [style-guide], but
is available for reference. To use the Nvim `gq` command with `clang-format`:
```
if !empty(findfile('.clang-format', ';'))
setlocal formatprg=clang-format\ -style=file
endif
```
### Navigate ### Navigate
- Set `blame.ignoreRevsFile` to ignore [noise commits](https://github.com/neovim/neovim/commit/2d240024acbd68c2d3f82bc72cb12b1a4928c6bf) in git blame: - Use **[universal-ctags](https://github.com/universal-ctags/ctags).**
``` ("Exuberant ctags", the typical `ctags` binary provided by your distro, is
git config blame.ignoreRevsFile .git-blame-ignore-revs unmaintained and won't recognize many function signatures in Neovim source.)
```
- Recommendation is to use **[clangd]**.
Can use the maintained config in [nvim-lspconfig/clangd].
- Explore the source code [on the web](https://sourcegraph.com/github.com/neovim/neovim). - Explore the source code [on the web](https://sourcegraph.com/github.com/neovim/neovim).
- If using [lua-language-server], symlink `contrib/luarc.json` into the
project root:
$ ln -s contrib/luarc.json .luarc.json
### Includes
For managing includes in C files, use [include-what-you-use].
- [Install include-what-you-use][include-what-you-use-install]
- Run with:
```
make CMAKE_EXTRA_FLAGS=-DCMAKE_C_INCLUDE_WHAT_YOU_USE=include-what-you-use | tee iwyu.txt
```
See [#549][549] for more details.
Documenting
-----------
Many parts of the `:help` documentation are autogenerated from C or Lua docstrings using the `./scripts/gen_vimdoc.py` script.
You can filter the regeneration based on the target (api, lua, or lsp), or the file you changed, that need a doc refresh using `./scripts/gen_vimdoc.py -t <target>`.
## Lua docstrings
Lua documentation uses a subset of [EmmyLua] annotations. A rough outline of a function documentation is
```lua
--- {Brief}
---
--- {Long explanation}
---
---@param arg1 type {description}
---@param arg2 type {description}
{...}
---
---@return type {description}
```
If possible, always add type information (`table`, `string`, `number`, ...). Multiple valid types are separated by a bar (`string|table`). Indicate optional parameters via `type|nil`.
If a function in your Lua module should not be documented (e.g. internal function or local function), you should set the doc comment to:
```
---@private
```
Mark functions that are deprecated as
```
---@deprecated
```
Reviewing Reviewing
--------- ---------
@@ -295,46 +228,37 @@ Reviewing
To help review pull requests, start with [this checklist][review-checklist]. To help review pull requests, start with [this checklist][review-checklist].
Reviewing can be done on GitHub, but you may find it easier to do locally. Reviewing can be done on GitHub, but you may find it easier to do locally.
Using [GitHub CLI][gh], you can create a new branch with the contents of a pull Using [`hub`][hub], you can create a new branch with the contents of a pull
request, e.g. [#1820][1820]: request, e.g. [#1820][1820]:
gh pr checkout https://github.com/neovim/neovim/pull/1820 hub checkout https://github.com/neovim/neovim/pull/1820
Use [`git log -p master..FETCH_HEAD`][git-history-filtering] to list all Use [`git log -p master..FETCH_HEAD`][git-history-filtering] to list all
commits in the feature branch which aren't in the `master` branch; `-p` commits in the feature branch which aren't in the `master` branch; `-p`
shows each commit's diff. To show the whole surrounding function of a change shows each commit's diff. To show the whole surrounding function of a change
as context, use the `-W` argument as well. as context, use the `-W` argument as well.
[549]: https://github.com/neovim/neovim/issues/549
[1820]: https://github.com/neovim/neovim/pull/1820
[3174]: https://github.com/neovim/neovim/issues/3174
[ASan]: http://clang.llvm.org/docs/AddressSanitizer.html
[Cirrus CI]: https://cirrus-ci.com/github/neovim/neovim
[Clang report]: https://neovim.io/doc/reports/clang/
[GitHub Actions]: https://github.com/neovim/neovim/actions
[clangd]: https://clangd.llvm.org
[Merge a Vim patch]: https://github.com/neovim/neovim/wiki/Merging-patches-from-upstream-Vim
[complexity:low]: https://github.com/neovim/neovim/issues?q=is%3Aopen+is%3Aissue+label%3Acomplexity%3Alow
[conventional_commits]: https://www.conventionalcommits.org
[EmmyLua]: https://github.com/sumneko/lua-language-server/wiki/Annotations
[gcc-warnings]: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html [gcc-warnings]: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
[gh]: https://cli.github.com/
[git-bisect]: http://git-scm.com/book/en/v2/Git-Tools-Debugging-with-Git [git-bisect]: http://git-scm.com/book/en/v2/Git-Tools-Debugging-with-Git
[git-feature-branch]: https://www.atlassian.com/git/tutorials/comparing-workflows [git-feature-branch]: https://www.atlassian.com/git/tutorials/comparing-workflows
[git-history-filtering]: https://www.atlassian.com/git/tutorials/git-log/filtering-the-commit-history [git-history-filtering]: https://www.atlassian.com/git/tutorials/git-log/filtering-the-commit-history
[git-history-rewriting]: http://git-scm.com/book/en/v2/Git-Tools-Rewriting-History [git-history-rewriting]: http://git-scm.com/book/en/v2/Git-Tools-Rewriting-History
[git-rebasing]: http://git-scm.com/book/en/v2/Git-Branching-Rebasing [git-rebasing]: http://git-scm.com/book/en/v2/Git-Branching-Rebasing
[github-issues]: https://github.com/neovim/neovim/issues [github-issues]: https://github.com/neovim/neovim/issues
[include-what-you-use-install]: https://github.com/include-what-you-use/include-what-you-use#how-to-install [1820]: https://github.com/neovim/neovim/pull/1820
[include-what-you-use]: https://github.com/include-what-you-use/include-what-you-use#using-with-cmake [hub]: https://hub.github.com/
[lua-language-server]: https://github.com/sumneko/lua-language-server/ [conventional_commits]: https://www.conventionalcommits.org
[master error list]: https://raw.githubusercontent.com/neovim/doc/gh-pages/reports/clint/errors.json [style-guide]: http://neovim.io/develop/style-guide.xml
[nvim-lspconfig/clangd]: https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#clangd [ASan]: http://clang.llvm.org/docs/AddressSanitizer.html
[pr-draft]: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request
[pr-ready]: https://docs.github.com/en/github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-stage-of-a-pull-request
[review-checklist]: https://github.com/neovim/neovim/wiki/Code-review-checklist
[run-tests]: https://github.com/neovim/neovim/blob/master/test/README.md#running-tests [run-tests]: https://github.com/neovim/neovim/blob/master/test/README.md#running-tests
[style-guide]: https://neovim.io/doc/user/dev_style.html#dev-style
[uncrustify]: http://uncrustify.sourceforge.net/
[wiki-contribute-help]: https://github.com/neovim/neovim/wiki/contribute-%3Ahelp
[wiki-faq]: https://github.com/neovim/neovim/wiki/FAQ [wiki-faq]: https://github.com/neovim/neovim/wiki/FAQ
[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
[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/
[complexity:low]: https://github.com/neovim/neovim/issues?q=is%3Aopen+is%3Aissue+label%3Acomplexity%3Alow
[master error list]: https://raw.githubusercontent.com/neovim/doc/gh-pages/reports/clint/errors.json
[wiki-contribute-help]: https://github.com/neovim/neovim/wiki/contribute-%3Ahelp

View File

@@ -8,7 +8,7 @@ Neovim's license follows:
==== ====
Apache License Apache License
Version 2.0, January 2004 Version 2.0, January 2004
https://www.apache.org/licenses/ http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
@@ -189,18 +189,8 @@ contributed under the Vim license and (2) externally maintained libraries.
The externally maintained libraries used by Neovim are: The externally maintained libraries used by Neovim are:
- Klib: a Generic Library in C. MIT/X11 license. - Klib: a Generic Library in C. MIT/X11 license.
- Lua: MIT license
- LuaJIT: a Just-In-Time Compiler for Lua. Copyright Mike Pall. MIT license.
- Luv: Apache 2.0 license
- libmpack: MIT license
- libtermkey: MIT license
- libuv. Copyright Joyent, Inc. and other Node contributors. Node.js license. - libuv. Copyright Joyent, Inc. and other Node contributors. Node.js license.
- libvterm: MIT license - LuaJIT: a Just-In-Time Compiler for Lua. Copyright Mike Pall. MIT license.
- lua-cjson: MIT license
- lua-compat: MIT license
- tree-sitter: MIT license
- unibilium: LGPL v3
- xdiff: LGPL v2
==== ====

View File

@@ -10,30 +10,31 @@ General guidelines
* Write down what was decided * Write down what was decided
* Constraints are good * Constraints are good
* Use automation to solve problems * Use automation to solve problems
* Never break the API... but sometimes break the UI * Never break the API
Issue triage Ticket triage
------------ -------------
In practice we haven't found a way to forecast more precisely than "next" and In practice we haven't found a meaningful way to forecast more precisely than
"after next". So there are usually one or two (at most) planned milestones: "next" and "after next". That means there are usually one or two (at most)
planned milestones:
* Next bugfix-release (1.0.x) - Next bugfix-release (1.0.x)
* Next feature-release (1.x.0) - Next feature-release (1.x.0)
The forecasting problem might be solved with an explicit priority system (like The forecasting problem might be solved with an explicit priority system (like
Bram's todo.txt). Meanwhile the Neovim priority system is defined by: Bram's todo.txt). Meanwhile the Neovim priority system is defined by:
* PRs nearing completion. - PRs nearing completion (RDY).
* Issue labels. E.g. the `+plan` label increases the ticket's priority merely - Issue labels. E.g. the `+plan` label increases the ticket's priority merely
for having a plan written down: it is _closer to completion_ than tickets for having a plan written down: it is _closer to completion_ than tickets
without a plan. without a plan.
* Comment activity or new information. - Comment activity or new information.
Anything that isn't in the next milestone, and doesn't have a finished PR—is Anything that isn't in the next milestone, and doesn't have a RDY PR ... is
just not something you care very much about, by construction. Post-release you just not something you care very much about, by construction. Post-release you
can review open issues, but chances are your next milestone is already getting can review open issues, but chances are your next milestone is already getting
full... :) full :)
Release policy Release policy
-------------- --------------
@@ -50,56 +51,13 @@ has a major bug:
1. Fix the bug on `master`. 1. Fix the bug on `master`.
2. Cherry-pick the fix to `release-x.y`. 2. Cherry-pick the fix to `release-x.y`.
3. Cut a release from `release-x.y`. 3. Cut a release from `release-x.y`.
* Run `./scripts/release.sh` - Run `./scripts/release.sh`
* Update (force-push) the remote `stable` tag. - Update (force-push) the remote `stable` tag.
* The [CI job](https://github.com/neovim/neovim/blob/3d45706478cd030c3ee05b4f336164bb96138095/.github/workflows/release.yml#L11-L13) - The [nightly job](https://github.com/neovim/bot-ci/blob/master/ci/nightly.sh)
will update the release assets and force-push to the `stable` tag. will update the release assets based on the `stable` tag.
### Release automation
Neovim automation includes a [backport bot](https://github.com/zeebe-io/backport-action).
Trigger the action by labeling a PR with `backport release-X.Y`. See `.github/workflows/backport.yml`.
Third-party dependencies
------------------------
These "bundled" dependencies can be updated by bumping their versions in `cmake.deps/CMakeLists.txt`.
Some can be auto-bumped by `scripts/bump-deps.sh`.
* [LuaJIT](https://github.com/LuaJIT/LuaJIT)
* [Lua](https://www.lua.org/download.html)
* [Luv](https://github.com/luvit/luv)
* [gettext](https://ftp.gnu.org/pub/gnu/gettext/)
* [libiconv](https://ftp.gnu.org/pub/gnu/libiconv)
* [libtermkey](https://github.com/neovim/libtermkey)
* [libuv](https://github.com/libuv/libuv)
* [libvterm](http://www.leonerd.org.uk/code/libvterm/)
* [lua-compat](https://github.com/keplerproject/lua-compat-5.3)
* [msys2](https://github.com/msys2/MINGW-packages) (for mingw Windows build)
* Changes to mingw can [break our mingw build](https://github.com/msys2/MINGW-packages/issues/9946).
* [tree-sitter](https://github.com/tree-sitter/tree-sitter)
* [unibilium](https://github.com/neovim/unibilium)
### Vendored dependencies
These dependencies are "vendored" (inlined), we must update the sources manually:
* `src/mpack/`: [libmpack](https://github.com/libmpack/libmpack)
* send improvements upstream!
* `src/xdiff/`: [xdiff](https://github.com/git/git/tree/master/xdiff)
* `src/cjson/`: [lua-cjson](https://github.com/openresty/lua-cjson)
* `src/nvim/lib/`: [Klib](https://github.com/attractivechaos/klib)
* `runtime/lua/vim/inspect.lua`: [inspect.lua](https://github.com/kikito/inspect.lua)
* `src/nvim/tui/terminfo_defs.h`: terminfo definitions
* Run `scripts/update_terminfo.sh` to update these definitions.
* [treesitter parsers](https://github.com/neovim/neovim/blob/fcc24e43e0b5f9d801a01ff2b8f78ce8c16dd551/cmake.deps/CMakeLists.txt#L197-L210)
### Forks
We may maintain forks, if we are waiting on upstream changes: https://github.com/neovim/neovim/wiki/Deps
See also See also
-------- --------
* https://github.com/neovim/neovim/issues/862 - https://github.com/neovim/neovim/issues/862
* https://github.com/git/git/blob/master/Documentation/howto/maintain-git.txt - https://github.com/git/git/blob/master/Documentation/howto/maintain-git.txt

118
Makefile
View File

@@ -1,6 +1,4 @@
MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST))) THIS_DIR = $(shell pwd)
MAKEFILE_DIR := $(dir $(MAKEFILE_PATH))
filter-false = $(strip $(filter-out 0 off OFF false FALSE,$1)) filter-false = $(strip $(filter-out 0 off OFF false FALSE,$1))
filter-true = $(strip $(filter-out 1 on ON true TRUE,$1)) filter-true = $(strip $(filter-out 1 on ON true TRUE,$1))
@@ -14,7 +12,6 @@ CMAKE_BUILD_TYPE ?= Debug
CMAKE_FLAGS := -DCMAKE_BUILD_TYPE=$(CMAKE_BUILD_TYPE) CMAKE_FLAGS := -DCMAKE_BUILD_TYPE=$(CMAKE_BUILD_TYPE)
# Extra CMake flags which extend the default set # Extra CMake flags which extend the default set
CMAKE_EXTRA_FLAGS ?= CMAKE_EXTRA_FLAGS ?=
NVIM_PRG := $(MAKEFILE_DIR)/build/bin/nvim
# CMAKE_INSTALL_PREFIX # CMAKE_INSTALL_PREFIX
# - May be passed directly or as part of CMAKE_EXTRA_FLAGS. # - May be passed directly or as part of CMAKE_EXTRA_FLAGS.
@@ -38,7 +35,7 @@ else
checkprefix: ; checkprefix: ;
endif endif
CMAKE_GENERATOR ?= $(shell (command -v ninja > /dev/null 2>&1 && echo "Ninja") || \ BUILD_TYPE ?= $(shell (type ninja > /dev/null 2>&1 && echo "Ninja") || \
echo "Unix Makefiles") echo "Unix Makefiles")
DEPS_BUILD_DIR ?= .deps DEPS_BUILD_DIR ?= .deps
ifneq (1,$(words [$(DEPS_BUILD_DIR)])) ifneq (1,$(words [$(DEPS_BUILD_DIR)]))
@@ -46,22 +43,29 @@ ifneq (1,$(words [$(DEPS_BUILD_DIR)]))
endif endif
ifeq (,$(BUILD_TOOL)) ifeq (,$(BUILD_TOOL))
ifeq (Ninja,$(CMAKE_GENERATOR)) ifeq (Ninja,$(BUILD_TYPE))
BUILD_TOOL = ninja ifneq ($(shell $(CMAKE_PRG) --help 2>/dev/null | grep Ninja),)
BUILD_TOOL := ninja
else
# User's version of CMake doesn't support Ninja
BUILD_TOOL = $(MAKE)
BUILD_TYPE := Unix Makefiles
endif
else else
BUILD_TOOL = $(MAKE) BUILD_TOOL = $(MAKE)
endif endif
endif endif
BUILD_CMD = $(BUILD_TOOL)
# Only need to handle Ninja here. Make will inherit the VERBOSE variable, and the -j, -l, and -n flags. # Only need to handle Ninja here. Make will inherit the VERBOSE variable, and the -j and -n flags.
ifeq ($(CMAKE_GENERATOR),Ninja) ifeq ($(BUILD_TYPE),Ninja)
ifneq ($(VERBOSE),) ifneq ($(VERBOSE),)
BUILD_TOOL += -v BUILD_CMD += -v
endif endif
BUILD_TOOL += $(shell printf '%s' '$(MAKEFLAGS)' | grep -o -- ' *-[jl][0-9]\+ *') BUILD_CMD += $(shell printf '%s' '$(MAKEFLAGS)' | grep -o -- '-j[0-9]\+')
ifeq (n,$(findstring n,$(firstword -$(MAKEFLAGS)))) ifeq (n,$(findstring n,$(firstword -$(MAKEFLAGS))))
BUILD_TOOL += -n BUILD_CMD += -n
endif endif
endif endif
@@ -83,33 +87,33 @@ endif
SINGLE_MAKE = export MAKEFLAGS= ; $(MAKE) SINGLE_MAKE = export MAKEFLAGS= ; $(MAKE)
nvim: build/.ran-cmake deps nvim: build/.ran-cmake deps
+$(BUILD_TOOL) -C build +$(BUILD_CMD) -C build
libnvim: build/.ran-cmake deps libnvim: build/.ran-cmake deps
+$(BUILD_TOOL) -C build libnvim +$(BUILD_CMD) -C build libnvim
cmake: cmake:
touch CMakeLists.txt touch CMakeLists.txt
$(MAKE) build/.ran-cmake $(MAKE) build/.ran-cmake
build/.ran-cmake: | deps build/.ran-cmake: | deps
cd build && $(CMAKE_PRG) -G '$(CMAKE_GENERATOR)' $(CMAKE_FLAGS) $(CMAKE_EXTRA_FLAGS) $(MAKEFILE_DIR) cd build && $(CMAKE_PRG) -G '$(BUILD_TYPE)' $(CMAKE_FLAGS) $(CMAKE_EXTRA_FLAGS) $(THIS_DIR)
touch $@ touch $@
deps: | build/.ran-deps-cmake deps: | build/.ran-third-party-cmake
ifeq ($(call filter-true,$(USE_BUNDLED)),) ifeq ($(call filter-true,$(USE_BUNDLED)),)
+$(BUILD_TOOL) -C $(DEPS_BUILD_DIR) +$(BUILD_CMD) -C $(DEPS_BUILD_DIR)
endif endif
ifeq ($(call filter-true,$(USE_BUNDLED)),) ifeq ($(call filter-true,$(USE_BUNDLED)),)
$(DEPS_BUILD_DIR): $(DEPS_BUILD_DIR):
mkdir -p "$@" mkdir -p "$@"
build/.ran-deps-cmake:: $(DEPS_BUILD_DIR) build/.ran-third-party-cmake:: $(DEPS_BUILD_DIR)
cd $(DEPS_BUILD_DIR) && \ cd $(DEPS_BUILD_DIR) && \
$(CMAKE_PRG) -G '$(CMAKE_GENERATOR)' $(BUNDLED_CMAKE_FLAG) $(BUNDLED_LUA_CMAKE_FLAG) \ $(CMAKE_PRG) -G '$(BUILD_TYPE)' $(BUNDLED_CMAKE_FLAG) $(BUNDLED_LUA_CMAKE_FLAG) \
$(DEPS_CMAKE_FLAGS) $(MAKEFILE_DIR)/cmake.deps $(DEPS_CMAKE_FLAGS) $(THIS_DIR)/third-party
endif endif
build/.ran-deps-cmake:: build/.ran-third-party-cmake::
mkdir -p build mkdir -p build
touch $@ touch $@
@@ -117,26 +121,58 @@ build/.ran-deps-cmake::
oldtest: | nvim build/runtime/doc/tags oldtest: | nvim build/runtime/doc/tags
+$(SINGLE_MAKE) -C src/nvim/testdir clean +$(SINGLE_MAKE) -C src/nvim/testdir clean
ifeq ($(strip $(TEST_FILE)),) ifeq ($(strip $(TEST_FILE)),)
+$(SINGLE_MAKE) -C src/nvim/testdir NVIM_PRG=$(NVIM_PRG) $(MAKEOVERRIDES) +$(SINGLE_MAKE) -C src/nvim/testdir NVIM_PRG="$(realpath build/bin/nvim)" $(MAKEOVERRIDES)
else else
@# Handle TEST_FILE=test_foo{,.res,.vim}. @# Handle TEST_FILE=test_foo{,.res,.vim}.
+$(SINGLE_MAKE) -C src/nvim/testdir NVIM_PRG=$(NVIM_PRG) SCRIPTS= $(MAKEOVERRIDES) $(patsubst %.vim,%,$(patsubst %.res,%,$(TEST_FILE))) +$(SINGLE_MAKE) -C src/nvim/testdir NVIM_PRG="$(realpath build/bin/nvim)" SCRIPTS= $(MAKEOVERRIDES) $(patsubst %.vim,%,$(patsubst %.res,%,$(TEST_FILE)))
endif endif
# Build oldtest by specifying the relative .vim filename. # Build oldtest by specifying the relative .vim filename.
.PHONY: phony_force .PHONY: phony_force
src/nvim/testdir/%.vim: phony_force src/nvim/testdir/%.vim: phony_force
+$(SINGLE_MAKE) -C src/nvim/testdir NVIM_PRG=$(NVIM_PRG) SCRIPTS= $(MAKEOVERRIDES) $(patsubst src/nvim/testdir/%.vim,%,$@) +$(SINGLE_MAKE) -C src/nvim/testdir NVIM_PRG="$(realpath build/bin/nvim)" SCRIPTS= $(MAKEOVERRIDES) $(patsubst src/nvim/testdir/%.vim,%,$@)
functionaltest functionaltest-lua unittest benchmark: | nvim build/runtime/doc/tags helptags: | nvim
$(BUILD_TOOL) -C build $@ +$(BUILD_CMD) -C build runtime/doc/tags
lintlua lintsh lintpy lintuncrustify lintc lintcfull check-single-includes generated-sources lintcommit lint formatc formatlua format: | build/.ran-cmake # Builds help HTML _and_ checks for invalid help tags.
$(CMAKE_PRG) --build build --target $@ helphtml: | nvim build/runtime/doc/tags
+$(BUILD_CMD) -C build doc_html
functionaltest: | nvim
+$(BUILD_CMD) -C build functionaltest
functionaltest-lua: | nvim
+$(BUILD_CMD) -C build functionaltest-lua
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/
# Run pylint only if flake8 is installed.
_opt_pylint:
@command -v flake8 && { $(MAKE) pylint; exit $$?; } \
|| echo "SKIP: pylint (flake8 not found)"
unittest: | nvim
+$(BUILD_CMD) -C build unittest
benchmark: | nvim
+$(BUILD_CMD) -C build benchmark
test: functionaltest unittest test: functionaltest unittest
clean: clean:
+test -d build && $(BUILD_TOOL) -C build clean || true +test -d build && $(BUILD_CMD) -C build clean || true
$(MAKE) -C src/nvim/testdir clean $(MAKE) -C src/nvim/testdir clean
$(MAKE) -C runtime/doc clean $(MAKE) -C runtime/doc clean
$(MAKE) -C runtime/indent clean $(MAKE) -C runtime/indent clean
@@ -146,7 +182,19 @@ distclean:
$(MAKE) clean $(MAKE) clean
install: checkprefix nvim install: checkprefix nvim
+$(BUILD_TOOL) -C build install +$(BUILD_CMD) -C build install
clint: build/.ran-cmake
+$(BUILD_CMD) -C build clint
clint-full: build/.ran-cmake
+$(BUILD_CMD) -C build clint-full
check-single-includes: build/.ran-cmake
+$(BUILD_CMD) -C build check-single-includes
generated-sources: build/.ran-cmake
+$(BUILD_CMD) -C build generated-sources
appimage: appimage:
bash scripts/genappimage.sh bash scripts/genappimage.sh
@@ -157,14 +205,16 @@ appimage:
appimage-%: appimage-%:
bash scripts/genappimage.sh $* bash scripts/genappimage.sh $*
lint: check-single-includes clint lualint _opt_pylint _opt_shlint
# Generic pattern rules, allowing for `make build/bin/nvim` etc. # Generic pattern rules, allowing for `make build/bin/nvim` etc.
# Does not work with "Unix Makefiles". # Does not work with "Unix Makefiles".
ifeq ($(CMAKE_GENERATOR),Ninja) ifeq ($(BUILD_TYPE),Ninja)
build/%: phony_force build/%: phony_force
$(BUILD_TOOL) -C build $(patsubst build/%,%,$@) $(BUILD_CMD) -C build $(patsubst build/%,%,$@)
$(DEPS_BUILD_DIR)/%: phony_force $(DEPS_BUILD_DIR)/%: phony_force
$(BUILD_TOOL) -C $(DEPS_BUILD_DIR) $(patsubst $(DEPS_BUILD_DIR)/%,%,$@) $(BUILD_CMD) -C $(DEPS_BUILD_DIR) $(patsubst $(DEPS_BUILD_DIR)/%,%,$@)
endif endif
.PHONY: test lintlua lintpy lintsh functionaltest unittest lint lintc clean distclean nvim libnvim cmake deps install appimage checkprefix lintcommit formatc formatlua format .PHONY: test lualint pylint shlint functionaltest unittest lint clint clean distclean nvim libnvim cmake deps install appimage checkprefix

View File

@@ -1,12 +1,11 @@
<h1 align="center"> [![Neovim](https://raw.githubusercontent.com/neovim/neovim.github.io/master/logos/neovim-logo-300x87.png)](https://neovim.io)
<img src="https://raw.githubusercontent.com/neovim/neovim.github.io/master/logos/neovim-logo-300x87.png" alt="Neovim">
</h1>
[Documentation](https://neovim.io/doc/general/) | [Documentation](https://neovim.io/doc/general/) |
[Chat](https://app.element.io/#/room/#neovim:matrix.org) | [Chat](https://gitter.im/neovim/neovim) |
[Twitter](https://twitter.com/Neovim) [Twitter](https://twitter.com/Neovim)
[![GitHub CI](https://github.com/neovim/neovim/workflows/CI/badge.svg)](https://github.com/neovim/neovim/actions?query=workflow%3ACI+branch%3Amaster+event%3Apush) [![GitHub CI](https://github.com/neovim/neovim/workflows/CI/badge.svg)](https://github.com/neovim/neovim/actions?query=workflow%3A%22CI%22)
[![Codecov coverage](https://img.shields.io/codecov/c/github/neovim/neovim.svg)](https://codecov.io/gh/neovim/neovim)
[![Coverity Scan analysis](https://scan.coverity.com/projects/2227/badge.svg)](https://scan.coverity.com/projects/2227) [![Coverity Scan analysis](https://scan.coverity.com/projects/2227/badge.svg)](https://scan.coverity.com/projects/2227)
[![Clang analysis](https://neovim.io/doc/reports/clang/badge.svg)](https://neovim.io/doc/reports/clang) [![Clang analysis](https://neovim.io/doc/reports/clang/badge.svg)](https://neovim.io/doc/reports/clang)
[![PVS-Studio analysis](https://neovim.io/doc/reports/pvs/badge.svg)](https://neovim.io/doc/reports/pvs/PVS-studio.html.d) [![PVS-Studio analysis](https://neovim.io/doc/reports/pvs/badge.svg)](https://neovim.io/doc/reports/pvs/PVS-studio.html.d)
@@ -47,7 +46,8 @@ Install from package
Pre-built packages for Windows, macOS, and Linux are found on the Pre-built packages for Windows, macOS, and Linux are found on the
[Releases](https://github.com/neovim/neovim/releases/) page. [Releases](https://github.com/neovim/neovim/releases/) page.
[Managed packages] are in [Homebrew], [Debian], [Ubuntu], [Fedora], [Arch Linux], [Void Linux], [Gentoo], and more! [Managed packages] are in [Homebrew], [Debian], [Ubuntu], [Fedora], [Arch Linux],
[Gentoo], and more!
Install from source Install from source
------------------- -------------------
@@ -62,10 +62,10 @@ After installing the dependencies, run the following command.
To install to a non-default location: To install to a non-default location:
make CMAKE_BUILD_TYPE=RelWithDebInfo CMAKE_INSTALL_PREFIX=/full/path/ make CMAKE_INSTALL_PREFIX=/full/path/
make install make install
CMake hints for inspecting the build: To inspect the build, these CMake features are useful:
- `cmake --build build --target help` lists all build targets. - `cmake --build build --target help` lists all build targets.
- `build/CMakeCache.txt` (or `cmake -LAH build/`) contains the resolved values of all CMake variables. - `build/CMakeCache.txt` (or `cmake -LAH build/`) contains the resolved values of all CMake variables.
@@ -80,10 +80,8 @@ Project layout
-------------- --------------
├─ ci/ build automation ├─ ci/ build automation
├─ cmake/ CMake utils ├─ cmake/ build scripts
├─ cmake.config/ CMake defines ├─ runtime/ user plugins/docs
├─ cmake.deps/ subproject to fetch and build dependencies (optional)
├─ runtime/ plugins and docs
├─ src/nvim/ application source code (see src/nvim/README.md) ├─ src/nvim/ application source code (see src/nvim/README.md)
│ ├─ api/ API subsystem │ ├─ api/ API subsystem
│ ├─ eval/ VimL subsystem │ ├─ eval/ VimL subsystem
@@ -94,6 +92,7 @@ Project layout
│ ├─ msgpack_rpc/ RPC subsystem │ ├─ msgpack_rpc/ RPC subsystem
│ ├─ os/ low-level platform code │ ├─ os/ low-level platform code
│ └─ tui/ built-in UI │ └─ tui/ built-in UI
├─ third-party/ CMake subproject to build dependencies
└─ test/ tests (see test/README.md) └─ test/ tests (see test/README.md)
License License
@@ -121,9 +120,8 @@ Apache 2.0 license, except for contributions copied from Vim (identified by the
[Managed packages]: https://github.com/neovim/neovim/wiki/Installing-Neovim#install-from-package [Managed packages]: https://github.com/neovim/neovim/wiki/Installing-Neovim#install-from-package
[Debian]: https://packages.debian.org/testing/neovim [Debian]: https://packages.debian.org/testing/neovim
[Ubuntu]: http://packages.ubuntu.com/search?keywords=neovim [Ubuntu]: http://packages.ubuntu.com/search?keywords=neovim
[Fedora]: https://packages.fedoraproject.org/pkgs/neovim/neovim/ [Fedora]: https://apps.fedoraproject.org/packages/neovim
[Arch Linux]: https://www.archlinux.org/packages/?q=neovim [Arch Linux]: https://www.archlinux.org/packages/?q=neovim
[Void Linux]: https://voidlinux.org/packages/?arch=x86_64&q=neovim
[Gentoo]: https://packages.gentoo.org/packages/app-editors/neovim [Gentoo]: https://packages.gentoo.org/packages/app-editors/neovim
[Homebrew]: https://formulae.brew.sh/formula/neovim [Homebrew]: https://formulae.brew.sh/formula/neovim

View File

@@ -7,13 +7,16 @@ CI_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "${CI_DIR}/common/build.sh" source "${CI_DIR}/common/build.sh"
source "${CI_DIR}/common/suite.sh" source "${CI_DIR}/common/suite.sh"
mkdir -p "${HOME}/.cache"
echo "before_cache.sh: cache size" echo "before_cache.sh: cache size"
du -chd 1 "${HOME}/.cache" | sort -rh | head -20 du -chd 1 "${HOME}/.cache" | sort -rh | head -20
echo "before_cache.sh: ccache stats"
ccache -s 2>/dev/null || true
# Do not keep ccache stats (uploaded to cache otherwise; reset initially anyway).
find "${HOME}/.ccache" -name stats -delete
# Update the third-party dependency cache only if the build was successful. # Update the third-party dependency cache only if the build was successful.
if ended_successfully && [ -d "${DEPS_BUILD_DIR}" ]; then if ended_successfully; then
# Do not cache downloads. They should not be needed with up-to-date deps. # Do not cache downloads. They should not be needed with up-to-date deps.
rm -rf "${DEPS_BUILD_DIR}/build/downloads" rm -rf "${DEPS_BUILD_DIR}/build/downloads"
rm -rf "${CACHE_NVIM_DEPS_DIR}" rm -rf "${CACHE_NVIM_DEPS_DIR}"

59
ci/before_install.sh Executable file
View File

@@ -0,0 +1,59 @@
#!/usr/bin/env bash
set -e
set -o pipefail
echo 'Python info:'
(
set -x
python3 --version
python2 --version
python --version
pip3 --version
pip2 --version
pip --version
pyenv --version
pyenv versions
) 2>&1 | sed 's/^/ /' || true
# Use pyenv, but not for OSX on Travis, where it only has the "system" version.
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:3.8
echo 'Updated Python info:'
(
set -x
python3 --version
python2 --version
python --version
python3 -m pip --version
python2 -m pip --version
) 2>&1 | sed 's/^/ /'
fi
echo "Install node (LTS)"
if [[ "${TRAVIS_OS_NAME}" == osx ]] || [ ! -f ~/.nvm/nvm.sh ]; then
curl -o ~/.nvm/nvm.sh https://raw.githubusercontent.com/creationix/nvm/master/nvm.sh
fi
source ~/.nvm/nvm.sh
nvm install 10
if [[ -n "$CMAKE_URL" ]]; then
echo "Installing custom CMake: $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"
cmake_version="$(cmake --version)"
echo "$cmake_version" | grep -qF '2.8.12' || {
echo "Unexpected CMake version: $cmake_version"
exit 1
}
fi

View File

@@ -6,6 +6,12 @@ set -o pipefail
CI_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" CI_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "${CI_DIR}/common/build.sh" source "${CI_DIR}/common/build.sh"
# Enable ipv6 on Travis. ref: a39c8b7ce30d
if test -n "${TRAVIS_OS_NAME}" && ! 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. # Test some of the configuration variables.
if [[ -n "${GCOV}" ]] && [[ ! $(type -P "${GCOV}") ]]; then if [[ -n "${GCOV}" ]] && [[ ! $(type -P "${GCOV}") ]]; then
echo "\$GCOV: '${GCOV}' is not executable." echo "\$GCOV: '${GCOV}' is not executable."
@@ -16,6 +22,18 @@ if [[ -n "${LLVM_SYMBOLIZER}" ]] && [[ ! $(type -P "${LLVM_SYMBOLIZER}") ]]; the
exit 1 exit 1
fi fi
echo "before_script.sh: ccache stats (will be cleared)"
ccache -s
# Reset ccache stats for real results in before_cache.
ccache --zero-stats
if [[ "${TRAVIS_OS_NAME}" == osx ]]; then
# Adds user to a dummy group.
# That allows to test changing the group of the file by `os_fchown`.
sudo dscl . -create /Groups/chown_test
sudo dscl . -append /Groups/chown_test GroupMembership "${USER}"
fi
# Compile dependencies. # Compile dependencies.
build_deps build_deps

View File

@@ -1,32 +1,24 @@
[CmdletBinding(DefaultParameterSetName = "Build")] param([switch]$NoTests)
param(
[Parameter(ParameterSetName="Build")][switch]$Build,
[Parameter(ParameterSetName="BuildDeps")][switch]$BuildDeps,
[Parameter(ParameterSetName="EnsureTestDeps")][switch]$EnsureTestDeps,
[Parameter(ParameterSetName="Package")][switch]$Package,
[Parameter(ParameterSetName="Test")][switch]$Test,
[Parameter(ParameterSetName="TestOld")][switch]$TestOld
)
Set-StrictMode -Version Latest Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop' $ErrorActionPreference = 'Stop'
$ProgressPreference = 'SilentlyContinue' $ProgressPreference = 'SilentlyContinue'
$projectDir = [System.IO.Path]::GetFullPath("$(Get-Location)") $env:CONFIGURATION -match '^(?<compiler>\w+)_(?<bits>32|64)(?:-(?<option>\w+))?$'
$buildDir = Join-Path -Path $projectDir -ChildPath "build" $compiler = $Matches.compiler
$compileOption = if ($Matches -contains 'option') {$Matches.option} else {''}
# $env:CMAKE_BUILD_TYPE is ignored by cmake when not using ninja $bits = $Matches.bits
$cmakeBuildType = $(if ($null -ne $env:CMAKE_BUILD_TYPE) {$env:CMAKE_BUILD_TYPE} else {'RelWithDebInfo'}); $cmakeBuildType = $(if ($env:CMAKE_BUILD_TYPE -ne $null) {$env:CMAKE_BUILD_TYPE} else {'RelWithDebInfo'});
$buildDir = [System.IO.Path]::GetFullPath("$(pwd)")
$depsCmakeVars = @{ $depsCmakeVars = @{
CMAKE_BUILD_TYPE=$cmakeBuildType; CMAKE_BUILD_TYPE = $cmakeBuildType;
} }
$nvimCmakeVars = @{ $nvimCmakeVars = @{
CMAKE_BUILD_TYPE=$cmakeBuildType; CMAKE_BUILD_TYPE = $cmakeBuildType;
BUSTED_OUTPUT_TYPE = 'nvim'; BUSTED_OUTPUT_TYPE = 'nvim';
DEPS_PREFIX=$(if ($null -ne $env:DEPS_PREFIX) {$env:DEPS_PREFIX} else {".deps/usr"}); DEPS_PREFIX=$(if ($env:DEPS_PREFIX -ne $null) {$env:DEPS_PREFIX} else {".deps/usr"});
} }
if ($null -eq $env:DEPS_BUILD_DIR) { if ($env:DEPS_BUILD_DIR -eq $null) {
$env:DEPS_BUILD_DIR = Join-Path -Path $projectDir -ChildPath ".deps" $env:DEPS_BUILD_DIR = ".deps";
} }
$uploadToCodeCov = $false $uploadToCodeCov = $false
@@ -36,97 +28,141 @@ function exitIfFailed() {
} }
} }
function convertToCmakeArgs($vars) { if (-not $NoTests) {
return $vars.GetEnumerator() | ForEach-Object { "-D$($_.Key)=$($_.Value)" }
}
$installationPath = vswhere.exe -latest -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
if ($installationPath -and (Test-Path "$installationPath\Common7\Tools\vsdevcmd.bat")) {
& "${env:COMSPEC}" /s /c "`"$installationPath\Common7\Tools\vsdevcmd.bat`" -arch=x64 -no_logo && set" | ForEach-Object {
$name, $value = $_ -split '=', 2
Set-Content env:\"$name" $value
}
}
function BuildDeps {
if (Test-Path -PathType container $env:DEPS_BUILD_DIR) {
$cachedBuildTypeStr = $(Get-Content $env:DEPS_BUILD_DIR\CMakeCache.txt | Select-String -Pattern "CMAKE_BUILD_TYPE.*=($cmakeBuildType)")
if (-not $cachedBuildTypeStr) {
Write-Warning " unable to validate build type from cache dir ${env:DEPS_BUILD_DIR}"
}
}
# we currently can't use ninja for cmake.deps, see #19405
$depsCmakeGenerator = "Visual Studio 16 2019"
$depsCmakeGeneratorPlf = "x64"
cmake -S "$projectDir\cmake.deps" -B $env:DEPS_BUILD_DIR -G $depsCmakeGenerator -A $depsCmakeGeneratorPlf $(convertToCmakeArgs($depsCmakeVars)); exitIfFailed
$depsCmakeNativeToolOptions= @('/verbosity:normal', '/m')
cmake --build $env:DEPS_BUILD_DIR --config $cmakeBuildType -- $depsCmakeNativeToolOptions; exitIfFailed
}
function Build {
cmake -S $projectDir -B $buildDir $(convertToCmakeArgs($nvimCmakeVars)) -G Ninja; exitIfFailed
cmake --build $buildDir --config $cmakeBuildType; exitIfFailed
}
function EnsureTestDeps {
& $buildDir\bin\nvim.exe "--version"; exitIfFailed
# Ensure that the "win32" feature is set.
& $buildDir\bin\nvim -u NONE --headless -c 'exe !has(\"win32\").\"cq\"' ; exitIfFailed
python -m pip install pynvim
# Sanity check
python -c "import pynvim; print(str(pynvim))"; exitIfFailed
gem.cmd install --pre neovim
Get-Command -CommandType Application neovim-ruby-host.bat; exitIfFailed
node --version node --version
npm.cmd --version npm.cmd --version
}
npm.cmd install -g neovim; exitIfFailed if (-Not (Test-Path -PathType container $env:DEPS_BUILD_DIR)) {
Get-Command -CommandType Application neovim-node-host.cmd; exitIfFailed write-host "cache dir not found: $($env:DEPS_BUILD_DIR)"
npm.cmd link neovim mkdir $env:DEPS_BUILD_DIR
} else {
write-host "cache dir $($env:DEPS_BUILD_DIR) size: $(Get-ChildItem $env:DEPS_BUILD_DIR -recurse | Measure-Object -property length -sum | Select -expand sum)"
}
if ($env:USE_LUACOV -eq 1) { if ($compiler -eq 'MINGW') {
& $env:DEPS_PREFIX\luarocks\luarocks.bat install cluacov if ($bits -eq 32) {
$arch = 'i686'
}
elseif ($bits -eq 64) {
$arch = 'x86_64'
}
if ($compileOption -eq 'gcov') {
$nvimCmakeVars['USE_GCOV'] = 'ON'
$uploadToCodecov = $true
$env:GCOV = "C:\msys64\mingw$bits\bin\gcov"
# Setup/build Lua coverage.
$env:USE_LUACOV = 1
$env:BUSTED_ARGS = "--coverage"
}
# These are native MinGW builds, but they use the toolchain inside
# MSYS2, this allows using all the dependencies and tools available
# in MSYS2, but we cannot build inside the MSYS2 shell.
$cmakeGenerator = 'Ninja'
$cmakeGeneratorArgs = '-v'
$mingwPackages = @('ninja', 'cmake', 'diffutils').ForEach({
"mingw-w64-$arch-$_"
})
# Add MinGW to the PATH
$env:PATH = "C:\msys64\mingw$bits\bin;$env:PATH"
# Avoid pacman "warning" which causes non-zero return code. https://github.com/open62541/open62541/issues/2068
& C:\msys64\usr\bin\mkdir -p /var/cache/pacman/pkg
# Build third-party dependencies
C:\msys64\usr\bin\bash -lc "pacman --verbose --noconfirm -Su" ; exitIfFailed
C:\msys64\usr\bin\bash -lc "pacman --verbose --noconfirm --needed -S $mingwPackages" ; exitIfFailed
}
elseif ($compiler -eq 'MSVC') {
$cmakeGeneratorArgs = '/verbosity:normal'
if ($bits -eq 32) {
$cmakeGenerator = 'Visual Studio 15 2017'
}
elseif ($bits -eq 64) {
$cmakeGenerator = 'Visual Studio 15 2017 Win64'
} }
} }
function Test { if (-not $NoTests) {
# Setup python (use AppVeyor system python)
# Disambiguate python3, if needed
if (-not (Test-Path -Path C:\hostedtoolcache\windows\Python\3.5.4\x64\python3.exe) ) {
move C:\hostedtoolcache\windows\Python\3.5.4\x64\python.exe C:\hostedtoolcache\windows\Python\3.5.4\x64\python3.exe
}
$env:PATH = "C:\hostedtoolcache\windows\Python\2.7.18\x64;C:\hostedtoolcache\windows\Python\3.5.4\x64;$env:PATH"
python -m pip install pynvim ; exitIfFailed
python3 -m pip install pynvim ; exitIfFailed
# Sanity check
python -c "import pynvim; print(str(pynvim))" ; exitIfFailed
python3 -c "import pynvim; print(str(pynvim))" ; exitIfFailed
gem.cmd install --pre neovim
Get-Command -CommandType Application neovim-ruby-host.bat
npm.cmd install -g neovim
Get-Command -CommandType Application neovim-node-host.cmd
npm.cmd link neovim
}
if ($compiler -eq 'MSVC') {
# Required for LuaRocks (https://github.com/luarocks/luarocks/issues/1039#issuecomment-507296940).
$env:VCINSTALLDIR = "C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/"
}
function convertToCmakeArgs($vars) {
return $vars.GetEnumerator() | foreach { "-D$($_.Key)=$($_.Value)" }
}
cd $env:DEPS_BUILD_DIR
cmake -G $cmakeGenerator $(convertToCmakeArgs($depsCmakeVars)) "$buildDir/third-party/" ; exitIfFailed
cmake --build . --config $cmakeBuildType -- $cmakeGeneratorArgs ; exitIfFailed
cd $buildDir
# Build Neovim
mkdir build
cd build
cmake -G $cmakeGenerator $(convertToCmakeArgs($nvimCmakeVars)) .. ; exitIfFailed
cmake --build . --config $cmakeBuildType -- $cmakeGeneratorArgs ; exitIfFailed
.\bin\nvim --version ; exitIfFailed
# Ensure that the "win32" feature is set.
.\bin\nvim -u NONE --headless -c 'exe !has(\"win32\").\"cq\"' ; exitIfFailed
if ($env:USE_LUACOV -eq 1) {
& $env:DEPS_PREFIX\luarocks\luarocks.bat install cluacov
}
if (-not $NoTests) {
# Functional tests # Functional tests
# The $LastExitCode from MSBuild can't be trusted # The $LastExitCode from MSBuild can't be trusted
$failed = $false $failed = $false
# Run only this test file: # Run only this test file:
# $env:TEST_FILE = "test\functional\foo.lua" # $env:TEST_FILE = "test\functional\foo.lua"
cmake --build $buildDir --target functionaltest 2>&1 | cmake --build . --config $cmakeBuildType --target functionaltest -- $cmakeGeneratorArgs 2>&1 |
ForEach-Object { $failed = $failed -or foreach { $failed = $failed -or
$_ -match 'functional tests failed with error'; $_ } $_ -match 'functional tests failed with error'; $_ }
if ($uploadToCodecov) {
if ($env:USE_LUACOV -eq 1) {
& $env:DEPS_PREFIX\bin\luacov.bat
}
bash -l /c/projects/neovim/ci/common/submit_coverage.sh functionaltest
}
if ($failed) { if ($failed) {
exit $LastExitCode exit $LastExitCode
} }
if (-not $uploadToCodecov) {
return
}
if ($env:USE_LUACOV -eq 1) {
& $env:DEPS_PREFIX\bin\luacov.bat
}
bash -l /c/projects/neovim/ci/common/submit_coverage.sh functionaltest
}
function TestOld {
# Old tests # Old tests
# Add MSYS to path, required for e.g. `find` used in test scripts. # Add MSYS to path, required for e.g. `find` used in test scripts.
# But would break functionaltests, where its `more` would be used then. # But would break functionaltests, where its `more` would be used then.
$OldPath = $env:PATH $OldPath = $env:PATH
$env:PATH = "C:\msys64\usr\bin;$env:PATH" $env:PATH = "C:\msys64\usr\bin;$env:PATH"
& "C:\msys64\mingw64\bin\mingw32-make.exe" -C $(Convert-Path $projectDir\src\nvim\testdir) VERBOSE=1; exitIfFailed & "C:\msys64\mingw$bits\bin\mingw32-make.exe" -C $(Convert-Path ..\src\nvim\testdir) VERBOSE=1 ; exitIfFailed
$env:PATH = $OldPath $env:PATH = $OldPath
if ($uploadToCodecov) { if ($uploadToCodecov) {
@@ -134,13 +170,8 @@ function TestOld {
} }
} }
# Build artifacts
function Package { cpack -G ZIP -C RelWithDebInfo
cmake -S $projectDir -B $buildDir $(convertToCmakeArgs($nvimCmakeVars)) -G Ninja; exitIfFailed if ($env:APPVEYOR_REPO_TAG_NAME -ne $null) {
cmake --build $buildDir --target package; exitIfFailed cpack -G NSIS -C RelWithDebInfo
}
if ($PSCmdlet.ParameterSetName) {
& (Get-ChildItem "Function:$($PSCmdlet.ParameterSetName)")
exit
} }

View File

@@ -8,6 +8,8 @@ _stat() {
top_make() { top_make() {
printf '%78s\n' | tr ' ' '=' printf '%78s\n' | tr ' ' '='
# Travis has 1.5 virtual cores according to:
# http://docs.travis-ci.com/user/speeding-up-the-build/#Paralellizing-your-build-on-one-VM
ninja "$@" ninja "$@"
} }
@@ -24,7 +26,9 @@ build_deps() {
mkdir -p "${DEPS_BUILD_DIR}" mkdir -p "${DEPS_BUILD_DIR}"
# Use cached dependencies if $CACHE_MARKER exists. # Use cached dependencies if $CACHE_MARKER exists.
if test -f "${CACHE_MARKER}"; then if test "${CACHE_ENABLE}" = "false" ; then
export CCACHE_RECACHE=1
elif test -f "${CACHE_MARKER}" ; then
echo "Using third-party dependencies from cache (last update: $(_stat "${CACHE_MARKER}"))." echo "Using third-party dependencies from cache (last update: $(_stat "${CACHE_MARKER}"))."
cp -a "${CACHE_NVIM_DEPS_DIR}"/. "${DEPS_BUILD_DIR}" cp -a "${CACHE_NVIM_DEPS_DIR}"/. "${DEPS_BUILD_DIR}"
fi fi
@@ -33,7 +37,7 @@ build_deps() {
# update CMake configuration and update to newer deps versions. # update CMake configuration and update to newer deps versions.
cd "${DEPS_BUILD_DIR}" cd "${DEPS_BUILD_DIR}"
echo "Configuring with '${DEPS_CMAKE_FLAGS}'." echo "Configuring with '${DEPS_CMAKE_FLAGS}'."
CC= cmake -G Ninja ${DEPS_CMAKE_FLAGS} "${CI_BUILD_DIR}/cmake.deps/" CC= cmake -G Ninja ${DEPS_CMAKE_FLAGS} "${CI_BUILD_DIR}/third-party/"
if ! top_make; then if ! top_make; then
exit 1 exit 1
@@ -42,9 +46,7 @@ build_deps() {
cd "${CI_BUILD_DIR}" cd "${CI_BUILD_DIR}"
} }
build_nvim() { prepare_build() {
check_core_dumps --delete quiet
if test -n "${CLANG_SANITIZER}" ; then if test -n "${CLANG_SANITIZER}" ; then
CMAKE_FLAGS="${CMAKE_FLAGS} -DCLANG_${CLANG_SANITIZER}=ON" CMAKE_FLAGS="${CMAKE_FLAGS} -DCLANG_${CLANG_SANITIZER}=ON"
fi fi
@@ -53,8 +55,9 @@ build_nvim() {
cd "${BUILD_DIR}" cd "${BUILD_DIR}"
echo "Configuring with '${CMAKE_FLAGS} $@'." echo "Configuring with '${CMAKE_FLAGS} $@'."
cmake -G Ninja ${CMAKE_FLAGS} "$@" "${CI_BUILD_DIR}" cmake -G Ninja ${CMAKE_FLAGS} "$@" "${CI_BUILD_DIR}"
}
build_nvim() {
echo "Building nvim." echo "Building nvim."
if ! top_make nvim ; then if ! top_make nvim ; then
exit 1 exit 1

View File

@@ -4,7 +4,7 @@
# Args: # Args:
# $1: Flag(s) for codecov, separated by comma. # $1: Flag(s) for codecov, separated by comma.
set -e set -ex
# Change to grandparent dir (POSIXly). # Change to grandparent dir (POSIXly).
CDPATH='' cd -P -- "$(dirname -- "$0")/../.." || exit CDPATH='' cd -P -- "$(dirname -- "$0")/../.." || exit
@@ -18,12 +18,12 @@ if ! [ -f "$codecov_sh" ]; then
curl --retry 5 --silent --fail -o "$codecov_sh" https://codecov.io/bash curl --retry 5 --silent --fail -o "$codecov_sh" https://codecov.io/bash
chmod +x "$codecov_sh" chmod +x "$codecov_sh"
python -m pip install --quiet --user gcovr python3 -m pip install --quiet --user gcovr
fi fi
( (
cd build cd build
python -m gcovr --branches --exclude-unreachable-branches --print-summary -j 2 --exclude '.*/auto/.*' --root .. --delete -o ../coverage.xml --xml python3 -m gcovr --branches --exclude-unreachable-branches --print-summary -j 2 --exclude '.*/auto/.*' --root .. --delete -o ../coverage.xml --xml
) )
# Upload to codecov. # Upload to codecov.

View File

@@ -1,3 +1,9 @@
# HACK: get newline for use in strings given that "\n" and $'' do not work.
NL="$(printf '\nE')"
NL="${NL%E}"
FAIL_SUMMARY=""
# Test success marker. If END_MARKER file exists, we know that all tests # Test success marker. If END_MARKER file exists, we know that all tests
# finished. If FAIL_SUMMARY_FILE exists we know that some tests failed, this # finished. If FAIL_SUMMARY_FILE exists we know that some tests failed, this
# file will contain information about failed tests. Build is considered # file will contain information about failed tests. Build is considered
@@ -5,27 +11,190 @@
END_MARKER="$BUILD_DIR/.tests_finished" END_MARKER="$BUILD_DIR/.tests_finished"
FAIL_SUMMARY_FILE="$BUILD_DIR/.test_errors" FAIL_SUMMARY_FILE="$BUILD_DIR/.test_errors"
ANSI_CLEAR="\033[0K"
if test "$TRAVIS" = "true"; then
ci_fold() {
local action="$1"
local name="$2"
name="$(echo -n "$name" | tr '\n\0' '--' | sed 's/[^A-Za-z0-9]\{1,\}/-/g')"
name="$(echo -n "$name" | sed 's/-$//')"
echo -en "travis_fold:${action}:${name}\r${ANSI_CLEAR}"
}
elif test "$GITHUB_ACTIONS" = "true"; then
ci_fold() {
local action="$1"
local name="$2"
name="$(echo -n "$name" | tr '\n\0' '--' | sed 's/[^A-Za-z0-9]\{1,\}/-/g')"
name="$(echo -n "$name" | sed 's/-$//')"
case "$action" in
start)
echo "::group::${name}"
;;
end)
echo "::endgroup::"
;;
*)
:;;
esac
}
else
ci_fold() {
return 0
}
fi
enter_suite() {
set +x
FAILED=0
rm -f "${END_MARKER}"
local suite_name="$1"
export NVIM_TEST_CURRENT_SUITE="${NVIM_TEST_CURRENT_SUITE}/$suite_name"
ci_fold start "${NVIM_TEST_CURRENT_SUITE}"
set -x
}
exit_suite() {
set +x
if test $FAILED -ne 0 ; then
echo "Suite ${NVIM_TEST_CURRENT_SUITE} failed, summary:"
echo "${FAIL_SUMMARY}"
else
ci_fold end "${NVIM_TEST_CURRENT_SUITE}"
fi
export NVIM_TEST_CURRENT_SUITE="${NVIM_TEST_CURRENT_SUITE%/*}"
if test "$1" != "--continue" ; then
exit $FAILED
else
local saved_failed=$FAILED
FAILED=0
return $saved_failed
fi
}
fail() { fail() {
local test_name="$1" local test_name="$1"
local message="$2" local fail_char="$2"
local message="$3"
: ${fail_char:=F}
: ${message:=Test $test_name failed} : ${message:=Test $test_name failed}
local full_msg="$test_name :: $message" local full_msg="$fail_char $NVIM_TEST_CURRENT_SUITE|$test_name :: $message"
FAIL_SUMMARY="${FAIL_SUMMARY}${NL}${full_msg}"
echo "${full_msg}" >> "${FAIL_SUMMARY_FILE}" echo "${full_msg}" >> "${FAIL_SUMMARY_FILE}"
echo "Failed: $full_msg" echo "Failed: $full_msg"
FAILED=1 FAILED=1
} }
run_test() {
local cmd="$1"
test $# -gt 0 && shift
local test_name="$1"
: ${test_name:=$cmd}
test $# -gt 0 && shift
if ! eval "$cmd" ; then
fail "${test_name}" "$@"
fi
}
run_test_wd() {
local hang_ok=
if test "$1" = "--allow-hang" ; then
hang_ok=1
shift
fi
local timeout="$1"
test $# -gt 0 && shift
local cmd="$1"
test $# -gt 0 && shift
local restart_cmd="$1"
: ${restart_cmd:=true}
test $# -gt 0 && shift
local test_name="$1"
: ${test_name:=$cmd}
test $# -gt 0 && shift
local output_file="$(mktemp)"
local status_file="$(mktemp)"
local sid_file="$(mktemp)"
local restarts=5
local prev_tmpsize=-1
while test $restarts -gt 0 ; do
: > "$status_file"
: > "$sid_file"
setsid \
env \
output_file="$output_file" \
status_file="$status_file" \
sid_file="$sid_file" \
cmd="$cmd" \
CI_DIR="$CI_DIR" \
sh -c '
. "${CI_DIR}/common/test.sh"
ps -o sid= > "$sid_file"
(
ret=0
if ! eval "$cmd" 2>&1 ; then
ret=1
fi
echo "$ret" > "$status_file"
) | tee -a "$output_file"
'
while test "$(stat -c "%s" "$status_file")" -eq 0 ; do
prev_tmpsize=$tmpsize
sleep $timeout
tmpsize="$(stat -c "%s" "$output_file")"
if test $tempsize -eq $prev_temsize ; then
# no output, assuming either hang or exit
break
fi
done
restarts=$(( restarts - 1 ))
if test "$(stat -c "%s" "$status_file")" -eq 0 ; then
# Status file not updated, assuming hang
# SID not known, this should not ever happen
if test "$(stat -c "%s" "$sid_file")" -eq 0 ; then
fail "$test_name" E "Shell did not run"
break
fi
# Kill all processes which belong to one session: should get rid of test
# processes as well as sh itself.
pkill -KILL -s$(cat "$sid_file")
if test $restarts -eq 0 ; then
if test -z "$hang_ok" ; then
fail "$test_name" E "Test hang up"
fi
else
echo "Test ${test_name} hang up, restarting"
eval "$restart_cmd"
fi
else
local new_failed="$(cat "$status_file")"
if test "$new_failed" != "0" ; then
fail "$test_name" F "Test failed in run_test_wd"
fi
break
fi
done
rm -f "$output_file"
rm -f "$status_file"
rm -f "$sid_file"
}
ended_successfully() { ended_successfully() {
if test -f "${FAIL_SUMMARY_FILE}" ; then if test -f "${FAIL_SUMMARY_FILE}" ; then
echo 'Test failed, complete summary:' echo 'Test failed, complete summary:'
cat "${FAIL_SUMMARY_FILE}" cat "${FAIL_SUMMARY_FILE}"
if [[ "$GITHUB_ACTIONS" == "true" ]]; then
rm -f "$FAIL_SUMMARY_FILE"
fi
return 1 return 1
fi fi
if ! test -f "${END_MARKER}" ; then if ! test -f "${END_MARKER}" ; then

View File

@@ -51,7 +51,7 @@ check_core_dumps() {
fi fi
done done
if test "$app" != quiet ; then if test "$app" != quiet ; then
fail 'cores' 'Core dumps found' fail 'cores' E 'Core dumps found'
fi fi
} }
@@ -72,7 +72,7 @@ check_logs() {
rm "${log}" rm "${log}"
done done
if test -n "${err}" ; then if test -n "${err}" ; then
fail 'logs' 'Runtime errors detected.' fail 'logs' E 'Runtime errors detected.'
fi fi
} }
@@ -86,39 +86,46 @@ check_sanitizer() {
fi fi
} }
unittests() {( run_unittests() {(
enter_suite unittests
ulimit -c unlimited || true ulimit -c unlimited || true
if ! build_make unittest ; then if ! build_make unittest ; then
fail 'unittests' 'Unit tests failed' fail 'unittests' F 'Unit tests failed'
fi fi
submit_coverage unittest submit_coverage unittest
check_core_dumps "$(command -v luajit)" check_core_dumps "$(command -v luajit)"
exit_suite
)} )}
functionaltests() {( run_functionaltests() {(
enter_suite functionaltests
ulimit -c unlimited || true ulimit -c unlimited || true
if ! build_make ${FUNCTIONALTEST}; then if ! build_make ${FUNCTIONALTEST}; then
fail 'functionaltests' 'Functional tests failed' fail 'functionaltests' F 'Functional tests failed'
fi fi
submit_coverage functionaltest submit_coverage functionaltest
check_sanitizer "${LOG_DIR}" check_sanitizer "${LOG_DIR}"
valgrind_check "${LOG_DIR}" valgrind_check "${LOG_DIR}"
check_core_dumps check_core_dumps
exit_suite
)} )}
oldtests() {( run_oldtests() {(
enter_suite oldtests
ulimit -c unlimited || true ulimit -c unlimited || true
if ! make oldtest; then if ! make oldtest; then
reset reset
fail 'oldtests' 'Legacy tests failed' fail 'oldtests' F 'Legacy tests failed'
fi fi
submit_coverage oldtest submit_coverage oldtest
check_sanitizer "${LOG_DIR}" check_sanitizer "${LOG_DIR}"
valgrind_check "${LOG_DIR}" valgrind_check "${LOG_DIR}"
check_core_dumps check_core_dumps
exit_suite
)} )}
check_runtime_files() {( check_runtime_files() {(
set +x
local test_name="$1" ; shift local test_name="$1" ; shift
local message="$1" ; shift local message="$1" ; shift
local tst="$1" ; shift local tst="$1" ; shift
@@ -129,25 +136,27 @@ check_runtime_files() {(
# Prefer failing the build over using more robust construct because files # Prefer failing the build over using more robust construct because files
# with IFS are not welcome. # with IFS are not welcome.
if ! test -e "$file" ; then if ! test -e "$file" ; then
fail "$test_name" "It appears that $file is only a part of the file name" fail "$test_name" E \
"It appears that $file is only a part of the file name"
fi fi
if ! test "$tst" "$INSTALL_PREFIX/share/nvim/runtime/$file" ; then if ! test "$tst" "$INSTALL_PREFIX/share/nvim/runtime/$file" ; then
fail "$test_name" "$(printf "$message" "$file")" fail "$test_name" F "$(printf "$message" "$file")"
fi fi
done done
)} )}
install_nvim() {( install_nvim() {(
enter_suite 'install_nvim'
if ! build_make install ; then if ! build_make install ; then
fail 'install' 'make install failed' fail 'install' E 'make install failed'
exit 1 exit_suite
fi fi
"${INSTALL_PREFIX}/bin/nvim" --version "${INSTALL_PREFIX}/bin/nvim" --version
if ! "${INSTALL_PREFIX}/bin/nvim" -u NONE -e -c ':help' -c ':qall' ; then if ! "${INSTALL_PREFIX}/bin/nvim" -u NONE -e -c ':help' -c ':qall' ; then
echo "Running ':help' in the installed nvim failed." echo "Running ':help' in the installed nvim failed."
echo "Maybe the helptags have not been generated properly." echo "Maybe the helptags have not been generated properly."
fail 'help' 'Failed running :help' fail 'help' F 'Failed running :help'
fi fi
# Check that all runtime files were installed # Check that all runtime files were installed
@@ -168,6 +177,13 @@ install_nvim() {(
local genvimsynf=syntax/vim/generated.vim local genvimsynf=syntax/vim/generated.vim
local gpat='syn keyword vimFuncName .*eval' local gpat='syn keyword vimFuncName .*eval'
if ! grep -q "$gpat" "${INSTALL_PREFIX}/share/nvim/runtime/$genvimsynf" ; then if ! grep -q "$gpat" "${INSTALL_PREFIX}/share/nvim/runtime/$genvimsynf" ; then
fail 'funcnames' "It appears that $genvimsynf does not contain $gpat." fail 'funcnames' F "It appears that $genvimsynf does not contain $gpat."
fi fi
exit_suite
)} )}
csi_clean() {
find "${BUILD_DIR}/bin" -name 'test-includes-*' -delete
find "${BUILD_DIR}" -name '*test-include*.o' -delete
}

View File

@@ -3,18 +3,31 @@
set -e set -e
set -o pipefail set -o pipefail
if [[ "${CI_TARGET}" == lint ]]; then
python3 -m pip -q install --user --upgrade flake8
exit
fi
if [[ "${TRAVIS_OS_NAME}" == osx ]]; then
export PATH="/usr/local/opt/ccache/libexec:$PATH"
fi
# Use default CC to avoid compilation problems when installing Python modules. # Use default CC to avoid compilation problems when installing Python modules.
echo "Install neovim module for Python." echo "Install neovim module for Python 3."
CC=cc python3 -m pip -q install --user --upgrade pynvim CC=cc python3 -m pip -q install --user --upgrade pynvim
if python2 -m pip -c True 2>&1; then
echo "Install neovim module for Python 2."
CC=cc python2 -m pip -q install --user --upgrade pynvim
fi
echo "Install neovim RubyGem." echo "Install neovim RubyGem."
gem install --no-document --bindir "$HOME/.local/bin" --user-install --pre neovim gem install --no-document --bindir "$HOME/.local/bin" --user-install --pre neovim
echo "Install neovim npm package" echo "Install neovim npm package"
source ~/.nvm/nvm.sh
nvm use 10
npm install -g neovim npm install -g neovim
npm link neovim npm link neovim
if [[ $CI_OS_NAME != osx ]]; then sudo cpanm -n Neovim::Ext || cat "$HOME/.cpanm/build.log"
sudo cpanm -n Neovim::Ext || cat "$HOME/.cpanm/build.log" perl -W -e 'use Neovim::Ext; print $Neovim::Ext::VERSION'
perl -W -e 'use Neovim::Ext; print $Neovim::Ext::VERSION'
fi

36
ci/run_lint.sh Executable file
View File

@@ -0,0 +1,36 @@
#!/usr/bin/env bash
set -e
set -o pipefail
CI_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "${CI_DIR}/common/build.sh"
source "${CI_DIR}/common/suite.sh"
enter_suite 'clint'
run_test 'make clint-full' clint
exit_suite --continue
enter_suite 'lualint'
run_test 'make lualint' lualint
exit_suite --continue
enter_suite 'pylint'
run_test 'make pylint' pylint
exit_suite --continue
enter_suite 'shlint'
run_test 'make shlint' shlint
exit_suite --continue
enter_suite single-includes
CLICOLOR_FORCE=1 run_test_wd \
--allow-hang \
10s \
'make check-single-includes' \
'csi_clean' \
single-includes
exit_suite --continue
end_tests

View File

@@ -8,34 +8,33 @@ source "${CI_DIR}/common/build.sh"
source "${CI_DIR}/common/test.sh" source "${CI_DIR}/common/test.sh"
source "${CI_DIR}/common/suite.sh" source "${CI_DIR}/common/suite.sh"
rm -f "$END_MARKER" enter_suite build
# Run all tests (with some caveats) if no input argument is given check_core_dumps --delete quiet
if (($# == 0)); then
tests=('build_nvim')
if test "$CLANG_SANITIZER" != "TSAN"; then prepare_build
# Additional threads are only created when the builtin UI starts, which build_nvim
# doesn't happen in the unit/functional tests
if test "${FUNCTIONALTEST}" != "functionaltest-lua"; then exit_suite --continue
tests+=('unittests')
fi source ~/.nvm/nvm.sh
tests+=('functionaltests') nvm use 10
enter_suite tests
if test "$CLANG_SANITIZER" != "TSAN" ; then
# Additional threads are only created when the builtin UI starts, which
# doesn't happen in the unit/functional tests
if test "${FUNCTIONALTEST}" != "functionaltest-lua"; then
run_test run_unittests
fi fi
run_test run_functionaltests
tests+=('oldtests' 'install_nvim')
else
tests=("$@")
fi fi
run_test run_oldtests
for i in "${tests[@]}"; do run_test install_nvim
eval "$i" || fail "$i"
done exit_suite --continue
end_tests end_tests
if [[ -s "${GCOV_ERROR_FILE}" ]]; then
echo '=== Unexpected gcov errors: ==='
cat "${GCOV_ERROR_FILE}"
exit 1
fi

19
ci/script.sh Executable file
View File

@@ -0,0 +1,19 @@
#!/usr/bin/env bash
set -e
set -o pipefail
# This will pass the environment variables down to a bash process which runs
# as $USER, while retaining the environment variables defined and belonging
# to secondary groups given above in usermod.
if [[ "${TRAVIS_OS_NAME}" == osx ]]; then
sudo -E su "${USER}" -c "ci/run_${CI_TARGET}.sh"
else
ci/run_${CI_TARGET}.sh
fi
if [[ -s "${GCOV_ERROR_FILE}" ]]; then
echo '=== Unexpected gcov errors: ==='
cat "${GCOV_ERROR_FILE}"
exit 1
fi

View File

@@ -8,7 +8,7 @@ WEBHOOK_PAYLOAD="$(cat "${SNAP_DIR}/.snapcraft_payload")"
PAYLOAD_SIG="${SECRET_SNAP_SIG}" PAYLOAD_SIG="${SECRET_SNAP_SIG}"
snap_release_needed() { snap_realease_needed() {
last_committed_tag="$(git tag -l --sort=refname|head -1)" last_committed_tag="$(git tag -l --sort=refname|head -1)"
last_snap_release="$(snap info nvim | awk '$1 == "latest/edge:" { print $2 }' | perl -lpe 's/v\d.\d.\d-//g')" last_snap_release="$(snap info nvim | awk '$1 == "latest/edge:" { print $2 }' | perl -lpe 's/v\d.\d.\d-//g')"
git fetch -f --tags git fetch -f --tags
@@ -24,7 +24,7 @@ snap_release_needed() {
trigger_snapcraft_webhook() { trigger_snapcraft_webhook() {
[[ -n "${PAYLOAD_SIG}" ]] || exit [[ -n "${PAYLOAD_SIG}" ]] || exit
echo "Triggering new snap release via webhook..." echo "Triggering new snap relase via webhook..."
curl -X POST \ curl -X POST \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-H "X-Hub-Signature: sha1=${PAYLOAD_SIG}" \ -H "X-Hub-Signature: sha1=${PAYLOAD_SIG}" \
@@ -33,7 +33,7 @@ trigger_snapcraft_webhook() {
} }
if $(snap_release_needed); then if $(snap_realease_needed); then
echo "New snap release required" echo "New snap release required"
trigger_snapcraft_webhook trigger_snapcraft_webhook
fi fi

View File

@@ -1,43 +0,0 @@
if(WIN32)
set(LIBTERMKEY_CONFIGURE_COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/cmake/libtermkeyCMakeLists.txt
${DEPS_BUILD_DIR}/src/libtermkey/CMakeLists.txt
COMMAND ${CMAKE_COMMAND} ${DEPS_BUILD_DIR}/src/libtermkey
-DCMAKE_INSTALL_PREFIX=${DEPS_INSTALL_DIR}
# Pass toolchain
-DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN}
${BUILD_TYPE_STRING}
# Hack to avoid -rdynamic in Mingw
-DCMAKE_SHARED_LIBRARY_LINK_C_FLAGS=""
-DCMAKE_GENERATOR=${CMAKE_GENERATOR}
-DCMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM}
-DUNIBILIUM_INCLUDE_DIRS=${DEPS_INSTALL_DIR}/include
-DUNIBILIUM_LIBRARIES=${DEPS_LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}unibilium${CMAKE_STATIC_LIBRARY_SUFFIX})
set(LIBTERMKEY_BUILD_COMMAND ${CMAKE_COMMAND} --build . --config $<CONFIG>)
set(LIBTERMKEY_INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install --config $<CONFIG>)
else()
find_package(PkgConfig REQUIRED)
set(LIBTERMKEY_BUILD_COMMAND "" BUILD_IN_SOURCE 1)
set(LIBTERMKEY_INSTALL_COMMAND ${MAKE_PRG} CC=${DEPS_C_COMPILER}
PREFIX=${DEPS_INSTALL_DIR} PKG_CONFIG_PATH=${DEPS_LIB_DIR}/pkgconfig
CFLAGS=-fPIC LDFLAGS+=-static ${DEFAULT_MAKE_CFLAGS} install)
endif()
ExternalProject_Add(libtermkey
PREFIX ${DEPS_BUILD_DIR}
URL ${LIBTERMKEY_URL}
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/libtermkey
DOWNLOAD_COMMAND ${CMAKE_COMMAND}
-DPREFIX=${DEPS_BUILD_DIR}
-DDOWNLOAD_DIR=${DEPS_DOWNLOAD_DIR}/libtermkey
-DURL=${LIBTERMKEY_URL}
-DEXPECTED_SHA256=${LIBTERMKEY_SHA256}
-DTARGET=libtermkey
-DUSE_EXISTING_SRC_DIR=${USE_EXISTING_SRC_DIR}
-P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/DownloadAndExtractFile.cmake
CONFIGURE_COMMAND "${LIBTERMKEY_CONFIGURE_COMMAND}"
BUILD_COMMAND "${LIBTERMKEY_BUILD_COMMAND}"
INSTALL_COMMAND "${LIBTERMKEY_INSTALL_COMMAND}")
list(APPEND THIRD_PARTY_DEPS libtermkey)

View File

@@ -1,26 +0,0 @@
ExternalProject_Add(libuv
PREFIX ${DEPS_BUILD_DIR}
URL ${LIBUV_URL}
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${DEPS_INSTALL_DIR}
-DCMAKE_INSTALL_LIBDIR=lib
-DBUILD_TESTING=OFF
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
-DLIBUV_BUILD_SHARED=OFF
CMAKE_CACHE_ARGS
-DCMAKE_OSX_ARCHITECTURES:STRING=${CMAKE_OSX_ARCHITECTURES}
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/libuv
DOWNLOAD_COMMAND ${CMAKE_COMMAND}
-DPREFIX=${DEPS_BUILD_DIR}
-DDOWNLOAD_DIR=${DEPS_DOWNLOAD_DIR}/libuv
-DURL=${LIBUV_URL}
-DEXPECTED_SHA256=${LIBUV_SHA256}
-DTARGET=libuv
-DUSE_EXISTING_SRC_DIR=${USE_EXISTING_SRC_DIR}
-P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/DownloadAndExtractFile.cmake
PATCH_COMMAND
${GIT_EXECUTABLE} -C ${DEPS_BUILD_DIR}/src/libuv init
COMMAND ${GIT_EXECUTABLE} -C ${DEPS_BUILD_DIR}/src/libuv apply --ignore-whitespace
${CMAKE_CURRENT_SOURCE_DIR}/patches/libuv-disable-shared.patch)
list(APPEND THIRD_PARTY_DEPS libuv)

View File

@@ -1,46 +0,0 @@
if(WIN32)
set(LIBVTERM_CONFIGURE_COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/cmake/LibvtermCMakeLists.txt
${DEPS_BUILD_DIR}/src/libvterm/CMakeLists.txt
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/cmake/Libvterm-tbl2inc_c.cmake
${DEPS_BUILD_DIR}/src/libvterm/tbl2inc_c.cmake
COMMAND ${CMAKE_COMMAND} ${DEPS_BUILD_DIR}/src/libvterm
-DCMAKE_INSTALL_PREFIX=${DEPS_INSTALL_DIR}
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM}
-DCMAKE_GENERATOR=${CMAKE_GENERATOR})
if(MSVC)
list(APPEND LIBVTERM_CONFIGURE_COMMAND "-DCMAKE_C_FLAGS:STRING=${CMAKE_C_COMPILER_ARG1}")
else()
list(APPEND LIBVTERM_CONFIGURE_COMMAND "-DCMAKE_C_FLAGS:STRING=${CMAKE_C_COMPILER_ARG1} -fPIC")
endif()
set(LIBVTERM_BUILD_COMMAND ${CMAKE_COMMAND} --build . --config $<CONFIG>)
set(LIBVTERM_INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install --config $<CONFIG>)
else()
set(LIBVTERM_INSTALL_COMMAND ${MAKE_PRG} CC=${DEPS_C_COMPILER}
PREFIX=${DEPS_INSTALL_DIR}
CFLAGS=-fPIC
LDFLAGS+=-static
${DEFAULT_MAKE_CFLAGS}
install)
endif()
ExternalProject_Add(libvterm
PREFIX ${DEPS_BUILD_DIR}
URL ${LIBVTERM_URL}
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/libvterm
DOWNLOAD_COMMAND ${CMAKE_COMMAND}
-DPREFIX=${DEPS_BUILD_DIR}
-DDOWNLOAD_DIR=${DEPS_DOWNLOAD_DIR}/libvterm
-DURL=${LIBVTERM_URL}
-DEXPECTED_SHA256=${LIBVTERM_SHA256}
-DTARGET=libvterm
-DUSE_EXISTING_SRC_DIR=${USE_EXISTING_SRC_DIR}
-P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/DownloadAndExtractFile.cmake
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND "${LIBVTERM_CONFIGURE_COMMAND}"
BUILD_COMMAND "${LIBVTERM_BUILD_COMMAND}"
INSTALL_COMMAND "${LIBVTERM_INSTALL_COMMAND}")
list(APPEND THIRD_PARTY_DEPS libvterm)

View File

@@ -1,103 +0,0 @@
set(LUV_SRC_DIR ${DEPS_BUILD_DIR}/src/luv)
set(LUV_INCLUDE_FLAGS
"-I${DEPS_INSTALL_DIR}/include -I${DEPS_INSTALL_DIR}/include/luajit-2.1")
set(LUV_CONFIGURE_COMMAND_COMMON
${CMAKE_COMMAND} ${LUV_SRC_DIR}
-DCMAKE_GENERATOR=${CMAKE_GENERATOR}
${BUILD_TYPE_STRING}
-DCMAKE_INSTALL_PREFIX=${DEPS_INSTALL_DIR}
-DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES_ALT_SEP}
-DLUA_BUILD_TYPE=System
-DLUA_COMPAT53_DIR=${DEPS_BUILD_DIR}/src/lua-compat-5.3
-DWITH_SHARED_LIBUV=ON
-DBUILD_SHARED_LIBS=OFF
-DBUILD_STATIC_LIBS=ON
-DBUILD_MODULE=OFF)
if(USE_BUNDLED_LUAJIT)
list(APPEND LUV_CONFIGURE_COMMAND_COMMON -DWITH_LUA_ENGINE=LuaJit)
elseif(USE_BUNDLED_LUA)
list(APPEND LUV_CONFIGURE_COMMAND_COMMON -DWITH_LUA_ENGINE=Lua)
else()
find_package(LuaJit)
if(LUAJIT_FOUND)
list(APPEND LUV_CONFIGURE_COMMAND_COMMON -DWITH_LUA_ENGINE=LuaJit)
else()
list(APPEND LUV_CONFIGURE_COMMAND_COMMON -DWITH_LUA_ENGINE=Lua)
endif()
endif()
if(USE_BUNDLED_LIBUV)
set(LUV_CONFIGURE_COMMAND_COMMON
${LUV_CONFIGURE_COMMAND_COMMON}
-DCMAKE_PREFIX_PATH=${DEPS_INSTALL_DIR}
-DLIBUV_LIBRARIES=uv_a)
endif()
if(MSVC)
set(LUV_CONFIGURE_COMMAND
${LUV_CONFIGURE_COMMAND_COMMON}
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM}
# Same as Unix without fPIC
"-DCMAKE_C_FLAGS:STRING=${CMAKE_C_COMPILER_ARG1} ${LUV_INCLUDE_FLAGS}"
# Make sure we use the same generator, otherwise we may
# accidentally end up using different MSVC runtimes
-DCMAKE_GENERATOR=${CMAKE_GENERATOR})
else()
set(LUV_CONFIGURE_COMMAND
${LUV_CONFIGURE_COMMAND_COMMON}
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
"-DCMAKE_C_FLAGS:STRING=${CMAKE_C_COMPILER_ARG1} ${LUV_INCLUDE_FLAGS} -fPIC")
if(CMAKE_GENERATOR MATCHES "Unix Makefiles" AND
(CMAKE_SYSTEM_NAME MATCHES ".*BSD" OR CMAKE_SYSTEM_NAME MATCHES "DragonFly"))
set(LUV_CONFIGURE_COMMAND ${LUV_CONFIGURE_COMMAND} -DCMAKE_MAKE_PROGRAM=gmake)
endif()
endif()
ExternalProject_Add(lua-compat-5.3
PREFIX ${DEPS_BUILD_DIR}
URL ${LUA_COMPAT53_URL}
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/lua-compat-5.3
DOWNLOAD_COMMAND ${CMAKE_COMMAND}
-DPREFIX=${DEPS_BUILD_DIR}
-DDOWNLOAD_DIR=${DEPS_DOWNLOAD_DIR}/lua-compat-5.3
-DURL=${LUA_COMPAT53_URL}
-DEXPECTED_SHA256=${LUA_COMPAT53_SHA256}
-DTARGET=lua-compat-5.3
-DUSE_EXISTING_SRC_DIR=${USE_EXISTING_SRC_DIR}
-P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/DownloadAndExtractFile.cmake
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND "")
ExternalProject_Add(luv-static
PREFIX ${DEPS_BUILD_DIR}
DEPENDS lua-compat-5.3
URL ${LUV_URL}
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/luv
DOWNLOAD_COMMAND ${CMAKE_COMMAND}
-DPREFIX=${DEPS_BUILD_DIR}
-DDOWNLOAD_DIR=${DEPS_DOWNLOAD_DIR}/luv
-DURL=${LUV_URL}
-DEXPECTED_SHA256=${LUV_SHA256}
-DTARGET=luv-static
# The source is shared with BuildLuarocks (with USE_BUNDLED_LUV).
-DSRC_DIR=${DEPS_BUILD_DIR}/src/luv
-DUSE_EXISTING_SRC_DIR=${USE_EXISTING_SRC_DIR}
-P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/DownloadAndExtractFile.cmake
CONFIGURE_COMMAND "${LUV_CONFIGURE_COMMAND}"
BUILD_COMMAND ${CMAKE_COMMAND} --build . --config $<CONFIG>
INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install --config $<CONFIG>
LIST_SEPARATOR |)
list(APPEND THIRD_PARTY_DEPS luv-static)
if(USE_BUNDLED_LUAJIT)
add_dependencies(luv-static luajit)
elseif(USE_BUNDLED_LUA)
add_dependencies(luv-static lua)
endif()
if(USE_BUNDLED_LIBUV)
add_dependencies(luv-static libuv)
endif()

View File

@@ -1,42 +0,0 @@
set(MSGPACK_CONFIGURE_COMMAND ${CMAKE_COMMAND} ${DEPS_BUILD_DIR}/src/msgpack
-DMSGPACK_BUILD_TESTS=OFF
-DMSGPACK_BUILD_EXAMPLES=OFF
-DCMAKE_INSTALL_PREFIX=${DEPS_INSTALL_DIR}
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES_ALT_SEP}
"-DCMAKE_C_FLAGS:STRING=${CMAKE_C_COMPILER_ARG1} -fPIC"
-DCMAKE_GENERATOR=${CMAKE_GENERATOR})
if(MSVC)
# Same as Unix without fPIC
set(MSGPACK_CONFIGURE_COMMAND ${CMAKE_COMMAND} ${DEPS_BUILD_DIR}/src/msgpack
-DMSGPACK_BUILD_TESTS=OFF
-DMSGPACK_BUILD_EXAMPLES=OFF
-DCMAKE_INSTALL_PREFIX=${DEPS_INSTALL_DIR}
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM}
${BUILD_TYPE_STRING}
"-DCMAKE_C_FLAGS:STRING=${CMAKE_C_COMPILER_ARG1}"
# Make sure we use the same generator, otherwise we may
# accidentally end up using different MSVC runtimes
-DCMAKE_GENERATOR=${CMAKE_GENERATOR})
endif()
ExternalProject_Add(msgpack
PREFIX ${DEPS_BUILD_DIR}
URL ${MSGPACK_URL}
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/msgpack
DOWNLOAD_COMMAND ${CMAKE_COMMAND}
-DPREFIX=${DEPS_BUILD_DIR}
-DDOWNLOAD_DIR=${DEPS_DOWNLOAD_DIR}/msgpack
-DURL=${MSGPACK_URL}
-DEXPECTED_SHA256=${MSGPACK_SHA256}
-DTARGET=msgpack
-DUSE_EXISTING_SRC_DIR=${USE_EXISTING_SRC_DIR}
-P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/DownloadAndExtractFile.cmake
CONFIGURE_COMMAND "${MSGPACK_CONFIGURE_COMMAND}"
BUILD_COMMAND ${CMAKE_COMMAND} --build . --config $<CONFIG>
INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install --config $<CONFIG>
LIST_SEPARATOR |)
list(APPEND THIRD_PARTY_DEPS msgpack)

View File

@@ -1,38 +0,0 @@
if(MSVC)
set(TREESITTER_CONFIGURE_COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/cmake/TreesitterCMakeLists.txt
${DEPS_BUILD_DIR}/src/tree-sitter/CMakeLists.txt
COMMAND ${CMAKE_COMMAND} ${DEPS_BUILD_DIR}/src/tree-sitter/CMakeLists.txt
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_GENERATOR=${CMAKE_GENERATOR}
-DCMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM}
${BUILD_TYPE_STRING}
-DCMAKE_INSTALL_PREFIX=${DEPS_INSTALL_DIR})
set(TREESITTER_BUILD_COMMAND ${CMAKE_COMMAND} --build . --config $<CONFIG>)
set(TREESITTER_INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install --config $<CONFIG>)
else()
set(TS_CFLAGS "-O3 -Wall -Wextra")
set(TREESITTER_BUILD_COMMAND ${MAKE_PRG} CC=${DEPS_C_COMPILER} CFLAGS=${TS_CFLAGS})
set(TREESITTER_INSTALL_COMMAND
${MAKE_PRG} CC=${DEPS_C_COMPILER} PREFIX=${DEPS_INSTALL_DIR} install)
endif()
ExternalProject_Add(tree-sitter
PREFIX ${DEPS_BUILD_DIR}
URL ${TREESITTER_URL}
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/tree-sitter
INSTALL_DIR ${DEPS_INSTALL_DIR}
DOWNLOAD_COMMAND ${CMAKE_COMMAND}
-DPREFIX=${DEPS_BUILD_DIR}
-DDOWNLOAD_DIR=${DEPS_DOWNLOAD_DIR}/tree-sitter
-DURL=${TREESITTER_URL}
-DEXPECTED_SHA256=${TREESITTER_SHA256}
-DTARGET=tree-sitter
-DUSE_EXISTING_SRC_DIR=${USE_EXISTING_SRC_DIR}
-P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/DownloadAndExtractFile.cmake
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND "${TREESITTER_CONFIGURE_COMMAND}"
BUILD_COMMAND "${TREESITTER_BUILD_COMMAND}"
INSTALL_COMMAND "${TREESITTER_INSTALL_COMMAND}")
list(APPEND THIRD_PARTY_DEPS tree-sitter)

View File

@@ -1,28 +0,0 @@
function(BuildTSParser LANG TS_URL TS_SHA256 TS_CMAKE_FILE)
set(NAME treesitter-${LANG})
ExternalProject_Add(${NAME}
PREFIX ${DEPS_BUILD_DIR}
URL ${TREESITTER_C_URL}
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/${NAME}
CMAKE_CACHE_ARGS
-DCMAKE_OSX_ARCHITECTURES:STRING=${CMAKE_OSX_ARCHITECTURES}
DOWNLOAD_COMMAND ${CMAKE_COMMAND}
-DPREFIX=${DEPS_BUILD_DIR}
-DDOWNLOAD_DIR=${DEPS_DOWNLOAD_DIR}/${NAME}
-DURL=${TS_URL}
-DEXPECTED_SHA256=${TS_SHA256}
-DTARGET=${NAME}
-DUSE_EXISTING_SRC_DIR=${USE_EXISTING_SRC_DIR}
-P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/DownloadAndExtractFile.cmake
PATCH_COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/cmake/${TS_CMAKE_FILE}
${DEPS_BUILD_DIR}/src/${NAME}/CMakeLists.txt
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${DEPS_INSTALL_DIR}
-DPARSERLANG=${LANG})
endfunction()
BuildTSParser(c ${TREESITTER_C_URL} ${TREESITTER_C_SHA256} TreesitterParserCMakeLists.txt)
BuildTSParser(lua ${TREESITTER_LUA_URL} ${TREESITTER_LUA_SHA256} TreesitterParserCMakeLists.txt)
BuildTSParser(vim ${TREESITTER_VIM_URL} ${TREESITTER_VIM_SHA256} TreesitterParserCMakeLists.txt)
BuildTSParser(help ${TREESITTER_HELP_URL} ${TREESITTER_HELP_SHA256} TreesitterParserCMakeLists.txt)

View File

@@ -1,37 +0,0 @@
if(WIN32)
set(UNIBILIUM_CONFIGURE_COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/cmake/UnibiliumCMakeLists.txt
${DEPS_BUILD_DIR}/src/unibilium/CMakeLists.txt
COMMAND ${CMAKE_COMMAND} ${DEPS_BUILD_DIR}/src/unibilium
-DCMAKE_INSTALL_PREFIX=${DEPS_INSTALL_DIR}
# Pass toolchain
-DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN}
-DCMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM}
${BUILD_TYPE_STRING}
-DCMAKE_GENERATOR=${CMAKE_GENERATOR})
set(UNIBILIUM_BUILD_COMMAND ${CMAKE_COMMAND} --build . --config $<CONFIG>)
set(UNIBILIUM_INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install --config $<CONFIG>)
else()
set(UNIBILIUM_BUILD_COMMAND ${MAKE_PRG} CC=${DEPS_C_COMPILER}
PREFIX=${DEPS_INSTALL_DIR} CFLAGS=-fPIC LDFLAGS+=-static
BUILD_IN_SOURCE 1)
set(UNIBILIUM_INSTALL_COMMAND ${MAKE_PRG} PREFIX=${DEPS_INSTALL_DIR} install)
endif()
ExternalProject_Add(unibilium
PREFIX ${DEPS_BUILD_DIR}
URL ${UNIBILIUM_URL}
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/unibilium
DOWNLOAD_COMMAND ${CMAKE_COMMAND}
-DPREFIX=${DEPS_BUILD_DIR}
-DDOWNLOAD_DIR=${DEPS_DOWNLOAD_DIR}/unibilium
-DURL=${UNIBILIUM_URL}
-DEXPECTED_SHA256=${UNIBILIUM_SHA256}
-DTARGET=unibilium
-DUSE_EXISTING_SRC_DIR=${USE_EXISTING_SRC_DIR}
-P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/DownloadAndExtractFile.cmake
CONFIGURE_COMMAND "${UNIBILIUM_CONFIGURE_COMMAND}"
BUILD_COMMAND "${UNIBILIUM_BUILD_COMMAND}"
INSTALL_COMMAND "${UNIBILIUM_INSTALL_COMMAND}")
list(APPEND THIRD_PARTY_DEPS unibilium)

View File

@@ -1,117 +0,0 @@
From 326a1845f924432332071d03d156b7df4af7c46f Mon Sep 17 00:00:00 2001
From: Tim Tavlintsev <ttavlintsev@enttec.com>
Date: Thu, 21 Jul 2022 16:42:21 +1000
Subject: [PATCH] Add CMake option LIBUV_BUILD_SHARED to enable/disable shared
library build Fix #3637
---
CMakeLists.txt | 66 +++++++++++++++++++++++++++++---------------------
1 file changed, 38 insertions(+), 28 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2c42c3ff..a8e19980 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -28,6 +28,8 @@ cmake_dependent_option(LIBUV_BUILD_BENCH
"Build the benchmarks when building unit tests and we are the root project" ON
"LIBUV_BUILD_TESTS" OFF)
+option(LIBUV_BUILD_SHARED "Build shared lib" ON)
+
# Qemu Build
option(QEMU "build for qemu" OFF)
if(QEMU)
@@ -390,25 +392,27 @@ if(APPLE OR CMAKE_SYSTEM_NAME MATCHES "DragonFly|FreeBSD|Linux|NetBSD|OpenBSD")
list(APPEND uv_test_libraries util)
endif()
-add_library(uv SHARED ${uv_sources})
-target_compile_definitions(uv
- INTERFACE
- USING_UV_SHARED=1
- PRIVATE
- BUILDING_UV_SHARED=1
- ${uv_defines})
-target_compile_options(uv PRIVATE ${uv_cflags})
-target_include_directories(uv
- PUBLIC
- $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
- $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
- PRIVATE
- $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src>)
-if(CMAKE_SYSTEM_NAME STREQUAL "OS390")
- target_include_directories(uv PUBLIC $<BUILD_INTERFACE:${ZOSLIB_DIR}/include>)
- set_target_properties(uv PROPERTIES LINKER_LANGUAGE CXX)
+if(LIBUV_BUILD_SHARED)
+ add_library(uv SHARED ${uv_sources})
+ target_compile_definitions(uv
+ INTERFACE
+ USING_UV_SHARED=1
+ PRIVATE
+ BUILDING_UV_SHARED=1
+ ${uv_defines})
+ target_compile_options(uv PRIVATE ${uv_cflags})
+ target_include_directories(uv
+ PUBLIC
+ $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
+ PRIVATE
+ $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src>)
+ if(CMAKE_SYSTEM_NAME STREQUAL "OS390")
+ target_include_directories(uv PUBLIC $<BUILD_INTERFACE:${ZOSLIB_DIR}/include>)
+ set_target_properties(uv PROPERTIES LINKER_LANGUAGE CXX)
+ endif()
+ target_link_libraries(uv ${uv_libraries})
endif()
-target_link_libraries(uv ${uv_libraries})
add_library(uv_a STATIC ${uv_sources})
target_compile_definitions(uv_a PRIVATE ${uv_defines})
@@ -669,28 +673,34 @@ string(REPLACE ";" " " LIBS "${LIBS}")
file(STRINGS configure.ac configure_ac REGEX ^AC_INIT)
string(REGEX MATCH "([0-9]+)[.][0-9]+[.][0-9]+" PACKAGE_VERSION "${configure_ac}")
set(UV_VERSION_MAJOR "${CMAKE_MATCH_1}")
-# The version in the filename is mirroring the behaviour of autotools.
-set_target_properties(uv PROPERTIES
- VERSION ${UV_VERSION_MAJOR}.0.0
- SOVERSION ${UV_VERSION_MAJOR})
+
set(includedir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR})
set(libdir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR})
set(prefix ${CMAKE_INSTALL_PREFIX})
-configure_file(libuv.pc.in libuv.pc @ONLY)
configure_file(libuv-static.pc.in libuv-static.pc @ONLY)
install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
install(FILES LICENSE DESTINATION ${CMAKE_INSTALL_DOCDIR})
-install(FILES ${PROJECT_BINARY_DIR}/libuv.pc ${PROJECT_BINARY_DIR}/libuv-static.pc
+install(FILES ${PROJECT_BINARY_DIR}/libuv-static.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
-install(TARGETS uv EXPORT libuvConfig
- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(TARGETS uv_a EXPORT libuvConfig
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(EXPORT libuvConfig DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libuv)
+if(LIBUV_BUILD_SHARED)
+ # The version in the filename is mirroring the behaviour of autotools.
+ set_target_properties(uv PROPERTIES
+ VERSION ${UV_VERSION_MAJOR}.0.0
+ SOVERSION ${UV_VERSION_MAJOR})
+ configure_file(libuv.pc.in libuv.pc @ONLY)
+ install(FILES ${PROJECT_BINARY_DIR}/libuv.pc
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
+ install(TARGETS uv EXPORT libuvConfig
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
+endif()
+
if(MSVC)
set(CMAKE_DEBUG_POSTFIX d)
endif()
--
2.37.0

View File

@@ -1,64 +0,0 @@
set(CPACK_PACKAGE_NAME "Neovim")
set(CPACK_PACKAGE_VENDOR "neovim.io")
set(CPACK_PACKAGE_FILE_NAME "nvim")
# From the GitHub About section
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Vim-fork focused on extensibility and usability.")
set(CPACK_PACKAGE_INSTALL_DIRECTORY ${CPACK_PACKAGE_NAME})
# Pull the versions defined with the top level CMakeLists.txt
set(CPACK_PACKAGE_VERSION_MAJOR ${NVIM_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${NVIM_VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${NVIM_VERSION_PATCH})
# CPACK_VERBATIM_VARIABLES ensures that the variables prefixed with *CPACK_*
# are correctly passed to the cpack program.
# This should always be set to true.
set(CPACK_VERBATIM_VARIABLES TRUE)
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE.txt")
set(CPACK_RESOURCE_FILE_README ${PROJECT_SOURCE_DIR}/README.md)
if(WIN32)
set(CPACK_PACKAGE_FILE_NAME "nvim-win64")
set(CPACK_GENERATOR ZIP WIX)
# WIX
# CPACK_WIX_UPGRADE_GUID should be set, but should never change.
# CPACK_WIX_PRODUCT_GUID should not be set (leave as default to auto-generate).
# The following guid is just a randomly generated guid that's been pasted here.
# It has no special meaning other than to supply it to WIX.
set(CPACK_WIX_UPGRADE_GUID "207A1A70-7B0C-418A-A153-CA6883E38F4D")
set(CPACK_WIX_PRODUCT_ICON ${CMAKE_CURRENT_LIST_DIR}/neovim.ico)
# We use a wix patch to add further options to the installer. At present, it's just to add neovim to the path
# on installation, however, it can be extended.
# See: https://cmake.org/cmake/help/v3.7/module/CPackWIX.html#variable:CPACK_WIX_PATCH_FILE
list(APPEND CPACK_WIX_EXTENSIONS WixUtilExtension)
list(APPEND CPACK_WIX_PATCH_FILE ${CMAKE_CURRENT_LIST_DIR}/WixPatch.xml)
elseif(APPLE)
set(CPACK_PACKAGE_FILE_NAME "nvim-macos")
set(CPACK_GENERATOR TGZ)
set(CPACK_PACKAGE_ICON ${CMAKE_CURRENT_LIST_DIR}/neovim.icns)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(CPACK_PACKAGE_FILE_NAME "nvim-linux64")
set(CPACK_GENERATOR TGZ DEB)
set(CPACK_DEBIAN_PACKAGE_NAME "Neovim") # required
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Neovim.io") # required
# Automatically compute required shared lib dependencies.
# Unfortunately, you "just need to know" that this has a hidden
# dependency on dpkg-shlibdeps whilst using a debian based host.
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS TRUE)
else()
set(CPACK_GENERATOR TGZ)
endif()
# CPack variables are loaded in on the call to include(CPack). If you set
# variables *after* the inclusion, they don't get updated within the CPack
# config. Note that some CPack commands should still be run after it, such
# as cpack_add_component().
include(CPack)

View File

@@ -1,14 +0,0 @@
<CPackWiXPatch>
<!-- Fragment ID is from: <your build dir>/_CPack_Packages/win64/WIX/files.wxs -->
<CPackWiXFragment Id="CM_CP_bin.nvim.exe">
<Environment
Id='UpdatePath'
Name='PATH'
Action='set'
Permanent='no'
System='yes'
Part='last'
Value='[INSTALL_ROOT]bin'
/>
</CPackWiXFragment>
</CPackWiXPatch>

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

View File

@@ -1,147 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:sketch="http://www.bohemiancoding.com/sketch/ns"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="256"
height="256"
viewBox="0 0 256 256"
version="1.1"
id="svg4612"
sodipodi:docname="neovim.svg"
inkscape:version="0.92.4 5da689c313, 2019-01-14">
<metadata
id="metadata4616">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title>neovim-mark@2x</dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="2560"
inkscape:window-height="1333"
id="namedview4614"
showgrid="false"
inkscape:zoom="2.1945358"
inkscape:cx="132.84232"
inkscape:cy="196.34741"
inkscape:window-x="0"
inkscape:window-y="34"
inkscape:window-maximized="1"
inkscape:current-layer="svg4612" />
<title
id="title4587">neovim-mark@2x</title>
<description>Created with Sketch (http://www.bohemiancoding.com/sketch)</description>
<defs
id="defs4604">
<linearGradient
x1="167.95833"
y1="-0.46142399"
x2="167.95833"
y2="335.45523"
id="linearGradient-1"
gradientTransform="scale(0.46142398,2.1672042)"
gradientUnits="userSpaceOnUse">
<stop
stop-color="#16B0ED"
stop-opacity="0.800235524"
offset="0%"
id="stop4589" />
<stop
stop-color="#0F59B2"
stop-opacity="0.83700023"
offset="100%"
id="stop4591" />
</linearGradient>
<linearGradient
x1="1118.3427"
y1="-0.46586797"
x2="1118.3427"
y2="338.68604"
id="linearGradient-2"
gradientTransform="scale(0.46586797,2.1465309)"
gradientUnits="userSpaceOnUse">
<stop
stop-color="#7DB643"
offset="0%"
id="stop4594" />
<stop
stop-color="#367533"
offset="100%"
id="stop4596" />
</linearGradient>
<linearGradient
x1="356.33795"
y1="0"
x2="356.33795"
y2="612.90131"
id="linearGradient-3"
gradientTransform="scale(0.84189739,1.1877932)"
gradientUnits="userSpaceOnUse">
<stop
stop-color="#88C649"
stop-opacity="0.8"
offset="0%"
id="stop4599" />
<stop
stop-color="#439240"
stop-opacity="0.84"
offset="100%"
id="stop4601" />
</linearGradient>
</defs>
<g
id="Page-1"
sketch:type="MSPage"
style="fill:none;fill-rule:evenodd;stroke:none;stroke-width:1"
transform="matrix(0.34367476,0,0,0.34367476,25.312651,1.7737533)">
<g
id="mark-copy"
sketch:type="MSLayerGroup"
transform="translate(2,3)">
<path
d="M 0,155.5704 155,-1 V 727 L 0,572.23792 Z"
id="Left---green"
sketch:type="MSShapeGroup"
inkscape:connector-curvature="0"
style="fill:url(#linearGradient-1)" />
<path
d="M 443.0604,156.9824 600,-1 596.81879,727 442,572.21994 Z"
id="Right---blue"
sketch:type="MSShapeGroup"
transform="matrix(-1,0,0,1,1042,0)"
inkscape:connector-curvature="0"
style="fill:url(#linearGradient-2)" />
<path
d="M 154.98629,0 558,615.1897 445.2246,728 42,114.17202 Z"
id="Cross---blue"
sketch:type="MSShapeGroup"
inkscape:connector-curvature="0"
style="fill:url(#linearGradient-3)" />
<path
d="M 155,283.83232 154.78675,308 31,124.71061 42.461949,113 Z"
id="Shadow"
sketch:type="MSShapeGroup"
inkscape:connector-curvature="0"
style="fill:#000000;fill-opacity:0.12999998" />
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 4.3 KiB

View File

@@ -1,13 +0,0 @@
if(UNCRUSTIFY_PRG)
execute_process(COMMAND uncrustify --version
OUTPUT_VARIABLE user_version
OUTPUT_STRIP_TRAILING_WHITESPACE)
string(REGEX REPLACE "[A-Za-z_#-]" "" user_version ${user_version})
file(STRINGS ${CONFIG_FILE} required_version LIMIT_COUNT 1)
string(REGEX REPLACE "[A-Za-z_# -]" "" required_version ${required_version})
if(NOT user_version STREQUAL required_version)
message(FATAL_ERROR "Wrong uncrustify version! Required version is ${required_version} but found ${user_version}")
endif()
endif()

View File

@@ -41,16 +41,6 @@ endif()
if (MSVC) if (MSVC)
list(APPEND CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARY}) list(APPEND CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARY})
endif() endif()
# On macOS, if libintl is a static library then we also need
# to link libiconv and CoreFoundation.
get_filename_component(LibIntl_EXT "${LibIntl_LIBRARY}" EXT)
if (APPLE AND (LibIntl_EXT STREQUAL ".a"))
set(LibIntl_STATIC TRUE)
find_library(CoreFoundation_FRAMEWORK CoreFoundation)
list(APPEND CMAKE_REQUIRED_LIBRARIES "${ICONV_LIBRARY}" "${CoreFoundation_FRAMEWORK}")
endif()
check_c_source_compiles(" check_c_source_compiles("
#include <libintl.h> #include <libintl.h>
@@ -64,9 +54,6 @@ int main(int argc, char** argv) {
if (MSVC) if (MSVC)
list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARY}) list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARY})
endif() endif()
if (LibIntl_STATIC)
list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES "${ICONV_LIBRARY}" "${CoreFoundation_FRAMEWORK}")
endif()
if (LibIntl_INCLUDE_DIR) if (LibIntl_INCLUDE_DIR)
list(REMOVE_ITEM CMAKE_REQUIRED_INCLUDES "${LibIntl_INCLUDE_DIR}") list(REMOVE_ITEM CMAKE_REQUIRED_INCLUDES "${LibIntl_INCLUDE_DIR}")
endif() endif()

View File

@@ -15,7 +15,7 @@ find_path(LIBLUV_INCLUDE_DIR luv/luv.h
PATHS ${PC_LIBLUV_INCLUDEDIR} ${PC_LIBLUV_INCLUDE_DIRS}) PATHS ${PC_LIBLUV_INCLUDEDIR} ${PC_LIBLUV_INCLUDE_DIRS})
# Explicitly look for luv.so. #10407 # Explicitly look for luv.so. #10407
list(APPEND LIBLUV_NAMES luv_a luv libluv_a luv${CMAKE_SHARED_LIBRARY_SUFFIX}) list(APPEND LIBLUV_NAMES luv luv${CMAKE_SHARED_LIBRARY_SUFFIX})
find_library(LIBLUV_LIBRARY NAMES ${LIBLUV_NAMES} find_library(LIBLUV_LIBRARY NAMES ${LIBLUV_NAMES}
HINTS ${PC_LIBLUV_LIBDIR} ${PC_LIBLUV_LIBRARY_DIRS}) HINTS ${PC_LIBLUV_LIBDIR} ${PC_LIBLUV_LIBRARY_DIRS})

View File

@@ -13,7 +13,7 @@ endif()
find_path(LIBUV_INCLUDE_DIR uv.h find_path(LIBUV_INCLUDE_DIR uv.h
HINTS ${PC_LIBUV_INCLUDEDIR} ${PC_LIBUV_INCLUDE_DIRS}) HINTS ${PC_LIBUV_INCLUDEDIR} ${PC_LIBUV_INCLUDE_DIRS})
list(APPEND LIBUV_NAMES uv_a uv) list(APPEND LIBUV_NAMES uv)
find_library(LIBUV_LIBRARY NAMES ${LIBUV_NAMES} find_library(LIBUV_LIBRARY NAMES ${LIBUV_NAMES}
HINTS ${PC_LIBUV_LIBDIR} ${PC_LIBUV_LIBRARY_DIRS}) HINTS ${PC_LIBUV_LIBDIR} ${PC_LIBUV_LIBRARY_DIRS})
@@ -75,14 +75,6 @@ if(WIN32)
list(APPEND LIBUV_LIBRARIES ws2_32) list(APPEND LIBUV_LIBRARIES ws2_32)
endif() endif()
find_package(Threads)
if(Threads_FOUND)
# TODO: Fix the cmake file to properly handle static deps for bundled builds.
# Meanwhile just include the threads library if CMake tells us there's one to
# use.
list(APPEND LIBUV_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
endif()
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set LIBUV_FOUND to TRUE # handle the QUIETLY and REQUIRED arguments and set LIBUV_FOUND to TRUE

197
cmake/FindLua.cmake Normal file
View File

@@ -0,0 +1,197 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#.rst:
# FindLua
# -------
#
#
#
# Locate Lua library This module defines
#
# ::
#
# LUA_FOUND - if false, do not try to link to Lua
# LUA_LIBRARIES - both lua and lualib
# LUA_INCLUDE_DIR - where to find lua.h
# LUA_VERSION_STRING - the version of Lua found
# LUA_VERSION_MAJOR - the major version of Lua
# LUA_VERSION_MINOR - the minor version of Lua
# LUA_VERSION_PATCH - the patch version of Lua
#
#
#
# Note that the expected include convention is
#
# ::
#
# #include "lua.h"
#
# and not
#
# ::
#
# #include <lua/lua.h>
#
# This is because, the lua location is not standardized and may exist in
# locations other than lua/
unset(_lua_include_subdirs)
unset(_lua_library_names)
unset(_lua_append_versions)
# this is a function only to have all the variables inside go away automatically
function(_lua_set_version_vars)
set(LUA_VERSIONS5 5.4 5.3 5.2 5.1 5.0)
if (Lua_FIND_VERSION_EXACT)
if (Lua_FIND_VERSION_COUNT GREATER 1)
set(_lua_append_versions ${Lua_FIND_VERSION_MAJOR}.${Lua_FIND_VERSION_MINOR})
endif ()
elseif (Lua_FIND_VERSION)
# once there is a different major version supported this should become a loop
if (NOT Lua_FIND_VERSION_MAJOR GREATER 5)
if (Lua_FIND_VERSION_COUNT EQUAL 1)
set(_lua_append_versions ${LUA_VERSIONS5})
else ()
foreach (subver IN LISTS LUA_VERSIONS5)
if (NOT subver VERSION_LESS ${Lua_FIND_VERSION})
list(APPEND _lua_append_versions ${subver})
endif ()
endforeach ()
endif ()
endif ()
else ()
# once there is a different major version supported this should become a loop
set(_lua_append_versions ${LUA_VERSIONS5})
endif ()
list(APPEND _lua_include_subdirs "include/lua" "include")
foreach (ver IN LISTS _lua_append_versions)
string(REGEX MATCH "^([0-9]+)\\.([0-9]+)$" _ver "${ver}")
list(APPEND _lua_include_subdirs
include/lua${CMAKE_MATCH_1}${CMAKE_MATCH_2}
include/lua${CMAKE_MATCH_1}.${CMAKE_MATCH_2}
include/lua-${CMAKE_MATCH_1}.${CMAKE_MATCH_2}
)
endforeach ()
set(_lua_include_subdirs "${_lua_include_subdirs}" PARENT_SCOPE)
set(_lua_append_versions "${_lua_append_versions}" PARENT_SCOPE)
endfunction(_lua_set_version_vars)
function(_lua_check_header_version _hdr_file)
# At least 5.[012] have different ways to express the version
# so all of them need to be tested. Lua 5.2 defines LUA_VERSION
# and LUA_RELEASE as joined by the C preprocessor, so avoid those.
file(STRINGS "${_hdr_file}" lua_version_strings
REGEX "^#define[ \t]+LUA_(RELEASE[ \t]+\"Lua [0-9]|VERSION([ \t]+\"Lua [0-9]|_[MR])).*")
string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_MAJOR[ \t]+\"([0-9])\"[ \t]*;.*" "\\1" LUA_VERSION_MAJOR ";${lua_version_strings};")
if (LUA_VERSION_MAJOR MATCHES "^[0-9]+$")
string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_MINOR[ \t]+\"([0-9])\"[ \t]*;.*" "\\1" LUA_VERSION_MINOR ";${lua_version_strings};")
string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_RELEASE[ \t]+\"([0-9])\"[ \t]*;.*" "\\1" LUA_VERSION_PATCH ";${lua_version_strings};")
set(LUA_VERSION_STRING "${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}.${LUA_VERSION_PATCH}")
else ()
string(REGEX REPLACE ".*;#define[ \t]+LUA_RELEASE[ \t]+\"Lua ([0-9.]+)\"[ \t]*;.*" "\\1" LUA_VERSION_STRING ";${lua_version_strings};")
if (NOT LUA_VERSION_STRING MATCHES "^[0-9.]+$")
string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION[ \t]+\"Lua ([0-9.]+)\"[ \t]*;.*" "\\1" LUA_VERSION_STRING ";${lua_version_strings};")
endif ()
string(REGEX REPLACE "^([0-9]+)\\.[0-9.]*$" "\\1" LUA_VERSION_MAJOR "${LUA_VERSION_STRING}")
string(REGEX REPLACE "^[0-9]+\\.([0-9]+)[0-9.]*$" "\\1" LUA_VERSION_MINOR "${LUA_VERSION_STRING}")
string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]).*" "\\1" LUA_VERSION_PATCH "${LUA_VERSION_STRING}")
endif ()
foreach (ver IN LISTS _lua_append_versions)
if (ver STREQUAL "${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}")
set(LUA_VERSION_MAJOR ${LUA_VERSION_MAJOR} PARENT_SCOPE)
set(LUA_VERSION_MINOR ${LUA_VERSION_MINOR} PARENT_SCOPE)
set(LUA_VERSION_PATCH ${LUA_VERSION_PATCH} PARENT_SCOPE)
set(LUA_VERSION_STRING ${LUA_VERSION_STRING} PARENT_SCOPE)
return()
endif ()
endforeach ()
endfunction(_lua_check_header_version)
_lua_set_version_vars()
if (LUA_INCLUDE_DIR AND EXISTS "${LUA_INCLUDE_DIR}/lua.h")
_lua_check_header_version("${LUA_INCLUDE_DIR}/lua.h")
endif ()
if (NOT LUA_VERSION_STRING)
foreach (subdir IN LISTS _lua_include_subdirs)
unset(LUA_INCLUDE_PREFIX CACHE)
find_path(LUA_INCLUDE_PREFIX ${subdir}/lua.h
HINTS
ENV LUA_DIR
PATHS
~/Library/Frameworks
/Library/Frameworks
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
/opt
)
if (LUA_INCLUDE_PREFIX)
_lua_check_header_version("${LUA_INCLUDE_PREFIX}/${subdir}/lua.h")
if (LUA_VERSION_STRING)
set(LUA_INCLUDE_DIR "${LUA_INCLUDE_PREFIX}/${subdir}")
break()
endif ()
endif ()
endforeach ()
endif ()
unset(_lua_include_subdirs)
unset(_lua_append_versions)
if (LUA_VERSION_STRING)
set(_lua_library_names
lua${LUA_VERSION_MAJOR}${LUA_VERSION_MINOR}
lua${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}
lua-${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}
lua.${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}
)
endif ()
find_library(LUA_LIBRARY
NAMES ${_lua_library_names} lua
HINTS
ENV LUA_DIR
PATH_SUFFIXES lib
PATHS
~/Library/Frameworks
/Library/Frameworks
/sw
/opt/local
/opt/csw
/opt
)
unset(_lua_library_names)
if (LUA_LIBRARY)
# include the math library for Unix
if (UNIX AND NOT APPLE AND NOT BEOS)
find_library(LUA_MATH_LIBRARY m)
set(LUA_LIBRARIES "${LUA_LIBRARY};${LUA_MATH_LIBRARY}")
# include dl library for statically-linked Lua library
get_filename_component(LUA_LIB_EXT ${LUA_LIBRARY} EXT)
if(LUA_LIB_EXT STREQUAL CMAKE_STATIC_LIBRARY_SUFFIX)
list(APPEND LUA_LIBRARIES ${CMAKE_DL_LIBS})
endif()
# For Windows and Mac, don't need to explicitly include the math library
else ()
set(LUA_LIBRARIES "${LUA_LIBRARY}")
endif ()
endif ()
include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if
# all listed variables are TRUE
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lua
REQUIRED_VARS LUA_LIBRARIES LUA_INCLUDE_DIR
VERSION_VAR LUA_VERSION_STRING)
mark_as_advanced(LUA_INCLUDE_DIR LUA_LIBRARY LUA_MATH_LIBRARY)

10
cmake/FindWinpty.cmake Normal file
View File

@@ -0,0 +1,10 @@
include(LibFindMacros)
find_path(WINPTY_INCLUDE_DIR winpty.h)
set(WINPTY_INCLUDE_DIRS ${WINPTY_INCLUDE_DIR})
find_library(WINPTY_LIBRARY winpty)
find_program(WINPTY_AGENT_EXE winpty-agent.exe)
set(WINPTY_LIBRARIES ${WINPTY_LIBRARY})
find_package_handle_standard_args(Winpty DEFAULT_MSG WINPTY_LIBRARY WINPTY_INCLUDE_DIR)

View File

@@ -1,67 +0,0 @@
# Returns a list of all files that has been changed in current branch compared
# to master branch. This includes unstaged, staged and committed files.
function(get_changed_files outvar)
set(default_branch master)
execute_process(
COMMAND git branch --show-current
OUTPUT_VARIABLE current_branch
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(
COMMAND git merge-base ${default_branch} ${current_branch}
OUTPUT_VARIABLE ancestor_commit
OUTPUT_STRIP_TRAILING_WHITESPACE)
# Changed files that have been committed
execute_process(
COMMAND git diff --name-only ${ancestor_commit}...${current_branch}
OUTPUT_VARIABLE committed_files
OUTPUT_STRIP_TRAILING_WHITESPACE)
separate_arguments(committed_files NATIVE_COMMAND ${committed_files})
# Unstaged files
execute_process(
COMMAND git diff --name-only
OUTPUT_VARIABLE unstaged_files
OUTPUT_STRIP_TRAILING_WHITESPACE)
separate_arguments(unstaged_files NATIVE_COMMAND ${unstaged_files})
# Staged files
execute_process(
COMMAND git diff --cached --name-only
OUTPUT_VARIABLE staged_files
OUTPUT_STRIP_TRAILING_WHITESPACE)
separate_arguments(staged_files NATIVE_COMMAND ${staged_files})
set(files ${committed_files} ${unstaged_files} ${staged_files})
list(REMOVE_DUPLICATES files)
set(${outvar} "${files}" PARENT_SCOPE)
endfunction()
get_changed_files(changed_files)
if(LANG STREQUAL c)
list(FILTER changed_files INCLUDE REGEX "\\.[ch]$")
list(FILTER changed_files INCLUDE REGEX "^src/nvim/")
if(changed_files)
if(FORMAT_PRG)
execute_process(COMMAND ${FORMAT_PRG} -c "src/uncrustify.cfg" --replace --no-backup ${changed_files})
else()
message(STATUS "Uncrustify not found. Skip formatting C files.")
endif()
endif()
elseif(LANG STREQUAL lua)
list(FILTER changed_files INCLUDE REGEX "\\.lua$")
list(FILTER changed_files INCLUDE REGEX "^runtime/")
if(changed_files)
if(FORMAT_PRG)
execute_process(COMMAND ${FORMAT_PRG} ${changed_files})
else()
message(STATUS "Stylua not found. Skip formatting lua files.")
endif()
endif()
endif()

View File

@@ -1,34 +0,0 @@
set(NVIM_VERSION
"v${NVIM_VERSION_MAJOR}.${NVIM_VERSION_MINOR}.${NVIM_VERSION_PATCH}${NVIM_VERSION_PRERELEASE}")
execute_process(
COMMAND git --git-dir=${NVIM_SOURCE_DIR}/.git --work-tree=${NVIM_SOURCE_DIR} describe --first-parent --dirty --always
OUTPUT_VARIABLE GIT_TAG
OUTPUT_STRIP_TRAILING_WHITESPACE
RESULT_VARIABLE RES)
if(RES AND NOT RES EQUAL 0)
message(STATUS "Using NVIM_VERSION: ${NVIM_VERSION}")
file(WRITE "${OUTPUT}" "")
return()
endif()
# `git describe` annotates the most recent tagged release; for pre-release
# builds we append that to the dev version.
if(NVIM_VERSION_PRERELEASE)
string(REGEX REPLACE "^v[0-9]+.[0-9]+.[0-9]+-" "" NVIM_VERSION_GIT "${GIT_TAG}")
string(REGEX REPLACE "^([0-9]+)-([a-z0-9]+)" "\\1+\\2" NVIM_VERSION_GIT "${NVIM_VERSION_GIT}")
set(NVIM_VERSION "${NVIM_VERSION}-${NVIM_VERSION_GIT}")
endif()
set(NVIM_VERSION_STRING "#define NVIM_VERSION_MEDIUM \"${NVIM_VERSION}\"\n")
string(SHA1 CURRENT_VERSION_HASH "${NVIM_VERSION_STRING}")
if(EXISTS ${OUTPUT})
file(SHA1 "${OUTPUT}" NVIM_VERSION_HASH)
endif()
if(NOT "${NVIM_VERSION_HASH}" STREQUAL "${CURRENT_VERSION_HASH}")
message(STATUS "Using NVIM_VERSION: ${NVIM_VERSION}")
file(WRITE "${OUTPUT}" "${NVIM_VERSION_STRING}")
endif()

View File

@@ -0,0 +1,2 @@
file(GLOB_RECURSE JSON_FILES *.json)
file(COPY ${JSON_FILES} DESTINATION "${TARGET}")

View File

@@ -45,7 +45,7 @@ function(create_install_dir_with_perms)
while(NOT EXISTS \$ENV{DESTDIR}\${_current_dir} AND NOT \${_prev_dir} STREQUAL \${_current_dir}) while(NOT EXISTS \$ENV{DESTDIR}\${_current_dir} AND NOT \${_prev_dir} STREQUAL \${_current_dir})
list(APPEND _parent_dirs \${_current_dir}) list(APPEND _parent_dirs \${_current_dir})
set(_prev_dir \${_current_dir}) set(_prev_dir \${_current_dir})
get_filename_component(_current_dir \${_current_dir} DIRECTORY) get_filename_component(_current_dir \${_current_dir} PATH)
endwhile() endwhile()
if(_parent_dirs) if(_parent_dirs)
@@ -154,25 +154,3 @@ function(install_helper)
${RENAME}) ${RENAME})
endif() endif()
endfunction() endfunction()
# Without CONFIGURE_DEPENDS globbing reuses cached file tree on rebuild.
# For example it will ignore new files.
# CONFIGURE_DEPENDS was introduced in 3.12
function(glob_wrapper outvar)
if(${CMAKE_VERSION} VERSION_LESS 3.12)
file(GLOB ${outvar} ${ARGN})
else()
file(GLOB ${outvar} CONFIGURE_DEPENDS ${ARGN})
endif()
set(${outvar} ${${outvar}} PARENT_SCOPE)
endfunction()
function(globrecurse_wrapper outvar root)
if(${CMAKE_VERSION} VERSION_LESS 3.12)
file(GLOB_RECURSE ${outvar} RELATIVE ${root} ${ARGN})
else()
file(GLOB_RECURSE ${outvar} CONFIGURE_DEPENDS RELATIVE ${root} ${ARGN})
endif()
set(${outvar} ${${outvar}} PARENT_SCOPE)
endfunction()

View File

@@ -2,9 +2,7 @@
set(ENV{LC_ALL} "en_US.UTF-8") set(ENV{LC_ALL} "en_US.UTF-8")
if(POLICY CMP0012) if(POLICY CMP0012)
# Avoid policy warning due to CI=true. This is needed even if the main # Handle CI=true, without dev warnings.
# project has already set this policy as policy settings are reset when using
# the cmake script mode (-P).
cmake_policy(SET CMP0012 NEW) cmake_policy(SET CMP0012 NEW)
endif() endif()
@@ -12,8 +10,6 @@ set(ENV{VIMRUNTIME} ${WORKING_DIR}/runtime)
set(ENV{NVIM_RPLUGIN_MANIFEST} ${BUILD_DIR}/Xtest_rplugin_manifest) set(ENV{NVIM_RPLUGIN_MANIFEST} ${BUILD_DIR}/Xtest_rplugin_manifest)
set(ENV{XDG_CONFIG_HOME} ${BUILD_DIR}/Xtest_xdg/config) set(ENV{XDG_CONFIG_HOME} ${BUILD_DIR}/Xtest_xdg/config)
set(ENV{XDG_DATA_HOME} ${BUILD_DIR}/Xtest_xdg/share) set(ENV{XDG_DATA_HOME} ${BUILD_DIR}/Xtest_xdg/share)
unset(ENV{XDG_DATA_DIRS})
unset(ENV{NVIM}) # Clear $NVIM in case tests are running from Nvim. #11009
if(NOT DEFINED ENV{NVIM_LOG_FILE}) if(NOT DEFINED ENV{NVIM_LOG_FILE})
set(ENV{NVIM_LOG_FILE} ${BUILD_DIR}/.nvimlog) set(ENV{NVIM_LOG_FILE} ${BUILD_DIR}/.nvimlog)
@@ -49,17 +45,10 @@ if(DEFINED ENV{TEST_FILTER} AND NOT "$ENV{TEST_FILTER}" STREQUAL "")
list(APPEND BUSTED_ARGS --filter $ENV{TEST_FILTER}) list(APPEND BUSTED_ARGS --filter $ENV{TEST_FILTER})
endif() endif()
if(DEFINED ENV{TEST_FILTER_OUT} AND NOT "$ENV{TEST_FILTER_OUT}" STREQUAL "") # TMPDIR: use relative test path (for parallel test runs / isolation).
list(APPEND BUSTED_ARGS --filter-out $ENV{TEST_FILTER_OUT}) set(ENV{TMPDIR} "${BUILD_DIR}/Xtest_tmpdir/${TEST_PATH}")
endif()
# TMPDIR: for helpers.tmpname() and Nvim tempname().
set(ENV{TMPDIR} "${BUILD_DIR}/Xtest_tmpdir")
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory $ENV{TMPDIR}) execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory $ENV{TMPDIR})
# HISTFILE: do not write into user's ~/.bash_history
set(ENV{HISTFILE} "/dev/null")
if(NOT DEFINED ENV{TEST_TIMEOUT} OR "$ENV{TEST_TIMEOUT}" STREQUAL "") if(NOT DEFINED ENV{TEST_TIMEOUT} OR "$ENV{TEST_TIMEOUT}" STREQUAL "")
set(ENV{TEST_TIMEOUT} 1200) set(ENV{TEST_TIMEOUT} 1200)
endif() endif()

View File

@@ -1,13 +0,0 @@
if(NOT EXISTS "${CMAKE_BINARY_DIR}/install_manifest.txt")
message(FATAL_ERROR "Cannot find install manifest: ${CMAKE_BINARY_DIR}/install_manifest.txt")
endif()
file(STRINGS "${CMAKE_BINARY_DIR}/install_manifest.txt" files)
foreach(file ${files})
message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
file(REMOVE $ENV{DESTDIR}${file})
else()
message(STATUS "File $ENV{DESTDIR}${file} does not exist.")
endif()
endforeach()

View File

@@ -0,0 +1,21 @@
if(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt")
message(FATAL_ERROR "Cannot find install manifest: @CMAKE_BINARY_DIR@/install_manifest.txt")
endif()
file(READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files)
string(REGEX REPLACE "\n" ";" files "${files}")
foreach(file ${files})
message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
exec_program(
"@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
OUTPUT_VARIABLE rm_out
RETURN_VALUE rm_retval
)
if(NOT "${rm_retval}" STREQUAL 0)
message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}")
endif()
else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
message(STATUS "File $ENV{DESTDIR}${file} does not exist.")
endif()
endforeach()

View File

@@ -1,185 +0,0 @@
# Defines a target that depends on FILES and the files found by globbing
# when using GLOB_PAT and GLOB_DIRS. The target will rerun if any files it
# depends on has changed. Which files the target will run the command on
# depends on the value of TOUCH_STRATEGY.
#
# Options:
# REQUIRED - Abort if COMMAND doesn't exist.
#
# Single value arguments:
# TARGET - Name of the target
# COMMAND - Path of the command to be run
# GLOB_PAT - Glob pattern to use. Only used if GLOB_DIRS is specified
# TOUCH_STRATEGY - Specify touch strategy, meaning decide how to group files
# and connect them to a specific touch file.
#
# For example, let us say we have file A and B and that we create a touch file
# for each of them, TA and TB. This would essentially make file A and B
# independent of each other, meaning that if I change file A and run the
# target, then the target will only run its commands for file A and ignore
# file B.
#
# Another example: let's say we have file A and B, but now we create only a
# single touch file T for both of them. This would mean that if I change
# either file A or B, then the target will run its commands on both A and B.
# Meaning that even if I only change file A, the target will still run
# commands on both A and B.
#
# The more touch files we create for a target, the fewer commands we'll need
# to rerun, and by extension, the more time we'll save. Unfortunately, the
# more touch files we create the more intermediary targets will be created,
# one for each touch file. This makes listing all targets with
# `cmake --build build --target help` less useful since each touch file will
# be listed. The tradeoff that needs to be done here is between performance
# and "discoverability". As a general guideline: the more popular a target is
# and the more time it takes to run it, the more granular you want your touch
# files to be. Conversely, if a target rarely needs to be run or if it's fast,
# then you should create fewer targets.
#
# Possible values for TOUCH_STRATEGY:
# "SINGLE": create a single touch file for all files.
# "PER_FILE": create a touch file for each file. Defaults to this if
# TOUCH_STRATEGY isn't specified.
# "PER_DIR": create a touch file for each directory.
#
# List arguments:
# FLAGS - List of flags to use after COMMAND
# FILES - List of files to use COMMAND on. It's possible to combine this
# with GLOB_PAT and GLOB_DIRS; the files found by globbing will
# simple be added to FILES
# GLOB_DIRS - The directories to recursively search for files with extension
# GLOB_PAT
#
function(add_glob_targets)
cmake_parse_arguments(ARG
"REQUIRED"
"TARGET;COMMAND;GLOB_PAT;TOUCH_STRATEGY"
"FLAGS;FILES;GLOB_DIRS"
${ARGN}
)
if(NOT ARG_COMMAND)
add_custom_target(${ARG_TARGET})
if(ARG_REQUIRED)
add_custom_command(TARGET ${ARG_TARGET}
COMMAND ${CMAKE_COMMAND} -E echo "${ARG_TARGET}: ${ARG_COMMAND} not found"
COMMAND false)
else()
add_custom_command(TARGET ${ARG_TARGET}
COMMAND ${CMAKE_COMMAND} -E echo "${ARG_TARGET} SKIP: ${ARG_COMMAND} not found")
endif()
return()
endif()
foreach(gd ${ARG_GLOB_DIRS})
file(GLOB_RECURSE globfiles ${PROJECT_SOURCE_DIR}/${gd}/${ARG_GLOB_PAT})
list(APPEND ARG_FILES ${globfiles})
endforeach()
if(NOT ARG_TOUCH_STRATEGY)
set(ARG_TOUCH_STRATEGY PER_FILE)
endif()
set(POSSIBLE_TOUCH_STRATEGIES SINGLE PER_FILE PER_DIR)
if(NOT ARG_TOUCH_STRATEGY IN_LIST POSSIBLE_TOUCH_STRATEGIES)
message(FATAL_ERROR "Unrecognized value for TOUCH_STRATEGY: ${ARG_TOUCH_STRATEGY}")
endif()
if(ARG_TOUCH_STRATEGY STREQUAL SINGLE)
set(touch_file ${TOUCHES_DIR}/ran-${ARG_TARGET})
add_custom_command(
OUTPUT ${touch_file}
COMMAND ${CMAKE_COMMAND} -E touch ${touch_file}
COMMAND ${ARG_COMMAND} ${ARG_FLAGS} ${ARG_FILES}
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
DEPENDS ${ARG_FILES})
list(APPEND touch_list ${touch_file})
elseif(ARG_TOUCH_STRATEGY STREQUAL PER_FILE)
set(touch_dir ${TOUCHES_DIR}/${ARG_TARGET})
file(MAKE_DIRECTORY ${touch_dir})
foreach(f ${ARG_FILES})
string(REGEX REPLACE "^${PROJECT_SOURCE_DIR}/" "" tf ${f})
string(REGEX REPLACE "[/.]" "-" tf ${tf})
set(touch_file ${touch_dir}/ran-${tf})
add_custom_command(
OUTPUT ${touch_file}
COMMAND ${CMAKE_COMMAND} -E touch ${touch_file}
COMMAND ${ARG_COMMAND} ${ARG_FLAGS} ${f}
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
DEPENDS ${f})
list(APPEND touch_list ${touch_file})
endforeach()
elseif(ARG_TOUCH_STRATEGY STREQUAL PER_DIR)
set(touch_dirs)
foreach(f ${ARG_FILES})
get_filename_component(out ${f} DIRECTORY)
list(APPEND touch_dirs ${out})
endforeach()
list(REMOVE_DUPLICATES touch_dirs)
foreach(touch_dir ${touch_dirs})
set(relevant_files)
foreach(f ${ARG_FILES})
get_filename_component(out ${f} DIRECTORY)
if(${touch_dir} STREQUAL ${out})
list(APPEND relevant_files ${f})
endif()
endforeach()
set(td ${TOUCHES_DIR}/${ARG_TARGET})
file(MAKE_DIRECTORY ${td})
string(REGEX REPLACE "^${PROJECT_SOURCE_DIR}/" "" tf ${touch_dir})
string(REGEX REPLACE "[/.]" "-" tf ${tf})
set(touch_file ${td}/ran-${tf})
add_custom_command(
OUTPUT ${touch_file}
COMMAND ${CMAKE_COMMAND} -E touch ${touch_file}
COMMAND ${ARG_COMMAND} ${ARG_FLAGS} ${relevant_files}
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
DEPENDS ${relevant_files})
list(APPEND touch_list ${touch_file})
endforeach()
endif()
add_custom_target(${ARG_TARGET} DEPENDS ${touch_list})
endfunction()
# Set default build type to Debug. Also limit the list of allowable build types
# to the ones defined in variable allowableBuildTypes.
#
# The correct way to specify build type (for example Release) for
# single-configuration generators (Make and Ninja) is to run
#
# cmake -B build -D CMAKE_BUILD_TYPE=Release
# cmake --build build
#
# while for multi-configuration generators (Visual Studio, Xcode and Ninja
# Multi-Config) is to run
#
# cmake -B build
# cmake --build build --config Release
#
# Passing CMAKE_BUILD_TYPE for multi-config generators will now not only
# not be used, but also generate a warning for the user.
function(set_default_buildtype)
set(allowableBuildTypes Debug Release MinSizeRel RelWithDebInfo)
get_property(isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if(isMultiConfig)
set(CMAKE_CONFIGURATION_TYPES ${allowableBuildTypes} PARENT_SCOPE)
if(CMAKE_BUILD_TYPE)
message(WARNING "CMAKE_BUILD_TYPE specified which is ignored on \
multi-configuration generators. Defaulting to Debug build type.")
endif()
else()
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "${allowableBuildTypes}")
if(NOT CMAKE_BUILD_TYPE)
message(STATUS "CMAKE_BUILD_TYPE not specified, default is 'Debug'")
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build" FORCE)
elseif(NOT CMAKE_BUILD_TYPE IN_LIST allowableBuildTypes)
message(FATAL_ERROR "Invalid build type: ${CMAKE_BUILD_TYPE}")
else()
message(STATUS "CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}")
endif()
endif()
endfunction()

View File

@@ -0,0 +1,7 @@
set(CMAKE_SYSTEM_PROCESSOR i386)
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_VERSION gnu)
if(NOT ${CMAKE_C_COMPILER})
set(CMAKE_C_COMPILER gcc)
endif()
set(CMAKE_C_COMPILER_ARG1 "-m32")

View File

@@ -5,13 +5,17 @@ include(CheckIncludeFiles)
include(CheckCSourceRuns) include(CheckCSourceRuns)
include(CheckCSourceCompiles) include(CheckCSourceCompiles)
check_type_size("int" SIZEOF_INT LANGUAGE C) check_type_size("int" SIZEOF_INT)
check_type_size("long" SIZEOF_LONG LANGUAGE C) check_type_size("long" SIZEOF_LONG)
check_type_size("intmax_t" SIZEOF_INTMAX_T LANGUAGE C) check_type_size("intmax_t" SIZEOF_INTMAX_T)
check_type_size("int32_t" SIZEOF_INT32_T LANGUAGE C) check_type_size("size_t" SIZEOF_SIZE_T)
check_type_size("size_t" SIZEOF_SIZE_T LANGUAGE C) check_type_size("long long" SIZEOF_LONG_LONG)
check_type_size("long long" SIZEOF_LONG_LONG LANGUAGE C) check_type_size("void *" SIZEOF_VOID_PTR)
check_type_size("void *" SIZEOF_VOID_PTR LANGUAGE C)
if (CMAKE_HOST_SYSTEM_VERSION MATCHES ".*-(Microsoft|microsoft-standard)")
# Windows Subsystem for Linux
set(HAVE_WSL 1)
endif()
check_symbol_exists(_NSGetEnviron crt_externs.h HAVE__NSGETENVIRON) check_symbol_exists(_NSGetEnviron crt_externs.h HAVE__NSGETENVIRON)
@@ -46,24 +50,10 @@ check_function_exists(readlink HAVE_READLINK)
check_function_exists(setpgid HAVE_SETPGID) check_function_exists(setpgid HAVE_SETPGID)
check_function_exists(setsid HAVE_SETSID) check_function_exists(setsid HAVE_SETSID)
check_function_exists(sigaction HAVE_SIGACTION) check_function_exists(sigaction HAVE_SIGACTION)
check_function_exists(strnlen HAVE_STRNLEN)
check_function_exists(strcasecmp HAVE_STRCASECMP) check_function_exists(strcasecmp HAVE_STRCASECMP)
check_function_exists(strncasecmp HAVE_STRNCASECMP) check_function_exists(strncasecmp HAVE_STRNCASECMP)
check_function_exists(strptime HAVE_STRPTIME) check_function_exists(strptime HAVE_STRPTIME)
if(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
check_c_source_compiles("
#include <termios.h>
int
main(void)
{
return forkpty(0, NULL, NULL, NULL);
}
" HAVE_FORKPTY)
else()
set(HAVE_FORKPTY 1)
endif()
# Symbols # Symbols
check_symbol_exists(FD_CLOEXEC "fcntl.h" HAVE_FD_CLOEXEC) check_symbol_exists(FD_CLOEXEC "fcntl.h" HAVE_FD_CLOEXEC)
if(HAVE_LANGINFO_H) if(HAVE_LANGINFO_H)
@@ -107,7 +97,7 @@ if (NOT "${HAVE_BE64TOH}")
# any case and ORDER_BIG_ENDIAN will not be examined. # any case and ORDER_BIG_ENDIAN will not be examined.
# - CMAKE_CROSSCOMPILING *and* HAVE_BE64TOH are both false. In this case # - CMAKE_CROSSCOMPILING *and* HAVE_BE64TOH are both false. In this case
# be64toh function which uses cycle and arithmetic operations is used which # be64toh function which uses cycle and arithmetic operations is used which
# will work regardless of endianness. Function is sub-optimal though. # will work regardless of endianess. Function is sub-optimal though.
check_c_source_runs(" check_c_source_runs("
${SI} ${SI}
${MS} ${MS}
@@ -128,14 +118,14 @@ endif()
# generate configuration header and update include directories # generate configuration header and update include directories
configure_file ( configure_file (
"${PROJECT_SOURCE_DIR}/cmake.config/config.h.in" "${PROJECT_SOURCE_DIR}/config/config.h.in"
"${PROJECT_BINARY_DIR}/cmake.config/auto/config.h" "${PROJECT_BINARY_DIR}/config/auto/config.h"
) )
# generate version definitions # generate version definitions
configure_file ( configure_file (
"${PROJECT_SOURCE_DIR}/cmake.config/versiondef.h.in" "${PROJECT_SOURCE_DIR}/config/versiondef.h.in"
"${PROJECT_BINARY_DIR}/cmake.config/auto/versiondef.h" "${PROJECT_BINARY_DIR}/config/auto/versiondef.h"
) )
# generate pathdef.c # generate pathdef.c
@@ -158,6 +148,6 @@ elseif (EXISTS ${HOSTNAME_PROG})
endif() endif()
configure_file ( configure_file (
"${PROJECT_SOURCE_DIR}/cmake.config/pathdef.c.in" "${PROJECT_SOURCE_DIR}/config/pathdef.c.in"
"${PROJECT_BINARY_DIR}/cmake.config/auto/pathdef.c" "${PROJECT_BINARY_DIR}/config/auto/pathdef.c"
ESCAPE_QUOTES) ESCAPE_QUOTES)

View File

@@ -3,12 +3,8 @@
#cmakedefine DEBUG #cmakedefine DEBUG
#cmakedefine SIZEOF_INT @SIZEOF_INT@ #define SIZEOF_INT @SIZEOF_INT@
#cmakedefine SIZEOF_INTMAX_T @SIZEOF_INTMAX_T@ #define SIZEOF_LONG @SIZEOF_LONG@
#cmakedefine SIZEOF_INT32_T @SIZEOF_INT32_T@
#cmakedefine SIZEOF_LONG @SIZEOF_LONG@
#cmakedefine SIZEOF_LONG_LONG @SIZEOF_LONG_LONG@
#cmakedefine SIZEOF_SIZE_T @SIZEOF_SIZE_T@
#if @SIZEOF_VOID_PTR@ == 8 #if @SIZEOF_VOID_PTR@ == 8
#define ARCH_64 #define ARCH_64
@@ -16,7 +12,7 @@
#define ARCH_32 #define ARCH_32
#endif #endif
#cmakedefine PROJECT_NAME "@PROJECT_NAME@" #define PROJECT_NAME "@PROJECT_NAME@"
#cmakedefine HAVE__NSGETENVIRON #cmakedefine HAVE__NSGETENVIRON
#cmakedefine HAVE_FD_CLOEXEC #cmakedefine HAVE_FD_CLOEXEC
@@ -34,7 +30,6 @@
#cmakedefine HAVE_SETPGID #cmakedefine HAVE_SETPGID
#cmakedefine HAVE_SETSID #cmakedefine HAVE_SETSID
#cmakedefine HAVE_SIGACTION #cmakedefine HAVE_SIGACTION
#cmakedefine HAVE_STRNLEN
#cmakedefine HAVE_STRCASECMP #cmakedefine HAVE_STRCASECMP
#cmakedefine HAVE_STRINGS_H #cmakedefine HAVE_STRINGS_H
#cmakedefine HAVE_STRNCASECMP #cmakedefine HAVE_STRNCASECMP
@@ -44,6 +39,7 @@
#cmakedefine HAVE_SYS_WAIT_H #cmakedefine HAVE_SYS_WAIT_H
#cmakedefine HAVE_TERMIOS_H #cmakedefine HAVE_TERMIOS_H
#cmakedefine HAVE_WORKING_LIBINTL #cmakedefine HAVE_WORKING_LIBINTL
#cmakedefine HAVE_WSL
#cmakedefine UNIX #cmakedefine UNIX
#cmakedefine CASE_INSENSITIVE_FILENAME #cmakedefine CASE_INSENSITIVE_FILENAME
#cmakedefine USE_FNAME_CASE #cmakedefine USE_FNAME_CASE
@@ -54,7 +50,6 @@
# undef HAVE_SYS_UIO_H # undef HAVE_SYS_UIO_H
# endif # endif
#endif #endif
#cmakedefine HAVE_FORKPTY
#cmakedefine FEAT_TUI #cmakedefine FEAT_TUI

View File

@@ -0,0 +1,31 @@
# YouCompleteMe Integration
## What is this?
This provides the code necessary to configure vim's YCM plugin to provide C
semantic support (completion, go-to-definition, etc) for developers working on
the Neovim project.
## Installation
### Step 1
Install [YouCompleteMe](https://github.com/Valloric/YouCompleteMe).
### Step 2
```bash
cp contrib/YouCompleteMe/ycm_extra_conf.py .ycm_extra_conf.py
echo .ycm_extra_conf.py >> .git/info/exclude
make
```
Tip: to improve source code navigation, add something like this to your nvim
configuration:
```vim
au FileType c,cpp nnoremap <buffer> <c-]> :YcmCompleter GoTo<CR>
```
And use `ctrl+]` when the cursor is positioned in a symbol to quickly jump to a
definition or declaration.

View File

@@ -0,0 +1,65 @@
# .ycm_extra_conf.py for nvim source code.
import os
import ycm_core
def DirectoryOfThisScript():
return os.path.dirname(os.path.abspath(__file__))
def GetDatabase():
compilation_database_folder = os.path.join(DirectoryOfThisScript(),
'build')
if os.path.exists(compilation_database_folder):
return ycm_core.CompilationDatabase(compilation_database_folder)
return None
def GetCompilationInfoForFile(filename):
database = GetDatabase()
if not database:
return None
return database.GetCompilationInfoForFile(filename)
# It seems YCM does not resolve directories correctly. This function will
# adjust paths in the compiler flags to be absolute
def FixDirectories(args, compiler_working_dir):
def adjust_path(path):
return os.path.abspath(os.path.join(compiler_working_dir, path))
adjust_next_arg = False
new_args = []
for arg in args:
if adjust_next_arg:
arg = adjust_path(arg)
adjust_next_arg = False
else:
for dir_flag in ['-I', '-isystem', '-o', '-c']:
if arg.startswith(dir_flag):
if arg != dir_flag:
# flag and path are concatenated in same arg
path = arg[len(dir_flag):]
new_path = adjust_path(path)
arg = '{0}{1}'.format(dir_flag, new_path)
else:
# path is specified in next argument
adjust_next_arg = True
new_args.append(arg)
return new_args
def FlagsForFile(filename):
compilation_info = GetCompilationInfoForFile(filename)
if not compilation_info:
return None
# Add flags not needed for clang-the-binary,
# but needed for libclang-the-library (YCM uses this last one).
flags = FixDirectories((list(compilation_info.compiler_flags_)
if compilation_info.compiler_flags_
else []), compilation_info.compiler_working_dir_)
extra_flags = ['-Wno-newline-eof']
return {
'flags': flags + extra_flags,
'do_cache': True
}

View File

@@ -1,28 +0,0 @@
#!/bin/bash
# Helper script to build and run neovim with Address Sanitizer enabled.
# You may read more information in src/nvim/README.md in the section "Build
# with ASAN".
shopt -s nullglob
root_path=$(git rev-parse --show-toplevel)
log_path=$(mktemp -d)
export CC='clang'
# Change to detect_leaks=1 to detect memory leaks (slower).
export ASAN_OPTIONS="detect_leaks=0:log_path=$log_path/asan"
# Show backtraces in the logs.
export UBSAN_OPTIONS="print_stacktrace=1"
make -C "$root_path" CMAKE_EXTRA_FLAGS="-DCLANG_ASAN_UBSAN=ON"
VIMRUNTIME="$root_path"/runtime "$root_path"/build/bin/nvim
# Need to manually reset terminal to avoid mangled output, nvim does not
# properly restore the terminal when it crashes.
tput reset
for i in "$log_path"/*; do
cat "$i"
done

View File

@@ -0,0 +1,757 @@
/*
* Title, should be H1
*/
.title {
font-family: 'Lato', sans-serif;
font-size: 2em;
margin: 0.67em 0 0;
}
dt {
font-weight: bold;
}
div.multicol {
-moz-column-gap: 1em;
-webkit-column-gap: 1em;
-moz-column-count: 3;
-webkit-column-count: 3;
}
div.qindex, div.navtab {
background-color: #EBEFF6;
border: 1px solid #A3B4D7;
text-align: center;
}
div.line {
font-family: monospace, fixed;
min-height: 13px;
line-height: 1.0;
text-wrap: unrestricted;
white-space: -moz-pre-wrap; /* Moz */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
white-space: pre-wrap; /* CSS3 */
word-wrap: break-word; /* IE 5.5+ */
text-indent: -53px;
padding-left: 53px;
padding-bottom: 0px;
margin: 0px;
}
span.lineno {
padding-right: 4px;
text-align: right;
border-right: 2px solid #0F0;
white-space: pre;
}
/* @group Code Colorization */
span.keyword {
color: #008000
}
span.keywordtype {
color: #604020
}
span.keywordflow {
color: #e08000
}
span.comment {
color: #800000
}
span.preprocessor {
color: #806020
}
span.stringliteral {
color: #002080
}
span.charliteral {
color: #008080
}
span.vhdldigit {
color: #ff00ff
}
span.vhdlchar {
color: #000000
}
span.vhdlkeyword {
color: #700070
}
span.vhdllogic {
color: #ff0000
}
blockquote {
background-color: #F7F8FB;
border-left: 2px solid #9CAFD4;
margin: 0 24px 0 4px;
padding: 0 12px 0 16px;
}
/* @end */
hr {
height: 0px;
border: none;
display: none;
}
dl {
padding: 0 0 0 10px;
}
/* dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug */
dl.section {
margin-left: 0px;
padding-left: 0px;
}
dl.note {
margin-left:-7px;
padding-left: 3px;
border-left:4px solid;
border-color: #D0C000;
}
dl.warning, dl.attention {
margin-left:-7px;
padding-left: 3px;
border-left:4px solid;
border-color: #FF0000;
}
dl.pre, dl.post, dl.invariant {
margin-left:-7px;
padding-left: 3px;
border-left:4px solid;
border-color: #00D000;
}
dl.deprecated {
margin-left:-7px;
padding-left: 3px;
border-left:4px solid;
border-color: #505050;
}
dl.todo {
margin-left:-7px;
padding-left: 3px;
border-left:4px solid;
border-color: #00C0E0;
}
dl.test {
margin-left:-7px;
padding-left: 3px;
border-left:4px solid;
border-color: #3030E0;
}
dl.bug {
margin-left:-7px;
padding-left: 3px;
border-left:4px solid;
border-color: #C08050;
}
dl.section dd {
margin-bottom: 6px;
}
/* tooltip related style info */
.ttc {
position: absolute;
display: none;
}
#powerTip {
cursor: default;
white-space: nowrap;
background-color: white;
border: 1px solid gray;
border-radius: 4px 4px 4px 4px;
box-shadow: 1px 1px 7px gray;
display: none;
font-size: smaller;
max-width: 80%;
opacity: 0.9;
padding: 1ex 1em 1em;
position: absolute;
z-index: 2147483647;
}
#powerTip div.ttdoc {
color: grey;
font-style: italic;
}
#powerTip div.ttname a {
font-weight: bold;
}
#powerTip div.ttname {
font-weight: bold;
}
#powerTip div.ttdeci {
color: #006318;
}
#powerTip div {
margin: 0px;
padding: 0px;
font: 12px/16px Roboto,sans-serif;
}
#powerTip:before, #powerTip:after {
content: "";
position: absolute;
margin: 0px;
}
#powerTip.n:after, #powerTip.n:before,
#powerTip.s:after, #powerTip.s:before,
#powerTip.w:after, #powerTip.w:before,
#powerTip.e:after, #powerTip.e:before,
#powerTip.ne:after, #powerTip.ne:before,
#powerTip.se:after, #powerTip.se:before,
#powerTip.nw:after, #powerTip.nw:before,
#powerTip.sw:after, #powerTip.sw:before {
border: solid transparent;
content: " ";
height: 0;
width: 0;
position: absolute;
}
#powerTip.n:after, #powerTip.s:after,
#powerTip.w:after, #powerTip.e:after,
#powerTip.nw:after, #powerTip.ne:after,
#powerTip.sw:after, #powerTip.se:after {
border-color: rgba(255, 255, 255, 0);
}
#powerTip.n:before, #powerTip.s:before,
#powerTip.w:before, #powerTip.e:before,
#powerTip.nw:before, #powerTip.ne:before,
#powerTip.sw:before, #powerTip.se:before {
border-color: rgba(128, 128, 128, 0);
}
#powerTip.n:after, #powerTip.n:before,
#powerTip.ne:after, #powerTip.ne:before,
#powerTip.nw:after, #powerTip.nw:before {
top: 100%;
}
#powerTip.n:after, #powerTip.ne:after, #powerTip.nw:after {
border-top-color: #ffffff;
border-width: 10px;
margin: 0px -10px;
}
#powerTip.n:before {
border-top-color: #808080;
border-width: 11px;
margin: 0px -11px;
}
#powerTip.n:after, #powerTip.n:before {
left: 50%;
}
#powerTip.nw:after, #powerTip.nw:before {
right: 14px;
}
#powerTip.ne:after, #powerTip.ne:before {
left: 14px;
}
#powerTip.s:after, #powerTip.s:before,
#powerTip.se:after, #powerTip.se:before,
#powerTip.sw:after, #powerTip.sw:before {
bottom: 100%;
}
#powerTip.s:after, #powerTip.se:after, #powerTip.sw:after {
border-bottom-color: #ffffff;
border-width: 10px;
margin: 0px -10px;
}
#powerTip.s:before, #powerTip.se:before, #powerTip.sw:before {
border-bottom-color: #808080;
border-width: 11px;
margin: 0px -11px;
}
#powerTip.s:after, #powerTip.s:before {
left: 50%;
}
#powerTip.sw:after, #powerTip.sw:before {
right: 14px;
}
#powerTip.se:after, #powerTip.se:before {
left: 14px;
}
#powerTip.e:after, #powerTip.e:before {
left: 100%;
}
#powerTip.e:after {
border-left-color: #ffffff;
border-width: 10px;
top: 50%;
margin-top: -10px;
}
#powerTip.e:before {
border-left-color: #808080;
border-width: 11px;
top: 50%;
margin-top: -11px;
}
#powerTip.w:after, #powerTip.w:before {
right: 100%;
}
#powerTip.w:after {
border-right-color: #ffffff;
border-width: 10px;
top: 50%;
margin-top: -10px;
}
#powerTip.w:before {
border-right-color: #808080;
border-width: 11px;
top: 50%;
margin-top: -11px;
}
/*
* Centered container for all content
*/
div.contents,
div.header > *,
ul.tablist,
.navpath ul {
margin:0 15px;
}
@media (min-width: 568px) {
div.contents,
div.header > *,
ul.tablist,
.navpath ul {
margin: 0 auto;
width: 90%;
max-width: 1200px;
}
}
/*
* padding inside content
*/
div.contents > * {
padding-top: 8px;
padding-bottom: 8px;
}
@media (min-width: 568px) {
div.contents > h2,
div.contents > div.textblock,
div.contents > div.memitem,
div.contents > table.memberdecls h2,
div.contents > p {
padding-top: 30px;
}
}
div.contents h2 {
margin-top: 0px;
}
div.summary {
display: none;
}
/*
* Tabs
*
* Based on doxygen tabs.css
*/
.tabs, .tabs2, .tabs3 {
width: 100%;
background-color: #f4f4f4;
border-top: solid 1px #ececec;
}
.tablist {
margin: 0;
padding: 0;
display: table;
}
.tablist li {
float: left;
display: table-cell;
line-height: 36px;
list-style: none;
}
.tablist a {
display: block;
padding: 0 30px 0 0;
}
.tabs3 .tablist a {
padding: 0 20px 0 0;
}
.tablist li.current a {
color: #54a23d;
}
/*
* Navpath
*/
.navpath ul
{
padding:20px 0px;
}
.navpath li
{
list-style-type:none;
padding-right: 10px;
float:left;
}
.navpath li.navelem a
{
padding-left: 10px;
}
.navpath li.navelem:before {
content: "/";
color: #777;
}
/*
* Member
*
* Styles for detailed member documentation
*/
.memitem {
border-top: solid 1px #c9c9c9;
}
.memname {
font-weight: bold;
font-family: monospace;
}
td.memname {
color: #54a23d;
}
.memname td {
vertical-align: bottom;
}
.memproto, dl.reflist dt {
font-weight: bold;
}
.memdoc, dl.reflist dd {
}
/*
* Parameters
*/
.paramkey {
text-align: right;
}
.paramtype {
white-space: nowrap;
}
.paramname {
color: #aa0e0e;
white-space: nowrap;
}
.paramname em {
font-style: normal;
}
.params, .retval, .exception, .tparams {
margin-left: 0px;
padding-left: 0px;
}
.params td {
padding-right: 1em;
padding-bottom: 0.5em;
}
.params .paramname, .retval .paramname {
font-weight: bold;
vertical-align: top;
}
.params .paramtype {
font-style: italic;
vertical-align: top;
}
/*
* Inline Label etc.
*/
table.mlabels {
border-spacing: 0px;
}
td.mlabels-left {
width: 100%;
padding: 0px;
}
td.mlabels-right {
vertical-align: bottom;
padding: 0px;
white-space: nowrap;
}
span.mlabels {
margin-left: 8px;
}
/*
* Member Descriptions
*/
table.memberdecls {
font-family: monospace;
border-spacing: 0px;
padding: 0px;
}
.memSeparator {
line-height: 1px;
margin: 0px;
padding: 0 0 0.2em 0;
}
.memItemLeft, .memTemplItemLeft {
white-space: nowrap;
}
.memItemRight {
width: 100%;
}
.memTemplParams {
color: #4665A2;
white-space: nowrap;
font-size: 80%;
}
/*
* Fieldtable (Enums)
*/
.fieldtable td, .fieldtable th {
padding: 0 1em 0.2em 0;
}
.fieldtable td.fieldtype, .fieldtable td.fieldname {
white-space: nowrap;
vertical-align: top;
}
/*
* Directory
*/
.directory table {
border-collapse:collapse;
}
.directory td {
margin: 0px;
padding: 0px;
vertical-align: top;
}
.directory td.entry {
white-space: nowrap;
padding-right: 6px;
padding-top: 3px;
}
.directory td.entry a {
outline:none;
}
.directory td.entry a img {
border: none;
}
.directory td.desc {
width: 100%;
padding-left: 6px;
padding-right: 6px;
padding-top: 3px;
}
.directory tr.even {
padding-left: 6px;
}
.directory img {
vertical-align: -30%;
}
.directory .levels {
white-space: nowrap;
width: 100%;
text-align: right;
}
.directory .levels span {
cursor: pointer;
padding-left: 2px;
padding-right: 2px;
color: #3c92d1;
}
.arrow {
color: #9CAFD4;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
cursor: pointer;
font-size: 80%;
display: inline-block;
width: 16px;
height: 22px;
}
.icon {
font-family: Arial, Helvetica;
font-weight: bold;
font-size: 12px;
height: 14px;
width: 16px;
display: inline-block;
background-color: #54a23d;
color: white;
text-align: center;
border-radius: 4px;
margin-left: 2px;
margin-right: 2px;
}
.icona {
width: 24px;
height: 22px;
display: inline-block;
}
.iconfopen {
width: 24px;
height: 18px;
margin-bottom: 4px;
background-image:url('ftv2folderopen.png');
background-position: 0px 0px;
background-repeat: repeat-y;
vertical-align:top;
display: inline-block;
}
.iconfclosed {
width: 24px;
height: 18px;
margin-bottom: 4px;
background-image:url('ftv2folderclosed.png');
background-position: 0px 0px;
background-repeat: repeat-y;
vertical-align:top;
display: inline-block;
}
.icondoc {
width: 24px;
height: 18px;
margin-bottom: 4px;
background-image:url('ftv2doc.png');
background-position: 0px -1px;
background-repeat: repeat-y;
vertical-align:top;
display: inline-block;
}
/*
* Data Structure Index
*
* Hardcoded style attribute
*/
.contents > table[style] {
margin: 20px auto !important;
}
/*
* Search Box
*/
#MSearchBox {
right: 4%;
}
@media print
{
#top { display: none; }
#side-nav { display: none; }
#nav-path { display: none; }
body { overflow:visible; }
h1, h2, h3, h4, h5, h6 { page-break-after: avoid; }
.summary { display: none; }
.memitem { page-break-inside: avoid; }
#doc-content
{
margin-left:0 !important;
height:auto !important;
width:auto !important;
overflow:inherit;
display:inline;
}
}

777
contrib/doxygen/extra.css Normal file
View File

@@ -0,0 +1,777 @@
/*! normalize.css v3.0.0 | MIT License | git.io/normalize */
/**
* 1. Set default font family to sans-serif.
* 2. Prevent iOS text size adjust after orientation change, without disabling
* user zoom.
*/
html {
font-family: sans-serif; /* 1 */
-ms-text-size-adjust: 100%; /* 2 */
-webkit-text-size-adjust: 100%; /* 2 */
}
/**
* Remove default margin.
*/
body {
margin: 0;
}
/* HTML5 display definitions
========================================================================== */
/**
* Correct `block` display not defined in IE 8/9.
*/
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
nav,
section,
summary {
display: block;
}
/**
* 1. Correct `inline-block` display not defined in IE 8/9.
* 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera.
*/
audio,
canvas,
progress,
video {
display: inline-block; /* 1 */
vertical-align: baseline; /* 2 */
}
/**
* Prevent modern browsers from displaying `audio` without controls.
* Remove excess height in iOS 5 devices.
*/
audio:not([controls]) {
display: none;
height: 0;
}
/**
* Address `[hidden]` styling not present in IE 8/9.
* Hide the `template` element in IE, Safari, and Firefox < 22.
*/
[hidden],
template {
display: none;
}
/* Links
========================================================================== */
/**
* Remove the gray background color from active links in IE 10.
*/
a {
background: transparent;
}
/**
* Improve readability when focused and also mouse hovered in all browsers.
*/
a:active,
a:hover {
outline: 0;
}
/* Text-level semantics
========================================================================== */
/**
* Address styling not present in IE 8/9, Safari 5, and Chrome.
*/
abbr[title] {
border-bottom: 1px dotted;
}
/**
* Address style set to `bolder` in Firefox 4+, Safari 5, and Chrome.
*/
b,
strong {
font-weight: bold;
}
/**
* Address styling not present in Safari 5 and Chrome.
*/
dfn {
font-style: italic;
}
/**
* Address variable `h1` font-size and margin within `section` and `article`
* contexts in Firefox 4+, Safari 5, and Chrome.
*/
h1 {
font-size: 2em;
margin: 0.67em 0;
}
/**
* Address styling not present in IE 8/9.
*/
mark {
background: #ff0;
color: #000;
}
/**
* Address inconsistent and variable font size in all browsers.
*/
small {
font-size: 80%;
}
/**
* Prevent `sub` and `sup` affecting `line-height` in all browsers.
*/
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sup {
top: -0.5em;
}
sub {
bottom: -0.25em;
}
/* Embedded content
========================================================================== */
/**
* Remove border when inside `a` element in IE 8/9.
*/
img {
border: 0;
}
/**
* Correct overflow displayed oddly in IE 9.
*/
svg:not(:root) {
overflow: hidden;
}
/* Grouping content
========================================================================== */
/**
* Address margin not present in IE 8/9 and Safari 5.
*/
figure {
margin: 1em 40px;
}
/**
* Address differences between Firefox and other browsers.
*/
hr {
-moz-box-sizing: content-box;
box-sizing: content-box;
height: 0;
}
/**
* Contain overflow in all browsers.
*/
pre {
overflow: auto;
}
/**
* Address odd `em`-unit font size rendering in all browsers.
*/
code,
kbd,
pre,
samp {
font-family: monospace, monospace;
font-size: 1em;
}
/* Forms
========================================================================== */
/**
* Known limitation: by default, Chrome and Safari on OS X allow very limited
* styling of `select`, unless a `border` property is set.
*/
/**
* 1. Correct color not being inherited.
* Known issue: affects color of disabled elements.
* 2. Correct font properties not being inherited.
* 3. Address margins set differently in Firefox 4+, Safari 5, and Chrome.
*/
button,
input,
optgroup,
select,
textarea {
color: inherit; /* 1 */
font: inherit; /* 2 */
margin: 0; /* 3 */
}
/**
* Address `overflow` set to `hidden` in IE 8/9/10.
*/
button {
overflow: visible;
}
/**
* Address inconsistent `text-transform` inheritance for `button` and `select`.
* All other form control elements do not inherit `text-transform` values.
* Correct `button` style inheritance in Firefox, IE 8+, and Opera
* Correct `select` style inheritance in Firefox.
*/
button,
select {
text-transform: none;
}
/**
* 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
* and `video` controls.
* 2. Correct inability to style clickable `input` types in iOS.
* 3. Improve usability and consistency of cursor style between image-type
* `input` and others.
*/
button,
html input[type="button"], /* 1 */
input[type="reset"],
input[type="submit"] {
-webkit-appearance: button; /* 2 */
cursor: pointer; /* 3 */
}
/**
* Re-set default cursor for disabled elements.
*/
button[disabled],
html input[disabled] {
cursor: default;
}
/**
* Remove inner padding and border in Firefox 4+.
*/
button::-moz-focus-inner,
input::-moz-focus-inner {
border: 0;
padding: 0;
}
/**
* Address Firefox 4+ setting `line-height` on `input` using `!important` in
* the UA stylesheet.
*/
input {
line-height: normal;
}
/**
* It's recommended that you don't attempt to style these elements.
* Firefox's implementation doesn't respect box-sizing, padding, or width.
*
* 1. Address box sizing set to `content-box` in IE 8/9/10.
* 2. Remove excess padding in IE 8/9/10.
*/
input[type="checkbox"],
input[type="radio"] {
box-sizing: border-box; /* 1 */
padding: 0; /* 2 */
}
/**
* Fix the cursor style for Chrome's increment/decrement buttons. For certain
* `font-size` values of the `input`, it causes the cursor style of the
* decrement button to change from `default` to `text`.
*/
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
height: auto;
}
/**
* 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome.
* 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome
* (include `-moz` to future-proof).
*/
input[type="search"] {
-webkit-appearance: textfield; /* 1 */
-moz-box-sizing: content-box;
-webkit-box-sizing: content-box; /* 2 */
box-sizing: content-box;
}
/**
* Remove inner padding and search cancel button in Safari and Chrome on OS X.
* Safari (but not Chrome) clips the cancel button when the search input has
* padding (and `textfield` appearance).
*/
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
/**
* Define consistent border, margin, and padding.
*/
fieldset {
border: 1px solid #c0c0c0;
margin: 0 2px;
padding: 0.35em 0.625em 0.75em;
}
/**
* 1. Correct `color` not being inherited in IE 8/9.
* 2. Remove padding so people aren't caught out if they zero out fieldsets.
*/
legend {
border: 0; /* 1 */
padding: 0; /* 2 */
}
/**
* Remove default vertical scrollbar in IE 8/9.
*/
textarea {
overflow: auto;
}
/**
* Don't inherit the `font-weight` (applied by a rule above).
* NOTE: the default cannot safely be changed in Chrome and Safari on OS X.
*/
optgroup {
font-weight: bold;
}
/* Tables
========================================================================== */
/**
* Remove most spacing between table cells.
*/
table {
border-collapse: collapse;
border-spacing: 0;
}
td,
th {
padding: 0;
}
/* neovim.io/css/main.css */
* {
-moz-box-sizing: border-box;
box-sizing: border-box;
}
body {
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-size: 15px;
line-height: 1.4;
color: #444;
background-color: #fbfbfb;
}
@media (min-width: 568px) {
body {
font-size: 17px;
}
}
a {
color: #3c92d1;
text-decoration: none;
}
h1,
h2,
h3 {
font-family: 'Lato', sans-serif;
}
h2 {
font-size: 24px;
font-weight: 400;
color: #54a23d;
margin-bottom: 0;
}
@media (min-width: 568px) {
h2 {
font-size: 30px;
}
}
h3 {
/* color: #54a23d; */
}
blockquote {
border-left: 5px solid #eeeeee;
margin-left: 0;
padding-left: 15px;
}
/*
* Content container
*
* Centered container for all content
*/
.container {
margin: 0 15px;
}
@media (min-width: 568px) {
.container {
margin: 0 auto;
width: 90%;
max-width: 1200px;
}
}
/*
* Navbar
*
* Logo and navigation at the top of the page
*/
.navbar {
padding: 12px 0;
}
@media (min-width: 568px) {
.navbar {
padding-top: 30px;
padding-bottom: 30px;
}
}
.logo {
width: 120px;
position: relative;
top: 4px;
}
@media (min-width: 568px) {
.logo {
width: 180px;
}
}
.site-nav {
display: none;
}
@media (min-width: 568px) {
.site-nav {
display: block;
float: right;
}
.site-nav ul {
list-style: none;
}
.site-nav li {
display: inline-block;
margin-top: 5px;
margin-left: 20px;
font-size: 18px;
font-family: 'Lato', sans-serif;
}
}
/*
* Masthead
*
* Big intro billboard
*/
.masthead {
border-top: solid 1px #ececec;
border-bottom: solid 1px #ececec;
text-align: center;
padding: 20px 12px;
}
@media (min-width: 568px) {
.masthead {
padding-top: 40px;
padding-bottom: 40px;
}
}
.masthead .container {
}
@media (min-width: 568px) {
.masthead .container {
width: 568px;
margin: 0 auto;
}
}
.masthead h1 {
font-size: 20px;
font-weight: 400;
}
@media (min-width: 568px) {
.masthead h1 {
font-size: 40px;
margin-bottom: 50px;
}
}
.masthead .lead {
font-weight: 900;
color: #54a23d;
font-family: 'Lato', sans-serif;
font-size: 16px;
font-weight: 900;
}
@media (min-width: 568px) {
.masthead .lead {
font-size: 26px;
}
}
/*
* Columns
*
* Two columns utilizing the golden ratio
*/
.col-wide,
.col-narrow {
display: block;
}
@media (min-width: 568px) {
.col-wide {
display: table-cell;
width: 61.8%;
vertical-align: top;
}
.col-narrow {
display: table-cell;
width: 38.2%;
padding-left: 6%;
vertical-align: top;
}
}
/*
* Front page
*
* Big section blocks for the front page
*/
.front-section {
padding: 8px 0;
}
@media (min-width: 568px) {
.front-section {
padding-top: 30px;
padding-bottom: 30px;
display: table;
width: 100%;
}
.front-section h2:first-child {
margin-top: 0;
}
}
.front-section.shaded {
background-color: #f4f4f4;
}
/*
* FAQs
*
* Formatted as a definition list
*/
.faqs dt {
font-weight: 700;
}
.faqs dd {
color: #777;
font-size: 15px;
margin-left: 0;
margin-bottom: 20px;
}
/*
* Buttons
*
* Fun to click
*/
.btn {
display: inline-block;
text-align: center;
vertical-align: middle;
background-color: #3c92d1;
color: #fff;
font-family: 'Lato', sans-serif;
border-radius: 4px;
padding: 15px 30px;
}
.btn:hover {
background-color: #3889c4;
}
.btn.full-width {
width: 100%;
}
/*
* Sponsors
*
* Callout-style box
*/
.sponsors {
background-color: #f5f5f5;
padding: 5px 20px;
border-radius: 4px;
margin-top: 10px;
}
.sponsors h3 {
color: #54a23d;
}
.first-level-sponsor {
margin-bottom: 20px;
}
.first-level-sponsor img {
max-width: 100%;
}
.second-level-sponsors {
width: 100%;
}
.second-level-sponsors td {
width: 50%;
padding: 12px 0;
text-align: center;
vertical-align: middle;
}
.second-level-sponsors img {
width: 80%;
}
@media (min-width: 568px) {
.second-level-sponsor img {
width: auto;
}
}
/*
* Footer
*
* Links, legalese, etc.
*/
footer .container {
border-top: solid 1px #ececec;
padding: 20px 0 50px;
font-size: 12px;
color: #777;
}
@media (min-width: 568px) {
footer .container {
font-size: 14px;
display: table;
}
}
footer a {
color: #444;
}
/*
* Misc
*
* Odds 'n ends
*/
.light {
color: #777;
}
.light a {
color: #444;
}
.small {
font-size: 70%;
}
/*
* Newsletter CSS
*/
.newsletter h1 {
margin-bottom: 0px;
}

View File

@@ -0,0 +1,23 @@
<!-- HTML footer for doxygen 1.8.6-->
<!-- start footer part -->
<!--BEGIN GENERATE_TREEVIEW-->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
$navpath
<li class="footer">$generatedby
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="$relpath^doxygen.png" alt="doxygen"/></a> $doxygenversion </li>
</ul>
</div>
<!--END GENERATE_TREEVIEW-->
<!--BEGIN !GENERATE_TREEVIEW-->
<footer>
<div class="container">
$generatedby
<a href="http://www.doxygen.org/index.html">Doxygen</a>
$doxygenversion
</div>
</footer>
<!--END !GENERATE_TREEVIEW-->
</body>
</html>

View File

@@ -0,0 +1,36 @@
<!-- HTML header for doxygen 1.8.6-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen $doxygenversion"/>
<!--BEGIN PROJECT_NAME--><title>$projectname: $title</title><!--END PROJECT_NAME-->
<!--BEGIN !PROJECT_NAME--><title>$title</title><!--END !PROJECT_NAME-->
<script type="text/javascript" src="$relpath^jquery.js"></script>
<script type="text/javascript" src="$relpath^dynsections.js"></script>
$treeview
$search
$mathjax
<link href="$relpath^$stylesheet" rel="stylesheet" type="text/css" />
$extrastylesheet
<link href="http://fonts.googleapis.com/css?family=Lato:400,700,900" rel="stylesheet">
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<!--BEGIN TITLEAREA-->
<header class="navbar">
<div class="container">
<nav class="site-nav">
<ul>
<li><a href="http://neovim.io/">Neovim Home</a></li>
</ul>
</nav>
<a href="$relpath^index.html">
<img src="$relpath^$projectlogo" class="logo" alt="Neovim Dev-Doc">
</a>
</div>
</header>
<!--END TITLEAREA-->
<!-- end header part -->

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Some files were not shown because too many files have changed in this diff Show More