mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 11:28:22 +00:00
Compare commits
148 Commits
release-0.
...
v0.8.2
Author | SHA1 | Date | |
---|---|---|---|
![]() |
1fa917f9a1 | ||
![]() |
73298d1cd6 | ||
![]() |
0eb155cd26 | ||
![]() |
da68023d98 | ||
![]() |
3892ba2405 | ||
![]() |
9c109a46d3 | ||
![]() |
d5bdcb2bd7 | ||
![]() |
e951181d84 | ||
![]() |
2542aa0b75 | ||
![]() |
172202b49a | ||
![]() |
68ef157cc2 | ||
![]() |
460c1b7888 | ||
![]() |
cc02cfee2f | ||
![]() |
342312b8ad | ||
![]() |
b840eb6945 | ||
![]() |
799e5fb92b | ||
![]() |
9a6a7ad469 | ||
![]() |
76987e8f04 | ||
![]() |
d0f71270cc | ||
![]() |
d849640613 | ||
![]() |
d2582350b2 | ||
![]() |
bd3634d7a4 | ||
![]() |
1860792ed6 | ||
![]() |
48f0545594 | ||
![]() |
9bda3b3e04 | ||
![]() |
23202944ec | ||
![]() |
bc6ff78fad | ||
![]() |
3510298930 | ||
![]() |
5b718e8c12 | ||
![]() |
a9e78dd2f6 | ||
![]() |
ad82f59f59 | ||
![]() |
da47f6e56a | ||
![]() |
faa5ecce93 | ||
![]() |
ec2d6dc955 | ||
![]() |
ca4a600e43 | ||
![]() |
b8b2101540 | ||
![]() |
45d593e1c8 | ||
![]() |
6f386c75c4 | ||
![]() |
21ea794690 | ||
![]() |
0bc56cebe7 | ||
![]() |
cf7ae5f2f9 | ||
![]() |
eacc8230ed | ||
![]() |
927074c97a | ||
![]() |
e5fda53f5d | ||
![]() |
a853becfea | ||
![]() |
015d3ddcfe | ||
![]() |
8d41ffcb5b | ||
![]() |
17f636cf23 | ||
![]() |
ccb718a23d | ||
![]() |
9bd5ba83ab | ||
![]() |
78caeae92f | ||
![]() |
65c8851098 | ||
![]() |
e2afca9c76 | ||
![]() |
ebfe54617f | ||
![]() |
bc4d11cd9d | ||
![]() |
9f5c5abd42 | ||
![]() |
922a3c33f1 | ||
![]() |
4d0fabfe4b | ||
![]() |
4bef100e47 | ||
![]() |
346f77c5a6 | ||
![]() |
4152151c94 | ||
![]() |
742bd4c181 | ||
![]() |
41192dae78 | ||
![]() |
9c32331904 | ||
![]() |
b994deb0aa | ||
![]() |
935615ffed | ||
![]() |
3e0783db43 | ||
![]() |
32b0b13cc5 | ||
![]() |
3d0ddd2d1f | ||
![]() |
7a49cf4da9 | ||
![]() |
1b359d4034 | ||
![]() |
81781810e6 | ||
![]() |
8e28d8a370 | ||
![]() |
a35efe1e4f | ||
![]() |
ca9b5687f6 | ||
![]() |
b0cb9a8ad0 | ||
![]() |
95e1978959 | ||
![]() |
2255d0fb63 | ||
![]() |
eefa7fbbc2 | ||
![]() |
bd4269c6a6 | ||
![]() |
2c374e626a | ||
![]() |
6a2dcaf6ab | ||
![]() |
747b8dac73 | ||
![]() |
f70feadb17 | ||
![]() |
06144afb71 | ||
![]() |
5eab16fa24 | ||
![]() |
ddc0b75d53 | ||
![]() |
7aaa0f4888 | ||
![]() |
c34ebe60be | ||
![]() |
06c63f50fc | ||
![]() |
32ccb9770b | ||
![]() |
f73bc880f4 | ||
![]() |
f76473898d | ||
![]() |
5a14c820a9 | ||
![]() |
e7ed53286e | ||
![]() |
7e8662676a | ||
![]() |
cb086f1886 | ||
![]() |
9234e5acd6 | ||
![]() |
24769cf1b5 | ||
![]() |
6fe00190f0 | ||
![]() |
50f756ceb2 | ||
![]() |
47454d0012 | ||
![]() |
c52d256e91 | ||
![]() |
59087b615d | ||
![]() |
89fbffff13 | ||
![]() |
7ba968ef3b | ||
![]() |
8595f0298a | ||
![]() |
7a011cb58d | ||
![]() |
5b1bda14ae | ||
![]() |
1cd5361c39 | ||
![]() |
719afa2988 | ||
![]() |
60ccada4cb | ||
![]() |
6b49a20137 | ||
![]() |
5f54cfcc05 | ||
![]() |
bca9b1ecdf | ||
![]() |
5e88506508 | ||
![]() |
f294712d8c | ||
![]() |
acb8033bca | ||
![]() |
a6b62821de | ||
![]() |
deda165155 | ||
![]() |
2853284434 | ||
![]() |
62e3ca3e2b | ||
![]() |
0f669b7b70 | ||
![]() |
29aa6e715b | ||
![]() |
d92e6acc46 | ||
![]() |
00761ad1e6 | ||
![]() |
47cd3cf852 | ||
![]() |
00ce3d6e7a | ||
![]() |
aaee148392 | ||
![]() |
9ad6f0da83 | ||
![]() |
bca4588e17 | ||
![]() |
126e434fec | ||
![]() |
2ad8d36b89 | ||
![]() |
e49dcbcc4b | ||
![]() |
a6f19d39a4 | ||
![]() |
68eb063416 | ||
![]() |
cafc2ebc91 | ||
![]() |
8fc775e3a4 | ||
![]() |
7773fed570 | ||
![]() |
d66e7a13c9 | ||
![]() |
49dd143abc | ||
![]() |
9857cc1dbf | ||
![]() |
947ec159ae | ||
![]() |
0c3054b033 | ||
![]() |
ce422ba763 | ||
![]() |
bb9c5c3f60 | ||
![]() |
9e784a53b4 | ||
![]() |
4db8c25bda |
@@ -1,19 +1,21 @@
|
|||||||
env:
|
env:
|
||||||
CIRRUS_CLONE_DEPTH: '2'
|
CIRRUS_CLONE_DEPTH: '2'
|
||||||
LANG: en_US.UTF-8
|
LANG: en_US.UTF-8
|
||||||
|
CMAKE_EXTRA_FLAGS: -DCI_BUILD=ON -DMIN_LOG_LEVEL=3
|
||||||
|
|
||||||
freebsd_task:
|
freebsd_task:
|
||||||
name: FreeBSD
|
name: FreeBSD
|
||||||
only_if: $BRANCH != "master"
|
only_if: $BRANCH != "master"
|
||||||
freebsd_instance:
|
freebsd_instance:
|
||||||
image_family: freebsd-14-2
|
image_family: freebsd-13-1
|
||||||
timeout_in: 30m
|
timeout_in: 30m
|
||||||
install_script:
|
install_script:
|
||||||
- pkg install -y cmake gmake ninja unzip wget gettext python git
|
- pkg update -f
|
||||||
|
- pkg install -y cmake gmake ninja libtool automake pkgconf unzip wget gettext python libffi git
|
||||||
build_deps_script:
|
build_deps_script:
|
||||||
- gmake deps
|
- gmake deps
|
||||||
build_script:
|
build_script:
|
||||||
- gmake CMAKE_EXTRA_FLAGS="-DCI_BUILD=ON" nvim
|
- gmake CMAKE_EXTRA_FLAGS="${CMAKE_EXTRA_FLAGS}" nvim
|
||||||
workaround_script:
|
workaround_script:
|
||||||
# Run tests as user "cirrus" instead of root. This is required for the
|
# Run tests as user "cirrus" instead of root. This is required for the
|
||||||
# permission-related tests to work correctly.
|
# permission-related tests to work correctly.
|
||||||
|
@@ -14,7 +14,7 @@ PenaltyReturnTypeOnItsOwnLine: 200
|
|||||||
AllowAllParametersOfDeclarationOnNextLine: false
|
AllowAllParametersOfDeclarationOnNextLine: false
|
||||||
AllowShortIfStatementsOnASingleLine: false
|
AllowShortIfStatementsOnASingleLine: false
|
||||||
AllowShortLoopsOnASingleLine: false
|
AllowShortLoopsOnASingleLine: false
|
||||||
BinPackParameters: true
|
BinPackParameters: false
|
||||||
BreakBeforeBinaryOperators: true
|
BreakBeforeBinaryOperators: true
|
||||||
BreakBeforeTernaryOperators: true
|
BreakBeforeTernaryOperators: true
|
||||||
ContinuationIndentWidth: 2
|
ContinuationIndentWidth: 2
|
||||||
@@ -23,7 +23,7 @@ AlwaysBreakAfterReturnType: None
|
|||||||
AlwaysBreakBeforeMultilineStrings: No
|
AlwaysBreakBeforeMultilineStrings: No
|
||||||
AlwaysBreakTemplateDeclarations: No
|
AlwaysBreakTemplateDeclarations: No
|
||||||
AlignEscapedNewlines: DontAlign
|
AlignEscapedNewlines: DontAlign
|
||||||
BinPackArguments: true
|
BinPackArguments: false
|
||||||
BraceWrapping:
|
BraceWrapping:
|
||||||
AfterClass: false
|
AfterClass: false
|
||||||
AfterControlStatement: false
|
AfterControlStatement: false
|
||||||
|
76
.clang-tidy
76
.clang-tidy
@@ -1,76 +0,0 @@
|
|||||||
WarningsAsErrors: '*,-clang-diagnostic-unused-function'
|
|
||||||
Checks: >
|
|
||||||
Enable all warnings by default. This ensures we don't miss new and useful
|
|
||||||
warnings when a new version of clang-tidy is dropped.
|
|
||||||
|
|
||||||
IMPORTANT
|
|
||||||
clang-tidy doesn't support comments but we can simulate comments by just
|
|
||||||
writing text directly here. These are then interpreted as warnings and will
|
|
||||||
be dropped. As long as you start every sentence with a capital letter and
|
|
||||||
don't use commas in your "comments" you should be fine,
|
|
||||||
*,
|
|
||||||
|
|
||||||
Untriaged warnings. Please categorize them accordingly if you find a relevant
|
|
||||||
section for it,
|
|
||||||
-bugprone-assignment-in-if-condition,
|
|
||||||
-bugprone-implicit-widening-of-multiplication-result,
|
|
||||||
-bugprone-multi-level-implicit-pointer-conversion,
|
|
||||||
-bugprone-not-null-terminated-result,
|
|
||||||
-bugprone-suspicious-memory-comparison,
|
|
||||||
-bugprone-switch-missing-default-case,
|
|
||||||
-cert-env33-c,
|
|
||||||
-cert-err33-c,
|
|
||||||
-cert-err34-c,
|
|
||||||
-concurrency-mt-unsafe,
|
|
||||||
-cppcoreguidelines-narrowing-conversions,
|
|
||||||
|
|
||||||
Warnings that may be useful, but are too inconsistent to enable by default
|
|
||||||
May yield useful results with some manual triaging,
|
|
||||||
-bugprone-branch-clone,
|
|
||||||
-bugprone-macro-parentheses,
|
|
||||||
-bugprone-sizeof-expression,
|
|
||||||
-hicpp-multiway-paths-covered,
|
|
||||||
-hicpp-signed-bitwise,
|
|
||||||
-misc-unused-parameters,
|
|
||||||
-modernize-macro-to-enum,
|
|
||||||
-readability-avoid-nested-conditional-operator,
|
|
||||||
-readability-else-after-return,
|
|
||||||
-readability-function-size,
|
|
||||||
-readability-isolate-declaration,
|
|
||||||
|
|
||||||
Warnings that are rarely useful,
|
|
||||||
-altera-*, Checks related to OpenCL programming for FPGAs. Not relevant,
|
|
||||||
-android-*,
|
|
||||||
-bugprone-easily-swappable-parameters,
|
|
||||||
-bugprone-inc-dec-in-conditions,
|
|
||||||
-bugprone-swapped-arguments,
|
|
||||||
-clang-analyzer-*, Already covered by the cmake target "clang-analyzer",
|
|
||||||
-cppcoreguidelines-avoid-non-const-global-variables,
|
|
||||||
-cppcoreguidelines-init-variables,
|
|
||||||
-llvm-header-guard, We use #pragma once,
|
|
||||||
-llvmlibc-restrict-system-libc-headers, We want to use glibc,
|
|
||||||
-misc-include-cleaner, Looks useful but redundant with IWYU. We may replace IWYU with this one day,
|
|
||||||
-misc-misplaced-const,
|
|
||||||
-misc-no-recursion,
|
|
||||||
-performance-no-int-to-ptr,
|
|
||||||
-readability-function-cognitive-complexity,
|
|
||||||
-readability-identifier-length,
|
|
||||||
-readability-magic-numbers,
|
|
||||||
-readability-redundant-declaration, Conflicts with our header generation scripts,
|
|
||||||
-readability-suspicious-call-argument,
|
|
||||||
|
|
||||||
Aliases. These are just duplicates of other warnings and should always be ignored,
|
|
||||||
-bugprone-narrowing-conversions,
|
|
||||||
-cert-dcl37-c,
|
|
||||||
-cert-dcl51-cpp,
|
|
||||||
-cert-exp42-c,
|
|
||||||
-cert-flp37-c,
|
|
||||||
-cert-msc24-c,
|
|
||||||
-cert-msc33-c,
|
|
||||||
-cppcoreguidelines-avoid-magic-numbers,
|
|
||||||
-cppcoreguidelines-macro-to-enum,
|
|
||||||
-google-readability-braces-around-statements,
|
|
||||||
-google-readability-function-size,
|
|
||||||
-hicpp-braces-around-statements,
|
|
||||||
-hicpp-function-size,
|
|
||||||
-llvm-else-after-return,
|
|
2
.clangd
2
.clangd
@@ -1,4 +1,2 @@
|
|||||||
CompileFlags:
|
CompileFlags:
|
||||||
CompilationDatabase: build/ # Search build/ directory for compile_commands.json
|
CompilationDatabase: build/ # Search build/ directory for compile_commands.json
|
||||||
Diagnostics:
|
|
||||||
UnusedIncludes: None
|
|
||||||
|
@@ -10,9 +10,6 @@ insert_final_newline = true
|
|||||||
[*.{c,h,in,lua}]
|
[*.{c,h,in,lua}]
|
||||||
max_line_length = 100
|
max_line_length = 100
|
||||||
|
|
||||||
[*.py]
|
|
||||||
indent_size = 4
|
|
||||||
|
|
||||||
[{Makefile,**/Makefile,runtime/doc/*.txt}]
|
[{Makefile,**/Makefile,runtime/doc/*.txt}]
|
||||||
indent_style = tab
|
indent_style = tab
|
||||||
indent_size = 8
|
indent_size = 8
|
||||||
|
@@ -53,34 +53,10 @@ aa4f9c5341f5280f16cce0630ea54b84eef717b3
|
|||||||
93f24403f8cc760ff47979c596976b53a8b16358
|
93f24403f8cc760ff47979c596976b53a8b16358
|
||||||
1ffd527c837fb2465c9659273bbe5447a1352db2
|
1ffd527c837fb2465c9659273bbe5447a1352db2
|
||||||
2498e9feb025361576603a0101c86393d211e31e
|
2498e9feb025361576603a0101c86393d211e31e
|
||||||
0b3ae64480ea28bb57783c2269a61f0a60ffc55e
|
|
||||||
0fc8597f011e0927e529abd11bf0ddd8d0d1eaab
|
|
||||||
6ff245732a5a8ab821598a38fb0c5805e6bd3779
|
|
||||||
abf758a2977c4e6cab4dfa217f56da853d85851c
|
|
||||||
cb84f5ee530f0f32b92bed5b4ad41344e8b551aa
|
|
||||||
f98b8d2d44d289263b1a3b33b6a7f20644ef671c
|
|
||||||
544ef994df72c3cbe0dca6b856ce2dcbc5169767
|
|
||||||
45fe4d11add933df76a2ea4bf52ce8904f4a778b
|
|
||||||
517f0cc634b985057da5b95cf4ad659ee456a77e
|
|
||||||
04f2f864e270e772c6326cefdf24947f0130e492
|
|
||||||
|
|
||||||
# typos
|
# typos
|
||||||
d238b8f6003d34cae7f65ff7585b48a2cd9449fb
|
d238b8f6003d34cae7f65ff7585b48a2cd9449fb
|
||||||
4547137aaff32b20172870a549d3a28a3c7adf1c
|
4547137aaff32b20172870a549d3a28a3c7adf1c
|
||||||
08616571f47cc367a5fe59b52295708b9fda3b09
|
|
||||||
09c6ce8c4e4c6415cca9b834539ed0df461373f6
|
|
||||||
0b0c4f7dfa4a9a564cbf44262d4bea9bdefe2dc9
|
|
||||||
4a96e7809f4d9f6ce21869817eb95ff6dcaa1693
|
|
||||||
61205c1defb64ac5466496b5451e4a7f3171e21e
|
|
||||||
64116d78502e0ca611e13adf9323ef2d3fe708c2
|
|
||||||
abc087f4c65ca547cae58518b42aee82ff4a07f6
|
|
||||||
b8dcbcc732baf84fc48d6b272c3ade0bcb129b3b
|
|
||||||
c815aadfccd6bada47ecfb09fe188ee7f7c5caf3
|
|
||||||
caa6992a1071a2ac373bec21085685da4a1790d6
|
|
||||||
df646572c53f55268a5dbb61628d7c3b302d5663
|
|
||||||
e63e5d1dbd3dd4711efa0ecf9e844ff308b370a6
|
|
||||||
eb123b565e201418dd135d2602dc20eea3cead39
|
|
||||||
ff20d40321399fa187bd350f9619cf6418d7eb6e
|
|
||||||
|
|
||||||
# generated docs
|
# generated docs
|
||||||
ea333badd24f691c753d8048f911d1db349bc2cd
|
ea333badd24f691c753d8048f911d1db349bc2cd
|
||||||
|
12
.gitattributes
vendored
12
.gitattributes
vendored
@@ -3,16 +3,14 @@
|
|||||||
*CMakeLists.txt linguist-language=CMake
|
*CMakeLists.txt linguist-language=CMake
|
||||||
|
|
||||||
runtime/doc/* linguist-documentation
|
runtime/doc/* linguist-documentation
|
||||||
runtime/doc/builtin.txt linguist-generated
|
|
||||||
|
|
||||||
runtime/lua/vim/_meta/vimfn.lua linguist-generated
|
|
||||||
runtime/lua/vim/_meta/vvars.lua linguist-generated
|
|
||||||
runtime/lua/vim/_meta/api.lua linguist-generated
|
|
||||||
runtime/lua/vim/_meta/api_keysets.lua linguist-generated
|
|
||||||
runtime/lua/vim/_meta/options.lua linguist-generated
|
|
||||||
|
|
||||||
src/xdiff/** linguist-vendored
|
src/xdiff/** linguist-vendored
|
||||||
src/cjson/** linguist-vendored
|
src/cjson/** linguist-vendored
|
||||||
src/unicode/** linguist-vendored
|
src/unicode/** linguist-vendored
|
||||||
|
|
||||||
|
src/nvim/testdir/test42.in diff
|
||||||
|
|
||||||
.github/ export-ignore
|
.github/ export-ignore
|
||||||
|
.travis.yml export-ignore
|
||||||
|
codecov.yml export-ignore
|
||||||
|
.builds/ export-ignore
|
||||||
|
61
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
61
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@@ -6,40 +6,7 @@ body:
|
|||||||
- type: markdown
|
- type: markdown
|
||||||
attributes:
|
attributes:
|
||||||
value: |
|
value: |
|
||||||
*Before reporting:*
|
_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.
|
||||||
- Confirm the problem is reproducible on [**master**](https://github.com/neovim/neovim/releases/nightly) or [**latest stable**](https://github.com/neovim/neovim/releases/stable) release
|
|
||||||
- Run `make distclean` when encountering build issues
|
|
||||||
- Search [existing issues](https://github.com/neovim/neovim/issues?q=is%3Aissue+is%3Aopen+label%3Abug,bug-crash) (including [closed](https://github.com/neovim/neovim/issues?q=is%3Aissue+is%3Aclosed+label%3Abug%2Cbug-crash))
|
|
||||||
- Read the [FAQ](https://neovim.io/doc/user/faq.html) and ["Reporting Problems" in CONTRIBUTING.md](https://github.com/neovim/neovim/blob/master/CONTRIBUTING.md#reporting-problems).
|
|
||||||
|
|
||||||
Usage or "How to" questions belong on [stackoverflow](https://vi.stackexchange.com/) and will be closed.
|
|
||||||
- type: textarea
|
|
||||||
attributes:
|
|
||||||
label: "Problem"
|
|
||||||
description: "Describe the current behavior. May include logs, images, or videos."
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
attributes:
|
|
||||||
label: "Steps to reproduce"
|
|
||||||
description: |
|
|
||||||
- For build failures: list the exact steps including CMake flags (if any).
|
|
||||||
- If the bug pertains to crashing (or segfault), please include a [stacktrace](https://neovim.io/doc/user/dev_tools.html#dev-tools-backtrace).
|
|
||||||
- For startup or shell-related problems: try `env -i TERM=ansi-256color "$(which nvim)"`.
|
|
||||||
- Use the provided [minimal reproduction template](https://github.com/neovim/neovim/blob/master/contrib/minimal.lua) to create a minimal configuration. After you fill it out with necessary information, run with `nvim --clean -u minimal.lua`.
|
|
||||||
- Please do **not** include a package manager in the reproduction steps.
|
|
||||||
placeholder: |
|
|
||||||
nvim --clean
|
|
||||||
:edit foo
|
|
||||||
yiwp
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
attributes:
|
|
||||||
label: "Expected behavior"
|
|
||||||
description: "Describe the behavior you expect."
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
- type: input
|
- type: input
|
||||||
attributes:
|
attributes:
|
||||||
@@ -80,3 +47,29 @@ body:
|
|||||||
placeholder: "Arch User Repository (AUR)"
|
placeholder: "Arch User Repository (AUR)"
|
||||||
validations:
|
validations:
|
||||||
required: true
|
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
|
||||||
|
2
.github/ISSUE_TEMPLATE/config.yml
vendored
2
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -1,5 +1,5 @@
|
|||||||
blank_issues_enabled: false
|
blank_issues_enabled: false
|
||||||
contact_links:
|
contact_links:
|
||||||
- name: Question
|
- name: Question
|
||||||
url: https://vi.stackexchange.com/
|
url: https://neovim.discourse.group/
|
||||||
about: Ask questions about configuration and usage of Neovim
|
about: Ask questions about configuration and usage of Neovim
|
||||||
|
19
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
19
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
@@ -6,19 +6,16 @@ body:
|
|||||||
- type: markdown
|
- type: markdown
|
||||||
attributes:
|
attributes:
|
||||||
value: |
|
value: |
|
||||||
Before requesting: search [existing feature requests](https://github.com/neovim/neovim/labels/enhancement) and check the [FAQ](https://neovim.io/doc/user/faq.html).
|
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
|
- type: textarea
|
||||||
attributes:
|
attributes:
|
||||||
label: "Problem"
|
label: "Feature description"
|
||||||
description: "Describe the problem to be solved. Include references to other projects (Vim, Emacs, etc.) if relevant."
|
|
||||||
placeholder: "No smurf icons available. Smurfs are useful because ..."
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
- type: textarea
|
|
||||||
attributes:
|
|
||||||
label: "Expected behavior"
|
|
||||||
description: "Describe what the new feature or behavior would look like. How does it solve the problem? Is it worth the cost?"
|
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
|
68
.github/ISSUE_TEMPLATE/lsp_bug_report.yml
vendored
68
.github/ISSUE_TEMPLATE/lsp_bug_report.yml
vendored
@@ -6,56 +6,7 @@ body:
|
|||||||
- type: markdown
|
- type: markdown
|
||||||
attributes:
|
attributes:
|
||||||
value: |
|
value: |
|
||||||
_Before reporting:_ search [existing issues](https://github.com/neovim/neovim/issues?q=is%3Aissue+is%3Aopen+label%3Abug) and check the [FAQ](https://neovim.io/doc/user/faq.html). Usage questions or "Why isn't X language server/feature working?" belong on [stackoverflow](https://vi.stackexchange.com/) and will be closed.
|
_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: textarea
|
|
||||||
attributes:
|
|
||||||
label: "Problem"
|
|
||||||
description: "Describe the bug caused by the Nvim LSP client."
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
attributes:
|
|
||||||
label: 'Steps to reproduce using "nvim -u minimal_init.lua"'
|
|
||||||
description: |
|
|
||||||
- Create a minimal_init.lua using vim.lsp.start:
|
|
||||||
|
|
||||||
```lua
|
|
||||||
--- CHANGE THESE
|
|
||||||
local pattern = 'the-filetype'
|
|
||||||
local cmd = {'name-of-language-server-executable'}
|
|
||||||
-- Add files/folders here that indicate the root of a project
|
|
||||||
local root_markers = {'.git', '.editorconfig'}
|
|
||||||
-- Change to table with settings if required
|
|
||||||
local settings = vim.empty_dict()
|
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd('FileType', {
|
|
||||||
pattern = pattern,
|
|
||||||
callback = function(args)
|
|
||||||
local match = vim.fs.find(root_markers, { path = args.file, upward = true })[1]
|
|
||||||
local root_dir = match and vim.fn.fnamemodify(match, ':p:h') or nil
|
|
||||||
vim.lsp.start({
|
|
||||||
name = 'bugged-ls',
|
|
||||||
cmd = cmd,
|
|
||||||
root_dir = root_dir,
|
|
||||||
settings = settings
|
|
||||||
})
|
|
||||||
end
|
|
||||||
})
|
|
||||||
```
|
|
||||||
|
|
||||||
See `:h lsp-quickstart` and `:h vim.lsp.start` for more information
|
|
||||||
|
|
||||||
- Provide a short code example and describe the folder layout
|
|
||||||
- Describe how to trigger the issue. E.g. using `:lua vim.lsp.buf.*` commands
|
|
||||||
|
|
||||||
_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: input
|
- type: input
|
||||||
attributes:
|
attributes:
|
||||||
@@ -76,6 +27,23 @@ body:
|
|||||||
validations:
|
validations:
|
||||||
required: true
|
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
|
- type: input
|
||||||
attributes:
|
attributes:
|
||||||
label: "Log file"
|
label: "Log file"
|
||||||
|
2
.github/SECURITY.md
vendored
2
.github/SECURITY.md
vendored
@@ -1,2 +0,0 @@
|
|||||||
To report a security vulnerability to Neovim, use
|
|
||||||
https://github.com/neovim/neovim/security/advisories/new
|
|
33
.github/actions/cache/action.yml
vendored
33
.github/actions/cache/action.yml
vendored
@@ -1,33 +0,0 @@
|
|||||||
name: 'Cache'
|
|
||||||
description: "This action caches neovim dependencies"
|
|
||||||
runs:
|
|
||||||
using: "composite"
|
|
||||||
steps:
|
|
||||||
- run: echo "CACHE_KEY=${{ github.workflow }}" >> $GITHUB_ENV
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- run: echo "CACHE_KEY=${{ github.job }}" >> $GITHUB_ENV
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- if: ${{ matrix }}
|
|
||||||
run: echo "CACHE_KEY=$CACHE_KEY-${{ join(matrix.*, '-') }}" >> $GITHUB_ENV
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- if: ${{ matrix.build }}
|
|
||||||
run: echo "CACHE_KEY=$CACHE_KEY-${{ join(matrix.build.*, '-') }}" >> $GITHUB_ENV
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- id: image
|
|
||||||
run: echo "version=$ImageVersion" >> $GITHUB_OUTPUT
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
# Avoid using '**/CMakeLists.txt' (or any pattern starting with '**/') even
|
|
||||||
# if it makes the expression below simpler. hashFiles() has a timer that
|
|
||||||
# will fail the job if it times out, which can happen if there are too many
|
|
||||||
# files to search through.
|
|
||||||
- uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: .deps
|
|
||||||
key: ${{ env.CACHE_KEY }}-${{ steps.image.outputs.version }}-${{ hashFiles('cmake**',
|
|
||||||
'.github/**', 'CMakeLists.txt',
|
|
||||||
'runtime/CMakeLists.txt', 'src/nvim/**/CMakeLists.txt') }}
|
|
29
.github/actions/setup/action.yml
vendored
29
.github/actions/setup/action.yml
vendored
@@ -1,29 +0,0 @@
|
|||||||
name: 'setup'
|
|
||||||
description: "Creates necessary setup for CI"
|
|
||||||
inputs:
|
|
||||||
install_flags:
|
|
||||||
description: 'Install script flags'
|
|
||||||
required: false
|
|
||||||
default: ''
|
|
||||||
runs:
|
|
||||||
using: "composite"
|
|
||||||
steps:
|
|
||||||
- name: Set $BIN_DIR
|
|
||||||
shell: bash
|
|
||||||
run: echo "$BIN_DIR" >> $GITHUB_PATH
|
|
||||||
|
|
||||||
- if: ${{ runner.os != 'Windows' }}
|
|
||||||
name: Set ulimit
|
|
||||||
shell: bash
|
|
||||||
run: ulimit -c unlimited
|
|
||||||
|
|
||||||
- if: ${{ runner.os == 'Windows' }}
|
|
||||||
run: .github/scripts/env.ps1
|
|
||||||
shell: pwsh
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: ./.github/scripts/install_deps.sh ${{ inputs.install_flags }}
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Cache
|
|
||||||
uses: ./.github/actions/cache
|
|
8
.github/dependabot.yml
vendored
8
.github/dependabot.yml
vendored
@@ -1,8 +0,0 @@
|
|||||||
version: 2
|
|
||||||
updates:
|
|
||||||
- package-ecosystem: "github-actions"
|
|
||||||
directory: "/"
|
|
||||||
schedule:
|
|
||||||
interval: "daily"
|
|
||||||
commit-message:
|
|
||||||
prefix: "ci"
|
|
65
.github/labeler.yml
vendored
Normal file
65
.github/labeler.yml
vendored
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
"lsp":
|
||||||
|
- runtime/lua/vim/lsp.lua
|
||||||
|
- runtime/lua/vim/lsp/*
|
||||||
|
|
||||||
|
"lua":
|
||||||
|
- runtime/lua/**/*
|
||||||
|
- src/nvim/lua/*
|
||||||
|
|
||||||
|
"tui":
|
||||||
|
- src/nvim/tui/tui.*
|
||||||
|
|
||||||
|
"treesitter":
|
||||||
|
- src/nvim/lua/treesitter.*
|
||||||
|
- runtime/lua/vim/treesitter.lua
|
||||||
|
- runtime/lua/vim/treesitter/*
|
||||||
|
- runtime/queries/**/*
|
||||||
|
|
||||||
|
"diagnostic":
|
||||||
|
- runtime/lua/vim/diagnostic.lua
|
||||||
|
|
||||||
|
"dependencies":
|
||||||
|
- cmake.deps/**/*
|
||||||
|
|
||||||
|
"spell":
|
||||||
|
- src/nvim/spell*
|
||||||
|
|
||||||
|
"terminal":
|
||||||
|
- src/nvim/terminal.*
|
||||||
|
|
||||||
|
"column":
|
||||||
|
- src/nvim/sign*
|
||||||
|
|
||||||
|
"folds":
|
||||||
|
- src/nvim/fold*
|
||||||
|
|
||||||
|
"mouse":
|
||||||
|
- src/nvim/mouse*
|
||||||
|
|
||||||
|
"documentation":
|
||||||
|
- all: ["runtime/doc/*"]
|
||||||
|
- all: ["**/*.md"]
|
||||||
|
|
||||||
|
"clipboard":
|
||||||
|
- runtime/autoload/provider/clipboard.vim
|
||||||
|
|
||||||
|
"diff":
|
||||||
|
- src/nvim/diff.*
|
||||||
|
|
||||||
|
"build":
|
||||||
|
- CMakeLists.txt
|
||||||
|
- "**/CMakeLists.txt"
|
||||||
|
- "**/Makefile"
|
||||||
|
- "**/*.cmake"
|
||||||
|
|
||||||
|
"test":
|
||||||
|
- all: ["test/**/*"]
|
||||||
|
|
||||||
|
"ci":
|
||||||
|
- .github/labeler.yml
|
||||||
|
- .github/workflows/**/*
|
||||||
|
- .builds/*
|
||||||
|
- ci/**/*
|
||||||
|
|
||||||
|
"filetype":
|
||||||
|
- runtime/lua/vim/filetype.lua
|
56
.github/scripts/close_unresponsive.js
vendored
56
.github/scripts/close_unresponsive.js
vendored
@@ -1,56 +0,0 @@
|
|||||||
function labeledEvent(data) {
|
|
||||||
return data.event === "labeled" && data.label.name === "needs:response";
|
|
||||||
}
|
|
||||||
|
|
||||||
const numberOfDaysLimit = 30;
|
|
||||||
const close_message = `This has been closed since a request for information has \
|
|
||||||
not been answered for ${numberOfDaysLimit} days. It can be reopened when the \
|
|
||||||
requested information is provided.`;
|
|
||||||
|
|
||||||
module.exports = async ({ github, context }) => {
|
|
||||||
const owner = context.repo.owner;
|
|
||||||
const repo = context.repo.repo;
|
|
||||||
|
|
||||||
const issues = await github.rest.issues.listForRepo({
|
|
||||||
owner: owner,
|
|
||||||
repo: repo,
|
|
||||||
labels: "needs:response",
|
|
||||||
});
|
|
||||||
const numbers = issues.data.map((e) => e.number);
|
|
||||||
|
|
||||||
for (const number of numbers) {
|
|
||||||
const events = await github.paginate(
|
|
||||||
github.rest.issues.listEventsForTimeline,
|
|
||||||
{
|
|
||||||
owner: owner,
|
|
||||||
repo: repo,
|
|
||||||
issue_number: number,
|
|
||||||
},
|
|
||||||
(response) => response.data.filter(labeledEvent),
|
|
||||||
);
|
|
||||||
|
|
||||||
const latest_response_label = events[events.length - 1];
|
|
||||||
|
|
||||||
const created_at = new Date(latest_response_label.created_at);
|
|
||||||
const now = new Date();
|
|
||||||
const diff = now - created_at;
|
|
||||||
const diffDays = diff / (1000 * 60 * 60 * 24);
|
|
||||||
|
|
||||||
if (diffDays > numberOfDaysLimit) {
|
|
||||||
github.rest.issues.update({
|
|
||||||
owner: owner,
|
|
||||||
repo: repo,
|
|
||||||
issue_number: number,
|
|
||||||
state_reason: "not_planned",
|
|
||||||
state: "closed",
|
|
||||||
});
|
|
||||||
|
|
||||||
github.rest.issues.createComment({
|
|
||||||
owner: owner,
|
|
||||||
repo: repo,
|
|
||||||
issue_number: number,
|
|
||||||
body: close_message,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
9
.github/scripts/env.ps1
vendored
9
.github/scripts/env.ps1
vendored
@@ -1,9 +0,0 @@
|
|||||||
# This script enables Developer Command Prompt
|
|
||||||
# See https://github.com/microsoft/vswhere/wiki/Start-Developer-Command-Prompt#using-powershell
|
|
||||||
$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
|
|
||||||
"$name=$value" >> $env:GITHUB_ENV
|
|
||||||
}
|
|
||||||
}
|
|
47
.github/scripts/install_deps.sh
vendored
47
.github/scripts/install_deps.sh
vendored
@@ -1,47 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
while (($# > 0)); do
|
|
||||||
case $1 in
|
|
||||||
--test) # install test dependencies
|
|
||||||
TEST=1
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
os=$(uname -s)
|
|
||||||
if [[ $os == Linux ]]; then
|
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install -y build-essential cmake curl gettext ninja-build
|
|
||||||
|
|
||||||
if [[ $CC == clang ]]; then
|
|
||||||
DEFAULT_CLANG_VERSION=$(echo | clang -dM -E - | grep __clang_major | awk '{print $3}')
|
|
||||||
CLANG_VERSION=19
|
|
||||||
if ((DEFAULT_CLANG_VERSION >= CLANG_VERSION)); then
|
|
||||||
echo "Default clang version is $DEFAULT_CLANG_VERSION, which equal or larger than wanted version $CLANG_VERSION. Aborting!"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
wget https://apt.llvm.org/llvm.sh
|
|
||||||
chmod +x llvm.sh
|
|
||||||
sudo ./llvm.sh $CLANG_VERSION
|
|
||||||
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-$CLANG_VERSION 100
|
|
||||||
sudo update-alternatives --set clang /usr/bin/clang-$CLANG_VERSION
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -n $TEST ]]; then
|
|
||||||
sudo apt-get install -y locales-all cpanminus attr libattr1-dev gdb fswatch xdg-utils
|
|
||||||
|
|
||||||
# Use default CC to avoid compilation problems when installing Python modules
|
|
||||||
CC=cc python3 -m pip -q install --user --upgrade --break-system-packages pynvim
|
|
||||||
fi
|
|
||||||
elif [[ $os == Darwin ]]; then
|
|
||||||
brew update --quiet
|
|
||||||
brew install ninja
|
|
||||||
if [[ -n $TEST ]]; then
|
|
||||||
brew install cpanminus fswatch
|
|
||||||
|
|
||||||
# Use default CC to avoid compilation problems when installing Python modules
|
|
||||||
CC=cc python3 -m pip -q install --user --upgrade --break-system-packages pynvim
|
|
||||||
fi
|
|
||||||
fi
|
|
91
.github/scripts/labeler_configuration.yml
vendored
91
.github/scripts/labeler_configuration.yml
vendored
@@ -1,91 +0,0 @@
|
|||||||
build:
|
|
||||||
- changed-files:
|
|
||||||
- any-glob-to-any-file: [ CMakeLists.txt, "**/CMakeLists.txt", "**/Makefile", "**/*.cmake", cmake.deps/**/* ]
|
|
||||||
|
|
||||||
checkhealth:
|
|
||||||
- changed-files:
|
|
||||||
- any-glob-to-any-file: [ "**/health.lua" ]
|
|
||||||
|
|
||||||
ci:
|
|
||||||
- changed-files:
|
|
||||||
- any-glob-to-any-file: [ .github/actions/**, .github/workflows/**, .github/scripts/** ]
|
|
||||||
|
|
||||||
clipboard:
|
|
||||||
- changed-files:
|
|
||||||
- any-glob-to-any-file: [ runtime/autoload/provider/clipboard.vim ]
|
|
||||||
|
|
||||||
column:
|
|
||||||
- changed-files:
|
|
||||||
- any-glob-to-any-file: [ src/nvim/sign* ]
|
|
||||||
|
|
||||||
comment:
|
|
||||||
- changed-files:
|
|
||||||
- any-glob-to-any-file: [ runtime/lua/vim/_comment.lua ]
|
|
||||||
|
|
||||||
defaults:
|
|
||||||
- changed-files:
|
|
||||||
- any-glob-to-any-file: [ runtime/lua/vim/_defaults.lua ]
|
|
||||||
|
|
||||||
diagnostic:
|
|
||||||
- changed-files:
|
|
||||||
- any-glob-to-any-file: [ runtime/lua/vim/diagnostic.lua ]
|
|
||||||
|
|
||||||
diff:
|
|
||||||
- changed-files:
|
|
||||||
- any-glob-to-any-file: [ src/nvim/diff.* ]
|
|
||||||
|
|
||||||
documentation:
|
|
||||||
- changed-files:
|
|
||||||
- any-glob-to-all-files: [ runtime/doc/*, "**/*.md" ]
|
|
||||||
|
|
||||||
editorconfig:
|
|
||||||
- changed-files:
|
|
||||||
- any-glob-to-any-file: [ .editorconfig, runtime/lua/editorconfig.lua, runtime/plugin/editorconfig.lua ]
|
|
||||||
|
|
||||||
filetype:
|
|
||||||
- changed-files:
|
|
||||||
- any-glob-to-any-file: [ runtime/lua/vim/filetype.lua, runtime/lua/vim/filetype/detect.lua ]
|
|
||||||
|
|
||||||
filesystem:
|
|
||||||
- changed-files:
|
|
||||||
- any-glob-to-any-file: [ runtime/lua/vim/fs.lua ]
|
|
||||||
|
|
||||||
folds:
|
|
||||||
- changed-files:
|
|
||||||
- any-glob-to-any-file: [ src/nvim/fold* ]
|
|
||||||
|
|
||||||
lsp:
|
|
||||||
- changed-files:
|
|
||||||
- any-glob-to-any-file: [ runtime/lua/vim/lsp.lua, runtime/lua/vim/lsp/* ]
|
|
||||||
|
|
||||||
mouse:
|
|
||||||
- changed-files:
|
|
||||||
- any-glob-to-any-file: [ src/nvim/mouse* ]
|
|
||||||
|
|
||||||
netrw:
|
|
||||||
- changed-files:
|
|
||||||
- any-glob-to-any-file: [ runtime/autoload/netrw.vim, runtime/plugin/netrwPlugin.vim ]
|
|
||||||
|
|
||||||
snippet:
|
|
||||||
- changed-files:
|
|
||||||
- any-glob-to-any-file: [ runtime/lua/vim/snippet.lua ]
|
|
||||||
|
|
||||||
spell:
|
|
||||||
- changed-files:
|
|
||||||
- any-glob-to-any-file: [ src/nvim/spell* ]
|
|
||||||
|
|
||||||
terminal:
|
|
||||||
- changed-files:
|
|
||||||
- any-glob-to-any-file: [ src/nvim/terminal.* ]
|
|
||||||
|
|
||||||
test:
|
|
||||||
- changed-files:
|
|
||||||
- any-glob-to-all-files: [test/**/*]
|
|
||||||
|
|
||||||
treesitter:
|
|
||||||
- changed-files:
|
|
||||||
- any-glob-to-any-file: [ src/nvim/lua/treesitter.*, runtime/lua/vim/treesitter.lua, runtime/lua/vim/treesitter/*, runtime/queries/**/* ]
|
|
||||||
|
|
||||||
tui:
|
|
||||||
- changed-files:
|
|
||||||
- any-glob-to-any-file: [ src/nvim/tui/tui.* ]
|
|
@@ -2,15 +2,15 @@ module.exports = async ({ github, context }) => {
|
|||||||
const requestedReviewers = await github.rest.pulls.listRequestedReviewers({
|
const requestedReviewers = await github.rest.pulls.listRequestedReviewers({
|
||||||
owner: context.repo.owner,
|
owner: context.repo.owner,
|
||||||
repo: context.repo.repo,
|
repo: context.repo.repo,
|
||||||
pull_number: context.issue.number,
|
pull_number: context.issue.number
|
||||||
});
|
});
|
||||||
|
|
||||||
const reviewers = requestedReviewers.data.users.map((e) => e.login);
|
const reviewers = requestedReviewers.data.users.map(e => e.login)
|
||||||
|
|
||||||
github.rest.pulls.removeRequestedReviewers({
|
github.rest.pulls.removeRequestedReviewers({
|
||||||
owner: context.repo.owner,
|
owner: context.repo.owner,
|
||||||
repo: context.repo.repo,
|
repo: context.repo.repo,
|
||||||
pull_number: context.issue.number,
|
pull_number: context.issue.number,
|
||||||
reviewers: reviewers,
|
reviewers: reviewers
|
||||||
});
|
});
|
||||||
};
|
}
|
19
.github/scripts/remove_response_label.js
vendored
19
.github/scripts/remove_response_label.js
vendored
@@ -1,19 +0,0 @@
|
|||||||
module.exports = async ({ github, context }) => {
|
|
||||||
const commenter = context.actor;
|
|
||||||
const issue = await github.rest.issues.get({
|
|
||||||
owner: context.repo.owner,
|
|
||||||
repo: context.repo.repo,
|
|
||||||
issue_number: context.issue.number,
|
|
||||||
});
|
|
||||||
const author = issue.data.user.login;
|
|
||||||
const labels = issue.data.labels.map((e) => e.name);
|
|
||||||
|
|
||||||
if (author === commenter && labels.includes("needs:response")) {
|
|
||||||
github.rest.issues.removeLabel({
|
|
||||||
owner: context.repo.owner,
|
|
||||||
repo: context.repo.repo,
|
|
||||||
issue_number: context.issue.number,
|
|
||||||
name: "needs:response",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
117
.github/scripts/reviewers_add.js
vendored
117
.github/scripts/reviewers_add.js
vendored
@@ -1,117 +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("build")) {
|
|
||||||
reviewers.add("dundargoc");
|
|
||||||
reviewers.add("jamessan");
|
|
||||||
reviewers.add("justinmk");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (labels.includes("ci")) {
|
|
||||||
reviewers.add("dundargoc");
|
|
||||||
reviewers.add("jamessan");
|
|
||||||
reviewers.add("justinmk");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (labels.includes("column")) {
|
|
||||||
reviewers.add("lewis6991");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (labels.includes("comment")) {
|
|
||||||
reviewers.add("echasnovski");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (labels.includes("defaults")) {
|
|
||||||
reviewers.add("gpanders");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (labels.includes("diagnostic")) {
|
|
||||||
reviewers.add("gpanders");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (labels.includes("diff")) {
|
|
||||||
reviewers.add("lewis6991");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (labels.includes("editorconfig")) {
|
|
||||||
reviewers.add("gpanders");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (labels.includes("marks")) {
|
|
||||||
reviewers.add("bfredl");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (labels.includes("filetype")) {
|
|
||||||
reviewers.add("clason");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (labels.includes("inccommand")) {
|
|
||||||
reviewers.add("famiu");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (labels.includes("lsp")) {
|
|
||||||
reviewers.add("MariaSolOs");
|
|
||||||
reviewers.add("mfussenegger");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (labels.includes("netrw")) {
|
|
||||||
reviewers.add("justinmk");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (labels.includes("options")) {
|
|
||||||
reviewers.add("famiu");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (labels.includes("platform:nix")) {
|
|
||||||
reviewers.add("teto");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (labels.includes("project-management")) {
|
|
||||||
reviewers.add("bfredl");
|
|
||||||
reviewers.add("justinmk");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (labels.includes("snippet")) {
|
|
||||||
reviewers.add("MariaSolOs");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (labels.includes("statusline")) {
|
|
||||||
reviewers.add("famiu");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (labels.includes("treesitter")) {
|
|
||||||
reviewers.add("bfredl");
|
|
||||||
reviewers.add("clason");
|
|
||||||
reviewers.add("lewis6991");
|
|
||||||
reviewers.add("wookayin");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (labels.includes("tui")) {
|
|
||||||
reviewers.add("gpanders");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (labels.includes("typo")) {
|
|
||||||
reviewers.add("dundargoc");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (labels.includes("vim-patch")) {
|
|
||||||
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),
|
|
||||||
});
|
|
||||||
};
|
|
92
.github/scripts/reviews.js
vendored
Normal file
92
.github/scripts/reviews.js
vendored
Normal file
@@ -0,0 +1,92 @@
|
|||||||
|
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)
|
||||||
|
});
|
||||||
|
}
|
18
.github/workflows/api-docs-check.yml
vendored
Normal file
18
.github/workflows/api-docs-check.yml
vendored
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
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
|
70
.github/workflows/api-docs.yml
vendored
Normal file
70
.github/workflows/api-docs.yml
vendored
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
# 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
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
paths:
|
||||||
|
- 'src/nvim/api/*.[ch]'
|
||||||
|
- 'runtime/lua/**.lua'
|
||||||
|
- 'runtime/doc/**'
|
||||||
|
branches:
|
||||||
|
- 'master'
|
||||||
|
- 'release-[0-9]+.[0-9]+'
|
||||||
|
workflow_dispatch:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
check_only:
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
required: false
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
regen-api-docs:
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
pull-requests: write
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
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
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo env DEBIAN_FRONTEND=noninteractive apt-get install -y doxygen python3 python3-msgpack luajit
|
||||||
|
|
||||||
|
- name: Setup git config
|
||||||
|
run: |
|
||||||
|
git config --global user.name 'marvim'
|
||||||
|
git config --global user.email 'marvim@users.noreply.github.com'
|
||||||
|
|
||||||
|
- run: printf 'DOC_BRANCH=marvim/api-doc-update/%s\n' ${GITHUB_REF#refs/heads/} >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Generate docs
|
||||||
|
id: docs
|
||||||
|
run: |
|
||||||
|
git checkout -b ${DOC_BRANCH}
|
||||||
|
python3 scripts/gen_vimdoc.py
|
||||||
|
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
|
||||||
|
if: ${{ steps.docs.outputs.UPDATED_DOCS != 0 && !inputs.check_only }}
|
||||||
|
run: |
|
||||||
|
git add -u
|
||||||
|
git commit -m 'docs: regenerate [skip ci]'
|
||||||
|
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
|
47
.github/workflows/backport.yml
vendored
47
.github/workflows/backport.yml
vendored
@@ -1,4 +1,4 @@
|
|||||||
name: backport
|
name: Backport
|
||||||
on:
|
on:
|
||||||
pull_request_target:
|
pull_request_target:
|
||||||
types: [closed, labeled]
|
types: [closed, labeled]
|
||||||
@@ -8,39 +8,20 @@ jobs:
|
|||||||
contents: write
|
contents: write
|
||||||
pull-requests: write
|
pull-requests: write
|
||||||
name: Backport Pull Request
|
name: Backport Pull Request
|
||||||
if: github.event.pull_request.merged
|
if: >
|
||||||
|
github.repository_owner == 'neovim' && (
|
||||||
|
github.event_name == 'pull_request_target' &&
|
||||||
|
github.event.pull_request.merged
|
||||||
|
)
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- uses: actions/create-github-app-token@v1
|
|
||||||
id: app-token
|
|
||||||
with:
|
with:
|
||||||
app-id: ${{ vars.BACKPORT_APP }}
|
# required to find all branches
|
||||||
private-key: ${{ secrets.BACKPORT_KEY }}
|
fetch-depth: 0
|
||||||
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
- name: Create backport PR
|
- name: Create backport PRs
|
||||||
id: backport
|
uses: zeebe-io/backport-action@v0.0.8
|
||||||
uses: korthout/backport-action@v3
|
|
||||||
with:
|
with:
|
||||||
pull_title: "${pull_title}"
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
label_pattern: "^ci:backport ([^ ]+)$"
|
github_workspace: ${{ github.workspace }}
|
||||||
github_token: ${{ steps.app-token.outputs.token }}
|
|
||||||
|
|
||||||
- name: Create failed backport label
|
|
||||||
if: ${{ steps.backport.outputs.was_successful == 'false' }}
|
|
||||||
uses: actions/github-script@v7
|
|
||||||
with:
|
|
||||||
script: |
|
|
||||||
github.rest.issues.addLabels({
|
|
||||||
issue_number: context.issue.number,
|
|
||||||
owner: context.repo.owner,
|
|
||||||
repo: context.repo.repo,
|
|
||||||
labels: ['needs:backport']
|
|
||||||
})
|
|
||||||
|
|
||||||
- name: Enable automerge
|
|
||||||
if: ${{ steps.backport.outputs.was_successful == 'true' }}
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
run: gh pr merge --rebase --auto ${{ steps.backport.outputs.created_pull_numbers }}
|
|
||||||
|
82
.github/workflows/build.yml
vendored
82
.github/workflows/build.yml
vendored
@@ -1,82 +0,0 @@
|
|||||||
name: build
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- 'master'
|
|
||||||
- 'release-[0-9]+.[0-9]+'
|
|
||||||
paths:
|
|
||||||
- '**.cmake'
|
|
||||||
- '**/CMakeLists.txt'
|
|
||||||
- '**/CMakePresets.json'
|
|
||||||
- 'cmake.*/**'
|
|
||||||
- '.github/**'
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
|
||||||
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
|
||||||
|
|
||||||
env:
|
|
||||||
BIN_DIR: ${{ github.workspace }}/bin
|
|
||||||
INSTALL_PREFIX: ${{ github.workspace }}/nvim-install
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
old-cmake:
|
|
||||||
name: Test oldest supported cmake
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
timeout-minutes: 15
|
|
||||||
env:
|
|
||||||
CMAKE_URL: 'https://cmake.org/files/v3.13/cmake-3.13.0-Linux-x86_64.sh'
|
|
||||||
CMAKE_VERSION: '3.13.0'
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: ./.github/actions/setup
|
|
||||||
|
|
||||||
- name: Install minimum required version of cmake
|
|
||||||
run: |
|
|
||||||
curl --retry 5 --silent --show-error --fail -o /tmp/cmake-installer.sh "$CMAKE_URL"
|
|
||||||
mkdir -p "$BIN_DIR" /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 "$BIN_DIR/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: Build dependencies
|
|
||||||
run: make deps
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
run: make CMAKE_FLAGS="-D CI_BUILD=ON -D CMAKE_INSTALL_PREFIX:PATH=$INSTALL_PREFIX"
|
|
||||||
|
|
||||||
- name: Install
|
|
||||||
run: make install
|
|
||||||
|
|
||||||
use-existing-src:
|
|
||||||
name: Test USE_EXISTING_SRC_DIR=ON builds with no network access
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: ./.github/actions/setup
|
|
||||||
|
|
||||||
- name: Build bundled dependencies
|
|
||||||
run: make deps
|
|
||||||
|
|
||||||
- name: Clean bundled dependencies à la neovim/deps
|
|
||||||
run: |
|
|
||||||
rm -rf ./build
|
|
||||||
find .deps .deps/build -maxdepth 1 '!' \( -name .deps -o -name build -o -name src \) -exec rm -r '{}' +
|
|
||||||
cd .deps/build/src
|
|
||||||
rm -rf ./*-build
|
|
||||||
rm -rf ./*-stamp/*-{configure,build,install,done}
|
|
||||||
for d in *; do (cd "$d"; rm -rf ./autom4te.cache; make clean || true; make distclean || true); done
|
|
||||||
|
|
||||||
- name: Re-build bundled dependencies with no network access
|
|
||||||
run: |
|
|
||||||
sudo sysctl kernel.apparmor_restrict_unprivileged_userns=0
|
|
||||||
unshare --map-root-user --net make deps DEPS_CMAKE_FLAGS=-DUSE_EXISTING_SRC_DIR=ON
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
run: make CMAKE_FLAGS="-D CI_BUILD=ON"
|
|
33
.github/workflows/build_dummy.yml
vendored
33
.github/workflows/build_dummy.yml
vendored
@@ -1,33 +0,0 @@
|
|||||||
name: build_dummy
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- 'master'
|
|
||||||
- 'release-[0-9]+.[0-9]+'
|
|
||||||
# This needs to be an exact complement of `paths` in the build.yml workflow.
|
|
||||||
# This is required to bypass required checks since a required job is always
|
|
||||||
# needed to run.
|
|
||||||
paths-ignore:
|
|
||||||
- '**.cmake'
|
|
||||||
- '**/CMakeLists.txt'
|
|
||||||
- '**/CMakePresets.json'
|
|
||||||
- 'cmake.*/**'
|
|
||||||
- '.github/**'
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
|
||||||
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
old-cmake:
|
|
||||||
name: Test oldest supported cmake
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
timeout-minutes: 15
|
|
||||||
steps:
|
|
||||||
- run: echo "success"
|
|
||||||
|
|
||||||
use-existing-src:
|
|
||||||
name: Test USE_EXISTING_SRC_DIR=ON builds with no network access
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- run: echo "success"
|
|
358
.github/workflows/ci.yml
vendored
Normal file
358
.github/workflows/ci.yml
vendored
Normal file
@@ -0,0 +1,358 @@
|
|||||||
|
name: CI
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- 'master'
|
||||||
|
- 'release-[0-9]+.[0-9]+'
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- 'master'
|
||||||
|
- '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:
|
||||||
|
lint:
|
||||||
|
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 \
|
||||||
|
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:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- flavor: asan
|
||||||
|
cc: clang-13
|
||||||
|
runner: ubuntu-20.04
|
||||||
|
os: linux
|
||||||
|
- flavor: tsan
|
||||||
|
cc: clang-13
|
||||||
|
runner: ubuntu-20.04
|
||||||
|
os: linux
|
||||||
|
- flavor: uchar
|
||||||
|
cc: gcc
|
||||||
|
runner: ubuntu-20.04
|
||||||
|
os: linux
|
||||||
|
- cc: clang
|
||||||
|
runner: macos-11
|
||||||
|
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
|
||||||
|
cc: gcc
|
||||||
|
runner: ubuntu-20.04
|
||||||
|
os: linux
|
||||||
|
cmake: minimum_required
|
||||||
|
runs-on: ${{ matrix.runner }}
|
||||||
|
timeout-minutes: 45
|
||||||
|
env:
|
||||||
|
CC: ${{ matrix.cc }}
|
||||||
|
CI_OS_NAME: ${{ matrix.os }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Setup common environment variables
|
||||||
|
run: ./.github/workflows/env.sh ${{ matrix.flavor }}
|
||||||
|
|
||||||
|
- name: Install apt packages
|
||||||
|
if: matrix.os == 'linux'
|
||||||
|
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: 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
|
||||||
|
if: matrix.flavor == 'asan' || matrix.flavor == 'tsan'
|
||||||
|
run: |
|
||||||
|
wget https://apt.llvm.org/llvm.sh
|
||||||
|
chmod a+x llvm.sh
|
||||||
|
sudo ./llvm.sh 13
|
||||||
|
rm llvm.sh
|
||||||
|
|
||||||
|
- name: Install brew packages
|
||||||
|
if: matrix.os == 'osx'
|
||||||
|
run: |
|
||||||
|
brew update --quiet
|
||||||
|
brew install automake cpanminus ninja
|
||||||
|
|
||||||
|
- name: Setup interpreter packages
|
||||||
|
run: ./ci/install.sh
|
||||||
|
|
||||||
|
- name: Cache dependencies
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
${{ env.CACHE_NVIM_DEPS_DIR }}
|
||||||
|
key: ${{ matrix.runner }}-${{ matrix.flavor }}-${{ matrix.cc }}-${{ hashFiles('cmake/*', 'cmake.deps/**', '**/CMakeLists.txt') }}-${{ github.base_ref }}
|
||||||
|
|
||||||
|
- name: Build third-party deps
|
||||||
|
run: ./ci/before_script.sh
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: ./ci/run_tests.sh build_nvim
|
||||||
|
|
||||||
|
- 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
|
||||||
|
run: ./ci/before_cache.sh
|
||||||
|
|
||||||
|
windows:
|
||||||
|
runs-on: windows-2019
|
||||||
|
timeout-minutes: 45
|
||||||
|
env:
|
||||||
|
DEPS_BUILD_DIR: ${{ format('{0}/nvim-deps', 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
|
||||||
|
with:
|
||||||
|
path: ${{ env.DEPS_BUILD_DIR }}
|
||||||
|
key: ${{ hashFiles('cmake.deps\**') }}
|
||||||
|
|
||||||
|
- name: Build deps
|
||||||
|
run: .\ci\build.ps1 -BuildDeps
|
||||||
|
|
||||||
|
- name: Build nvim
|
||||||
|
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
|
42
.github/workflows/codeql-analysis.yml
vendored
Normal file
42
.github/workflows/codeql-analysis.yml
vendored
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
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
|
36
.github/workflows/codeql.yml
vendored
36
.github/workflows/codeql.yml
vendored
@@ -1,36 +0,0 @@
|
|||||||
name: "codeql"
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
|
||||||
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ "master" ]
|
|
||||||
pull_request:
|
|
||||||
# The branches below must be a subset of the branches above
|
|
||||||
branches: [ "master" ]
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
analyze:
|
|
||||||
name: Analyze
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
actions: read
|
|
||||||
contents: read
|
|
||||||
security-events: write
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: ./.github/actions/setup
|
|
||||||
|
|
||||||
- name: Initialize CodeQL
|
|
||||||
uses: github/codeql-action/init@v3
|
|
||||||
with:
|
|
||||||
languages: cpp
|
|
||||||
|
|
||||||
- run: make
|
|
||||||
|
|
||||||
- name: Perform CodeQL Analysis
|
|
||||||
uses: github/codeql-action/analyze@v3
|
|
23
.github/workflows/commitlint.yml
vendored
Normal file
23
.github/workflows/commitlint.yml
vendored
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
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})"
|
@@ -1,4 +1,4 @@
|
|||||||
name: coverity
|
name: Coverity
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '10 0 * * *' # Run every day at 00:10
|
- cron: '10 0 * * *' # Run every day at 00:10
|
||||||
@@ -8,8 +8,12 @@ jobs:
|
|||||||
scan:
|
scan:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v3
|
||||||
- uses: ./.github/actions/setup
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y autoconf automake build-essential cmake gettext libtool-bin locales ninja-build pkg-config unzip
|
||||||
|
|
||||||
- name: Download Coverity
|
- name: Download Coverity
|
||||||
run: |
|
run: |
|
||||||
@@ -33,7 +37,7 @@ jobs:
|
|||||||
--form email=$EMAIL \
|
--form email=$EMAIL \
|
||||||
--form file=@cov-scan.tgz \
|
--form file=@cov-scan.tgz \
|
||||||
--form version="$(git rev-parse HEAD)" \
|
--form version="$(git rev-parse HEAD)" \
|
||||||
--form description="Daily GHA scan" \
|
--form description="Weekly GHA scan" \
|
||||||
'https://scan.coverity.com/builds?project=neovim%2Fneovim'
|
'https://scan.coverity.com/builds?project=neovim%2Fneovim'
|
||||||
env:
|
env:
|
||||||
TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
|
TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
|
26
.github/workflows/docs.yml
vendored
26
.github/workflows/docs.yml
vendored
@@ -1,26 +0,0 @@
|
|||||||
name: docs
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
types: [opened, synchronize, reopened, ready_for_review]
|
|
||||||
jobs:
|
|
||||||
docs:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: github.event.pull_request.draft == false
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
pull-requests: write
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: ./.github/actions/setup
|
|
||||||
|
|
||||||
- name: Generate docs
|
|
||||||
run: |
|
|
||||||
make doc
|
|
||||||
if [ -n "$(git status --porcelain)" ]; then
|
|
||||||
echo "::error::Job failed, run 'make doc' and commit your doc changes."
|
|
||||||
echo "::error::The doc generation produces the following changes:"
|
|
||||||
git diff --color --exit-code
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Validate docs
|
|
||||||
run: make lintdoc
|
|
70
.github/workflows/env.sh
vendored
Executable file
70
.github/workflows/env.sh
vendored
Executable file
@@ -0,0 +1,70 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e -u
|
||||||
|
|
||||||
|
FLAVOR=${1:-}
|
||||||
|
|
||||||
|
cat <<EOF >> "$GITHUB_PATH"
|
||||||
|
$HOME/.local/bin
|
||||||
|
EOF
|
||||||
|
|
||||||
|
cat <<EOF >> "$GITHUB_ENV"
|
||||||
|
CI_BUILD_DIR=$GITHUB_WORKSPACE
|
||||||
|
BUILD_DIR=$GITHUB_WORKSPACE/build
|
||||||
|
DEPS_BUILD_DIR=$HOME/nvim-deps
|
||||||
|
INSTALL_PREFIX=$HOME/nvim-install
|
||||||
|
LOG_DIR=$GITHUB_WORKSPACE/build/log
|
||||||
|
NVIM_LOG_FILE=$GITHUB_WORKSPACE/build/.nvimlog
|
||||||
|
VALGRIND_LOG=$GITHUB_WORKSPACE/build/log/valgrind-%p.log
|
||||||
|
CACHE_NVIM_DEPS_DIR=$HOME/.cache/nvim-deps
|
||||||
|
CACHE_MARKER=$HOME/.cache/nvim-deps/.ci_cache_marker
|
||||||
|
CACHE_UNCRUSTIFY=$HOME/.cache/uncrustify
|
||||||
|
UNCRUSTIFY_VERSION=uncrustify-0.75.0
|
||||||
|
EOF
|
||||||
|
|
||||||
|
DEPS_CMAKE_FLAGS=
|
||||||
|
FUNCTIONALTEST=functionaltest
|
||||||
|
BUILD_FLAGS="CMAKE_FLAGS=-DCI_BUILD=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX:PATH=$HOME/nvim-install -DBUSTED_OUTPUT_TYPE=nvim -DDEPS_PREFIX=$HOME/nvim-deps/usr -DMIN_LOG_LEVEL=3"
|
||||||
|
|
||||||
|
case "$FLAVOR" in
|
||||||
|
asan)
|
||||||
|
BUILD_FLAGS="$BUILD_FLAGS -DPREFER_LUA=ON"
|
||||||
|
cat <<EOF >> "$GITHUB_ENV"
|
||||||
|
CLANG_SANITIZER=ASAN_UBSAN
|
||||||
|
SYMBOLIZER=asan_symbolize-13
|
||||||
|
ASAN_OPTIONS=detect_leaks=1:check_initialization_order=1:log_path=$GITHUB_WORKSPACE/build/log/asan:intercept_tls_get_addr=0
|
||||||
|
UBSAN_OPTIONS=print_stacktrace=1 log_path=$GITHUB_WORKSPACE/build/log/ubsan
|
||||||
|
EOF
|
||||||
|
;;
|
||||||
|
tsan)
|
||||||
|
cat <<EOF >> "$GITHUB_ENV"
|
||||||
|
TSAN_OPTIONS=log_path=$GITHUB_WORKSPACE/build/log/tsan
|
||||||
|
CLANG_SANITIZER=TSAN
|
||||||
|
EOF
|
||||||
|
;;
|
||||||
|
uchar)
|
||||||
|
cat <<EOF >> "$GITHUB_ENV"
|
||||||
|
BUILD_UCHAR=1
|
||||||
|
EOF
|
||||||
|
;;
|
||||||
|
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"
|
||||||
|
USE_BUNDLED=OFF
|
||||||
|
EOF
|
||||||
|
;;
|
||||||
|
functionaltest-lua)
|
||||||
|
BUILD_FLAGS="$BUILD_FLAGS -DPREFER_LUA=ON"
|
||||||
|
FUNCTIONALTEST=functionaltest-lua
|
||||||
|
DEPS_CMAKE_FLAGS="$DEPS_CMAKE_FLAGS -DUSE_BUNDLED_LUAJIT=OFF"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
cat <<EOF >> "$GITHUB_ENV"
|
||||||
|
$BUILD_FLAGS
|
||||||
|
DEPS_CMAKE_FLAGS=$DEPS_CMAKE_FLAGS
|
||||||
|
FUNCTIONALTEST=$FUNCTIONALTEST
|
||||||
|
EOF
|
@@ -1,21 +1,21 @@
|
|||||||
name: "labeler: PR"
|
name: "Pull Request Labeler"
|
||||||
on:
|
on:
|
||||||
pull_request_target:
|
pull_request_target:
|
||||||
types: [opened]
|
types: [opened]
|
||||||
jobs:
|
jobs:
|
||||||
changed-files:
|
|
||||||
|
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/checkout@v4
|
- uses: actions/labeler@v4
|
||||||
- uses: actions/labeler@v5
|
|
||||||
with:
|
with:
|
||||||
configuration-path: .github/scripts/labeler_configuration.yml
|
repo-token: "${{ secrets.GITHUB_TOKEN }}"
|
||||||
|
sync-labels: ""
|
||||||
|
|
||||||
type-scope:
|
type-scope:
|
||||||
needs: changed-files
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
@@ -33,25 +33,17 @@ jobs:
|
|||||||
- name: "Extract if the PR is a breaking change and add it as label"
|
- 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
|
run: gh pr edit "$PR_NUMBER" --add-label "$(echo "$PR_TITLE" | sed -E 's|[[:alpha:]]+(\(.*\))?!:.*|breaking-change|')" || true
|
||||||
|
|
||||||
target-release:
|
request-reviewer:
|
||||||
needs: ["changed-files", "type-scope"]
|
if: github.event.pull_request.state == 'open' && github.event.pull_request.draft == false
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
needs: ["triage", "type-scope"]
|
||||||
permissions:
|
permissions:
|
||||||
pull-requests: write
|
pull-requests: write
|
||||||
steps:
|
steps:
|
||||||
- if: startsWith(github.base_ref, 'release')
|
- uses: actions/checkout@v3
|
||||||
uses: actions/github-script@v7
|
- name: 'Request reviewers'
|
||||||
|
uses: actions/github-script@v6
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
github.rest.issues.addLabels({
|
const script = require('./.github/scripts/reviews.js')
|
||||||
issue_number: context.issue.number,
|
await script({github, context})
|
||||||
owner: context.repo.owner,
|
|
||||||
repo: context.repo.repo,
|
|
||||||
labels: ['target:release']
|
|
||||||
})
|
|
||||||
|
|
||||||
request-reviewer:
|
|
||||||
needs: ["changed-files", "type-scope", "target-release"]
|
|
||||||
permissions:
|
|
||||||
pull-requests: write
|
|
||||||
uses: ./.github/workflows/reviewers_add.yml
|
|
31
.github/workflows/labeler_issue.yml
vendored
31
.github/workflows/labeler_issue.yml
vendored
@@ -1,31 +0,0 @@
|
|||||||
name: "labeler: issue"
|
|
||||||
on:
|
|
||||||
issues:
|
|
||||||
types: [opened]
|
|
||||||
jobs:
|
|
||||||
labeler:
|
|
||||||
permissions:
|
|
||||||
issues: write
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: check issue title
|
|
||||||
uses: actions/github-script@v7
|
|
||||||
with:
|
|
||||||
script: |
|
|
||||||
const title = context.payload.issue.title;
|
|
||||||
const titleSplit = title.split(/\b/).map(e => e.toLowerCase());
|
|
||||||
const keywords = ['api', 'treesitter', 'ui', 'lsp'];
|
|
||||||
var match = new Set();
|
|
||||||
for (const keyword of keywords) {
|
|
||||||
if (titleSplit.includes(keyword)) {
|
|
||||||
match.add(keyword)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (match.size !== 0) {
|
|
||||||
github.rest.issues.addLabels({
|
|
||||||
owner: context.repo.owner,
|
|
||||||
repo: context.repo.repo,
|
|
||||||
issue_number: context.issue.number,
|
|
||||||
labels: Array.from(match)
|
|
||||||
})
|
|
||||||
}
|
|
27
.github/workflows/lintcommit.yml
vendored
27
.github/workflows/lintcommit.yml
vendored
@@ -1,27 +0,0 @@
|
|||||||
name: lintcommit
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
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@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
ref: ${{ github.event.pull_request.head.sha }}
|
|
||||||
|
|
||||||
- uses: ./.github/actions/setup
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
run: |
|
|
||||||
cmake -S cmake.deps --preset ci
|
|
||||||
cmake --build .deps
|
|
||||||
cmake --preset ci
|
|
||||||
cmake --build build
|
|
||||||
|
|
||||||
- name: lintcommit
|
|
||||||
run: cmake --build build --target lintcommit
|
|
16
.github/workflows/lintcommit_dummy.yml
vendored
16
.github/workflows/lintcommit_dummy.yml
vendored
@@ -1,16 +0,0 @@
|
|||||||
# Dummy workflow of lintcommit.yml. lintcommit is a required check, but it's
|
|
||||||
# only designed to work on master. Since required checks are always required to
|
|
||||||
# run, we can essentially "skip" the lintcommit on release branches with this
|
|
||||||
# dummy check that automatically passes.
|
|
||||||
name: lintcommit_dummy
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
types: [opened, synchronize, reopened, ready_for_review]
|
|
||||||
branches:
|
|
||||||
- 'release-[0-9]+.[0-9]+'
|
|
||||||
jobs:
|
|
||||||
lint-commits:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: github.event.pull_request.draft == false
|
|
||||||
steps:
|
|
||||||
- run: echo "success"
|
|
34
.github/workflows/news.yml
vendored
34
.github/workflows/news.yml
vendored
@@ -1,34 +0,0 @@
|
|||||||
name: "news.txt"
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled]
|
|
||||||
branches:
|
|
||||||
- 'master'
|
|
||||||
jobs:
|
|
||||||
check:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: github.event.pull_request.draft == false && !contains(github.event.pull_request.labels.*.name, 'ci:skip-news')
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
ref: ${{ github.event.pull_request.head.sha }}
|
|
||||||
- name: news.txt needs to be updated
|
|
||||||
run: |
|
|
||||||
for commit in $(git rev-list HEAD~${{ github.event.pull_request.commits }}..HEAD); do
|
|
||||||
message=$(git log -n1 --pretty=format:%s $commit)
|
|
||||||
type="$(echo "$message" | sed -E 's|([[:alpha:]]+)(\(.*\))?!?:.*|\1|')"
|
|
||||||
breaking="$(echo "$message" | sed -E 's|[[:alpha:]]+(\(.*\))?!:.*|breaking-change|')"
|
|
||||||
if [[ "$type" == "feat" ]] || [[ "$breaking" == "breaking-change" ]]; then
|
|
||||||
! git diff HEAD~${{ github.event.pull_request.commits }}..HEAD --quiet runtime/doc/news.txt ||
|
|
||||||
{
|
|
||||||
echo "
|
|
||||||
Pull request includes a new feature or a breaking change, but
|
|
||||||
news.txt hasn't been updated yet. This is just a reminder
|
|
||||||
that news.txt may need to be updated. You can ignore this CI
|
|
||||||
failure if you think the change won't be of interest to
|
|
||||||
users."
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
fi
|
|
||||||
done
|
|
81
.github/workflows/notes.md
vendored
81
.github/workflows/notes.md
vendored
@@ -9,84 +9,57 @@ ${NVIM_VERSION}
|
|||||||
#### Zip
|
#### Zip
|
||||||
|
|
||||||
1. Download **nvim-win64.zip**
|
1. Download **nvim-win64.zip**
|
||||||
2. Extract the zip
|
2. Extract the zip.
|
||||||
3. Run `nvim.exe` on your CLI of choice
|
3. Run `nvim-qt.exe`
|
||||||
|
|
||||||
#### MSI
|
#### MSI
|
||||||
|
|
||||||
1. Download **nvim-win64.msi**
|
1. Download **nvim-win64.msi**
|
||||||
2. Run the MSI
|
2. Run the MSI
|
||||||
3. Run `nvim.exe` on your CLI of choice
|
3. Search and run `nvim-qt.exe` or run `nvim.exe` on your CLI of choice.
|
||||||
|
|
||||||
### macOS (x86_64)
|
### macOS
|
||||||
|
|
||||||
1. Download **nvim-macos-x86_64.tar.gz**
|
1. Download **nvim-macos.tar.gz**
|
||||||
2. Run `xattr -c ./nvim-macos-x86_64.tar.gz` (to avoid "unknown developer" warning)
|
2. Run `xattr -c ./nvim-macos.tar.gz` (to avoid "unknown developer" warning)
|
||||||
3. Extract: `tar xzvf nvim-macos-x86_64.tar.gz`
|
3. Extract: `tar xzvf nvim-macos.tar.gz`
|
||||||
4. Run `./nvim-macos-x86_64/bin/nvim`
|
4. Run `./nvim-macos/bin/nvim`
|
||||||
|
|
||||||
### macOS (arm64)
|
### Linux (x64)
|
||||||
|
|
||||||
1. Download **nvim-macos-arm64.tar.gz**
|
|
||||||
2. Run `xattr -c ./nvim-macos-arm64.tar.gz` (to avoid "unknown developer" warning)
|
|
||||||
3. Extract: `tar xzvf nvim-macos-arm64.tar.gz`
|
|
||||||
4. Run `./nvim-macos-arm64/bin/nvim`
|
|
||||||
|
|
||||||
### Linux (x86_64)
|
|
||||||
|
|
||||||
Minimum glibc version to run these releases is 2.31. People requiring releases
|
|
||||||
that work on older glibc versions can find them at
|
|
||||||
https://github.com/neovim/neovim-releases.
|
|
||||||
|
|
||||||
#### AppImage
|
|
||||||
|
|
||||||
1. Download **nvim-linux-x86_64.appimage**
|
|
||||||
2. Run `chmod u+x nvim-linux-x86_64.appimage && ./nvim-linux-x86_64.appimage`
|
|
||||||
- If your system does not have FUSE you can [extract the appimage](https://github.com/AppImage/AppImageKit/wiki/FUSE#type-2-appimage):
|
|
||||||
```
|
|
||||||
./nvim-linux-x86_64.appimage --appimage-extract
|
|
||||||
./squashfs-root/usr/bin/nvim
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Tarball
|
#### Tarball
|
||||||
|
|
||||||
1. Download **nvim-linux-x86_64.tar.gz**
|
1. Download **nvim-linux64.tar.gz**
|
||||||
2. Extract: `tar xzvf nvim-linux-x86_64.tar.gz`
|
2. Extract: `tar xzvf nvim-linux64.tar.gz`
|
||||||
3. Run `./nvim-linux-x86_64/bin/nvim`
|
3. Run `./nvim-linux64/bin/nvim`
|
||||||
|
|
||||||
### Linux (arm64)
|
#### Debian Package
|
||||||
|
|
||||||
|
1. Download **nvim-linux64.deb**
|
||||||
|
2. Install the package using `sudo apt install ./nvim-linux64.deb`
|
||||||
|
3. Run `nvim`
|
||||||
|
|
||||||
#### AppImage
|
#### AppImage
|
||||||
|
1. Download **nvim.appimage**
|
||||||
1. Download **nvim-linux-arm64.appimage**
|
2. Run `chmod u+x nvim.appimage && ./nvim.appimage`
|
||||||
2. Run `chmod u+x nvim-linux-arm64.appimage && ./nvim-linux-arm64.appimage`
|
|
||||||
- If your system does not have FUSE you can [extract the appimage](https://github.com/AppImage/AppImageKit/wiki/FUSE#type-2-appimage):
|
- If your system does not have FUSE you can [extract the appimage](https://github.com/AppImage/AppImageKit/wiki/FUSE#type-2-appimage):
|
||||||
```
|
```
|
||||||
./nvim-linux-arm64.appimage --appimage-extract
|
./nvim.appimage --appimage-extract
|
||||||
./squashfs-root/usr/bin/nvim
|
./squashfs-root/usr/bin/nvim
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Tarball
|
|
||||||
|
|
||||||
1. Download **nvim-linux-arm64.tar.gz**
|
|
||||||
2. Extract: `tar xzvf nvim-linux-arm64.tar.gz`
|
|
||||||
3. Run `./nvim-linux-arm64/bin/nvim`
|
|
||||||
|
|
||||||
### Other
|
### Other
|
||||||
|
|
||||||
- Install by [package manager](https://github.com/neovim/neovim/blob/master/INSTALL.md#install-from-package)
|
- Install by [package manager](https://github.com/neovim/neovim/wiki/Installing-Neovim)
|
||||||
|
|
||||||
## SHA256 Checksums
|
## SHA256 Checksums
|
||||||
|
|
||||||
```
|
```
|
||||||
${SHA_APPIMAGE_ARM64}
|
${SHA_LINUX_64_TAR}
|
||||||
${SHA_APPIMAGE_ARM64_ZSYNC}
|
${SHA_LINUX_64_DEB}
|
||||||
${SHA_LINUX_ARM64_TAR}
|
${SHA_APP_IMAGE}
|
||||||
${SHA_APPIMAGE_X86_64}
|
${SHA_APP_IMAGE_ZSYNC}
|
||||||
${SHA_APPIMAGE_X86_64_ZSYNC}
|
${SHA_MACOS}
|
||||||
${SHA_LINUX_X86_64_TAR}
|
|
||||||
${SHA_MACOS_ARM64}
|
|
||||||
${SHA_MACOS_X86_64}
|
|
||||||
${SHA_WIN_64_MSI}
|
|
||||||
${SHA_WIN_64_ZIP}
|
${SHA_WIN_64_ZIP}
|
||||||
|
${SHA_WIN_64_MSI}
|
||||||
```
|
```
|
||||||
|
55
.github/workflows/optional.yml
vendored
55
.github/workflows/optional.yml
vendored
@@ -1,55 +0,0 @@
|
|||||||
name: optional
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
types: [labeled, opened, synchronize, reopened]
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
|
||||||
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
|
||||||
|
|
||||||
env:
|
|
||||||
INSTALL_PREFIX: ${{ github.workspace }}/nvim-install
|
|
||||||
# Double test timeout since it's running via qemu
|
|
||||||
TEST_TIMEOUT: 3600
|
|
||||||
# TEST_FILE: test/functional/shada
|
|
||||||
# TEST_FILTER: foo
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
s390x:
|
|
||||||
if: contains(github.event.pull_request.labels.*.name, 'ci:s390x') || github.event_name == 'workflow_dispatch'
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
test: [functionaltest, oldtest]
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
timeout-minutes: 90
|
|
||||||
steps:
|
|
||||||
- run: docker run --rm --privileged multiarch/qemu-user-static:register --reset
|
|
||||||
- uses: docker://multiarch/ubuntu-core:s390x-focal
|
|
||||||
with:
|
|
||||||
# Docker runs the command as root, but we want the build/test to run
|
|
||||||
# as non-root so permissions based tests run correctly
|
|
||||||
args: >
|
|
||||||
bash -c
|
|
||||||
"
|
|
||||||
apt-get -y update &&
|
|
||||||
time DEBIAN_FRONTEND=noninteractive apt-get -y install build-essential cmake curl gettext ninja-build locales-all cpanminus git attr libattr1-dev xdg-utils &&
|
|
||||||
useradd --create-home qemuci &&
|
|
||||||
chown -R qemuci. . &&
|
|
||||||
runuser -u qemuci -- git clone --depth=1 https://github.com/neovim/neovim.git &&
|
|
||||||
cd neovim &&
|
|
||||||
runuser -u qemuci -- git fetch origin ${{ github.ref }}:pr &&
|
|
||||||
runuser -u qemuci -- git switch pr &&
|
|
||||||
runuser -u qemuci -- cmake -S cmake.deps -B .deps -G Ninja -D USE_BUNDLED_LUAJIT=OFF -D USE_BUNDLED_LUA=ON &&
|
|
||||||
runuser -u qemuci -- cmake --build .deps &&
|
|
||||||
runuser -u qemuci -- cmake -B build -G Ninja -D CI_BUILD=ON -D PREFER_LUA=ON &&
|
|
||||||
runuser -u qemuci -- make ${{ matrix.test }}
|
|
||||||
"
|
|
||||||
|
|
||||||
windows-asan:
|
|
||||||
if: contains(github.event.pull_request.labels.*.name, 'ci:windows-asan') || github.event_name == 'workflow_dispatch'
|
|
||||||
uses: ./.github/workflows/test_windows.yml
|
|
||||||
with:
|
|
||||||
build_flags: "-D ENABLE_ASAN_UBSAN=ON"
|
|
||||||
functionaltest_timeout: 40
|
|
342
.github/workflows/release.yml
vendored
342
.github/workflows/release.yml
vendored
@@ -1,4 +1,4 @@
|
|||||||
name: release
|
name: Release
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '5 5 * * *'
|
- cron: '5 5 * * *'
|
||||||
@@ -15,151 +15,160 @@ on:
|
|||||||
# 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)
|
# Build with gcc-10 to prevent triggering #14150 (default is still gcc-9 on 20.04)
|
||||||
jobs:
|
jobs:
|
||||||
setup:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
outputs:
|
|
||||||
build_type: ${{ steps.build.outputs.build_type }}
|
|
||||||
appimage_tag: ${{ steps.build.outputs.appimage_tag }}
|
|
||||||
steps:
|
|
||||||
# Nightly uses RelWithDebInfo while stable uses Release (which disables
|
|
||||||
# asserts). This helps get better debug info from people brave enough to
|
|
||||||
# use the nightly builds.
|
|
||||||
- if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name != 'nightly')
|
|
||||||
run: |
|
|
||||||
echo 'CMAKE_BUILD_TYPE=Release' >> $GITHUB_ENV
|
|
||||||
echo 'APPIMAGE_TAG=latest' >> $GITHUB_ENV
|
|
||||||
- if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly')
|
|
||||||
run: |
|
|
||||||
echo 'CMAKE_BUILD_TYPE=RelWithDebInfo' >> $GITHUB_ENV
|
|
||||||
echo 'APPIMAGE_TAG=nightly' >> $GITHUB_ENV
|
|
||||||
- name: Export build information
|
|
||||||
id: build
|
|
||||||
run: |
|
|
||||||
printf "build_type=${CMAKE_BUILD_TYPE}\n" >> $GITHUB_OUTPUT
|
|
||||||
printf "appimage_tag=${APPIMAGE_TAG}\n" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
linux:
|
linux:
|
||||||
needs: setup
|
runs-on: ubuntu-20.04
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
runner: [ ubuntu-20.04, ubuntu-24.04-arm ]
|
|
||||||
include:
|
|
||||||
- runner: ubuntu-20.04
|
|
||||||
arch: x86_64
|
|
||||||
cc: gcc-10
|
|
||||||
- runner: ubuntu-24.04-arm
|
|
||||||
arch: arm64
|
|
||||||
runs-on: ${{ matrix.runner }}
|
|
||||||
env:
|
|
||||||
CC: ${{ matrix.cc }}
|
|
||||||
LDAI_NO_APPSTREAM: 1 # skip checking (broken) AppStream metadata for issues
|
|
||||||
outputs:
|
outputs:
|
||||||
version: ${{ steps.build.outputs.version }}
|
version: ${{ steps.build.outputs.version }}
|
||||||
|
release: ${{ steps.build.outputs.release }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
# Perform a full checkout #13471
|
|
||||||
fetch-depth: 0
|
|
||||||
- run: ./.github/scripts/install_deps.sh
|
|
||||||
- run: echo "CMAKE_BUILD_TYPE=${{ needs.setup.outputs.build_type }}" >> $GITHUB_ENV
|
|
||||||
- if: matrix.arch == 'arm64'
|
|
||||||
run: sudo apt-get update && sudo apt-get install -y libfuse2t64
|
|
||||||
- name: appimage
|
|
||||||
run: |
|
|
||||||
./scripts/genappimage.sh ${{ needs.setup.outputs.appimage_tag }}
|
|
||||||
- name: tar.gz
|
|
||||||
run: cpack --config build/CPackConfig.cmake -G TGZ
|
|
||||||
- uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: appimage-${{ matrix.arch }}
|
|
||||||
path: |
|
|
||||||
build/bin/nvim-linux-${{ matrix.arch }}.appimage
|
|
||||||
build/bin/nvim-linux-${{ matrix.arch }}.appimage.zsync
|
|
||||||
retention-days: 1
|
|
||||||
- uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: nvim-linux-${{ matrix.arch }}
|
|
||||||
path: |
|
|
||||||
build/nvim-linux-${{ matrix.arch }}.tar.gz
|
|
||||||
retention-days: 1
|
|
||||||
- name: Export version
|
|
||||||
id: build
|
|
||||||
run: |
|
|
||||||
printf 'version<<END\n' >> $GITHUB_OUTPUT
|
|
||||||
./build/bin/nvim --version | head -n 3 >> $GITHUB_OUTPUT
|
|
||||||
printf 'END\n' >> $GITHUB_OUTPUT
|
|
||||||
macos:
|
|
||||||
needs: setup
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
runner: [ macos-13, macos-14 ]
|
|
||||||
include:
|
|
||||||
- runner: macos-13
|
|
||||||
arch: x86_64
|
|
||||||
- runner: macos-14
|
|
||||||
arch: arm64
|
|
||||||
runs-on: ${{ matrix.runner }}
|
|
||||||
env:
|
|
||||||
MACOSX_DEPLOYMENT_TARGET: 11.0
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
# Perform a full checkout #13471
|
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: ./.github/scripts/install_deps.sh
|
|
||||||
|
|
||||||
- name: Build deps
|
|
||||||
run: |
|
run: |
|
||||||
cmake -S cmake.deps -B .deps -G Ninja \
|
sudo apt-get update
|
||||||
-D CMAKE_BUILD_TYPE=${{ needs.setup.outputs.build_type }} \
|
sudo apt-get install -y autoconf automake build-essential cmake gettext libtool-bin locales ninja-build pkg-config unzip
|
||||||
-D CMAKE_FIND_FRAMEWORK=NEVER
|
- if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name != 'nightly')
|
||||||
cmake --build .deps
|
run: printf 'NVIM_BUILD_TYPE=Release\n' >> $GITHUB_ENV
|
||||||
- name: Build neovim
|
- 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
|
||||||
|
- name: Build release
|
||||||
|
id: build
|
||||||
run: |
|
run: |
|
||||||
cmake -B build -G Ninja \
|
CC=gcc-10 make CMAKE_BUILD_TYPE=${NVIM_BUILD_TYPE} CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX:PATH="
|
||||||
-D CMAKE_BUILD_TYPE=${{ needs.setup.outputs.build_type }} \
|
printf '::set-output name=version::%s\n' "$(./build/bin/nvim --version | head -n 3 | sed -z 's/\n/%0A/g')"
|
||||||
-D ENABLE_LIBINTL=OFF \
|
printf '::set-output name=release::%s\n' "$(./build/bin/nvim --version | head -n 1)"
|
||||||
-D CMAKE_FIND_FRAMEWORK=NEVER
|
make DESTDIR="$GITHUB_WORKSPACE/build/release/nvim-linux64" install
|
||||||
cmake --build build
|
cd "$GITHUB_WORKSPACE/build/"
|
||||||
- name: Package
|
cpack -C $NVIM_BUILD_TYPE
|
||||||
run: cpack --config build/CPackConfig.cmake
|
- uses: actions/upload-artifact@v3
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
|
||||||
with:
|
with:
|
||||||
name: nvim-macos-${{ matrix.arch }}
|
name: nvim-linux64
|
||||||
path: build/nvim-macos-${{ matrix.arch }}.tar.gz
|
path: |
|
||||||
|
build/nvim-linux64.tar.gz
|
||||||
|
build/nvim-linux64.deb
|
||||||
|
retention-days: 1
|
||||||
|
|
||||||
|
appimage:
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
container:
|
||||||
|
image: ubuntu:18.04
|
||||||
|
options: --privileged # Privileged mode is needed to load fuse module.
|
||||||
|
steps:
|
||||||
|
- name: Prepare container
|
||||||
|
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:
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
apt-get update
|
||||||
|
apt-get install -y autoconf automake build-essential cmake gettext libtool-bin locales ninja-build pkg-config unzip
|
||||||
|
- if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name != 'nightly')
|
||||||
|
run: CC=gcc-10 make appimage-latest
|
||||||
|
- if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly')
|
||||||
|
run: CC=gcc-10 make appimage-nightly
|
||||||
|
- uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: appimage
|
||||||
|
path: |
|
||||||
|
build/bin/nvim.appimage
|
||||||
|
build/bin/nvim.appimage.zsync
|
||||||
|
retention-days: 1
|
||||||
|
|
||||||
|
macOS:
|
||||||
|
runs-on: macos-11
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Install brew packages
|
||||||
|
run: |
|
||||||
|
brew update --quiet
|
||||||
|
brew install automake ninja
|
||||||
|
- 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
|
||||||
|
- 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
|
||||||
|
- 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
|
||||||
|
run: |
|
||||||
|
export MACOSX_DEPLOYMENT_TARGET="$(sw_vers -productVersion | cut -f1 -d.)"
|
||||||
|
OSX_FLAGS="-DCMAKE_OSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} -DCMAKE_OSX_ARCHITECTURES=arm64\;x86_64"
|
||||||
|
make CMAKE_BUILD_TYPE=${NVIM_BUILD_TYPE} \
|
||||||
|
CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX:PATH= $OSX_FLAGS" \
|
||||||
|
DEPS_CMAKE_FLAGS="$OSX_FLAGS"
|
||||||
|
make DESTDIR="$GITHUB_WORKSPACE/build/release/nvim-macos" install
|
||||||
|
cd "$GITHUB_WORKSPACE/build/"
|
||||||
|
# Make sure we build everything for M1 as well
|
||||||
|
for macho in bin/* lib/nvim/parser/*.so
|
||||||
|
do
|
||||||
|
lipo -info "$macho" | grep -q arm64 || exit 1
|
||||||
|
done
|
||||||
|
cpack -C "$NVIM_BUILD_TYPE"
|
||||||
|
- uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: nvim-macos
|
||||||
|
path: build/nvim-macos.tar.gz
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
||||||
windows:
|
windows:
|
||||||
needs: setup
|
|
||||||
runs-on: windows-2019
|
runs-on: windows-2019
|
||||||
|
env:
|
||||||
|
DEPS_BUILD_DIR: ${{ format('{0}/nvim-deps', github.workspace) }}
|
||||||
|
DEPS_PREFIX: ${{ format('{0}/nvim-deps/usr', github.workspace) }}
|
||||||
|
CMAKE_BUILD_TYPE: "RelWithDebInfo"
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- config: MSVC_64
|
||||||
|
archive: nvim-win64
|
||||||
|
name: windows (${{ matrix.config }})
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
# Perform a full checkout #13471
|
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- run: .github/scripts/env.ps1
|
|
||||||
- name: Build deps
|
- name: Build deps
|
||||||
run: |
|
run: .\ci\build.ps1 -BuildDeps
|
||||||
cmake -S cmake.deps -B .deps -G Ninja -DCMAKE_BUILD_TYPE=${{ needs.setup.outputs.build_type }}
|
|
||||||
cmake --build .deps
|
|
||||||
- name: build package
|
- name: build package
|
||||||
run: |
|
run: .\ci\build.ps1 -Package
|
||||||
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=${{ needs.setup.outputs.build_type }}
|
- uses: actions/upload-artifact@v3
|
||||||
cmake --build build --target package
|
|
||||||
- uses: actions/upload-artifact@v4
|
|
||||||
with:
|
with:
|
||||||
name: nvim-win64
|
name: ${{ matrix.archive }}
|
||||||
path: |
|
path: |
|
||||||
build/nvim-win64.msi
|
build/${{ matrix.archive }}.msi
|
||||||
build/nvim-win64.zip
|
build/${{ matrix.archive }}.zip
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
||||||
publish:
|
publish:
|
||||||
needs: [linux, macos, windows]
|
needs: [linux, appimage, macOS, windows]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
GH_REPO: ${{ github.repository }}
|
GH_REPO: ${{ github.repository }}
|
||||||
@@ -169,9 +178,9 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
# Must perform checkout first, since it deletes the target directory
|
# Must perform checkout first, since it deletes the target directory
|
||||||
# before running, and would therefore delete the downloaded artifacts
|
# before running, and would therefore delete the downloaded artifacts
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v3
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: sudo apt-get update && sudo apt-get install -y gettext-base
|
run: sudo apt-get update && sudo apt-get install -y gettext-base
|
||||||
@@ -198,46 +207,28 @@ jobs:
|
|||||||
git push origin :stable || true
|
git push origin :stable || true
|
||||||
# `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 Linux x86_64 SHA256 checksums
|
- name: Generate Linux64 SHA256 checksums
|
||||||
run: |
|
run: |
|
||||||
cd ./nvim-linux-x86_64
|
cd ./nvim-linux64
|
||||||
sha256sum nvim-linux-x86_64.tar.gz > nvim-linux-x86_64.tar.gz.sha256sum
|
sha256sum nvim-linux64.tar.gz > nvim-linux64.tar.gz.sha256sum
|
||||||
echo "SHA_LINUX_X86_64_TAR=$(cat nvim-linux-x86_64.tar.gz.sha256sum)" >> $GITHUB_ENV
|
echo "SHA_LINUX_64_TAR=$(cat nvim-linux64.tar.gz.sha256sum)" >> $GITHUB_ENV
|
||||||
- name: Generate Linux arm64 SHA256 checksums
|
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
|
||||||
run: |
|
run: |
|
||||||
cd ./nvim-linux-arm64
|
cd ./appimage
|
||||||
sha256sum nvim-linux-arm64.tar.gz > nvim-linux-arm64.tar.gz.sha256sum
|
sha256sum nvim.appimage > nvim.appimage.sha256sum
|
||||||
echo "SHA_LINUX_ARM64_TAR=$(cat nvim-linux-arm64.tar.gz.sha256sum)" >> $GITHUB_ENV
|
echo "SHA_APP_IMAGE=$(cat nvim.appimage.sha256sum)" >> $GITHUB_ENV
|
||||||
- name: Generate AppImage x64_64 SHA256 checksums
|
- name: Generate App Image Zsync SHA256 checksums
|
||||||
run: |
|
run: |
|
||||||
cd ./appimage-x86_64
|
cd ./appimage
|
||||||
sha256sum nvim-linux-x86_64.appimage > nvim-linux-x86_64.appimage.sha256sum
|
sha256sum nvim.appimage.zsync > nvim.appimage.zsync.sha256sum
|
||||||
echo "SHA_APPIMAGE_X86_64=$(cat nvim-linux-x86_64.appimage.sha256sum)" >> $GITHUB_ENV
|
echo "SHA_APP_IMAGE_ZSYNC=$(cat nvim.appimage.zsync.sha256sum)" >> $GITHUB_ENV
|
||||||
- name: Generate AppImage x86_64 Zsync SHA256 checksums
|
- name: Generate macOS SHA256 checksums
|
||||||
run: |
|
run: |
|
||||||
cd ./appimage-x86_64
|
cd ./nvim-macos
|
||||||
sha256sum nvim-linux-x86_64.appimage.zsync > nvim-linux-x86_64.appimage.zsync.sha256sum
|
sha256sum nvim-macos.tar.gz > nvim-macos.tar.gz.sha256sum
|
||||||
echo "SHA_APPIMAGE_X86_64_ZSYNC=$(cat nvim-linux-x86_64.appimage.zsync.sha256sum)" >> $GITHUB_ENV
|
echo "SHA_MACOS=$(cat nvim-macos.tar.gz.sha256sum)" >> $GITHUB_ENV
|
||||||
- name: Generate AppImage x64_64 SHA256 checksums
|
|
||||||
run: |
|
|
||||||
cd ./appimage-arm64
|
|
||||||
sha256sum nvim-linux-arm64.appimage > nvim-linux-arm64.appimage.sha256sum
|
|
||||||
echo "SHA_APPIMAGE_ARM64=$(cat nvim-linux-arm64.appimage.sha256sum)" >> $GITHUB_ENV
|
|
||||||
- name: Generate AppImage arm64 Zsync SHA256 checksums
|
|
||||||
run: |
|
|
||||||
cd ./appimage-arm64
|
|
||||||
sha256sum nvim-linux-arm64.appimage.zsync > nvim-linux-arm64.appimage.zsync.sha256sum
|
|
||||||
echo "SHA_APPIMAGE_ARM64_ZSYNC=$(cat nvim-linux-arm64.appimage.zsync.sha256sum)" >> $GITHUB_ENV
|
|
||||||
- name: Generate macos x86_64 SHA256 checksums
|
|
||||||
run: |
|
|
||||||
cd ./nvim-macos-x86_64
|
|
||||||
sha256sum nvim-macos-x86_64.tar.gz > nvim-macos-x86_64.tar.gz.sha256sum
|
|
||||||
echo "SHA_MACOS_X86_64=$(cat nvim-macos-x86_64.tar.gz.sha256sum)" >> $GITHUB_ENV
|
|
||||||
- name: Generate macos arm64 SHA256 checksums
|
|
||||||
run: |
|
|
||||||
cd ./nvim-macos-arm64
|
|
||||||
sha256sum nvim-macos-arm64.tar.gz > nvim-macos-arm64.tar.gz.sha256sum
|
|
||||||
echo "SHA_MACOS_ARM64=$(cat nvim-macos-arm64.tar.gz.sha256sum)" >> $GITHUB_ENV
|
|
||||||
- name: Generate Win64 SHA256 checksums
|
- name: Generate Win64 SHA256 checksums
|
||||||
run: |
|
run: |
|
||||||
cd ./nvim-win64
|
cd ./nvim-win64
|
||||||
@@ -251,7 +242,34 @@ jobs:
|
|||||||
DEBUG: api
|
DEBUG: api
|
||||||
run: |
|
run: |
|
||||||
envsubst < "$GITHUB_WORKSPACE/.github/workflows/notes.md" > "$RUNNER_TEMP/notes.md"
|
envsubst < "$GITHUB_WORKSPACE/.github/workflows/notes.md" > "$RUNNER_TEMP/notes.md"
|
||||||
|
gh release create $TAG_NAME $PRERELEASE --notes-file "$RUNNER_TEMP/notes.md" --title "$SUBJECT" --target $GITHUB_SHA nvim-macos/* nvim-linux64/* appimage/* nvim-win64/*
|
||||||
if [ "$TAG_NAME" != "nightly" ]; then
|
if [ "$TAG_NAME" != "nightly" ]; then
|
||||||
gh release create stable $PRERELEASE --notes-file "$RUNNER_TEMP/notes.md" --title "$SUBJECT" --target $GITHUB_SHA nvim-macos-x86_64/* nvim-macos-arm64/* nvim-linux-x86_64/* nvim-linux-arm64/* appimage-x86_64/* appimage-arm64/* nvim-win64/*
|
gh release create stable $PRERELEASE --notes-file "$RUNNER_TEMP/notes.md" --title "$SUBJECT" --target $GITHUB_SHA nvim-macos/* nvim-linux64/* appimage/* nvim-win64/*
|
||||||
fi
|
fi
|
||||||
gh release create $TAG_NAME $PRERELEASE --notes-file "$RUNNER_TEMP/notes.md" --title "$SUBJECT" --target $GITHUB_SHA nvim-macos-x86_64/* nvim-macos-arm64/* nvim-linux-x86_64/* nvim-linux-arm64/* appimage-x86_64/* appimage-arm64/* nvim-win64/*
|
publish-winget:
|
||||||
|
needs: publish
|
||||||
|
runs-on: windows-latest
|
||||||
|
steps:
|
||||||
|
- if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name != 'nightly')
|
||||||
|
name: Publish stable
|
||||||
|
uses: vedantmgoyal2009/winget-releaser@latest
|
||||||
|
with:
|
||||||
|
identifier: Neovim.Neovim
|
||||||
|
release-tag: ${{ github.event.inputs.tag_name || github.ref }}
|
||||||
|
token: ${{ secrets.WINGET_TOKEN }}
|
||||||
|
- if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly')
|
||||||
|
name: Get nightly version
|
||||||
|
id: get-version
|
||||||
|
run: |
|
||||||
|
Invoke-WebRequest https://github.com/neovim/neovim/releases/download/nightly/nvim-win64.msi -OutFile setup.msi
|
||||||
|
Install-Module -Name 'Carbon.Windows.Installer' -Force
|
||||||
|
$VERSION = (Get-CMsi (Resolve-Path .\setup.msi).Path).ProductVersion
|
||||||
|
echo "::set-output name=version::$VERSION"
|
||||||
|
- if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly')
|
||||||
|
name: Publish nightly
|
||||||
|
uses: vedantmgoyal2009/winget-releaser@latest
|
||||||
|
with:
|
||||||
|
identifier: Neovim.Neovim.Nightly
|
||||||
|
version: ${{ steps.get-version.outputs.version }}
|
||||||
|
release-tag: nightly
|
||||||
|
token: ${{ secrets.WINGET_TOKEN }}
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
name: "reviewers: remove"
|
name: "Remove reviewers"
|
||||||
on:
|
on:
|
||||||
pull_request_target:
|
pull_request_target:
|
||||||
types: [converted_to_draft, closed]
|
types: [converted_to_draft, closed]
|
||||||
@@ -8,10 +8,10 @@ jobs:
|
|||||||
permissions:
|
permissions:
|
||||||
pull-requests: write
|
pull-requests: write
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v3
|
||||||
- name: 'Remove reviewers'
|
- name: 'Remove reviewers'
|
||||||
uses: actions/github-script@v7
|
uses: actions/github-script@v6
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
const script = require('./.github/scripts/reviewers_remove.js')
|
const script = require('./.github/scripts/remove-reviewers.js')
|
||||||
await script({github, context})
|
await script({github, context})
|
35
.github/workflows/response.yml
vendored
35
.github/workflows/response.yml
vendored
@@ -1,35 +0,0 @@
|
|||||||
name: no_response
|
|
||||||
on:
|
|
||||||
schedule:
|
|
||||||
- cron: '30 1 * * *' # Run every day at 01:30
|
|
||||||
workflow_dispatch:
|
|
||||||
issue_comment:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
close:
|
|
||||||
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
issues: write
|
|
||||||
pull-requests: write
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: actions/github-script@v7
|
|
||||||
with:
|
|
||||||
script: |
|
|
||||||
const script = require('./.github/scripts/close_unresponsive.js')
|
|
||||||
await script({github, context})
|
|
||||||
|
|
||||||
remove_label:
|
|
||||||
if: github.event_name == 'issue_comment'
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
issues: write
|
|
||||||
pull-requests: write
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: actions/github-script@v7
|
|
||||||
with:
|
|
||||||
script: |
|
|
||||||
const script = require('./.github/scripts/remove_response_label.js')
|
|
||||||
await script({github, context})
|
|
@@ -1,19 +1,18 @@
|
|||||||
name: "reviewers: add"
|
name: "Request reviews"
|
||||||
on:
|
on:
|
||||||
pull_request_target:
|
pull_request_target:
|
||||||
types: [labeled, ready_for_review, reopened]
|
types: [labeled, ready_for_review]
|
||||||
workflow_call:
|
|
||||||
jobs:
|
jobs:
|
||||||
request-reviewer:
|
request-reviewer:
|
||||||
if: github.event.pull_request.state == 'open' && github.event.pull_request.draft == false && !endsWith(github.actor, '[bot]')
|
if: github.event.pull_request.state == 'open' && github.event.pull_request.draft == false
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
pull-requests: write
|
pull-requests: write
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v3
|
||||||
- name: 'Request reviewers'
|
- name: 'Request reviewers'
|
||||||
uses: actions/github-script@v7
|
uses: actions/github-script@v6
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
const script = require('./.github/scripts/reviewers_add.js')
|
const script = require('./.github/scripts/reviews.js')
|
||||||
await script({github, context})
|
await script({github, context})
|
243
.github/workflows/test.yml
vendored
243
.github/workflows/test.yml
vendored
@@ -1,243 +0,0 @@
|
|||||||
name: test
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- 'master'
|
|
||||||
- 'release-[0-9]+.[0-9]+'
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- 'master'
|
|
||||||
- 'release-[0-9]+.[0-9]+'
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
|
||||||
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
|
||||||
|
|
||||||
env:
|
|
||||||
ASAN_OPTIONS: detect_leaks=1:check_initialization_order=1:log_path=${{ github.workspace }}/build/log/asan:intercept_tls_get_addr=0
|
|
||||||
BIN_DIR: ${{ github.workspace }}/bin
|
|
||||||
BUILD_DIR: ${{ github.workspace }}/build
|
|
||||||
INSTALL_PREFIX: ${{ github.workspace }}/nvim-install
|
|
||||||
LOG_DIR: ${{ github.workspace }}/build/log
|
|
||||||
NVIM_LOG_FILE: ${{ github.workspace }}/build/.nvimlog
|
|
||||||
TSAN_OPTIONS: log_path=${{ github.workspace }}/build/log/tsan
|
|
||||||
VALGRIND_LOG: ${{ github.workspace }}/build/log/valgrind-%p.log
|
|
||||||
# TEST_FILE: test/functional/core/startup_spec.lua
|
|
||||||
# TEST_FILTER: foo
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
lint:
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
timeout-minutes: 10
|
|
||||||
env:
|
|
||||||
CC: clang
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: ./.github/actions/setup
|
|
||||||
|
|
||||||
- name: Install stylua
|
|
||||||
run: |
|
|
||||||
wget --directory-prefix="$BIN_DIR" https://github.com/JohnnyMorganz/StyLua/releases/latest/download/stylua-linux-x86_64.zip
|
|
||||||
(cd "$BIN_DIR"; unzip stylua*.zip)
|
|
||||||
|
|
||||||
- name: Build third-party deps
|
|
||||||
run: |
|
|
||||||
cmake -S cmake.deps -B .deps -G Ninja
|
|
||||||
cmake --build .deps
|
|
||||||
|
|
||||||
- run: cmake -B build -G Ninja -D CI_LINT=ON
|
|
||||||
|
|
||||||
- if: "!cancelled()"
|
|
||||||
name: Determine if run should be aborted
|
|
||||||
id: abort_job
|
|
||||||
run: echo "status=${{ job.status }}" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- if: success() || failure() && steps.abort_job.outputs.status == 'success'
|
|
||||||
name: stylua
|
|
||||||
run: cmake --build build --target lintlua-stylua
|
|
||||||
|
|
||||||
- if: success() || failure() && steps.abort_job.outputs.status == 'success'
|
|
||||||
name: luacheck
|
|
||||||
run: cmake --build build --target lintlua-luacheck
|
|
||||||
|
|
||||||
- if: success() || failure() && steps.abort_job.outputs.status == 'success'
|
|
||||||
name: lintsh
|
|
||||||
run: cmake --build build --target lintsh
|
|
||||||
|
|
||||||
- if: success() || failure() && steps.abort_job.outputs.status == 'success'
|
|
||||||
name: clint.py
|
|
||||||
run: cmake --build build --target lintc-clint
|
|
||||||
|
|
||||||
- if: success() || failure() && steps.abort_job.outputs.status == 'success'
|
|
||||||
name: clang-tidy
|
|
||||||
run: cmake --build build --target lintc-clang-tidy
|
|
||||||
|
|
||||||
- if: success() || failure() && steps.abort_job.outputs.status == 'success'
|
|
||||||
name: uncrustify
|
|
||||||
run: cmake --build build --target lintc-uncrustify
|
|
||||||
|
|
||||||
clang-analyzer:
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
timeout-minutes: 20
|
|
||||||
env:
|
|
||||||
CC: clang
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: ./.github/actions/setup
|
|
||||||
- name: Build third-party deps
|
|
||||||
run: |
|
|
||||||
cmake -S cmake.deps --preset ci
|
|
||||||
cmake --build .deps
|
|
||||||
cmake --preset ci
|
|
||||||
- run: cmake --build build --target clang-analyzer
|
|
||||||
|
|
||||||
posix:
|
|
||||||
name: ${{ matrix.build.os }} ${{ matrix.build.flavor }} ${{ matrix.build.cc }} ${{ matrix.test }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
# The `os` field is not needed to differentiate between the different
|
|
||||||
# matrix builds. It is needed to not change the required checks (which
|
|
||||||
# uses jobs names) each time we bump the runner version. It may be
|
|
||||||
# possible to remove if we e.g. start using `-latest` runner versions
|
|
||||||
# or if github introduces a wildcard for required checks in the future.
|
|
||||||
build:
|
|
||||||
[
|
|
||||||
{ runner: ubuntu-24.04, os: ubuntu, flavor: asan, cc: clang, flags: -D ENABLE_ASAN_UBSAN=ON },
|
|
||||||
{ runner: ubuntu-24.04, os: ubuntu, flavor: tsan, cc: clang, flags: -D ENABLE_TSAN=ON },
|
|
||||||
{ runner: ubuntu-24.04, os: ubuntu, flavor: release, cc: gcc, flags: -D CMAKE_BUILD_TYPE=Release },
|
|
||||||
{ runner: ubuntu-24.04-arm, os: ubuntu, flavor: arm, cc: gcc, flags: -D CMAKE_BUILD_TYPE=RelWithDebInfo },
|
|
||||||
{ runner: macos-13, os: macos, flavor: intel, cc: clang, flags: -D CMAKE_FIND_FRAMEWORK=NEVER, deps_flags: -D CMAKE_FIND_FRAMEWORK=NEVER },
|
|
||||||
{ runner: macos-15, os: macos, flavor: arm, cc: clang, flags: -D CMAKE_FIND_FRAMEWORK=NEVER, deps_flags: -D CMAKE_FIND_FRAMEWORK=NEVER },
|
|
||||||
{ runner: ubuntu-24.04, os: ubuntu, flavor: puc-lua, cc: gcc, deps_flags: -D USE_BUNDLED_LUAJIT=OFF -D USE_BUNDLED_LUA=ON, flags: -D PREFER_LUA=ON },
|
|
||||||
]
|
|
||||||
test: [unittest, functionaltest, oldtest]
|
|
||||||
exclude:
|
|
||||||
- test: unittest
|
|
||||||
build: { flavor: tsan }
|
|
||||||
- test: unittest
|
|
||||||
build: { flavor: puc-lua }
|
|
||||||
- test: oldtest
|
|
||||||
build: { flavor: tsan }
|
|
||||||
runs-on: ${{ matrix.build.runner }}
|
|
||||||
timeout-minutes: 45
|
|
||||||
env:
|
|
||||||
CC: ${{ matrix.build.cc }}
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: ./.github/actions/setup
|
|
||||||
with:
|
|
||||||
install_flags: "--test"
|
|
||||||
|
|
||||||
- name: Create log dir
|
|
||||||
run: mkdir -p "$LOG_DIR"
|
|
||||||
|
|
||||||
- if: ${{ matrix.test != 'unittest' }}
|
|
||||||
name: Set up interpreter packages
|
|
||||||
run: |
|
|
||||||
echo "Install neovim RubyGem."
|
|
||||||
gem install --no-document --bindir "$BIN_DIR" --user-install --pre neovim
|
|
||||||
|
|
||||||
echo "Install neovim npm package"
|
|
||||||
npm install -g neovim
|
|
||||||
npm link neovim
|
|
||||||
|
|
||||||
sudo cpanm -n Neovim::Ext || cat "$HOME/.cpanm/build.log"
|
|
||||||
perl -W -e 'use Neovim::Ext; print $Neovim::Ext::VERSION'
|
|
||||||
|
|
||||||
- name: Remove .git directory
|
|
||||||
if: ${{ matrix.build.os == 'ubuntu' }}
|
|
||||||
run: cmake -E rm -rf -- .git
|
|
||||||
|
|
||||||
- name: Build third-party deps
|
|
||||||
run: |
|
|
||||||
cmake -S cmake.deps --preset ci -D CMAKE_BUILD_TYPE=Debug ${{ matrix.build.deps_flags }}
|
|
||||||
cmake --build .deps
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
run: |
|
|
||||||
cmake --preset ci -D CMAKE_BUILD_TYPE=Debug -D CMAKE_INSTALL_PREFIX:PATH=$INSTALL_PREFIX ${{ matrix.build.flags }}
|
|
||||||
cmake --build build
|
|
||||||
|
|
||||||
- if: ${{ matrix.test == 'oldtest' }}
|
|
||||||
name: ${{ matrix.test }}
|
|
||||||
timeout-minutes: 20
|
|
||||||
run: make -C test/old/testdir NVIM_PRG=$(realpath build)/bin/nvim
|
|
||||||
|
|
||||||
- if: ${{ matrix.test != 'oldtest' }}
|
|
||||||
name: ${{ matrix.test }}
|
|
||||||
timeout-minutes: 20
|
|
||||||
run: cmake --build build --target ${{ matrix.test }}
|
|
||||||
|
|
||||||
- name: Install
|
|
||||||
run: |
|
|
||||||
cmake --install build
|
|
||||||
"$INSTALL_PREFIX/bin/nvim" --version
|
|
||||||
if ! "$INSTALL_PREFIX/bin/nvim" -u NONE -e -c ':help' -c ':qall'; then
|
|
||||||
echo "Running ':help' in the installed nvim failed."
|
|
||||||
echo "Maybe the helptags have not been generated properly."
|
|
||||||
echo 'Failed running :help'
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Check that all runtime files were installed
|
|
||||||
for file in $(git -C runtime ls-files '*.vim' '*.ps' '*.dict' '*.py' '*.tutor' '*.awk' '*.sh' '*.bat'); do
|
|
||||||
if ! test -e "$INSTALL_PREFIX/share/nvim/runtime/$file"; then
|
|
||||||
printf "It appears that %s is not installed." "$file"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# Check that generated syntax file has function names, #5060.
|
|
||||||
genvimsynf=syntax/vim/generated.vim
|
|
||||||
gpat='syn keyword vimFuncName .*eval'
|
|
||||||
if ! grep -q "$gpat" "$INSTALL_PREFIX/share/nvim/runtime/$genvimsynf"; then
|
|
||||||
echo "It appears that $genvimsynf does not contain $gpat."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
- if: '!cancelled()'
|
|
||||||
name: Show logs
|
|
||||||
run: cat $(find "$LOG_DIR" -type f)
|
|
||||||
|
|
||||||
windows:
|
|
||||||
uses: ./.github/workflows/test_windows.yml
|
|
||||||
|
|
||||||
with-external-deps:
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
timeout-minutes: 10
|
|
||||||
env:
|
|
||||||
CC: gcc
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: ./.github/actions/setup
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
|
||||||
sudo add-apt-repository ppa:neovim-ppa/stable
|
|
||||||
sudo apt-get install -y \
|
|
||||||
libluajit-5.1-dev \
|
|
||||||
libmsgpack-dev \
|
|
||||||
libtermkey-dev \
|
|
||||||
libunibilium-dev \
|
|
||||||
libuv1-dev \
|
|
||||||
lua-filesystem \
|
|
||||||
lua-lpeg \
|
|
||||||
luajit \
|
|
||||||
lua-luv-dev
|
|
||||||
# libtree-sitter-dev \
|
|
||||||
# libvterm-dev
|
|
||||||
|
|
||||||
# Remove comments from packages once we start using these external
|
|
||||||
# dependencies.
|
|
||||||
|
|
||||||
- name: Build third-party deps
|
|
||||||
run: |
|
|
||||||
cmake -S cmake.deps --preset external_deps
|
|
||||||
cmake --build .deps
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
run: |
|
|
||||||
cmake --preset ci
|
|
||||||
cmake --build build
|
|
79
.github/workflows/test_windows.yml
vendored
79
.github/workflows/test_windows.yml
vendored
@@ -1,79 +0,0 @@
|
|||||||
name: windows
|
|
||||||
on:
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
build_flags:
|
|
||||||
type: string
|
|
||||||
functionaltest_timeout:
|
|
||||||
default: 20
|
|
||||||
type: number
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
windows:
|
|
||||||
runs-on: windows-2022
|
|
||||||
timeout-minutes: 45
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
test: [functional, old]
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: ./.github/actions/setup
|
|
||||||
|
|
||||||
- name: Build deps
|
|
||||||
run: |
|
|
||||||
cmake -S cmake.deps -B .deps -G Ninja -D CMAKE_BUILD_TYPE='RelWithDebInfo'
|
|
||||||
cmake --build .deps
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
run: |
|
|
||||||
cmake --preset ci -D CMAKE_BUILD_TYPE='RelWithDebInfo' ${{ inputs.build_flags }}
|
|
||||||
cmake --build build
|
|
||||||
|
|
||||||
# FIXME(dundargoc): this workaround is needed as the python3 provider
|
|
||||||
# tests suddenly started to become extremely flaky, and this removes the
|
|
||||||
# flakiness for some reason.
|
|
||||||
- uses: actions/setup-python@v4
|
|
||||||
with:
|
|
||||||
python-version: '3.13'
|
|
||||||
|
|
||||||
- name: Install test deps
|
|
||||||
run: |
|
|
||||||
$PSNativeCommandArgumentPassing = 'Legacy'
|
|
||||||
|
|
||||||
& build\bin\nvim.exe "--version"
|
|
||||||
|
|
||||||
# Ensure that the "win32" feature is set.
|
|
||||||
& build\bin\nvim -u NONE --headless -c 'exe !has(\"win32\").\"cq\"'
|
|
||||||
|
|
||||||
python -m pip install pynvim
|
|
||||||
# Sanity check
|
|
||||||
python -c "import pynvim; print(str(pynvim))"
|
|
||||||
|
|
||||||
node --version
|
|
||||||
npm.cmd --version
|
|
||||||
|
|
||||||
npm.cmd install -g neovim
|
|
||||||
Get-Command -CommandType Application neovim-node-host.cmd
|
|
||||||
npm.cmd link neovim
|
|
||||||
|
|
||||||
- if: ${{ matrix.test == 'functional' }}
|
|
||||||
name: functionaltest
|
|
||||||
timeout-minutes: ${{ inputs.functionaltest_timeout }}
|
|
||||||
run: cmake --build build --target functionaltest
|
|
||||||
|
|
||||||
- if: ${{ matrix.test == 'old' }}
|
|
||||||
uses: msys2/setup-msys2@v2
|
|
||||||
with:
|
|
||||||
update: true
|
|
||||||
pacboy: >-
|
|
||||||
make:p gcc:p diffutils:p
|
|
||||||
release: false
|
|
||||||
|
|
||||||
- if: ${{ matrix.test == 'old' }}
|
|
||||||
name: oldtest
|
|
||||||
shell: msys2 {0}
|
|
||||||
run: |
|
|
||||||
cd test/old/testdir
|
|
||||||
mingw32-make VERBOSE=1
|
|
@@ -2,7 +2,6 @@ name: vim-patches
|
|||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '3 3 * * *'
|
- cron: '3 3 * * *'
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
update-vim-patches:
|
update-vim-patches:
|
||||||
@@ -11,22 +10,20 @@ jobs:
|
|||||||
contents: write
|
contents: write
|
||||||
pull-requests: write
|
pull-requests: write
|
||||||
env:
|
env:
|
||||||
VIM_SOURCE_DIR: ${{ github.workspace }}/vim-src
|
VIM_SOURCE_DIR: ${{ format('{0}/vim-src', github.workspace) }}
|
||||||
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@v4
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
repository: vim/vim
|
repository: vim/vim
|
||||||
path: ${{ env.VIM_SOURCE_DIR }}
|
path: ${{ env.VIM_SOURCE_DIR }}
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- run: sudo apt-get install libfuse2
|
|
||||||
|
|
||||||
- run: |
|
- run: |
|
||||||
gh release download -R neovim/neovim -p nvim.appimage
|
gh release download -R neovim/neovim -p nvim.appimage
|
||||||
chmod a+x nvim.appimage
|
chmod a+x nvim.appimage
|
||||||
@@ -43,13 +40,13 @@ 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 }}
|
||||||
run: |
|
run: |
|
||||||
git add -u
|
git add -u
|
||||||
git commit -m 'docs: update version.c'
|
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 --draft --fill --label vim-patch --base ${GITHUB_REF#refs/heads/} --head ${VERSION_BRANCH} || true
|
38
.gitignore
vendored
38
.gitignore
vendored
@@ -1,8 +1,7 @@
|
|||||||
# Tools
|
# Tools
|
||||||
/.direnv/
|
|
||||||
/venv/
|
/venv/
|
||||||
compile_commands.json
|
compile_commands.json
|
||||||
/.envrc
|
/.luarc.json
|
||||||
|
|
||||||
# IDEs
|
# IDEs
|
||||||
/.vs/
|
/.vs/
|
||||||
@@ -37,22 +36,21 @@ compile_commands.json
|
|||||||
*.rej
|
*.rej
|
||||||
|
|
||||||
# Generated by old (Vim) tests.
|
# Generated by old (Vim) tests.
|
||||||
/test/old/testdir/del
|
/src/nvim/testdir/del
|
||||||
/test/old/testdir/test*.out
|
/src/nvim/testdir/test*.out
|
||||||
/test/old/testdir/test*.res
|
/src/nvim/testdir/test*.res
|
||||||
/test/old/testdir/test*.log
|
/src/nvim/testdir/test*.log
|
||||||
/test/old/testdir/messages
|
/src/nvim/testdir/messages
|
||||||
/test/old/testdir/starttime
|
/src/nvim/testdir/viminfo
|
||||||
/test/old/testdir/viminfo
|
/src/nvim/testdir/test.ok
|
||||||
/test/old/testdir/test.ok
|
/src/nvim/testdir/*.failed
|
||||||
/test/old/testdir/*.failed
|
/src/nvim/testdir/X*
|
||||||
/test/old/testdir/X*
|
/src/nvim/testdir/valgrind.*
|
||||||
/test/old/testdir/valgrind.*
|
/src/nvim/testdir/.gdbinit
|
||||||
/test/old/testdir/.gdbinit
|
|
||||||
/runtime/indent/testdir/*.out
|
/runtime/indent/testdir/*.out
|
||||||
+runtime/indent/testdir/*.fail
|
+runtime/indent/testdir/*.fail
|
||||||
# Generated by test/old/testdir/runnvim.sh.
|
# Generated by src/nvim/testdir/runnvim.sh.
|
||||||
/test/old/testdir/*.tlog
|
/src/nvim/testdir/*.tlog
|
||||||
|
|
||||||
# Generated by unit tests.
|
# Generated by unit tests.
|
||||||
/test/includes/post/
|
/test/includes/post/
|
||||||
@@ -76,10 +74,4 @@ tags
|
|||||||
# vim patches
|
# vim patches
|
||||||
/vim-*.patch
|
/vim-*.patch
|
||||||
|
|
||||||
# nix build results
|
/CMakeUserPresets.json
|
||||||
/result
|
|
||||||
/result-*
|
|
||||||
/contrib/result
|
|
||||||
/contrib/result-*
|
|
||||||
|
|
||||||
CMakeUserPresets.json
|
|
||||||
|
10
.luacheckrc
10
.luacheckrc
@@ -19,10 +19,6 @@ cache = true
|
|||||||
ignore = {
|
ignore = {
|
||||||
"631", -- max_line_length
|
"631", -- max_line_length
|
||||||
"212/_.*", -- unused argument, for vars with "_" prefix
|
"212/_.*", -- unused argument, for vars with "_" prefix
|
||||||
"214", -- used variable with unused hint ("_" prefix)
|
|
||||||
"121", -- setting read-only global variable 'vim'
|
|
||||||
"122", -- setting read-only field of global variable 'vim'
|
|
||||||
"581", -- negation of a relational operator- operator can be flipped (not for tables)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Global objects defined by the C code
|
-- Global objects defined by the C code
|
||||||
@@ -43,10 +39,4 @@ globals = {
|
|||||||
|
|
||||||
exclude_files = {
|
exclude_files = {
|
||||||
'test/functional/fixtures/lua/syntax_error.lua',
|
'test/functional/fixtures/lua/syntax_error.lua',
|
||||||
'runtime/lua/vim/treesitter/_meta.lua',
|
|
||||||
'runtime/lua/vim/_meta/vimfn.lua',
|
|
||||||
'runtime/lua/vim/_meta/api.lua',
|
|
||||||
'runtime/lua/vim/re.lua',
|
|
||||||
'runtime/lua/coxpcall.lua',
|
|
||||||
'src/nvim/eval.lua',
|
|
||||||
}
|
}
|
||||||
|
31
.luarc.json
31
.luarc.json
@@ -1,31 +0,0 @@
|
|||||||
{
|
|
||||||
"$schema": "https://raw.githubusercontent.com/LuaLS/vscode-lua/master/setting/schema.json",
|
|
||||||
"runtime": {
|
|
||||||
"version": "LuaJIT"
|
|
||||||
},
|
|
||||||
"workspace": {
|
|
||||||
"library": [
|
|
||||||
"runtime/lua",
|
|
||||||
"${3rd}/busted/library",
|
|
||||||
"${3rd}/luv/library"
|
|
||||||
],
|
|
||||||
"ignoreDir": [
|
|
||||||
"test"
|
|
||||||
],
|
|
||||||
"checkThirdParty": "Disable"
|
|
||||||
},
|
|
||||||
"diagnostics": {
|
|
||||||
"groupFileStatus": {
|
|
||||||
"strict": "Opened",
|
|
||||||
"strong": "Opened"
|
|
||||||
},
|
|
||||||
"groupSeverity": {
|
|
||||||
"strong": "Warning",
|
|
||||||
"strict": "Warning"
|
|
||||||
},
|
|
||||||
"unusedLocalExclude": [ "_*" ],
|
|
||||||
"disable": [
|
|
||||||
"luadoc-miss-see-name"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
12
.mailmap
12
.mailmap
@@ -8,12 +8,15 @@ Anmol Sethi <hi@nhooyr.io> <nhooyr@users.noreply.github.com>
|
|||||||
BK1603 <chouhan.shreyansh2702@gmail.com> Shreyansh Chouhan
|
BK1603 <chouhan.shreyansh2702@gmail.com> Shreyansh Chouhan
|
||||||
Billy Su <g4691821@gmail.com> Billy SU
|
Billy Su <g4691821@gmail.com> Billy SU
|
||||||
Billy Vong <billyvg@gmail.com> <billyvg@users.noreply.github.com>
|
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>
|
Carlos Hernandez <carlos@techbyte.ca> <hurricanehrndz@users.noreply.github.com>
|
||||||
Chris Kipp <ckipp@pm.me> ckipp01
|
Chris Kipp <ckipp@pm.me> ckipp01
|
||||||
Christian Clason <c.clason@uni-graz.at> <christian.clason@uni-due.de>
|
Christian Clason <c.clason@uni-graz.at> <christian.clason@uni-due.de>
|
||||||
Cédric Barreteau <> <cbarrete@users.noreply.github.com>
|
Cédric Barreteau <> <cbarrete@users.noreply.github.com>
|
||||||
Dan Aloni <alonid@gmail.com> <dan@kernelim.com>
|
Dan Aloni <alonid@gmail.com> <dan@kernelim.com>
|
||||||
Daniel Hahler <git@thequod.de> <github@thequod.de>
|
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
|
Eisuke Kawashima <e-kwsm@users.noreply.github.com> E Kawashima
|
||||||
ElPiloto <luis.r.piloto@gmail.com> Luis Piloto
|
ElPiloto <luis.r.piloto@gmail.com> Luis Piloto
|
||||||
Eliseo Martínez <eliseomarmol@gmail.com> Eliseo Martínez
|
Eliseo Martínez <eliseomarmol@gmail.com> Eliseo Martínez
|
||||||
@@ -35,7 +38,6 @@ 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> <jack.bracewell@unboxedconsulting.com>
|
||||||
Jack Bracewell <FriedSock@users.noreply.github.com> <jbtwentythree@gmail.com>
|
Jack Bracewell <FriedSock@users.noreply.github.com> <jbtwentythree@gmail.com>
|
||||||
Jacques Germishuys <jacquesg@striata.com> <jacquesg@users.noreply.github.com>
|
Jacques Germishuys <jacquesg@striata.com> <jacquesg@users.noreply.github.com>
|
||||||
Jaehwang Jung <tomtomjhj@gmail.com> Jaehwang Jerry Jung
|
|
||||||
Jakub Łuczyński <doubleloop@o2.pl> <doubleloop@users.noreply.github.com>
|
Jakub Łuczyński <doubleloop@o2.pl> <doubleloop@users.noreply.github.com>
|
||||||
James McCoy <jamessan@jamessan.com> <vega.james@gmail.com>
|
James McCoy <jamessan@jamessan.com> <vega.james@gmail.com>
|
||||||
Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> <janedmundlazo@hotmail.com>
|
Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> <janedmundlazo@hotmail.com>
|
||||||
@@ -55,8 +57,6 @@ Kwon-Young Choi <kwon-young.choi@hotmail.fr> Kwon-Young
|
|||||||
Lewis Russell <lewis6991@gmail.com> <me@lewisr.dev>
|
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@posteo.de>
|
||||||
Lucas Hoffmann <l-m-h@web.de> <lucc@users.noreply.github.com>
|
Lucas Hoffmann <l-m-h@web.de> <lucc@users.noreply.github.com>
|
||||||
Luuk van Baal <luukvbaal@gmail.com> <31730729+luukvbaal@users.noreply.github.com>
|
|
||||||
Luuk van Baal <luukvbaal@gmail.com> luukvbaal
|
|
||||||
Marco Hinz <mh.codebro@gmail.com> <mh.codebro+github@gmail.com>
|
Marco Hinz <mh.codebro@gmail.com> <mh.codebro+github@gmail.com>
|
||||||
Marvim the Paranoid Android <marvim@users.noreply.github.com> marvim
|
Marvim the Paranoid Android <marvim@users.noreply.github.com> marvim
|
||||||
Mateusz Czapliński <czapkofan@gmail.com> Mateusz Czaplinski
|
Mateusz Czapliński <czapkofan@gmail.com> Mateusz Czaplinski
|
||||||
@@ -111,20 +111,14 @@ Yorick Peterse <git@yorickpeterse.com> <yorick@yorickpeterse.com>
|
|||||||
ZyX <kp-pav@yandex.ru> <kp-pav@ya.ru>
|
ZyX <kp-pav@yandex.ru> <kp-pav@ya.ru>
|
||||||
ZyX <kp-pav@yandex.ru> Nikolai Aleksandrovich Pavlov
|
ZyX <kp-pav@yandex.ru> Nikolai Aleksandrovich Pavlov
|
||||||
aph <a.hewson@gmail.com> Ashley Hewson
|
aph <a.hewson@gmail.com> Ashley Hewson
|
||||||
bfredl <bjorn.linse@gmail.com>
|
|
||||||
butwerenotthereyet <58348703+butwerenotthereyet@users.noreply.github.com> We're Yet
|
butwerenotthereyet <58348703+butwerenotthereyet@users.noreply.github.com> We're Yet
|
||||||
chemzqm <chemzqm@gmail.com> Qiming zhao
|
chemzqm <chemzqm@gmail.com> Qiming zhao
|
||||||
chentau <tchen1998@gmail.com> Tony Chen
|
chentau <tchen1998@gmail.com> Tony Chen
|
||||||
dedmass <carlo.abelli@gmail.com> Carlo Abelli
|
dedmass <carlo.abelli@gmail.com> Carlo Abelli
|
||||||
dundargoc <gocdundar@gmail.com> <33953936+dundargoc@users.noreply.github.com>
|
|
||||||
dundargoc <gocdundar@gmail.com> Dundar Goc
|
|
||||||
equal-l2 <eng.equall2@gmail.com> <equal-l2@users.noreply.github.com>
|
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>
|
francisco souza <fsouza@users.noreply.github.com> <108725+fsouza@users.noreply.github.com>
|
||||||
glacambre <code@lacamb.re> <me@r4>
|
glacambre <code@lacamb.re> <me@r4>
|
||||||
glacambre <code@lacamb.re> Ghjuvan Lacambre
|
glacambre <code@lacamb.re> Ghjuvan Lacambre
|
||||||
glepnir <glephunter@gmail.com> Raphael
|
|
||||||
glepnir <glepnir@gopherhub.org> Raphael
|
|
||||||
glepnir <glepnir@neovim.pro> Raphael
|
|
||||||
ii14 <ii14@users.noreply.github.com> <59243201+ii14@users.noreply.github.com>
|
ii14 <ii14@users.noreply.github.com> <59243201+ii14@users.noreply.github.com>
|
||||||
jdrouhard <john@jmdtech.org> <github@jmdtech.org>
|
jdrouhard <john@jmdtech.org> <github@jmdtech.org>
|
||||||
kuuote <znmxodq1@gmail.com> <36663503+kuuote@users.noreply.github.com>
|
kuuote <znmxodq1@gmail.com> <36663503+kuuote@users.noreply.github.com>
|
||||||
|
@@ -3,4 +3,4 @@ line_endings = "Unix"
|
|||||||
indent_type = "Spaces"
|
indent_type = "Spaces"
|
||||||
indent_width = 2
|
indent_width = 2
|
||||||
quote_style = "AutoPreferSingle"
|
quote_style = "AutoPreferSingle"
|
||||||
call_parentheses = "Input"
|
call_parentheses = "Always"
|
||||||
|
@@ -1,14 +1,3 @@
|
|||||||
/build/
|
/scripts
|
||||||
/.deps/
|
/src
|
||||||
/runtime/lua/coxpcall.lua
|
/test
|
||||||
/runtime/lua/vim/_meta
|
|
||||||
/runtime/lua/vim/re.lua
|
|
||||||
|
|
||||||
test/functional/ui/decorations_spec.lua
|
|
||||||
test/functional/ui/float_spec.lua
|
|
||||||
test/functional/ui/multigrid_spec.lua
|
|
||||||
/test/functional/fixtures/lua/syntax_error.lua
|
|
||||||
/test/functional/legacy/030_fileformats_spec.lua
|
|
||||||
/test/functional/legacy/044_099_regexp_multibyte_magic_spec.lua
|
|
||||||
/test/functional/legacy/093_mksession_cursor_cols_latin1_spec.lua
|
|
||||||
/test/functional/lua/luaeval_spec.lua
|
|
||||||
|
@@ -1,15 +1,8 @@
|
|||||||
*backers.txt* Nvim
|
# Bountysource Backers
|
||||||
|
|
||||||
|
Thank you to everyone who backed our [Bountysource fundraiser](https://www.bountysource.com/teams/neovim/fundraiser)!
|
||||||
|
|
||||||
NVIM REFERENCE MANUAL
|
### Your name and URL in BACKERS.md.
|
||||||
|
|
||||||
|
|
||||||
==============================================================================
|
|
||||||
Fundraiser Backers
|
|
||||||
|
|
||||||
Thank you to everyone who backed the original Neovim Fundraiser.
|
|
||||||
|
|
||||||
LIST OF BACKERS
|
|
||||||
|
|
||||||
- [Bob Breznak](http://brez.io)
|
- [Bob Breznak](http://brez.io)
|
||||||
- [Tim Uruski](http://timuruski.net)
|
- [Tim Uruski](http://timuruski.net)
|
||||||
@@ -230,7 +223,7 @@ LIST OF BACKERS
|
|||||||
- BenBergman
|
- BenBergman
|
||||||
- Bengt Lüers
|
- Bengt Lüers
|
||||||
- Benjamin Bryant
|
- Benjamin Bryant
|
||||||
- Bèr "berkes" Kessels
|
- Bèr 'berkes' Kessels
|
||||||
- Bernd Homuth
|
- Bernd Homuth
|
||||||
- Bheesham Persaud
|
- Bheesham Persaud
|
||||||
- Bilal Quadri
|
- Bilal Quadri
|
||||||
@@ -466,7 +459,7 @@ LIST OF BACKERS
|
|||||||
- Matthias Lehmann
|
- Matthias Lehmann
|
||||||
- Maximilian Gerlach
|
- Maximilian Gerlach
|
||||||
- Meryn Stol
|
- Meryn Stol
|
||||||
- Michael "manveru" Fellinger
|
- Michael 'manveru' Fellinger
|
||||||
- Michael "beefsack" Alexander
|
- Michael "beefsack" Alexander
|
||||||
- Michael Iles
|
- Michael Iles
|
||||||
- Michael Irwin/mdi
|
- Michael Irwin/mdi
|
||||||
@@ -648,9 +641,6 @@ LIST OF BACKERS
|
|||||||
- Ziling Zhao
|
- Ziling Zhao
|
||||||
- Zsolt Botykai
|
- Zsolt Botykai
|
||||||
|
|
||||||
ANONYMOUS SUPPORTERS
|
### Anonymous Supporters
|
||||||
|
|
||||||
There were also 307 other people who didn't claim any level of reward but
|
There were also 307 other people who didn't claim any level of reward but contributed to the fundraiser. Thank you all for the support!
|
||||||
contributed to the fundraiser. Thank you all for the support!
|
|
||||||
|
|
||||||
vim:tw=78:ts=8:et:ft=help:norl:
|
|
451
BUILD.md
451
BUILD.md
@@ -1,451 +0,0 @@
|
|||||||
- **IMPORTANT**: Before upgrading to a new version, **always check for [breaking changes](https://neovim.io/doc/user/news.html#news-breaking).**
|
|
||||||
|
|
||||||
|
|
||||||
## Quick start
|
|
||||||
|
|
||||||
1. Install [build prerequisites](#build-prerequisites) on your system
|
|
||||||
2. `git clone https://github.com/neovim/neovim`
|
|
||||||
3. `cd neovim && make CMAKE_BUILD_TYPE=RelWithDebInfo`
|
|
||||||
- If you want the **stable release**, also run `git checkout stable`.
|
|
||||||
- If you want to install to a custom location, set `CMAKE_INSTALL_PREFIX`. See also [INSTALL.md](./INSTALL.md#install-from-source).
|
|
||||||
- On BSD, use `gmake` instead of `make`.
|
|
||||||
- To build on Windows, see the [Building on Windows](#building-on-windows) section. _MSVC (Visual Studio) is recommended._
|
|
||||||
4. `sudo make install`
|
|
||||||
- Default install location is `/usr/local`
|
|
||||||
- On Debian/Ubuntu, instead of `sudo make install`, you can try `cd build && cpack -G DEB && sudo dpkg -i nvim-linux-<arch>.deb` (with `<arch>` either `x86_64` or `arm64`) to build DEB-package and install it. This helps ensure clean removal of installed files. Note: This is an unsupported, "best-effort" feature of the Nvim build.
|
|
||||||
|
|
||||||
**Notes**:
|
|
||||||
- From the repository's root directory, running `make` will download and build all the needed dependencies and put the `nvim` executable in `build/bin`.
|
|
||||||
- Third-party dependencies (libuv, LuaJIT, etc.) are downloaded automatically to `.deps/`. See the [FAQ](https://neovim.io/doc/user/faq.html#faq-build) if you have issues.
|
|
||||||
- After building, you can run the `nvim` executable without installing it by running `VIMRUNTIME=runtime ./build/bin/nvim`.
|
|
||||||
- If you plan to develop Neovim, install [Ninja](https://ninja-build.org/) for faster builds. It will automatically be used.
|
|
||||||
- Install [ccache](https://ccache.dev/) for faster rebuilds of Neovim. It's used by default. To disable it, use `CCACHE_DISABLE=true make`.
|
|
||||||
|
|
||||||
## Running tests
|
|
||||||
|
|
||||||
See [test/README.md](https://github.com/neovim/neovim/blob/master/test/README.md).
|
|
||||||
|
|
||||||
## Building
|
|
||||||
|
|
||||||
First make sure you installed the [build prerequisites](#build-prerequisites). Now that you have the dependencies, you can try other build targets explained below.
|
|
||||||
|
|
||||||
The _build type_ determines the level of used compiler optimizations and debug information:
|
|
||||||
|
|
||||||
- `Release`: Full compiler optimizations and no debug information. Expect the best performance from this build type. Often used by package maintainers.
|
|
||||||
- `Debug`: Full debug information; few optimizations. Use this for development to get meaningful output from debuggers like GDB or LLDB. This is the default if `CMAKE_BUILD_TYPE` is not specified.
|
|
||||||
- `RelWithDebInfo` ("Release With Debug Info"): Enables many optimizations and adds enough debug info so that when Neovim ever crashes, you can still get a backtrace.
|
|
||||||
|
|
||||||
So, for a release build, just use:
|
|
||||||
|
|
||||||
```
|
|
||||||
make CMAKE_BUILD_TYPE=Release
|
|
||||||
```
|
|
||||||
(Do not add a `-j` flag if `ninja` is installed! The build will be in parallel automatically.)
|
|
||||||
|
|
||||||
Afterwards, the `nvim` executable can be found in `build/bin`. To verify the build type after compilation, run:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
./build/bin/nvim --version | grep ^Build
|
|
||||||
```
|
|
||||||
|
|
||||||
To install the executable to a certain location, use:
|
|
||||||
|
|
||||||
```
|
|
||||||
make CMAKE_INSTALL_PREFIX=$HOME/local/nvim install
|
|
||||||
```
|
|
||||||
|
|
||||||
CMake, our main build system, caches a lot of things in `build/CMakeCache.txt`. If you ever want to change `CMAKE_BUILD_TYPE` or `CMAKE_INSTALL_PREFIX`, run `rm -rf build` first. This is also required when rebuilding after a Git commit adds or removes files (including from `runtime`) — when in doubt, run `make distclean` (which is basically a shortcut for `rm -rf build .deps`).
|
|
||||||
|
|
||||||
By default (`USE_BUNDLED=1`), Neovim downloads and statically links its needed dependencies. In order to be able to use a debugger on these libraries, you might want to compile them with debug information as well:
|
|
||||||
|
|
||||||
<!-- THIS CAUSES SCREEN INTERFERENCE
|
|
||||||
```
|
|
||||||
make distclean
|
|
||||||
VERBOSE=1 DEBUG=1 make deps
|
|
||||||
```
|
|
||||||
-->
|
|
||||||
```
|
|
||||||
make distclean
|
|
||||||
make deps
|
|
||||||
```
|
|
||||||
|
|
||||||
## Building on Windows
|
|
||||||
|
|
||||||
### Windows / MSVC
|
|
||||||
|
|
||||||
**MSVC (Visual Studio) is the recommended way to build on Windows.** These steps were confirmed as of 2023.
|
|
||||||
|
|
||||||
1. Install [Visual Studio](https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=Community) (2017 or later) with the _Desktop development with C++_ workload.
|
|
||||||
- On 32-bit Windows, you will need [this workaround](https://developercommunity.visualstudio.com/content/problem/212989/ninja-binary-format.html).
|
|
||||||
2. Open the Neovim project folder.
|
|
||||||
- Visual Studio should detect the cmake files and automatically start building...
|
|
||||||
3. Choose the `nvim.exe (bin\nvim.exe)` target and hit F5.
|
|
||||||
- If the build fails, it may be because Visual Studio started the build with `x64-{Debug,Release}` before you switched the configuration to `x86-Release`.
|
|
||||||
- Right-click _CMakeLists.txt → Delete Cache_.
|
|
||||||
- Right-click _CMakeLists.txt → Generate Cache_.
|
|
||||||
- If you see an "access violation" from `ntdll`, you can ignore it and continue.
|
|
||||||
4. If you set an error like `msgpackc.dll not found`, try the `nvim.exe (Install)` target. Then switch back to `nvim.exe (bin\nvim.exe)`.
|
|
||||||
|
|
||||||
### Windows / MSVC PowerShell
|
|
||||||
|
|
||||||
To build from the command line (i.e. invoke the `cmake` commands yourself),
|
|
||||||
|
|
||||||
1. Ensure you have the Visual Studio environment variables, using any of the following:
|
|
||||||
- Using the [Visual Studio Developer Command Prompt or Visual Studio Developer PowerShell](https://learn.microsoft.com/en-us/visualstudio/ide/reference/command-prompt-powershell?view=vs-2022)
|
|
||||||
- Invoking `Import-VisualStudioVars` in PowerShell from [this PowerShell module](https://github.com/Pscx/Pscx)
|
|
||||||
- Invoking `VsDevCmd.bat` in Command Prompt
|
|
||||||
```
|
|
||||||
VsDevCmd.bat -arch=x64
|
|
||||||
```
|
|
||||||
This is to make sure that `luarocks` finds the Visual Studio installation, and doesn't fall back to MinGW with errors like:
|
|
||||||
```
|
|
||||||
'mingw32-gcc' is not recognized as an internal or external command
|
|
||||||
```
|
|
||||||
2. From the "Developer PowerShell" or "Developer Command Prompt":
|
|
||||||
```
|
|
||||||
cmake -S cmake.deps -B .deps -G Ninja -D CMAKE_BUILD_TYPE=Release
|
|
||||||
cmake --build .deps --config Release
|
|
||||||
cmake -B build -G Ninja -D CMAKE_BUILD_TYPE=Release
|
|
||||||
cmake --build build --config Release
|
|
||||||
```
|
|
||||||
- Omit `--config Release` if you want a debug build.
|
|
||||||
- Omit `-G Ninja` to use the "Visual Studio" generator.
|
|
||||||
|
|
||||||
### Windows / CLion
|
|
||||||
|
|
||||||
1. Install [CLion](https://www.jetbrains.com/clion/).
|
|
||||||
2. Open the Neovim project in CLion.
|
|
||||||
3. Select _Build → Build All in 'Release'_.
|
|
||||||
|
|
||||||
### Windows / Cygwin
|
|
||||||
|
|
||||||
Install all dependencies the normal way, then build Neovim the normal way for a random CMake application (i.e. do not use the `Makefile` that automatically downloads and builds "bundled" dependencies).
|
|
||||||
|
|
||||||
The `cygport` repo contains Cygport files (e.g. `APKBUILD`, `PKGBUILD`) for all the dependencies not available in the Cygwin distribution, and describes any special commands or arguments needed to build. The Cygport definitions also try to describe the required dependencies for each one. Unless custom commands are provided, Cygport just calls `autogen`/`cmake`, `make`, `make install`, etc. in a clean and consistent way.
|
|
||||||
|
|
||||||
https://github.com/cascent/neovim-cygwin was built on Cygwin 2.9.0. Newer `libuv` should require slightly less patching. Some SSP stuff changed in Cygwin 2.10.0, so that might change things too when building Neovim.
|
|
||||||
|
|
||||||
|
|
||||||
### Windows / MSYS2 / MinGW
|
|
||||||
|
|
||||||
1. From the MSYS2 shell, install these packages:
|
|
||||||
```
|
|
||||||
pacman -S \
|
|
||||||
mingw-w64-x86_64-{gcc,cmake,make,ninja,diffutils}
|
|
||||||
```
|
|
||||||
2. From the Windows Command Prompt (`cmd.exe`), set up the `PATH` and build.
|
|
||||||
|
|
||||||
```cmd
|
|
||||||
set PATH=c:\msys64\mingw64\bin;c:\msys64\usr\bin;%PATH%
|
|
||||||
```
|
|
||||||
3. You have two options:
|
|
||||||
- Build using `cmake` and `Ninja` generator:
|
|
||||||
```cmd
|
|
||||||
cmake -S cmake.deps -B .deps -G Ninja -D CMAKE_BUILD_TYPE=RelWithDebInfo
|
|
||||||
cmake --build .deps
|
|
||||||
cmake -B build -G Ninja -D CMAKE_BUILD_TYPE=RelWithDebInfo
|
|
||||||
cmake --build build
|
|
||||||
```
|
|
||||||
If you cannot install neovim with `ninja install` due to permission restriction, you can install neovim in a directory you have write access to.
|
|
||||||
```cmd
|
|
||||||
cmake -S cmake.deps -B .deps -G Ninja -D CMAKE_BUILD_TYPE=RelWithDebInfo
|
|
||||||
cmake --build .deps
|
|
||||||
cmake -B build -G Ninja -D CMAKE_INSTALL_PREFIX=C:\nvim -D CMAKE_BUILD_TYPE=RelWithDebInfo
|
|
||||||
cmake --build build
|
|
||||||
```
|
|
||||||
- Or, alternatively, you can use `mingw32-make`:
|
|
||||||
```cmd
|
|
||||||
mingw32-make deps
|
|
||||||
mingw32-make CMAKE_BUILD_TYPE=RelWithDebInfo
|
|
||||||
:: Or you can do the previous command specifying a custom prefix
|
|
||||||
:: (Default is C:\Program Files (x86)\nvim)
|
|
||||||
:: mingw32-make CMAKE_BUILD_TYPE=RelWithDebInfo CMAKE_INSTALL_PREFIX=C:\nvim
|
|
||||||
mingw32-make install
|
|
||||||
```
|
|
||||||
|
|
||||||
## Localization
|
|
||||||
|
|
||||||
### Localization build
|
|
||||||
|
|
||||||
A normal build will create `.mo` files in `build/src/nvim/po`.
|
|
||||||
|
|
||||||
* If you see `msgfmt: command not found`, you need to install [`gettext`](http://en.wikipedia.org/wiki/Gettext). On most systems, the package is just called `gettext`.
|
|
||||||
|
|
||||||
### Localization check
|
|
||||||
|
|
||||||
To check the translations for `$LANG`, run `make -C build check-po-$LANG`. Examples:
|
|
||||||
|
|
||||||
```
|
|
||||||
cmake --build build --target check-po-de
|
|
||||||
cmake --build build --target check-po-pt_BR
|
|
||||||
```
|
|
||||||
|
|
||||||
- `check-po-$LANG` generates a detailed report in `./build/src/nvim/po/check-${LANG}.log`. (The report is generated by `nvim`, not by `msgfmt`.)
|
|
||||||
|
|
||||||
### Localization update
|
|
||||||
|
|
||||||
To update the `src/nvim/po/$LANG.po` file with the latest strings, run the following:
|
|
||||||
|
|
||||||
```
|
|
||||||
cmake --build build --target update-po-$LANG
|
|
||||||
```
|
|
||||||
|
|
||||||
- **Note**: Run `src/nvim/po/cleanup.vim` after updating.
|
|
||||||
|
|
||||||
## Compiler options
|
|
||||||
|
|
||||||
To see the chain of includes, use the `-H` option ([#918](https://github.com/neovim/neovim/issues/918)):
|
|
||||||
|
|
||||||
```sh
|
|
||||||
echo '#include "./src/nvim/buffer.h"' | \
|
|
||||||
> clang -I.deps/usr/include -Isrc -std=c99 -P -E -H - 2>&1 >/dev/null | \
|
|
||||||
> grep -v /usr/
|
|
||||||
```
|
|
||||||
|
|
||||||
- `grep -v /usr/` is used to filter out system header files.
|
|
||||||
- `-save-temps` can be added as well to see expanded macros or commented assembly.
|
|
||||||
|
|
||||||
## Custom Makefile
|
|
||||||
|
|
||||||
You can customize the build process locally by creating a `local.mk`, which is referenced at the top of the main `Makefile`. It's listed in `.gitignore`, so it can be used across branches. **A new target in `local.mk` overrides the default make-target.**
|
|
||||||
|
|
||||||
Here's a sample `local.mk` which adds a target to force a rebuild but *does not* override the default-target:
|
|
||||||
|
|
||||||
```make
|
|
||||||
all:
|
|
||||||
|
|
||||||
rebuild:
|
|
||||||
rm -rf build
|
|
||||||
make
|
|
||||||
```
|
|
||||||
|
|
||||||
## Third-party dependencies
|
|
||||||
|
|
||||||
Reference the [Debian package](https://packages.debian.org/sid/source/neovim) (or alternatively, the [Homebrew formula](https://github.com/Homebrew/homebrew-core/blob/master/Formula/neovim.rb)) for the precise list of dependencies/versions.
|
|
||||||
|
|
||||||
To build the bundled dependencies using CMake:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
cmake -S cmake.deps -B .deps -G Ninja -D CMAKE_BUILD_TYPE=RelWithDebInfo
|
|
||||||
cmake --build .deps
|
|
||||||
```
|
|
||||||
|
|
||||||
By default the libraries and headers are placed in `.deps/usr`. Now you can build Neovim:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
cmake -B build -G Ninja -D CMAKE_BUILD_TYPE=RelWithDebInfo
|
|
||||||
cmake --build build
|
|
||||||
```
|
|
||||||
|
|
||||||
### How to build without "bundled" dependencies
|
|
||||||
|
|
||||||
1. Manually install the dependencies:
|
|
||||||
- libuv libluv libvterm luajit lua-lpeg lua-mpack msgpack-c tree-sitter tree-sitter-c tree-sitter-lua tree-sitter-markdown tree-sitter-query tree-sitter-vim tree-sitter-vimdoc unibilium
|
|
||||||
2. Run CMake:
|
|
||||||
```sh
|
|
||||||
cmake -B build -G Ninja -D CMAKE_BUILD_TYPE=RelWithDebInfo
|
|
||||||
cmake --build build
|
|
||||||
```
|
|
||||||
If all the dependencies are not available in the package, you can use only some of the bundled dependencies as follows (example of using `ninja`):
|
|
||||||
```sh
|
|
||||||
cmake -S cmake.deps -B .deps -G Ninja -D CMAKE_BUILD_TYPE=RelWithDebInfo -DUSE_BUNDLED=OFF -DUSE_BUNDLED_LIBVTERM=ON -DUSE_BUNDLED_TS=ON
|
|
||||||
cmake --build .deps
|
|
||||||
cmake -B build -G Ninja -D CMAKE_BUILD_TYPE=RelWithDebInfo
|
|
||||||
cmake --build build
|
|
||||||
```
|
|
||||||
3. Run `make`, `ninja`, or whatever build tool you told CMake to generate.
|
|
||||||
- Using `ninja` is strongly recommended.
|
|
||||||
4. If treesitter parsers are not bundled, they need to be available in a `parser/` runtime directory (e.g. `/usr/share/nvim/runtime/parser/`).
|
|
||||||
|
|
||||||
#### Debian 10 (Buster) example:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
sudo apt install luajit libluajit-5.1-dev lua-mpack lua-lpeg libunibilium-dev libmsgpack-dev
|
|
||||||
cmake -S cmake.deps -B .deps -G Ninja -D CMAKE_BUILD_TYPE=RelWithDebInfo -DUSE_BUNDLED=OFF -DUSE_BUNDLED_LIBUV=ON -DUSE_BUNDLED_LUV=ON -DUSE_BUNDLED_LIBVTERM=ON -DUSE_BUNDLED_TS=ON
|
|
||||||
cmake --build .deps
|
|
||||||
cmake -B build -G Ninja -D CMAKE_BUILD_TYPE=RelWithDebInfo
|
|
||||||
cmake --build build
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Example of using a Makefile
|
|
||||||
|
|
||||||
- Example of using a package with all dependencies:
|
|
||||||
```
|
|
||||||
make USE_BUNDLED=OFF
|
|
||||||
```
|
|
||||||
- Example of using a package with some dependencies:
|
|
||||||
```
|
|
||||||
make BUNDLED_CMAKE_FLAG="-DUSE_BUNDLED=OFF -DUSE_BUNDLED_LUV=ON -DUSE_BUNDLED_TS=ON -DUSE_BUNDLED_LIBVTERM=ON -DUSE_BUNDLED_LIBUV=ON"
|
|
||||||
```
|
|
||||||
|
|
||||||
## Build prerequisites
|
|
||||||
|
|
||||||
General requirements (see [#1469](https://github.com/neovim/neovim/issues/1469#issuecomment-63058312)):
|
|
||||||
|
|
||||||
- Clang or GCC version 4.9+
|
|
||||||
- CMake version 3.13+, built with TLS/SSL support
|
|
||||||
- Optional: Get the latest CMake from an [installer](https://github.com/Kitware/CMake/releases) or the [Python package](https://pypi.org/project/cmake/) (`pip install cmake`)
|
|
||||||
|
|
||||||
Platform-specific requirements are listed below.
|
|
||||||
|
|
||||||
### Ubuntu / Debian
|
|
||||||
|
|
||||||
```sh
|
|
||||||
sudo apt-get install ninja-build gettext cmake unzip curl build-essential
|
|
||||||
```
|
|
||||||
|
|
||||||
### RHEL / Fedora
|
|
||||||
|
|
||||||
```
|
|
||||||
sudo dnf -y install ninja-build cmake gcc make unzip gettext curl glibc-gconv-extra
|
|
||||||
```
|
|
||||||
|
|
||||||
### openSUSE
|
|
||||||
|
|
||||||
```
|
|
||||||
sudo zypper install ninja cmake gcc-c++ gettext-tools curl
|
|
||||||
```
|
|
||||||
|
|
||||||
### Arch Linux
|
|
||||||
|
|
||||||
```
|
|
||||||
sudo pacman -S base-devel cmake unzip ninja curl
|
|
||||||
```
|
|
||||||
|
|
||||||
### Alpine Linux
|
|
||||||
|
|
||||||
```
|
|
||||||
apk add build-base cmake coreutils curl unzip gettext-tiny-dev
|
|
||||||
```
|
|
||||||
|
|
||||||
### Void Linux
|
|
||||||
|
|
||||||
```
|
|
||||||
xbps-install base-devel cmake curl git
|
|
||||||
```
|
|
||||||
|
|
||||||
### NixOS / Nix
|
|
||||||
|
|
||||||
Starting from NixOS 18.03, the Neovim binary resides in the `neovim-unwrapped` Nix package (the `neovim` package being just a wrapper to setup runtime options like Ruby/Python support):
|
|
||||||
|
|
||||||
```sh
|
|
||||||
cd path/to/neovim/src
|
|
||||||
```
|
|
||||||
|
|
||||||
Drop into `nix-shell` to pull in the Neovim dependencies:
|
|
||||||
|
|
||||||
```
|
|
||||||
nix-shell '<nixpkgs>' -A neovim-unwrapped
|
|
||||||
```
|
|
||||||
|
|
||||||
Configure and build:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
rm -rf build && cmakeConfigurePhase
|
|
||||||
buildPhase
|
|
||||||
```
|
|
||||||
|
|
||||||
Tests are not available by default, because of some unfixed failures. You can enable them via adding this package in your overlay:
|
|
||||||
```
|
|
||||||
neovim-dev = (super.pkgs.neovim-unwrapped.override {
|
|
||||||
doCheck=true;
|
|
||||||
}).overrideAttrs(oa:{
|
|
||||||
cmakeBuildType="debug";
|
|
||||||
|
|
||||||
nativeBuildInputs = oa.nativeBuildInputs ++ [ self.pkgs.valgrind ];
|
|
||||||
shellHook = ''
|
|
||||||
export NVIM_PYTHON_LOG_LEVEL=DEBUG
|
|
||||||
export NVIM_LOG_FILE=/tmp/log
|
|
||||||
export VALGRIND_LOG="$PWD/valgrind.log"
|
|
||||||
'';
|
|
||||||
});
|
|
||||||
```
|
|
||||||
and replacing `neovim-unwrapped` with `neovim-dev`:
|
|
||||||
```
|
|
||||||
nix-shell '<nixpkgs>' -A neovim-dev
|
|
||||||
```
|
|
||||||
|
|
||||||
Neovim contains a Nix flake in the `contrib` folder, with 3 packages:
|
|
||||||
- `neovim` to run the nightly
|
|
||||||
- `neovim-debug` to run the package with debug symbols
|
|
||||||
- `neovim-developer` to get all the tools to develop on `neovim`
|
|
||||||
|
|
||||||
Thus you can run Neovim nightly with `nix run github:neovim/neovim?dir=contrib`.
|
|
||||||
Similarly to develop on Neovim: `nix develop github:neovim/neovim?dir=contrib#neovim-developer`.
|
|
||||||
|
|
||||||
### FreeBSD
|
|
||||||
|
|
||||||
```
|
|
||||||
sudo pkg install cmake gmake sha unzip wget gettext curl
|
|
||||||
```
|
|
||||||
|
|
||||||
If you get an error regarding a `sha256sum` mismatch, where the actual SHA-256 hash is `e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855`, then this is your issue (that's the `sha256sum` of an empty file).
|
|
||||||
|
|
||||||
### OpenBSD
|
|
||||||
|
|
||||||
```sh
|
|
||||||
doas pkg_add gmake cmake unzip curl gettext-tools
|
|
||||||
```
|
|
||||||
|
|
||||||
Build can sometimes fail when using the top level `Makefile`, apparently due to some third-party component (see [#2445-comment](https://github.com/neovim/neovim/issues/2445#issuecomment-108124236)). The following instructions use CMake:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
mkdir .deps
|
|
||||||
cd .deps
|
|
||||||
cmake ../cmake.deps/
|
|
||||||
gmake
|
|
||||||
cd ..
|
|
||||||
mkdir build
|
|
||||||
cd build
|
|
||||||
cmake ..
|
|
||||||
gmake
|
|
||||||
```
|
|
||||||
|
|
||||||
### macOS
|
|
||||||
|
|
||||||
#### macOS / Homebrew
|
|
||||||
|
|
||||||
1. Install Xcode Command Line Tools: `xcode-select --install`
|
|
||||||
2. Install [Homebrew](http://brew.sh)
|
|
||||||
3. Install Neovim build dependencies:
|
|
||||||
```
|
|
||||||
brew install ninja cmake gettext curl
|
|
||||||
```
|
|
||||||
- **Note**: If you see Wget certificate errors (for older macOS versions less than 10.10):
|
|
||||||
```sh
|
|
||||||
brew install curl-ca-bundle
|
|
||||||
echo CA_CERTIFICATE=$(brew --prefix curl-ca-bundle)/share/ca-bundle.crt >> ~/.wgetrc
|
|
||||||
```
|
|
||||||
- **Note**: If you see `'stdio.h' file not found`, try the following:
|
|
||||||
```
|
|
||||||
open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
|
|
||||||
```
|
|
||||||
|
|
||||||
#### macOS / MacPorts
|
|
||||||
|
|
||||||
1. Install Xcode Command Line Tools: `xcode-select --install`
|
|
||||||
2. Install [MacPorts](http://www.macports.org)
|
|
||||||
3. Install Neovim build dependencies:
|
|
||||||
```
|
|
||||||
sudo port install ninja cmake gettext
|
|
||||||
```
|
|
||||||
- **Note**: If you see Wget certificate errors (for older macOS versions less than 10.10):
|
|
||||||
```sh
|
|
||||||
sudo port install curl-ca-bundle
|
|
||||||
echo CA_CERTIFICATE=/opt/local/share/curl/curl-ca-bundle.crt >> ~/.wgetrc
|
|
||||||
```
|
|
||||||
- **Note**: If you see `'stdio.h' file not found`, try the following:
|
|
||||||
```
|
|
||||||
open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Building for older macOS versions
|
|
||||||
|
|
||||||
From a newer macOS version, to build for older macOS versions, you will have to set the macOS deployment target:
|
|
||||||
|
|
||||||
```
|
|
||||||
make CMAKE_BUILD_TYPE=Release MACOSX_DEPLOYMENT_TARGET=10.13 DEPS_CMAKE_FLAGS="-DCMAKE_CXX_COMPILER=$(xcrun -find c++)"
|
|
||||||
```
|
|
||||||
|
|
||||||
Note that the C++ compiler is explicitly set so that it can be found when the deployment target is set.
|
|
||||||
|
|
774
CMakeLists.txt
774
CMakeLists.txt
@@ -1,77 +1,46 @@
|
|||||||
# 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/
|
# pitfalls: https://izzys.casa/2019/02/everything-you-never-wanted-to-know-about-cmake/
|
||||||
# - troubleshooting:
|
|
||||||
# - variable_watch https://cmake.org/cmake/help/latest/command/variable_watch.html
|
|
||||||
|
|
||||||
# Version should match the tested CMAKE_URL in .github/workflows/build.yml.
|
|
||||||
cmake_minimum_required(VERSION 3.13)
|
|
||||||
|
|
||||||
# Can be removed once minimum version is at least 3.15
|
|
||||||
if(POLICY CMP0092)
|
|
||||||
cmake_policy(SET CMP0092 NEW)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
|
# Version should match the tested CMAKE_URL in .github/workflows/ci.yml.
|
||||||
|
cmake_minimum_required(VERSION 3.10)
|
||||||
project(nvim C)
|
project(nvim C)
|
||||||
|
|
||||||
if(POLICY CMP0135)
|
if(POLICY CMP0075)
|
||||||
cmake_policy(SET CMP0135 NEW)
|
cmake_policy(SET CMP0075 NEW)
|
||||||
endif()
|
|
||||||
|
|
||||||
if(XCODE)
|
|
||||||
message(FATAL_ERROR [[Xcode generator is not supported. Use "Ninja" or "Unix Makefiles" instead]])
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Point CMake at any custom modules we may ship
|
# Point CMake at any custom modules we may ship
|
||||||
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
|
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
|
||||||
|
|
||||||
include(CheckCCompilerFlag)
|
# We don't support building in-tree.
|
||||||
include(CheckCSourceCompiles)
|
|
||||||
include(CheckLibraryExists)
|
|
||||||
include(ExternalProject)
|
|
||||||
include(FindPackageHandleStandardArgs)
|
|
||||||
include(GNUInstallDirs)
|
|
||||||
|
|
||||||
include(Deps)
|
|
||||||
include(Find)
|
|
||||||
include(InstallHelpers)
|
|
||||||
include(PreventInTreeBuilds)
|
include(PreventInTreeBuilds)
|
||||||
include(Util)
|
include(Util)
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
|
||||||
# User settings
|
|
||||||
#-------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
set(DEPS_IGNORE_SHA FALSE)
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
|
||||||
# Variables
|
|
||||||
#-------------------------------------------------------------------------------
|
|
||||||
set(FUNCS_DATA ${PROJECT_BINARY_DIR}/funcs_data.mpack)
|
|
||||||
set(TOUCHES_DIR ${PROJECT_BINARY_DIR}/touches)
|
set(TOUCHES_DIR ${PROJECT_BINARY_DIR}/touches)
|
||||||
|
|
||||||
file(GLOB DOCFILES CONFIGURE_DEPENDS ${PROJECT_SOURCE_DIR}/runtime/doc/*.txt)
|
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||||
|
|
||||||
if(NOT CI_BUILD)
|
|
||||||
set(CMAKE_INSTALL_MESSAGE NEVER)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(${CMAKE_VERSION} VERSION_LESS 3.20)
|
|
||||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL 3.26)
|
|
||||||
set(COPY_DIRECTORY copy_directory_if_different)
|
|
||||||
else()
|
|
||||||
set(COPY_DIRECTORY copy_directory)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Prefer our bundled versions of dependencies.
|
# Prefer our bundled versions of dependencies.
|
||||||
if(DEFINED ENV{DEPS_BUILD_DIR})
|
if(DEFINED ENV{DEPS_BUILD_DIR})
|
||||||
|
if(CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
|
||||||
|
# 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
|
||||||
|
# "/usr/include" as "/_usr/include".
|
||||||
|
# This check is also performed in the cmake.deps/CMakeLists.txt and in the
|
||||||
|
# else clause following here.
|
||||||
|
# https://github.com/neovim/neovim/pull/14745#issuecomment-860201794
|
||||||
|
set(DEPS_PREFIX "$ENV{DEPS_BUILD_DIR}/_usr" CACHE PATH "Path prefix for finding dependencies")
|
||||||
|
else()
|
||||||
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")
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
if(CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
|
||||||
|
set(DEPS_PREFIX "${CMAKE_CURRENT_SOURCE_DIR}/.deps/_usr" CACHE PATH "Path prefix for finding dependencies")
|
||||||
else()
|
else()
|
||||||
set(DEPS_PREFIX "${CMAKE_CURRENT_SOURCE_DIR}/.deps/usr" CACHE PATH "Path prefix for finding dependencies")
|
set(DEPS_PREFIX "${CMAKE_CURRENT_SOURCE_DIR}/.deps/usr" CACHE PATH "Path prefix for finding dependencies")
|
||||||
|
endif()
|
||||||
# When running from within CLion or Visual Studio,
|
# When running from within CLion or Visual Studio,
|
||||||
# build bundled dependencies automatically.
|
# build bundled dependencies automatically.
|
||||||
if(NOT EXISTS ${DEPS_PREFIX}
|
if(NOT EXISTS ${DEPS_PREFIX}
|
||||||
@@ -101,8 +70,20 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
list(INSERT CMAKE_PREFIX_PATH 0 ${DEPS_PREFIX})
|
list(INSERT CMAKE_PREFIX_PATH 0 ${DEPS_PREFIX})
|
||||||
|
set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:${DEPS_PREFIX}/lib/pkgconfig")
|
||||||
|
|
||||||
|
# used for check_c_compiler_flag
|
||||||
|
include(CheckCCompilerFlag)
|
||||||
|
|
||||||
|
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
||||||
|
# CMake tries to treat /sw and /opt/local as extension of the system path, but
|
||||||
|
# that doesn't really work out very well. Once you have a dependency that
|
||||||
|
# resides there and have to add it as an include directory, then any other
|
||||||
|
# dependency that could be satisfied from there must be--otherwise you can end
|
||||||
|
# up with conflicting versions. So, let's make them more of a priority having
|
||||||
|
# them be included as one of the first places to look for dependencies.
|
||||||
|
list(APPEND CMAKE_PREFIX_PATH /sw /opt/local)
|
||||||
|
|
||||||
if(APPLE)
|
|
||||||
# If the macOS deployment target is not set manually (via $MACOSX_DEPLOYMENT_TARGET),
|
# 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.
|
# fall back to local system version. Needs to be done both here and in cmake.deps.
|
||||||
if(NOT CMAKE_OSX_DEPLOYMENT_TARGET)
|
if(NOT CMAKE_OSX_DEPLOYMENT_TARGET)
|
||||||
@@ -111,16 +92,25 @@ if(APPLE)
|
|||||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
set(CMAKE_OSX_DEPLOYMENT_TARGET "${MACOS_VERSION}")
|
set(CMAKE_OSX_DEPLOYMENT_TARGET "${MACOS_VERSION}")
|
||||||
endif()
|
endif()
|
||||||
message(STATUS "Using deployment target ${CMAKE_OSX_DEPLOYMENT_TARGET}")
|
message("Using deployment target ${CMAKE_OSX_DEPLOYMENT_TARGET}")
|
||||||
|
|
||||||
|
# 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
|
||||||
|
# now.
|
||||||
|
if(CMAKE_C_COMPILER_ID MATCHES "GNU")
|
||||||
|
set(CMAKE_INCLUDE_SYSTEM_FLAG_C "-isystem ")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WIN32 OR APPLE)
|
if(WIN32 OR CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
||||||
# Ignore case when comparing filenames on Windows and Mac.
|
# Ignore case when comparing filenames on Windows and Mac.
|
||||||
set(CASE_INSENSITIVE_FILENAME TRUE)
|
set(CASE_INSENSITIVE_FILENAME TRUE)
|
||||||
# Enable fixing case-insensitive filenames for Windows and Mac.
|
# Enable fixing case-insensitive filenames for Windows and Mac.
|
||||||
set(USE_FNAME_CASE TRUE)
|
set(USE_FNAME_CASE TRUE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
option(ENABLE_LIBINTL "enable libintl" ON)
|
||||||
|
option(ENABLE_LIBICONV "enable libiconv" ON)
|
||||||
if (MINGW)
|
if (MINGW)
|
||||||
# Disable LTO by default as it may not compile
|
# Disable LTO by default as it may not compile
|
||||||
# See https://github.com/Alexpux/MINGW-packages/issues/3516
|
# See https://github.com/Alexpux/MINGW-packages/issues/3516
|
||||||
@@ -129,53 +119,424 @@ if (MINGW)
|
|||||||
else()
|
else()
|
||||||
option(ENABLE_LTO "enable link time optimization" ON)
|
option(ENABLE_LTO "enable link time optimization" ON)
|
||||||
endif()
|
endif()
|
||||||
option(ENABLE_LIBINTL "enable libintl" ON)
|
|
||||||
|
|
||||||
message(STATUS "CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}")
|
message(STATUS "CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}")
|
||||||
|
|
||||||
set_default_buildtype(Debug)
|
set_default_buildtype()
|
||||||
get_property(isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
if(CMAKE_BUILD_TYPE MATCHES Debug)
|
||||||
if(NOT isMultiConfig)
|
set(DEBUG 1)
|
||||||
# Unlike build dependencies in cmake.deps, we assume we want dev dependencies
|
else()
|
||||||
# such as Uncrustify to always be built with Release.
|
set(DEBUG 0)
|
||||||
list(APPEND DEPS_CMAKE_ARGS -D CMAKE_BUILD_TYPE=Release)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# 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 10)
|
set(NVIM_VERSION_MINOR 8)
|
||||||
set(NVIM_VERSION_PATCH 5)
|
set(NVIM_VERSION_PATCH 2)
|
||||||
set(NVIM_VERSION_PRERELEASE "-dev") # for package maintainers
|
set(NVIM_VERSION_PRERELEASE "") # for package maintainers
|
||||||
|
|
||||||
# API level
|
# API level
|
||||||
set(NVIM_API_LEVEL 12) # Bump this after any API change.
|
set(NVIM_API_LEVEL 10) # 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)
|
||||||
|
|
||||||
|
set(NVIM_VERSION_BUILD_TYPE "${CMAKE_BUILD_TYPE}")
|
||||||
|
# NVIM_VERSION_CFLAGS set further below.
|
||||||
|
|
||||||
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||||
|
|
||||||
|
# Log level (MIN_LOG_LEVEL in log.h)
|
||||||
|
if("${MIN_LOG_LEVEL}" MATCHES "^$")
|
||||||
|
# Minimize logging for release-type builds.
|
||||||
|
if(CMAKE_BUILD_TYPE STREQUAL "Release"
|
||||||
|
OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"
|
||||||
|
OR CMAKE_BUILD_TYPE STREQUAL "MinSizeRel")
|
||||||
|
message(STATUS "MIN_LOG_LEVEL not specified, default is 3 (ERROR) for release builds")
|
||||||
|
set(MIN_LOG_LEVEL 3)
|
||||||
|
else()
|
||||||
|
message(STATUS "MIN_LOG_LEVEL not specified, default is 1 (INFO)")
|
||||||
|
set(MIN_LOG_LEVEL 1)
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
if(NOT MIN_LOG_LEVEL MATCHES "^[0-3]$")
|
||||||
|
message(FATAL_ERROR "invalid MIN_LOG_LEVEL: " ${MIN_LOG_LEVEL})
|
||||||
|
endif()
|
||||||
|
message(STATUS "MIN_LOG_LEVEL=${MIN_LOG_LEVEL}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Default to -O2 on release builds.
|
||||||
|
if(CMAKE_C_FLAGS_RELEASE MATCHES "-O3")
|
||||||
|
message(STATUS "Replacing -O3 in CMAKE_C_FLAGS_RELEASE with -O2")
|
||||||
|
string(REPLACE "-O3" "-O2" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(CMAKE_C_COMPILER_ID MATCHES "GNU")
|
||||||
|
check_c_compiler_flag(-Og HAS_OG_FLAG)
|
||||||
|
else()
|
||||||
|
set(HAS_OG_FLAG 0)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
#
|
||||||
# Build-type: RelWithDebInfo
|
# Build-type: RelWithDebInfo
|
||||||
# /Og means something different in MSVC
|
#
|
||||||
if(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
|
if(HAS_OG_FLAG)
|
||||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -Og -g")
|
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -Og -g")
|
||||||
endif()
|
endif()
|
||||||
# We _want_ assertions in RelWithDebInfo build-type.
|
# We _want_ assertions in RelWithDebInfo build-type.
|
||||||
if(CMAKE_C_FLAGS_RELWITHDEBINFO MATCHES DNDEBUG)
|
if(CMAKE_C_FLAGS_RELWITHDEBINFO MATCHES DNDEBUG)
|
||||||
string(REPLACE "-DNDEBUG" "" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}")
|
string(REPLACE "-DNDEBUG" "" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}")
|
||||||
string(REPLACE "/DNDEBUG" "" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}")
|
|
||||||
string(REPLACE " " " " CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}") # Remove duplicate whitespace
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
option(ENABLE_ASAN_UBSAN "Enable Clang address & undefined behavior sanitizer for nvim binary." OFF)
|
# gcc 4.0+ sets _FORTIFY_SOURCE=2 automatically. This currently
|
||||||
option(ENABLE_MSAN "Enable Clang memory sanitizer for nvim binary." OFF)
|
# does not work with Neovim due to some uses of dynamically-sized structures.
|
||||||
# TSAN exists to test Luv threads.
|
# https://github.com/neovim/neovim/issues/223
|
||||||
option(ENABLE_TSAN "Enable Clang thread sanitizer for nvim binary." OFF)
|
include(CheckCSourceCompiles)
|
||||||
|
|
||||||
if((ENABLE_ASAN_UBSAN AND ENABLE_MSAN)
|
# Include the build type's default flags in the check for _FORTIFY_SOURCE,
|
||||||
OR (ENABLE_ASAN_UBSAN AND ENABLE_TSAN)
|
# otherwise we may incorrectly identify the level as acceptable and find out
|
||||||
OR (ENABLE_MSAN AND ENABLE_TSAN))
|
# later that it was not when optimizations were enabled. CFLAGS is applied
|
||||||
|
# even though you don't see it in CMAKE_REQUIRED_FLAGS.
|
||||||
|
set(INIT_FLAGS_NAME CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE})
|
||||||
|
string(TOUPPER ${INIT_FLAGS_NAME} INIT_FLAGS_NAME)
|
||||||
|
if(${INIT_FLAGS_NAME})
|
||||||
|
set(CMAKE_REQUIRED_FLAGS "${${INIT_FLAGS_NAME}}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Include <string.h> because some toolchains define _FORTIFY_SOURCE=2 in
|
||||||
|
# internal header files, which should in turn be #included by <string.h>.
|
||||||
|
check_c_source_compiles("
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 1
|
||||||
|
#error \"_FORTIFY_SOURCE > 1\"
|
||||||
|
#endif
|
||||||
|
int
|
||||||
|
main(void)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
" HAS_ACCEPTABLE_FORTIFY)
|
||||||
|
|
||||||
|
if(NOT HAS_ACCEPTABLE_FORTIFY)
|
||||||
|
message(STATUS "Unsupported _FORTIFY_SOURCE found, forcing _FORTIFY_SOURCE=1")
|
||||||
|
# Extract possible prefix to _FORTIFY_SOURCE (e.g. -Wp,-D_FORTIFY_SOURCE).
|
||||||
|
STRING(REGEX MATCH "[^\ ]+-D_FORTIFY_SOURCE" _FORTIFY_SOURCE_PREFIX "${CMAKE_C_FLAGS}")
|
||||||
|
STRING(REPLACE "-D_FORTIFY_SOURCE" "" _FORTIFY_SOURCE_PREFIX "${_FORTIFY_SOURCE_PREFIX}" )
|
||||||
|
if(NOT _FORTIFY_SOURCE_PREFIX STREQUAL "")
|
||||||
|
message(STATUS "Detected _FORTIFY_SOURCE Prefix=${_FORTIFY_SOURCE_PREFIX}")
|
||||||
|
endif()
|
||||||
|
# -U in add_definitions doesn't end up in the correct spot, so we add it to
|
||||||
|
# the flags variable instead.
|
||||||
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_FORTIFY_SOURCE_PREFIX}-U_FORTIFY_SOURCE ${_FORTIFY_SOURCE_PREFIX}-D_FORTIFY_SOURCE=1")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Remove --sort-common from linker flags, as this seems to cause bugs (see #2641, #3374).
|
||||||
|
# TODO: Figure out the root cause.
|
||||||
|
if(CMAKE_EXE_LINKER_FLAGS MATCHES "--sort-common" OR
|
||||||
|
CMAKE_SHARED_LINKER_FLAGS MATCHES "--sort-common" OR
|
||||||
|
CMAKE_MODULE_LINKER_FLAGS MATCHES "--sort-common")
|
||||||
|
message(STATUS "Removing --sort-common from linker flags")
|
||||||
|
string(REGEX REPLACE ",--sort-common(=[^,]+)?" "" CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}")
|
||||||
|
string(REGEX REPLACE ",--sort-common(=[^,]+)?" "" CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
|
||||||
|
string(REGEX REPLACE ",--sort-common(=[^,]+)?" "" CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS}")
|
||||||
|
|
||||||
|
# If no linker flags remain for a -Wl argument, remove it.
|
||||||
|
# '-Wl$' will match LDFLAGS="-Wl,--sort-common",
|
||||||
|
# '-Wl ' will match LDFLAGS="-Wl,--sort-common -Wl,..."
|
||||||
|
string(REGEX REPLACE "-Wl($| )" "" CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}")
|
||||||
|
string(REGEX REPLACE "-Wl($| )" "" CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
|
||||||
|
string(REGEX REPLACE "-Wl($| )" "" CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
check_c_source_compiles("
|
||||||
|
#include <execinfo.h>
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
void *trace[1];
|
||||||
|
backtrace(trace, 1);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
" HAVE_EXECINFO_BACKTRACE)
|
||||||
|
|
||||||
|
check_c_source_compiles("
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
int a = 42;
|
||||||
|
__builtin_add_overflow(a, a, &a);
|
||||||
|
__builtin_sub_overflow(a, a, &a);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
" HAVE_BUILTIN_ADD_OVERFLOW)
|
||||||
|
|
||||||
|
option(ENABLE_COMPILER_SUGGESTIONS "Enable -Wsuggest compiler warnings" OFF)
|
||||||
|
if(MSVC)
|
||||||
|
# XXX: /W4 gives too many warnings. #3241
|
||||||
|
add_compile_options(/W3)
|
||||||
|
add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE)
|
||||||
|
add_definitions(-DMSWIN)
|
||||||
|
else()
|
||||||
|
add_compile_options(-Wall -Wextra -pedantic -Wno-unused-parameter
|
||||||
|
-Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion
|
||||||
|
-Wdouble-promotion
|
||||||
|
-Wmissing-noreturn
|
||||||
|
-Wmissing-format-attribute
|
||||||
|
-Wmissing-prototypes)
|
||||||
|
|
||||||
|
check_c_compiler_flag(-Wimplicit-fallthrough HAVE_WIMPLICIT_FALLTHROUGH_FLAG)
|
||||||
|
if(HAVE_WIMPLICIT_FALLTHROUGH_FLAG)
|
||||||
|
add_compile_options(-Wimplicit-fallthrough)
|
||||||
|
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
|
||||||
|
# 3.4.1 used there.
|
||||||
|
if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" AND CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||||
|
add_compile_options(-Wno-c11-extensions)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(MINGW)
|
||||||
|
# Use POSIX compatible stdio in Mingw
|
||||||
|
add_definitions(-D__USE_MINGW_ANSI_STDIO)
|
||||||
|
add_definitions(-DMSWIN)
|
||||||
|
endif()
|
||||||
|
if(WIN32)
|
||||||
|
# Windows Vista is the minimum supported version
|
||||||
|
add_definitions(-D_WIN32_WINNT=0x0600)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# OpenBSD's GCC (4.2.1) doesn't have -Wvla
|
||||||
|
check_c_compiler_flag(-Wvla HAS_WVLA_FLAG)
|
||||||
|
if(HAS_WVLA_FLAG)
|
||||||
|
add_compile_options(-Wvla)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(UNIX)
|
||||||
|
# -fstack-protector breaks non Unix builds even in Mingw-w64
|
||||||
|
check_c_compiler_flag(-fstack-protector-strong HAS_FSTACK_PROTECTOR_STRONG_FLAG)
|
||||||
|
check_c_compiler_flag(-fstack-protector HAS_FSTACK_PROTECTOR_FLAG)
|
||||||
|
|
||||||
|
if(HAS_FSTACK_PROTECTOR_STRONG_FLAG)
|
||||||
|
add_compile_options(-fstack-protector-strong)
|
||||||
|
link_libraries(-fstack-protector-strong)
|
||||||
|
elseif(HAS_FSTACK_PROTECTOR_FLAG)
|
||||||
|
add_compile_options(-fstack-protector --param ssp-buffer-size=4)
|
||||||
|
link_libraries(-fstack-protector --param ssp-buffer-size=4)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
check_c_compiler_flag(-fno-common HAVE_FNO_COMMON)
|
||||||
|
if (HAVE_FNO_COMMON)
|
||||||
|
add_compile_options(-fno-common)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
check_c_compiler_flag(-fdiagnostics-color=auto HAS_DIAG_COLOR_FLAG)
|
||||||
|
if(HAS_DIAG_COLOR_FLAG)
|
||||||
|
if(CMAKE_GENERATOR MATCHES "Ninja")
|
||||||
|
add_compile_options(-fdiagnostics-color=always)
|
||||||
|
else()
|
||||||
|
add_compile_options(-fdiagnostics-color=auto)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
option(CI_BUILD "CI, extra flags will be set" OFF)
|
||||||
|
|
||||||
|
if(CI_BUILD)
|
||||||
|
message(STATUS "CI build enabled")
|
||||||
|
add_compile_options(-Werror)
|
||||||
|
if(DEFINED ENV{BUILD_UCHAR})
|
||||||
|
# Get some test coverage for unsigned char
|
||||||
|
add_compile_options(-funsigned-char)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
option(LOG_LIST_ACTIONS "Add list actions logging" OFF)
|
||||||
|
|
||||||
|
add_definitions(-DINCLUDE_GENERATED_DECLARATIONS)
|
||||||
|
|
||||||
|
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
||||||
|
if(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
|
||||||
|
set(NO_UNDEFINED "-Wl,--no-undefined -lsocket")
|
||||||
|
elseif(NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
||||||
|
set(NO_UNDEFINED "-Wl,--no-undefined")
|
||||||
|
endif()
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${NO_UNDEFINED}")
|
||||||
|
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${NO_UNDEFINED}")
|
||||||
|
|
||||||
|
# For O_CLOEXEC, O_DIRECTORY, and O_NOFOLLOW flags on older systems
|
||||||
|
# (pre POSIX.1-2008: glibc 2.11 and earlier). #4042
|
||||||
|
# For ptsname(). #6743
|
||||||
|
add_definitions(-D_GNU_SOURCE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT PREFER_LUA AND LUAJIT_VERSION LESS "2.1.0-beta3")
|
||||||
|
# Required for luajit < 2.1.0-beta3.
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS
|
||||||
|
"${CMAKE_EXE_LINKER_FLAGS} -pagezero_size 10000 -image_base 100000000")
|
||||||
|
set(CMAKE_SHARED_LINKER_FLAGS
|
||||||
|
"${CMAKE_SHARED_LINKER_FLAGS} -image_base 100000000")
|
||||||
|
set(CMAKE_MODULE_LINKER_FLAGS
|
||||||
|
"${CMAKE_MODULE_LINKER_FLAGS} -image_base 100000000")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
include_directories("${PROJECT_BINARY_DIR}/cmake.config")
|
||||||
|
include_directories("${PROJECT_SOURCE_DIR}/src")
|
||||||
|
|
||||||
|
find_package(LibUV 1.28.0 REQUIRED)
|
||||||
|
include_directories(SYSTEM ${LIBUV_INCLUDE_DIRS})
|
||||||
|
|
||||||
|
find_package(Msgpack 1.0.0 REQUIRED)
|
||||||
|
include_directories(SYSTEM ${MSGPACK_INCLUDE_DIRS})
|
||||||
|
|
||||||
|
find_package(LibLUV 1.43.0 REQUIRED)
|
||||||
|
include_directories(SYSTEM ${LIBLUV_INCLUDE_DIRS})
|
||||||
|
|
||||||
|
find_package(TreeSitter REQUIRED)
|
||||||
|
include_directories(SYSTEM ${TreeSitter_INCLUDE_DIRS})
|
||||||
|
|
||||||
|
list(APPEND CMAKE_REQUIRED_INCLUDES "${TreeSitter_INCLUDE_DIRS}")
|
||||||
|
list(APPEND CMAKE_REQUIRED_LIBRARIES "${TreeSitter_LIBRARIES}")
|
||||||
|
check_c_source_compiles("
|
||||||
|
#include <tree_sitter/api.h>
|
||||||
|
int
|
||||||
|
main(void)
|
||||||
|
{
|
||||||
|
TSQueryCursor *cursor = ts_query_cursor_new();
|
||||||
|
ts_query_cursor_set_match_limit(cursor, 32);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
" TS_HAS_SET_MATCH_LIMIT)
|
||||||
|
if(TS_HAS_SET_MATCH_LIMIT)
|
||||||
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DNVIM_TS_HAS_SET_MATCH_LIMIT")
|
||||||
|
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.
|
||||||
|
option(PREFER_LUA "Prefer Lua over LuaJIT in the nvim executable." OFF)
|
||||||
|
|
||||||
|
if(PREFER_LUA)
|
||||||
|
find_package(Lua 5.1 EXACT REQUIRED)
|
||||||
|
set(LUA_PREFERRED_INCLUDE_DIRS ${LUA_INCLUDE_DIR})
|
||||||
|
set(LUA_PREFERRED_LIBRARIES ${LUA_LIBRARIES})
|
||||||
|
# Passive (not REQUIRED): if LUAJIT_FOUND is not set, nvim-test is skipped.
|
||||||
|
find_package(LuaJit)
|
||||||
|
else()
|
||||||
|
find_package(LuaJit REQUIRED)
|
||||||
|
set(LUA_PREFERRED_INCLUDE_DIRS ${LUAJIT_INCLUDE_DIRS})
|
||||||
|
set(LUA_PREFERRED_LIBRARIES ${LUAJIT_LIBRARIES})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
list(APPEND CMAKE_REQUIRED_INCLUDES "${MSGPACK_INCLUDE_DIRS}")
|
||||||
|
check_c_source_compiles("
|
||||||
|
#include <msgpack.h>
|
||||||
|
|
||||||
|
int
|
||||||
|
main(void)
|
||||||
|
{
|
||||||
|
return MSGPACK_OBJECT_FLOAT32;
|
||||||
|
}
|
||||||
|
" MSGPACK_HAS_FLOAT32)
|
||||||
|
list(REMOVE_ITEM CMAKE_REQUIRED_INCLUDES "${MSGPACK_INCLUDE_DIRS}")
|
||||||
|
if(MSGPACK_HAS_FLOAT32)
|
||||||
|
add_definitions(-DNVIM_MSGPACK_HAS_FLOAT32)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
option(FEAT_TUI "Enable the Terminal UI" ON)
|
||||||
|
|
||||||
|
if(FEAT_TUI)
|
||||||
|
find_package(UNIBILIUM 2.0 REQUIRED)
|
||||||
|
include_directories(SYSTEM ${UNIBILIUM_INCLUDE_DIRS})
|
||||||
|
|
||||||
|
list(APPEND CMAKE_REQUIRED_INCLUDES "${UNIBILIUM_INCLUDE_DIRS}")
|
||||||
|
list(APPEND CMAKE_REQUIRED_LIBRARIES "${UNIBILIUM_LIBRARIES}")
|
||||||
|
check_c_source_compiles("
|
||||||
|
#include <unibilium.h>
|
||||||
|
|
||||||
|
int
|
||||||
|
main(void)
|
||||||
|
{
|
||||||
|
unibi_str_from_var(unibi_var_from_str(\"\"));
|
||||||
|
return unibi_num_from_var(unibi_var_from_num(0));
|
||||||
|
}
|
||||||
|
" UNIBI_HAS_VAR_FROM)
|
||||||
|
list(REMOVE_ITEM CMAKE_REQUIRED_INCLUDES "${UNIBILIUM_INCLUDE_DIRS}")
|
||||||
|
list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES "${UNIBILIUM_LIBRARIES}")
|
||||||
|
if(UNIBI_HAS_VAR_FROM)
|
||||||
|
add_definitions(-DNVIM_UNIBI_HAS_VAR_FROM)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
find_package(LibTermkey 0.22 REQUIRED)
|
||||||
|
include_directories(SYSTEM ${LIBTERMKEY_INCLUDE_DIRS})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
find_package(LIBVTERM 0.3 REQUIRED)
|
||||||
|
include_directories(SYSTEM ${LIBVTERM_INCLUDE_DIRS})
|
||||||
|
|
||||||
|
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_TSAN "Enable Clang thread sanitizer for nvim binary." OFF)
|
||||||
|
|
||||||
|
if((CLANG_ASAN_UBSAN AND CLANG_MSAN)
|
||||||
|
OR (CLANG_ASAN_UBSAN AND CLANG_TSAN)
|
||||||
|
OR (CLANG_MSAN AND CLANG_TSAN))
|
||||||
message(FATAL_ERROR "Sanitizers cannot be enabled simultaneously")
|
message(FATAL_ERROR "Sanitizers cannot be enabled simultaneously")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if((CLANG_ASAN_UBSAN OR CLANG_MSAN OR CLANG_TSAN) AND NOT CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||||
|
message(FATAL_ERROR "Sanitizers are only supported for Clang")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(ENABLE_LIBICONV)
|
||||||
|
find_package(Iconv REQUIRED)
|
||||||
|
include_directories(SYSTEM ${Iconv_INCLUDE_DIRS})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(ENABLE_LIBINTL)
|
||||||
|
# LibIntl (not Intl) selects our FindLibIntl.cmake script. #8464
|
||||||
|
find_package(LibIntl REQUIRED)
|
||||||
|
include_directories(SYSTEM ${LibIntl_INCLUDE_DIRS})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Determine platform's threading library. Set CMAKE_THREAD_PREFER_PTHREAD
|
||||||
|
# explicitly to indicate a strong preference for pthread.
|
||||||
|
set(CMAKE_THREAD_PREFER_PTHREAD ON)
|
||||||
|
find_package(Threads REQUIRED)
|
||||||
|
|
||||||
# Place targets in bin/ or lib/ for all build configurations
|
# Place targets in bin/ or lib/ for all build configurations
|
||||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
||||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
||||||
@@ -187,26 +548,36 @@ foreach(CFGNAME ${CMAKE_CONFIGURATION_TYPES})
|
|||||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CFGNAME} ${CMAKE_BINARY_DIR}/lib)
|
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CFGNAME} ${CMAKE_BINARY_DIR}/lib)
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
if(NOT PREFER_LUA)
|
# Find Lua interpreter
|
||||||
find_program(LUA_PRG NAMES luajit)
|
include(LuaHelpers)
|
||||||
endif()
|
set(LUA_DEPENDENCIES lpeg mpack bit)
|
||||||
find_program(LUA_PRG NAMES lua5.1 lua5.2 lua)
|
|
||||||
if(NOT LUA_PRG)
|
if(NOT LUA_PRG)
|
||||||
|
foreach(CURRENT_LUA_PRG luajit lua5.1 lua5.2 lua)
|
||||||
|
unset(_CHECK_LUA_PRG CACHE)
|
||||||
|
unset(LUA_PRG_WORKS)
|
||||||
|
find_program(_CHECK_LUA_PRG ${CURRENT_LUA_PRG})
|
||||||
|
|
||||||
|
if(_CHECK_LUA_PRG)
|
||||||
|
check_lua_deps(${_CHECK_LUA_PRG} "${LUA_DEPENDENCIES}" LUA_PRG_WORKS)
|
||||||
|
if(LUA_PRG_WORKS)
|
||||||
|
set(LUA_PRG "${_CHECK_LUA_PRG}" CACHE FILEPATH "Path to a program.")
|
||||||
|
break()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
unset(_CHECK_LUA_PRG CACHE)
|
||||||
|
else()
|
||||||
|
check_lua_deps(${LUA_PRG} "${LUA_DEPENDENCIES}" LUA_PRG_WORKS)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT LUA_PRG_WORKS)
|
||||||
message(FATAL_ERROR "Failed to find a Lua 5.1-compatible interpreter")
|
message(FATAL_ERROR "Failed to find a Lua 5.1-compatible interpreter")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
message(STATUS "Using Lua interpreter: ${LUA_PRG}")
|
message(STATUS "Using Lua interpreter: ${LUA_PRG}")
|
||||||
|
|
||||||
# Some of the code generation still relies on stable table ordering in order to
|
|
||||||
# produce reproducible output - specifically the msgpack'ed data in
|
|
||||||
# funcs_metadata.generated.h and ui_events_metadata.generated.h. This should
|
|
||||||
# ideally be fixed in the generators, but until then as a workaround you may provide
|
|
||||||
# a specific lua implementation that provides the needed stability by setting LUA_GEN_PRG:
|
|
||||||
if(NOT LUA_GEN_PRG)
|
|
||||||
set(LUA_GEN_PRG "${LUA_PRG}" CACHE FILEPATH "Path to the lua used for code generation.")
|
|
||||||
endif()
|
|
||||||
message(STATUS "Using Lua interpreter for code generation: ${LUA_GEN_PRG}")
|
|
||||||
|
|
||||||
option(COMPILE_LUA "Pre-compile Lua sources into bytecode (for sources that are included in the binary)" ON)
|
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(COMPILE_LUA AND NOT WIN32)
|
||||||
if(PREFER_LUA)
|
if(PREFER_LUA)
|
||||||
foreach(CURRENT_LUAC_PRG luac5.1 luac)
|
foreach(CURRENT_LUAC_PRG luac5.1 luac)
|
||||||
@@ -223,63 +594,84 @@ if(COMPILE_LUA AND NOT WIN32)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(LUAC_PRG)
|
if(LUAC_PRG)
|
||||||
message(STATUS "Using Lua compiler: ${LUAC_PRG}")
|
message(STATUS "Using Lua compiler: ${LUAC_PRG}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Lint
|
# Setup busted.
|
||||||
option(CI_LINT "Abort if lint programs not found" OFF)
|
find_program(BUSTED_PRG NAMES busted busted.bat)
|
||||||
if(CI_LINT)
|
find_program(BUSTED_LUA_PRG busted-lua)
|
||||||
set(LINT_REQUIRED "REQUIRED")
|
if(NOT BUSTED_OUTPUT_TYPE)
|
||||||
|
set(BUSTED_OUTPUT_TYPE "nvim")
|
||||||
endif()
|
endif()
|
||||||
find_program(SHELLCHECK_PRG shellcheck ${LINT_REQUIRED})
|
|
||||||
find_program(STYLUA_PRG stylua ${LINT_REQUIRED})
|
|
||||||
|
|
||||||
set(STYLUA_DIRS runtime scripts src test contrib)
|
#
|
||||||
|
# Lint
|
||||||
|
#
|
||||||
|
find_program(LUACHECK_PRG luacheck)
|
||||||
|
find_program(STYLUA_PRG stylua)
|
||||||
|
find_program(FLAKE8_PRG flake8)
|
||||||
|
find_program(UNCRUSTIFY_PRG uncrustify)
|
||||||
|
find_program(SHELLCHECK_PRG shellcheck)
|
||||||
|
|
||||||
add_glob_target(
|
add_glob_targets(
|
||||||
|
REQUIRED
|
||||||
TARGET lintlua-luacheck
|
TARGET lintlua-luacheck
|
||||||
COMMAND $<TARGET_FILE:nvim_bin>
|
COMMAND ${LUACHECK_PRG}
|
||||||
FLAGS -ll ${PROJECT_SOURCE_DIR}/test/lua_runner.lua ${CMAKE_BINARY_DIR}/usr luacheck -q
|
FLAGS -q
|
||||||
GLOB_DIRS runtime scripts src test
|
GLOB_DIRS runtime/ scripts/ src/ test/
|
||||||
GLOB_PAT *.lua
|
GLOB_PAT *.lua
|
||||||
TOUCH_STRATEGY PER_DIR)
|
TOUCH_STRATEGY SINGLE
|
||||||
add_dependencies(lintlua-luacheck lua_dev_deps)
|
)
|
||||||
|
|
||||||
add_glob_target(
|
add_glob_targets(
|
||||||
TARGET lintlua-stylua
|
TARGET lintlua-stylua
|
||||||
COMMAND ${STYLUA_PRG}
|
COMMAND ${STYLUA_PRG}
|
||||||
FLAGS --color=always --check --respect-ignores
|
FLAGS --color=always --check
|
||||||
GLOB_DIRS ${STYLUA_DIRS}
|
GLOB_DIRS runtime/
|
||||||
GLOB_PAT *.lua
|
GLOB_PAT *.lua
|
||||||
TOUCH_STRATEGY PER_DIR)
|
TOUCH_STRATEGY SINGLE
|
||||||
|
)
|
||||||
|
|
||||||
add_custom_target(lintlua)
|
add_custom_target(lintlua)
|
||||||
add_dependencies(lintlua lintlua-luacheck lintlua-stylua)
|
add_dependencies(lintlua lintlua-luacheck lintlua-stylua)
|
||||||
|
|
||||||
add_glob_target(
|
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
|
TARGET lintsh
|
||||||
COMMAND ${SHELLCHECK_PRG}
|
COMMAND ${SHELLCHECK_PRG}
|
||||||
FLAGS -x -a
|
FILES scripts/vim-patch.sh
|
||||||
GLOB_DIRS scripts
|
TOUCH_STRATEGY SINGLE
|
||||||
GLOB_PAT *.sh
|
)
|
||||||
TOUCH_STRATEGY PER_DIR)
|
|
||||||
|
|
||||||
add_custom_target(lintcommit
|
add_custom_target(lintcommit
|
||||||
COMMAND $<TARGET_FILE:nvim_bin> -u NONE -l ${PROJECT_SOURCE_DIR}/scripts/lintcommit.lua main)
|
COMMAND ${PROJECT_BINARY_DIR}/bin/nvim -u NONE -es -c [[lua require('scripts.lintcommit').main({trace=false})]]
|
||||||
add_dependencies(lintcommit nvim_bin)
|
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
||||||
|
VERBATIM)
|
||||||
|
add_dependencies(lintcommit nvim)
|
||||||
|
|
||||||
add_custom_target(lint)
|
add_custom_target(lint)
|
||||||
add_dependencies(lint lintc lintlua lintsh lintcommit)
|
add_dependencies(lint check-single-includes lintc lintlua lintpy lintsh lintcommit lintuncrustify)
|
||||||
|
|
||||||
|
#
|
||||||
# Format
|
# Format
|
||||||
add_glob_target(
|
#
|
||||||
TARGET formatlua
|
add_custom_target(formatlua
|
||||||
COMMAND ${STYLUA_PRG}
|
COMMAND ${CMAKE_COMMAND}
|
||||||
FLAGS --respect-ignores
|
-D FORMAT_PRG=${STYLUA_PRG}
|
||||||
GLOB_DIRS ${STYLUA_DIRS}
|
-D LANG=lua
|
||||||
GLOB_PAT *.lua
|
-P ${PROJECT_SOURCE_DIR}/cmake/Format.cmake
|
||||||
TOUCH_STRATEGY PER_DIR)
|
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
|
||||||
|
|
||||||
add_custom_target(format)
|
add_custom_target(format)
|
||||||
add_dependencies(format formatc formatlua)
|
add_dependencies(format formatc formatlua)
|
||||||
@@ -288,13 +680,117 @@ install_helper(
|
|||||||
FILES ${CMAKE_SOURCE_DIR}/src/man/nvim.1
|
FILES ${CMAKE_SOURCE_DIR}/src/man/nvim.1
|
||||||
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
|
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
|
||||||
|
|
||||||
add_custom_target(nvim ALL)
|
#
|
||||||
add_dependencies(nvim nvim_bin nvim_runtime_deps nvim_runtime)
|
# Go down the tree.
|
||||||
|
#
|
||||||
|
|
||||||
add_subdirectory(src/nvim)
|
add_subdirectory(src/nvim)
|
||||||
|
get_directory_property(NVIM_VERSION_CFLAGS DIRECTORY src/nvim DEFINITION NVIM_VERSION_CFLAGS)
|
||||||
|
add_subdirectory(test/includes)
|
||||||
add_subdirectory(cmake.config)
|
add_subdirectory(cmake.config)
|
||||||
|
add_subdirectory(test/functional/fixtures) # compile test programs
|
||||||
add_subdirectory(runtime)
|
add_subdirectory(runtime)
|
||||||
add_subdirectory(test)
|
get_directory_property(GENERATED_HELP_TAGS DIRECTORY runtime DEFINITION GENERATED_HELP_TAGS)
|
||||||
|
if(WIN32)
|
||||||
|
install_helper(
|
||||||
|
FILES ${DEPS_PREFIX}/share/nvim-qt/runtime/plugin/nvim_gui_shim.vim
|
||||||
|
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/nvim-qt/runtime/plugin)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Setup some test-related bits. We do this after going down the tree because we
|
||||||
|
# need some of the targets.
|
||||||
|
if(BUSTED_PRG)
|
||||||
|
get_property(TEST_INCLUDE_DIRS DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
|
PROPERTY INCLUDE_DIRECTORIES)
|
||||||
|
|
||||||
|
# When running tests from 'ninja' we need to use the
|
||||||
|
# console pool: to do so we need to use the USES_TERMINAL
|
||||||
|
# option, but this is only available in CMake 3.2
|
||||||
|
set(TEST_TARGET_ARGS)
|
||||||
|
list(APPEND TEST_TARGET_ARGS "USES_TERMINAL")
|
||||||
|
|
||||||
|
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(BENCHMARK_PREREQS nvim tty-test)
|
||||||
|
|
||||||
|
check_lua_module(${LUA_PRG} "ffi" LUA_HAS_FFI)
|
||||||
|
if(LUA_HAS_FFI)
|
||||||
|
add_custom_target(unittest
|
||||||
|
COMMAND ${CMAKE_COMMAND}
|
||||||
|
-DBUSTED_PRG=${BUSTED_PRG}
|
||||||
|
-DLUA_PRG=${LUA_PRG}
|
||||||
|
-DWORKING_DIR=${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
|
-DBUSTED_OUTPUT_TYPE=${BUSTED_OUTPUT_TYPE}
|
||||||
|
-DTEST_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test
|
||||||
|
-DBUILD_DIR=${CMAKE_BINARY_DIR}
|
||||||
|
-DTEST_TYPE=unit
|
||||||
|
-P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake
|
||||||
|
DEPENDS ${UNITTEST_PREREQS}
|
||||||
|
${TEST_TARGET_ARGS})
|
||||||
|
set_target_properties(unittest PROPERTIES FOLDER test)
|
||||||
|
else()
|
||||||
|
message(WARNING "disabling unit tests: no Luajit FFI in ${LUA_PRG}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(LUA_HAS_FFI)
|
||||||
|
set(TEST_LIBNVIM_PATH $<TARGET_FILE:nvim-test>)
|
||||||
|
else()
|
||||||
|
set(TEST_LIBNVIM_PATH "")
|
||||||
|
endif()
|
||||||
|
configure_file(
|
||||||
|
${CMAKE_SOURCE_DIR}/test/cmakeconfig/paths.lua.in
|
||||||
|
${CMAKE_BINARY_DIR}/test/cmakeconfig/paths.lua.gen)
|
||||||
|
file(GENERATE
|
||||||
|
OUTPUT ${CMAKE_BINARY_DIR}/test/cmakeconfig/paths.lua
|
||||||
|
INPUT ${CMAKE_BINARY_DIR}/test/cmakeconfig/paths.lua.gen)
|
||||||
|
|
||||||
|
add_custom_target(functionaltest
|
||||||
|
COMMAND ${CMAKE_COMMAND}
|
||||||
|
-DBUSTED_PRG=${BUSTED_PRG}
|
||||||
|
-DLUA_PRG=${LUA_PRG}
|
||||||
|
-DNVIM_PRG=$<TARGET_FILE:nvim>
|
||||||
|
-DWORKING_DIR=${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
|
-DBUSTED_OUTPUT_TYPE=${BUSTED_OUTPUT_TYPE}
|
||||||
|
-DTEST_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test
|
||||||
|
-DBUILD_DIR=${CMAKE_BINARY_DIR}
|
||||||
|
-DTEST_TYPE=functional
|
||||||
|
-P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake
|
||||||
|
DEPENDS ${FUNCTIONALTEST_PREREQS}
|
||||||
|
${TEST_TARGET_ARGS})
|
||||||
|
set_target_properties(functionaltest PROPERTIES FOLDER test)
|
||||||
|
|
||||||
|
add_custom_target(benchmark
|
||||||
|
COMMAND ${CMAKE_COMMAND}
|
||||||
|
-DBUSTED_PRG=${BUSTED_PRG}
|
||||||
|
-DLUA_PRG=${LUA_PRG}
|
||||||
|
-DNVIM_PRG=$<TARGET_FILE:nvim>
|
||||||
|
-DWORKING_DIR=${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
|
-DBUSTED_OUTPUT_TYPE=${BUSTED_OUTPUT_TYPE}
|
||||||
|
-DTEST_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test
|
||||||
|
-DBUILD_DIR=${CMAKE_BINARY_DIR}
|
||||||
|
-DTEST_TYPE=benchmark
|
||||||
|
-P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake
|
||||||
|
DEPENDS ${BENCHMARK_PREREQS}
|
||||||
|
${TEST_TARGET_ARGS})
|
||||||
|
set_target_properties(benchmark PROPERTIES FOLDER test)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(BUSTED_LUA_PRG)
|
||||||
|
add_custom_target(functionaltest-lua
|
||||||
|
COMMAND ${CMAKE_COMMAND}
|
||||||
|
-DBUSTED_PRG=${BUSTED_LUA_PRG}
|
||||||
|
-DLUA_PRG=${LUA_PRG}
|
||||||
|
-DNVIM_PRG=$<TARGET_FILE:nvim>
|
||||||
|
-DWORKING_DIR=${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
|
-DBUSTED_OUTPUT_TYPE=${BUSTED_OUTPUT_TYPE}
|
||||||
|
-DTEST_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test
|
||||||
|
-DBUILD_DIR=${CMAKE_BINARY_DIR}
|
||||||
|
-DTEST_TYPE=functional
|
||||||
|
-P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake
|
||||||
|
DEPENDS ${FUNCTIONALTEST_PREREQS}
|
||||||
|
${TEST_TARGET_ARGS})
|
||||||
|
set_target_properties(functionaltest-lua PROPERTIES FOLDER test)
|
||||||
|
endif()
|
||||||
|
|
||||||
add_custom_target(uninstall
|
add_custom_target(uninstall
|
||||||
COMMAND ${CMAKE_COMMAND} -P ${PROJECT_SOURCE_DIR}/cmake/UninstallHelper.cmake)
|
COMMAND ${CMAKE_COMMAND} -P ${PROJECT_SOURCE_DIR}/cmake/UninstallHelper.cmake)
|
||||||
@@ -302,25 +798,3 @@ add_custom_target(uninstall
|
|||||||
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
|
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
add_subdirectory(cmake.packaging)
|
add_subdirectory(cmake.packaging)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
get_externalproject_options(uncrustify ${DEPS_IGNORE_SHA})
|
|
||||||
ExternalProject_Add(uncrustify
|
|
||||||
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/uncrustify
|
|
||||||
CMAKE_ARGS ${DEPS_CMAKE_ARGS}
|
|
||||||
EXCLUDE_FROM_ALL TRUE
|
|
||||||
${EXTERNALPROJECT_OPTIONS})
|
|
||||||
|
|
||||||
option(USE_BUNDLED_BUSTED "Use bundled busted" ON)
|
|
||||||
if(USE_BUNDLED_BUSTED)
|
|
||||||
get_externalproject_options(lua_dev_deps ${DEPS_IGNORE_SHA})
|
|
||||||
ExternalProject_Add(lua_dev_deps
|
|
||||||
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/lua_dev_deps
|
|
||||||
SOURCE_DIR ${DEPS_SHARE_DIR}
|
|
||||||
CONFIGURE_COMMAND ""
|
|
||||||
BUILD_COMMAND ""
|
|
||||||
INSTALL_COMMAND ""
|
|
||||||
EXCLUDE_FROM_ALL TRUE
|
|
||||||
${EXTERNALPROJECT_OPTIONS})
|
|
||||||
else()
|
|
||||||
add_custom_target(lua_dev_deps)
|
|
||||||
endif()
|
|
||||||
|
@@ -14,7 +14,9 @@
|
|||||||
"cacheVariables": {
|
"cacheVariables": {
|
||||||
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
|
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
|
||||||
},
|
},
|
||||||
"inherits": ["base"]
|
"inherits": [
|
||||||
|
"base"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "debug",
|
"name": "debug",
|
||||||
@@ -23,7 +25,9 @@
|
|||||||
"cacheVariables": {
|
"cacheVariables": {
|
||||||
"CMAKE_BUILD_TYPE": "Debug"
|
"CMAKE_BUILD_TYPE": "Debug"
|
||||||
},
|
},
|
||||||
"inherits": ["base"]
|
"inherits": [
|
||||||
|
"base"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "release",
|
"name": "release",
|
||||||
@@ -32,23 +36,60 @@
|
|||||||
"cacheVariables": {
|
"cacheVariables": {
|
||||||
"CMAKE_BUILD_TYPE": "Release"
|
"CMAKE_BUILD_TYPE": "Release"
|
||||||
},
|
},
|
||||||
"inherits": ["base"]
|
"inherits": [
|
||||||
|
"base"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "iwyu",
|
"name": "windows-default",
|
||||||
"displayName": "IWYU",
|
"displayName": "Windows x64 RelWithDebInfo",
|
||||||
"description": "Run include-what-you-use",
|
"description": "Sets Ninja generator, enables optimizations with debug information for x64",
|
||||||
|
"generator": "Ninja",
|
||||||
"cacheVariables": {
|
"cacheVariables": {
|
||||||
"ENABLE_IWYU": "ON"
|
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
|
||||||
},
|
},
|
||||||
"inherits": ["base"]
|
"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": "ci",
|
"name": "debug",
|
||||||
"cacheVariables": {
|
"configurePreset": "debug"
|
||||||
"CI_BUILD": "ON"
|
|
||||||
},
|
},
|
||||||
"inherits": ["base"]
|
{
|
||||||
|
"name": "release",
|
||||||
|
"configurePreset": "release"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "windows-default",
|
||||||
|
"configurePreset": "windows-default",
|
||||||
|
"condition": {
|
||||||
|
"type": "equals",
|
||||||
|
"lhs": "${hostSystemName}",
|
||||||
|
"rhs": "Windows"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
271
CONTRIBUTING.md
271
CONTRIBUTING.md
@@ -8,11 +8,12 @@ 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.
|
- Try a [complexity:low] issue.
|
||||||
- Fix bugs found by [Coverity](#coverity).
|
- Fix bugs found by [Clang](#clang-scan-build), [PVS](#pvs-studio) or
|
||||||
|
[Coverity](#coverity).
|
||||||
|
- [Improve documentation](#documenting)
|
||||||
- [Merge a Vim patch] (requires strong familiarity with Vim)
|
- [Merge a Vim patch] (requires strong familiarity with Vim)
|
||||||
- NOTE: read the above link before sending improvements to "runtime files" (anything in `runtime/`).
|
- NOTE: read the above link before sending improvements to "runtime files" (anything in `runtime/`).
|
||||||
- Vimscript and documentation files are (mostly) maintained by [Vim], not Nvim.
|
- Vimscript and documentation files are (mostly) maintained by [Vim](https://github.com/vim/vim), not Nvim.
|
||||||
- Nvim's [filetype detection](https://github.com/neovim/neovim/blob/master/runtime/lua/vim/filetype.lua) behavior matches Vim, so changes to filetype detection should be submitted to [Vim] first.
|
|
||||||
- Lua files are maintained by Nvim.
|
- Lua files are maintained by Nvim.
|
||||||
|
|
||||||
Reporting problems
|
Reporting problems
|
||||||
@@ -22,31 +23,25 @@ Reporting problems
|
|||||||
- [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").
|
- Try to reproduce with `nvim --clean` ("factory defaults").
|
||||||
- If a specific configuration or plugin is necessary to recreate the problem, use the minimal template in `contrib/minimal.lua` with `nvim --clean -u contrib/minimal.lua` after making the necessary changes.
|
|
||||||
- [Bisect](https://neovim.io/doc/user/starting.html#bisect) your config: 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.
|
- [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://neovim.io/doc/user/dev_tools.html#dev-tools-backtrace).
|
- When reporting a crash, [include a stacktrace](https://github.com/neovim/neovim/wiki/FAQ#backtrace-linux).
|
||||||
- Use [ASAN/UBSAN](#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`
|
- Check the logs. `:edit $NVIM_LOG_FILE`
|
||||||
- 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) and [:help dev-doc][dev-doc-guide] if you are working on Nvim core.
|
- Read [:help dev](https://neovim.io/doc/user/develop.html#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](https://neovim.io/doc/user/develop.html#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](https://neovim.io/doc/user/develop.html#dev-api-client) if you are developing an API client.
|
||||||
- Install `ninja` for faster builds of Nvim.
|
- Install `ninja` for faster builds of Nvim.
|
||||||
```bash
|
```
|
||||||
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.
|
||||||
```
|
```
|
||||||
- Install `ccache` for faster rebuilds of Nvim. Nvim will use it automatically
|
|
||||||
if it's found. To disable caching use:
|
|
||||||
```bash
|
|
||||||
CCACHE_DISABLE=true make
|
|
||||||
```
|
|
||||||
|
|
||||||
Pull requests (PRs)
|
Pull requests (PRs)
|
||||||
---------------------
|
---------------------
|
||||||
@@ -55,8 +50,12 @@ Pull requests (PRs)
|
|||||||
- Your PR must include [test coverage][run-tests].
|
- Your PR must include [test coverage][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 all 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 force-push.
|
||||||
|
- Use a _merge workflow_ (as opposed to "rebase") for big, high-risk PRs.
|
||||||
|
- Merge `master` into your PR when there are conflicts or when master
|
||||||
|
introduces breaking changes.
|
||||||
|
- Do not edit commits that come before the merge commit.
|
||||||
|
|
||||||
### Merging to master
|
### Merging to master
|
||||||
|
|
||||||
@@ -83,31 +82,28 @@ a comment.
|
|||||||
### Commit messages
|
### Commit messages
|
||||||
|
|
||||||
Follow the [conventional commits guidelines][conventional_commits] to *make reviews easier* and to make
|
Follow the [conventional commits guidelines][conventional_commits] to *make reviews easier* and to make
|
||||||
the VCS/git logs more valuable. The structure of a commit message is:
|
the VCS/git logs more valuable. The general structure of a commit message is:
|
||||||
|
|
||||||
type(scope): subject
|
```
|
||||||
|
<type>([optional scope]): <description>
|
||||||
|
|
||||||
Problem:
|
[optional body]
|
||||||
...
|
|
||||||
|
|
||||||
Solution:
|
[optional footer(s)]
|
||||||
...
|
```
|
||||||
|
|
||||||
- Commit message **subject** (you can **ignore this for "fixup" commits** or any commits you expect to be squashed):
|
- Prefix the commit subject with one of these [_types_](https://github.com/commitizen/conventional-commit-types/blob/master/index.json):
|
||||||
- Prefix with a [_type_](https://github.com/commitizen/conventional-commit-types/blob/master/index.json):
|
- `build`, `ci`, `docs`, `feat`, `fix`, `perf`, `refactor`, `revert`, `test`, `vim-patch`, `dist`
|
||||||
- `build ci docs feat fix perf refactor revert test vim-patch`
|
- You can **ignore this for "fixup" commits** or any commits you expect to be squashed.
|
||||||
- Append an optional `(scope)` such as `(lsp)`, `(treesitter)`, `(float)`, …
|
- Append optional scope to _type_ such as `(lsp)`, `(treesitter)`, `(float)`, …
|
||||||
|
- _Description_ shouldn't start with a capital letter or end in a period.
|
||||||
- Use the _imperative voice_: "Fix bug" rather than "Fixed bug" or "Fixes bug."
|
- Use the _imperative voice_: "Fix bug" rather than "Fixed bug" or "Fixes bug."
|
||||||
- Keep it short (under 72 characters).
|
- Try to keep the first line under 72 characters.
|
||||||
- Commit message **body** (detail):
|
- A blank line must follow the subject.
|
||||||
- Concisely describe the Problem/Solution in the commit **body**. [Describing the problem](https://lamport.azurewebsites.net/pubs/state-the-problem.pdf)
|
- Breaking API changes must be indicated by
|
||||||
_independently of the solution_ often leads to a better understanding for you, reviewers, and future readers.
|
1. "!" after the type/scope, and
|
||||||
```
|
2. a "BREAKING CHANGE" footer describing the change.
|
||||||
Problem:
|
Example:
|
||||||
|
|
||||||
Solution:
|
|
||||||
```
|
|
||||||
- Indicate breaking API changes with "!" after the type, and a "BREAKING CHANGE" footer. Example:
|
|
||||||
```
|
```
|
||||||
refactor(provider)!: drop support for Python 2
|
refactor(provider)!: drop support for Python 2
|
||||||
|
|
||||||
@@ -120,23 +116,52 @@ Each pull request must pass the automated builds on [Cirrus CI] and [GitHub Acti
|
|||||||
|
|
||||||
- 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.
|
||||||
- If any tests fail, the build will fail. See [test/README.md#running-tests][run-tests] to run tests locally.
|
- If any tests fail, the build will fail.
|
||||||
|
See [test/README.md#running-tests][run-tests] to run tests locally.
|
||||||
|
Passing locally doesn't guarantee passing the CI build, because of the
|
||||||
|
different compilers and platforms tested against.
|
||||||
- CI runs [ASan] and other analyzers.
|
- CI runs [ASan] and other analyzers.
|
||||||
- To run valgrind locally: `VALGRIND=1 make test`
|
- To run valgrind locally: `VALGRIND=1 make test`
|
||||||
- To run ASan/UBSan locally: `CC=clang make CMAKE_FLAGS="-DENABLE_ASAN_UBSAN=ON"`.
|
- To run Clang ASan/UBSan locally: `CC=clang make CMAKE_FLAGS="-DCLANG_ASAN_UBSAN=ON"`
|
||||||
Note that MSVC requires Release or RelWithDebInfo build type to work properly.
|
- The [lint](#lint) build checks modified lines _and their immediate
|
||||||
- The [lint](#lint) build checks that the code is formatted correctly and
|
neighbors_, to encourage incrementally updating the legacy style to meet our
|
||||||
passes various linter checks.
|
[style](#style). (See [#3174][3174] for background.)
|
||||||
- CI for FreeBSD runs on [Cirrus CI].
|
- CI for FreeBSD runs on [Cirrus CI].
|
||||||
- To see CI results faster in your PR, you can temporarily set `TEST_FILE` in
|
|
||||||
[test.yml](https://github.com/neovim/neovim/blob/e35b9020b16985eee26e942f9a3f6b045bc3809b/.github/workflows/test.yml#L29).
|
### Clang scan-build
|
||||||
|
|
||||||
|
View the [Clang report] to see potential bugs found by the Clang
|
||||||
|
[scan-build](https://clang-analyzer.llvm.org/scan-build.html) analyzer.
|
||||||
|
|
||||||
|
- Search the Neovim commit history to find examples:
|
||||||
|
```
|
||||||
|
git log --oneline --no-merges --grep clang
|
||||||
|
```
|
||||||
|
- To verify a fix locally, run `scan-build` like this:
|
||||||
|
```
|
||||||
|
rm -rf build/
|
||||||
|
scan-build --use-analyzer=/usr/bin/clang make
|
||||||
|
```
|
||||||
|
|
||||||
|
### PVS-Studio
|
||||||
|
|
||||||
|
View the [PVS report](https://neovim.io/doc/reports/pvs/PVS-studio.html.d/) to
|
||||||
|
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)):
|
||||||
|
```
|
||||||
|
fix(PVS/V{id}): {description}
|
||||||
|
```
|
||||||
|
- Search the Neovim commit history to find examples:
|
||||||
|
```
|
||||||
|
git log --oneline --no-merges --grep PVS
|
||||||
|
```
|
||||||
|
- Try `./scripts/pvscheck.sh` to run PVS locally.
|
||||||
|
|
||||||
### Coverity
|
### Coverity
|
||||||
|
|
||||||
Coverity runs against the master build. To view the defects you must
|
[Coverity](https://scan.coverity.com/projects/neovim-neovim) runs against the
|
||||||
[request access](https://scan.coverity.com/projects/neovim-neovim) (Coverity
|
master build. To view the defects, just request access; you will be approved.
|
||||||
does not have a "public" view), then you will be approved as soon as
|
|
||||||
a maintainer sees the email.
|
|
||||||
|
|
||||||
- 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))):
|
||||||
@@ -144,21 +169,21 @@ a maintainer sees the email.
|
|||||||
fix(coverity/{id}): {description}
|
fix(coverity/{id}): {description}
|
||||||
```
|
```
|
||||||
- Search the Neovim commit history to find examples:
|
- Search the Neovim commit history to find examples:
|
||||||
```bash
|
```
|
||||||
git log --oneline --no-merges --grep coverity
|
git log --oneline --no-merges --grep coverity
|
||||||
```
|
```
|
||||||
|
|
||||||
### 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 -DENABLE_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
|
||||||
```
|
```
|
||||||
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.
|
||||||
|
|
||||||
@@ -170,27 +195,33 @@ Coding
|
|||||||
|
|
||||||
You can run the linter locally by:
|
You can run the linter locally by:
|
||||||
|
|
||||||
```bash
|
|
||||||
make lint
|
make lint
|
||||||
```
|
|
||||||
|
The lint step downloads the [master error list] and excludes them, so only lint
|
||||||
|
errors related to the local changes are reported.
|
||||||
|
|
||||||
|
You can lint a single file (but this will _not_ exclude legacy errors):
|
||||||
|
|
||||||
|
./src/clint.py src/nvim/ops.c
|
||||||
|
|
||||||
### Style
|
### Style
|
||||||
|
|
||||||
- You can format files by using:
|
- You can format files by using:
|
||||||
```bash
|
```
|
||||||
make format # or formatc, formatlua
|
make format
|
||||||
```
|
```
|
||||||
This will format changed Lua and C files with all appropriate flags set.
|
This will format changed Lua and C files with all appropriate flags set.
|
||||||
- Style rules are (mostly) defined by `src/uncrustify.cfg` which tries to match
|
- Style rules are (mostly) defined by `src/uncrustify.cfg` which tries to match
|
||||||
the [style-guide]. To use the Nvim `gq` command with `uncrustify`:
|
the [style-guide]. To use the Nvim `gq` command with `uncrustify`:
|
||||||
```vim
|
```
|
||||||
if !empty(findfile('src/uncrustify.cfg', ';'))
|
if !empty(findfile('src/uncrustify.cfg', ';'))
|
||||||
setlocal formatprg=uncrustify\ -q\ -l\ C\ -c\ src/uncrustify.cfg\ --no-backup
|
setlocal formatprg=uncrustify\ -q\ -l\ C\ -c\ src/uncrustify.cfg\ --no-backup
|
||||||
endif
|
endif
|
||||||
```
|
```
|
||||||
|
The required version of `uncrustify` is specified in `uncrustify.cfg`.
|
||||||
- There is also `.clang-format` which has drifted from the [style-guide], but
|
- 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`:
|
is available for reference. To use the Nvim `gq` command with `clang-format`:
|
||||||
```vim
|
```
|
||||||
if !empty(findfile('.clang-format', ';'))
|
if !empty(findfile('.clang-format', ';'))
|
||||||
setlocal formatprg=clang-format\ -style=file
|
setlocal formatprg=clang-format\ -style=file
|
||||||
endif
|
endif
|
||||||
@@ -198,93 +229,41 @@ make lint
|
|||||||
|
|
||||||
### Navigate
|
### Navigate
|
||||||
|
|
||||||
- Set `blame.ignoreRevsFile` to ignore [noisy commits](https://github.com/neovim/neovim/commit/2d240024acbd68c2d3f82bc72cb12b1a4928c6bf) in git blame:
|
- Set `blame.ignoreRevsFile` to ignore [noise commits](https://github.com/neovim/neovim/commit/2d240024acbd68c2d3f82bc72cb12b1a4928c6bf) in git blame:
|
||||||
```bash
|
```
|
||||||
git config blame.ignoreRevsFile .git-blame-ignore-revs
|
git config blame.ignoreRevsFile .git-blame-ignore-revs
|
||||||
```
|
```
|
||||||
|
|
||||||
- Recommendation is to use **[clangd]**.
|
- Recommendation is to use **[clangd]**.
|
||||||
Can use the maintained config in [nvim-lspconfig/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
|
### Includes
|
||||||
|
|
||||||
For managing includes in C files, use [include-what-you-use].
|
For managing includes in C files, use [include-what-you-use].
|
||||||
|
|
||||||
- [Install include-what-you-use][include-what-you-use-install]
|
- [Install include-what-you-use][include-what-you-use-install]
|
||||||
- To see which includes needs fixing use the cmake preset `iwyu`:
|
- Run with:
|
||||||
```bash
|
|
||||||
cmake --preset iwyu
|
|
||||||
cmake --build build
|
|
||||||
```
|
```
|
||||||
- There's also a make target that automatically fixes the suggestions from
|
make CMAKE_EXTRA_FLAGS=-DCMAKE_C_INCLUDE_WHAT_YOU_USE=include-what-you-use | tee iwyu.txt
|
||||||
IWYU:
|
|
||||||
```bash
|
|
||||||
make iwyu
|
|
||||||
```
|
```
|
||||||
|
|
||||||
See [#549][549] for more details.
|
See [#549][549] for more details.
|
||||||
|
|
||||||
### Lua runtime files
|
Documenting
|
||||||
|
-----------
|
||||||
|
|
||||||
Most of the Lua core [`runtime/`](./runtime) modules are precompiled to
|
Many parts of the `:help` documentation are autogenerated from C or Lua docstrings using the `./scripts/gen_vimdoc.py` script.
|
||||||
bytecode, so changes to those files won't get used unless you rebuild Nvim or
|
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>`.
|
||||||
by passing `--luamod-dev` and `$VIMRUNTIME`. For example, try adding a function
|
|
||||||
to `runtime/lua/vim/_editor.lua` then:
|
|
||||||
|
|
||||||
```bash
|
## Lua docstrings
|
||||||
VIMRUNTIME=./runtime ./build/bin/nvim --luamod-dev
|
|
||||||
```
|
|
||||||
|
|
||||||
Documentation
|
Lua documentation uses a subset of [EmmyLua] annotations. A rough outline of a function documentation is
|
||||||
-------------
|
|
||||||
|
|
||||||
Read [:help dev-doc][dev-doc-guide] to understand the expected documentation style and conventions.
|
|
||||||
|
|
||||||
### Generating :help
|
|
||||||
|
|
||||||
Many `:help` docs are autogenerated from (C or Lua) docstrings. To generate the documentation run:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
make doc
|
|
||||||
```
|
|
||||||
|
|
||||||
To validate the documentation files, run:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
make lintdoc
|
|
||||||
```
|
|
||||||
|
|
||||||
If you need to modify or debug the documentation flow, these are the main files:
|
|
||||||
- `./scripts/gen_vimdoc.lua`:
|
|
||||||
Main doc generator. Parses C and Lua files to render vimdoc files.
|
|
||||||
- `./scripts/luacats_parser.lua`:
|
|
||||||
Documentation parser for Lua files.
|
|
||||||
- `./scripts/cdoc_parser.lua`:
|
|
||||||
Documentation parser for C files.
|
|
||||||
- `./scripts/luacats_grammar.lua`:
|
|
||||||
Lpeg grammar for LuaCATS
|
|
||||||
- `./scripts/cdoc_grammar.lua`:
|
|
||||||
Lpeg grammar for C doc comments
|
|
||||||
- `./scripts/gen_eval_files.lua`:
|
|
||||||
Generates documentation and Lua type files from metadata files:
|
|
||||||
```
|
|
||||||
runtime/lua/vim/* => runtime/doc/lua.txt
|
|
||||||
runtime/lua/vim/* => runtime/doc/lua.txt
|
|
||||||
runtime/lua/vim/lsp/ => runtime/doc/lsp.txt
|
|
||||||
src/nvim/api/* => runtime/doc/api.txt
|
|
||||||
src/nvim/eval.lua => runtime/doc/builtin.txt
|
|
||||||
src/nvim/options.lua => runtime/doc/options.txt
|
|
||||||
```
|
|
||||||
|
|
||||||
- `./scripts/lintdoc.lua`: Validation and linting of documentation files.
|
|
||||||
|
|
||||||
### Lua docstrings
|
|
||||||
|
|
||||||
Use [LuaLS] annotations in Lua docstrings to annotate parameter types, return
|
|
||||||
types, etc. See [:help dev-lua-doc][dev-lua-doc].
|
|
||||||
|
|
||||||
- The template for function documentation is:
|
|
||||||
```lua
|
```lua
|
||||||
--- {Brief}
|
--- {Brief}
|
||||||
---
|
---
|
||||||
@@ -292,49 +271,34 @@ types, etc. See [:help dev-lua-doc][dev-lua-doc].
|
|||||||
---
|
---
|
||||||
---@param arg1 type {description}
|
---@param arg1 type {description}
|
||||||
---@param arg2 type {description}
|
---@param arg2 type {description}
|
||||||
--- ...
|
{...}
|
||||||
---
|
---
|
||||||
---@return type {description}
|
---@return type {description}
|
||||||
```
|
```
|
||||||
- If possible, 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, add `@nodoc`.
|
|
||||||
- If the function is internal or otherwise non-public add `@private`.
|
|
||||||
- Private functions usually should be underscore-prefixed (named "_foo", not "foo").
|
|
||||||
- Mark deprecated functions with `@deprecated`.
|
|
||||||
|
|
||||||
Third-party dependencies
|
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`.
|
||||||
------------------------
|
|
||||||
|
|
||||||
To build Nvim using a different commit of a dependency change the appropriate
|
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:
|
||||||
URL in `cmake.deps/deps.txt`. For example, to use a different version of luajit
|
|
||||||
replace the value in `LUAJIT_URL` with the wanted commit hash:
|
|
||||||
|
|
||||||
```bash
|
```
|
||||||
LUAJIT_URL https://github.com/LuaJIT/LuaJIT/archive/<sha>.tar.gz
|
---@private
|
||||||
```
|
```
|
||||||
|
|
||||||
Set `DEPS_IGNORE_SHA` to `TRUE` in `cmake.deps/CMakeLists.txt` to skip hash
|
Mark functions that are deprecated as
|
||||||
check from cmake.
|
```
|
||||||
|
---@deprecated
|
||||||
Alternatively, you may point the URL as a local path where the repository is.
|
|
||||||
This is convenient when bisecting a problem in a dependency with `git bisect`.
|
|
||||||
This may require running `make distclean` between each build. Hash checking is
|
|
||||||
always skipped in this case regardless of `DEPS_IGNORE_SHA`.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
LUAJIT_URL /home/user/luajit
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Reviewing
|
Reviewing
|
||||||
---------
|
---------
|
||||||
|
|
||||||
|
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 [GitHub CLI][gh], you can create a new branch with the contents of a pull
|
||||||
request, e.g. [#1820][1820]:
|
request, e.g. [#1820][1820]:
|
||||||
|
|
||||||
```bash
|
|
||||||
gh pr checkout https://github.com/neovim/neovim/pull/1820
|
gh pr 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`
|
||||||
@@ -348,26 +312,29 @@ as context, use the `-W` argument as well.
|
|||||||
[Cirrus CI]: https://cirrus-ci.com/github/neovim/neovim
|
[Cirrus CI]: https://cirrus-ci.com/github/neovim/neovim
|
||||||
[Clang report]: https://neovim.io/doc/reports/clang/
|
[Clang report]: https://neovim.io/doc/reports/clang/
|
||||||
[GitHub Actions]: https://github.com/neovim/neovim/actions
|
[GitHub Actions]: https://github.com/neovim/neovim/actions
|
||||||
[Vim]: https://github.com/vim/vim
|
|
||||||
[clangd]: https://clangd.llvm.org
|
[clangd]: https://clangd.llvm.org
|
||||||
[Merge a Vim patch]: https://neovim.io/doc/user/dev_vimpatch.html
|
[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
|
[complexity:low]: https://github.com/neovim/neovim/issues?q=is%3Aopen+is%3Aissue+label%3Acomplexity%3Alow
|
||||||
[conventional_commits]: https://www.conventionalcommits.org
|
[conventional_commits]: https://www.conventionalcommits.org
|
||||||
[dev-doc-guide]: https://neovim.io/doc/user/develop.html#dev-doc
|
[EmmyLua]: https://github.com/sumneko/lua-language-server/wiki/Annotations
|
||||||
[dev-lua-doc]: https://neovim.io/doc/user/develop.html#dev-lua-doc
|
|
||||||
[LuaLS]: https://luals.github.io/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/
|
[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-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
|
[include-what-you-use-install]: https://github.com/include-what-you-use/include-what-you-use#how-to-install
|
||||||
[include-what-you-use]: https://github.com/include-what-you-use/include-what-you-use#using-with-cmake
|
[include-what-you-use]: https://github.com/include-what-you-use/include-what-you-use#using-with-cmake
|
||||||
[lua-language-server]: https://github.com/sumneko/lua-language-server/
|
[lua-language-server]: https://github.com/sumneko/lua-language-server/
|
||||||
|
[master error list]: https://raw.githubusercontent.com/neovim/doc/gh-pages/reports/clint/errors.json
|
||||||
[nvim-lspconfig/clangd]: https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#clangd
|
[nvim-lspconfig/clangd]: https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#clangd
|
||||||
[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-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
|
[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
|
[style-guide]: https://neovim.io/doc/user/dev_style.html#dev-style
|
||||||
[wiki-faq]: https://neovim.io/doc/user/faq.html
|
[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
|
||||||
|
426
INSTALL.md
426
INSTALL.md
@@ -1,426 +0,0 @@
|
|||||||
You can install Neovim from [download](#install-from-download), [package](#install-from-package), or [source](#install-from-source) in just a few seconds.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
- To start Neovim, run `nvim` (not `neovim`).
|
|
||||||
- [Discover plugins](https://github.com/neovim/neovim/wiki/Related-projects#plugins).
|
|
||||||
- Before upgrading to a new version, **check [Breaking Changes](https://neovim.io/doc/user/news.html#news-breaking).**
|
|
||||||
- For config (vimrc) see [the FAQ](https://neovim.io/doc/user/faq.html#faq-general).
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
Install from download
|
|
||||||
=====================
|
|
||||||
|
|
||||||
Downloads are available on the [Releases](https://github.com/neovim/neovim/releases) page.
|
|
||||||
|
|
||||||
* Latest [stable release](https://github.com/neovim/neovim/releases/latest)
|
|
||||||
* [macOS x86_64](https://github.com/neovim/neovim/releases/latest/download/nvim-macos-x86_64.tar.gz)
|
|
||||||
* [macOS arm64](https://github.com/neovim/neovim/releases/latest/download/nvim-macos-arm64.tar.gz)
|
|
||||||
* [Linux x86_64](https://github.com/neovim/neovim/releases/latest/download/nvim-linux-x86_64.tar.gz)
|
|
||||||
* [Linux arm64](https://github.com/neovim/neovim/releases/latest/download/nvim-linux-arm64.tar.gz)
|
|
||||||
* [Windows](https://github.com/neovim/neovim/releases/latest/download/nvim-win64.msi)
|
|
||||||
* Latest [development prerelease](https://github.com/neovim/neovim/releases/nightly)
|
|
||||||
|
|
||||||
|
|
||||||
Install from package
|
|
||||||
====================
|
|
||||||
|
|
||||||
Packages are listed below. (You can also [build Neovim from source](#install-from-source).)
|
|
||||||
|
|
||||||
## Windows
|
|
||||||
|
|
||||||
Windows 8+ is required. Windows 7 or older is not supported.
|
|
||||||
|
|
||||||
### [Winget](https://docs.microsoft.com/en-us/windows/package-manager/winget/)
|
|
||||||
|
|
||||||
- **Release:** `winget install Neovim.Neovim`
|
|
||||||
|
|
||||||
### [Chocolatey](https://chocolatey.org)
|
|
||||||
|
|
||||||
- **Latest Release:** `choco install neovim` (use -y for automatically skipping confirmation messages)
|
|
||||||
- **Development (pre-release):** `choco install neovim --pre`
|
|
||||||
|
|
||||||
### [Scoop](https://scoop.sh/)
|
|
||||||
```
|
|
||||||
scoop bucket add main
|
|
||||||
scoop install neovim
|
|
||||||
```
|
|
||||||
- **Release:** `scoop install neovim`
|
|
||||||
|
|
||||||
Several Neovim GUIs are available from scoop (extras): [scoop.sh/#/apps?q=neovim](https://scoop.sh/#/apps?q=neovim)
|
|
||||||
|
|
||||||
### Pre-built archives
|
|
||||||
|
|
||||||
0. If you are missing `VCRUNTIME140.dll`, install the [Visual Studio 2015 C++ redistributable](https://support.microsoft.com/en-us/kb/2977003) (choose x86_64 or x86 depending on your system).
|
|
||||||
1. Choose a package (**nvim-winXX.zip**) from the [releases page](https://github.com/neovim/neovim/releases).
|
|
||||||
2. Unzip the package. Any location is fine, administrator privileges are _not_ required.
|
|
||||||
- `$VIMRUNTIME` will be set to that location automatically.
|
|
||||||
3. Run `nvim.exe` from a terminal.
|
|
||||||
|
|
||||||
**Optional** steps:
|
|
||||||
|
|
||||||
- Add the `bin` folder (e.g. `C:\Program Files\nvim\bin`) to your PATH.
|
|
||||||
- This makes it easy to run `nvim` from anywhere.
|
|
||||||
- If `:set spell` does not work, create the `C:/Users/foo/AppData/Local/nvim/site/spell` folder.
|
|
||||||
You can then copy your spell files over (for English, located
|
|
||||||
[here](https://github.com/vim/vim/blob/master/runtime/spell/en.utf-8.spl) and
|
|
||||||
[here](https://github.com/vim/vim/blob/master/runtime/spell/en.utf-8.sug));
|
|
||||||
- For Python plugins you need the `pynvim` module. "Virtual envs" are recommended. After activating the virtual env do `pip install pynvim` (in *both*). Edit your `init.vim` so that it contains the path to the env's Python executable:
|
|
||||||
```vim
|
|
||||||
let g:python3_host_prog='C:/Users/foo/Envs/neovim3/Scripts/python.exe'
|
|
||||||
```
|
|
||||||
- Run `:checkhealth` and read `:help provider-python`.
|
|
||||||
- **init.vim ("vimrc"):** If you already have Vim installed you can copy `%userprofile%\_vimrc` to `%userprofile%\AppData\Local\nvim\init.vim` to use your Vim config with Neovim.
|
|
||||||
|
|
||||||
|
|
||||||
## macOS / OS X
|
|
||||||
|
|
||||||
### Pre-built archives
|
|
||||||
|
|
||||||
The [Releases](https://github.com/neovim/neovim/releases) page provides pre-built binaries for macOS 10.15+.
|
|
||||||
|
|
||||||
For x86_64:
|
|
||||||
|
|
||||||
curl -LO https://github.com/neovim/neovim/releases/download/nightly/nvim-macos-x86_64.tar.gz
|
|
||||||
tar xzf nvim-macos-x86_64.tar.gz
|
|
||||||
./nvim-macos-x86_64/bin/nvim
|
|
||||||
|
|
||||||
For arm64:
|
|
||||||
|
|
||||||
curl -LO https://github.com/neovim/neovim/releases/download/nightly/nvim-macos-arm64.tar.gz
|
|
||||||
tar xzf nvim-macos-arm64.tar.gz
|
|
||||||
./nvim-macos-arm64/bin/nvim
|
|
||||||
|
|
||||||
### [Homebrew](https://brew.sh) on macOS or Linux
|
|
||||||
|
|
||||||
brew install neovim
|
|
||||||
|
|
||||||
### [MacPorts](https://www.macports.org/)
|
|
||||||
|
|
||||||
sudo port selfupdate
|
|
||||||
sudo port install neovim
|
|
||||||
|
|
||||||
## Linux
|
|
||||||
|
|
||||||
### Pre-built archives
|
|
||||||
|
|
||||||
The [Releases](https://github.com/neovim/neovim/releases) page provides pre-built binaries for Linux systems.
|
|
||||||
|
|
||||||
```sh
|
|
||||||
curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux64.tar.gz
|
|
||||||
sudo rm -rf /opt/nvim
|
|
||||||
sudo tar -C /opt -xzf nvim-linux64.tar.gz
|
|
||||||
```
|
|
||||||
|
|
||||||
After this step add this to `~/.bashrc`:
|
|
||||||
|
|
||||||
export PATH="$PATH:/opt/nvim-linux64/bin"
|
|
||||||
|
|
||||||
### AppImage ("universal" Linux package)
|
|
||||||
|
|
||||||
The [Releases](https://github.com/neovim/neovim/releases) page provides an [AppImage](https://appimage.org) that runs on most Linux systems. No installation is needed, just download `nvim-linux-x86_64.appimage` and run it. (It might not work if your Linux distribution is more than 4 years old.) The following instructions assume an `x86_64` architecture; on ARM Linux replace with `arm64`.
|
|
||||||
|
|
||||||
curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux-86_64.appimage
|
|
||||||
chmod u+x nvim-linux-x86_64.appimage
|
|
||||||
./nvim-linux-x86_64.appimage
|
|
||||||
|
|
||||||
To expose nvim globally:
|
|
||||||
|
|
||||||
mkdir -p /opt/nvim
|
|
||||||
mv nvim-linux-x86_64.appimage /opt/nvim/nvim
|
|
||||||
|
|
||||||
And the following line to `~/.bashrc`:
|
|
||||||
|
|
||||||
export PATH="$PATH:/opt/nvim/"
|
|
||||||
|
|
||||||
If the `./nvim-linux-x86_64.appimage` command fails, try:
|
|
||||||
```sh
|
|
||||||
./nvim-linux-x86_64.appimage --appimage-extract
|
|
||||||
./squashfs-root/AppRun --version
|
|
||||||
|
|
||||||
# Optional: exposing nvim globally.
|
|
||||||
sudo mv squashfs-root /
|
|
||||||
sudo ln -s /squashfs-root/AppRun /usr/bin/nvim
|
|
||||||
nvim
|
|
||||||
```
|
|
||||||
|
|
||||||
### Arch Linux
|
|
||||||
|
|
||||||
Neovim can be installed from the community repository:
|
|
||||||
|
|
||||||
sudo pacman -S neovim
|
|
||||||
|
|
||||||
Alternatively, Neovim can be also installed using the PKGBUILD [`neovim-git`](https://aur.archlinux.org/packages/neovim-git), available on the [AUR](https://wiki.archlinux.org/index.php/Arch_User_Repository).
|
|
||||||
|
|
||||||
Alternatively, Neovim Nightly builds can be also installed using the PKGBUILD [`neovim-nightly-bin`](https://aur.archlinux.org/packages/neovim-nightly-bin), available on the [AUR](https://wiki.archlinux.org/index.php/Arch_User_Repository).
|
|
||||||
|
|
||||||
The Python module is available from the community repository:
|
|
||||||
|
|
||||||
sudo pacman -S python-pynvim
|
|
||||||
|
|
||||||
Ruby modules (currently only supported in `neovim-git`) are available from the AUR as [`ruby-neovim`](https://aur.archlinux.org/packages/ruby-neovim).
|
|
||||||
|
|
||||||
### CentOS 8 / RHEL 8
|
|
||||||
|
|
||||||
Neovim is available through [EPEL (Extra Packages for Enterprise Linux)](https://fedoraproject.org/wiki/EPEL)
|
|
||||||
|
|
||||||
yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
|
|
||||||
yum install -y neovim python3-neovim
|
|
||||||
|
|
||||||
### Clear Linux OS
|
|
||||||
|
|
||||||
Neovim is available through the [neovim bundle](https://github.com/clearlinux/clr-bundles/blob/master/bundles/neovim)
|
|
||||||
|
|
||||||
sudo swupd bundle-add neovim
|
|
||||||
|
|
||||||
Python (`:python`) support is available if the [python-basic bundle](https://github.com/clearlinux/clr-bundles/blob/master/bundles/python-basic) is installed.
|
|
||||||
|
|
||||||
sudo swupd bundle-add python-basic
|
|
||||||
|
|
||||||
### Debian
|
|
||||||
|
|
||||||
Neovim is in [Debian](https://packages.debian.org/search?keywords=neovim).
|
|
||||||
|
|
||||||
sudo apt-get install neovim
|
|
||||||
|
|
||||||
Python (`:python`) support is installable via the package manager on Debian unstable.
|
|
||||||
|
|
||||||
sudo apt-get install python3-neovim
|
|
||||||
|
|
||||||
### Exherbo Linux
|
|
||||||
|
|
||||||
Exhereses for scm and released versions are currently available in repository `::medvid`. Python client (with GTK+ GUI included) and Qt5 GUI are also available as suggestions:
|
|
||||||
|
|
||||||
cave resolve app-editors/neovim --take dev-python/neovim-python --take app-editors/neovim-qt
|
|
||||||
|
|
||||||
### Fedora
|
|
||||||
|
|
||||||
Neovim is in [Fedora](https://src.fedoraproject.org/rpms/neovim) starting with Fedora 25:
|
|
||||||
|
|
||||||
sudo dnf install -y neovim python3-neovim
|
|
||||||
|
|
||||||
You can also get nightly builds of git master from the [Copr automated build system](https://copr.fedoraproject.org/coprs/agriffis/neovim-nightly/):
|
|
||||||
|
|
||||||
dnf copr enable agriffis/neovim-nightly
|
|
||||||
dnf install -y neovim python3-neovim
|
|
||||||
|
|
||||||
See the [blog post](https://arongriffis.com/2019/03/02/neovim-nightly-builds) for information on how these are built.
|
|
||||||
|
|
||||||
### Flatpak
|
|
||||||
|
|
||||||
You can find Neovim on [Flathub](https://flathub.org/apps/details/io.neovim.nvim). Providing you have Flatpak [set up](https://flatpak.org/setup/):
|
|
||||||
|
|
||||||
flatpak install flathub io.neovim.nvim
|
|
||||||
flatpak run io.neovim.nvim
|
|
||||||
|
|
||||||
You can add `/var/lib/flatpak/exports/bin` (or `~/.local/share/flatpak/exports/bin` if you used `--user`) to the `$PATH` and run it with `io.neovim.nvim`.
|
|
||||||
|
|
||||||
Note that Flatpak'ed Neovim will look for `init.vim` in `~/.var/app/io.neovim.nvim/config/nvim` instead of `~/.config/nvim`.
|
|
||||||
|
|
||||||
### Gentoo Linux
|
|
||||||
|
|
||||||
An ebuild is available in Gentoo's official portage repository:
|
|
||||||
|
|
||||||
emerge -a app-editors/neovim
|
|
||||||
|
|
||||||
### GNU Guix
|
|
||||||
|
|
||||||
Neovim can be installed with:
|
|
||||||
|
|
||||||
guix install neovim
|
|
||||||
|
|
||||||
### GoboLinux
|
|
||||||
|
|
||||||
Neovim can be installed with:
|
|
||||||
|
|
||||||
sudo -H Compile NeoVim
|
|
||||||
|
|
||||||
### Nix / NixOS
|
|
||||||
|
|
||||||
Neovim can be installed with:
|
|
||||||
|
|
||||||
nix-env -iA nixpkgs.neovim
|
|
||||||
|
|
||||||
Or alternatively, if you use flakes:
|
|
||||||
|
|
||||||
nix profile install nixpkgs#neovim
|
|
||||||
|
|
||||||
### Mageia 7
|
|
||||||
|
|
||||||
urpmi neovim
|
|
||||||
|
|
||||||
To install the Python modules:
|
|
||||||
|
|
||||||
urpmi python3-pynvim
|
|
||||||
|
|
||||||
### makedeb Package Repository (MPR)
|
|
||||||
|
|
||||||
Neovim is available inside the [MPR](https://mpr.makedeb.org/packages/neovim). You can install it with:
|
|
||||||
|
|
||||||
git clone https://mpr.makedeb.org/neovim
|
|
||||||
cd neovim/
|
|
||||||
makedeb -si
|
|
||||||
|
|
||||||
### OpenSUSE
|
|
||||||
|
|
||||||
Neovim can be installed with:
|
|
||||||
|
|
||||||
sudo zypper in neovim
|
|
||||||
|
|
||||||
To install the Python modules:
|
|
||||||
|
|
||||||
sudo zypper in python-neovim python3-neovim
|
|
||||||
|
|
||||||
### PLD Linux
|
|
||||||
|
|
||||||
Neovim is in [PLD Linux](https://github.com/pld-linux/neovim):
|
|
||||||
|
|
||||||
poldek -u neovim
|
|
||||||
poldek -u python-neovim python3-neovim
|
|
||||||
poldek -u python-neovim-gui python3-neovim-gui
|
|
||||||
|
|
||||||
### Slackware
|
|
||||||
|
|
||||||
See [neovim on SlackBuilds](https://slackbuilds.org/apps/neovim/).
|
|
||||||
|
|
||||||
### Source Mage
|
|
||||||
|
|
||||||
Neovim can be installed using the Sorcery package manager:
|
|
||||||
|
|
||||||
cast neovim
|
|
||||||
|
|
||||||
### Solus
|
|
||||||
|
|
||||||
Neovim can be installed using the default package manager in Solus (eopkg):
|
|
||||||
|
|
||||||
sudo eopkg install neovim
|
|
||||||
|
|
||||||
### Snap
|
|
||||||
|
|
||||||
Neovim nightly and stable are available on the [snap store](https://snapcraft.io/nvim).
|
|
||||||
|
|
||||||
**Stable Builds**
|
|
||||||
|
|
||||||
```sh
|
|
||||||
sudo snap install --beta nvim --classic
|
|
||||||
```
|
|
||||||
|
|
||||||
**Nightly Builds**
|
|
||||||
|
|
||||||
```sh
|
|
||||||
sudo snap install --edge nvim --classic
|
|
||||||
```
|
|
||||||
|
|
||||||
### Ubuntu
|
|
||||||
As in Debian, Neovim is in [Ubuntu](https://packages.ubuntu.com/search?keywords=neovim).
|
|
||||||
|
|
||||||
sudo apt install neovim
|
|
||||||
|
|
||||||
Python (`:python`) support seems to be automatically installed
|
|
||||||
|
|
||||||
sudo apt install python3-neovim
|
|
||||||
|
|
||||||
Neovim has been added to a "Personal Package Archive" (PPA). This allows you to install it with `apt-get`. Follow the links to the PPAs to see which versions of Ubuntu are currently available via the PPA. Choose **stable** or **unstable**:
|
|
||||||
|
|
||||||
- [https://launchpad.net/~neovim-ppa/+archive/ubuntu/**stable**](https://launchpad.net/~neovim-ppa/+archive/ubuntu/stable)
|
|
||||||
- [https://launchpad.net/~neovim-ppa/+archive/ubuntu/**unstable**](https://launchpad.net/~neovim-ppa/+archive/ubuntu/unstable)
|
|
||||||
|
|
||||||
**Important:** The Neovim team does not maintain the PPA packages. For problems or questions about the PPA specifically contact https://launchpad.net/~neovim-ppa.
|
|
||||||
|
|
||||||
To be able to use **add-apt-repository** you may need to install software-properties-common:
|
|
||||||
|
|
||||||
sudo apt-get install software-properties-common
|
|
||||||
|
|
||||||
If you're using an older version Ubuntu you must use:
|
|
||||||
|
|
||||||
sudo apt-get install python-software-properties
|
|
||||||
|
|
||||||
Run the following commands:
|
|
||||||
|
|
||||||
sudo add-apt-repository ppa:neovim-ppa/stable
|
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install neovim
|
|
||||||
|
|
||||||
Prerequisites for the Python modules:
|
|
||||||
|
|
||||||
sudo apt-get install python-dev python-pip python3-dev python3-pip
|
|
||||||
|
|
||||||
If you're using an older version Ubuntu you must use:
|
|
||||||
|
|
||||||
sudo apt-get install python-dev python-pip python3-dev
|
|
||||||
sudo apt-get install python3-setuptools
|
|
||||||
sudo easy_install3 pip
|
|
||||||
|
|
||||||
### Void-Linux
|
|
||||||
|
|
||||||
Neovim can be installed using the xbps package manager
|
|
||||||
|
|
||||||
sudo xbps-install -S neovim
|
|
||||||
|
|
||||||
### Alpine Linux
|
|
||||||
|
|
||||||
Neovim can be installed using the apk package manager
|
|
||||||
|
|
||||||
sudo apk add neovim
|
|
||||||
|
|
||||||
## BSD
|
|
||||||
|
|
||||||
### FreeBSD
|
|
||||||
|
|
||||||
Neovim can be installed using [`pkg(8)`](https://www.freebsd.org/cgi/man.cgi?query=pkg&sektion=8&n=1):
|
|
||||||
|
|
||||||
pkg install neovim
|
|
||||||
|
|
||||||
or [from the ports tree](https://www.freshports.org/editors/neovim/):
|
|
||||||
|
|
||||||
cd /usr/ports/editors/neovim/ && make install clean
|
|
||||||
|
|
||||||
To install the pynvim Python modules using [`pkg(8)`](https://www.freebsd.org/cgi/man.cgi?query=pkg&sektion=8&n=1) run:
|
|
||||||
|
|
||||||
pkg install py36-pynvim
|
|
||||||
|
|
||||||
### OpenBSD
|
|
||||||
|
|
||||||
Neovim can be installed using [`pkg_add(1)`](https://man.openbsd.org/pkg_add):
|
|
||||||
|
|
||||||
pkg_add neovim
|
|
||||||
|
|
||||||
or [from the ports tree](https://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/editors/neovim/):
|
|
||||||
|
|
||||||
cd /usr/ports/editors/neovim/ && make install
|
|
||||||
|
|
||||||
## Android
|
|
||||||
|
|
||||||
[Termux](https://github.com/termux/termux-app) offers a Neovim package.
|
|
||||||
|
|
||||||
|
|
||||||
Install from source
|
|
||||||
===================
|
|
||||||
|
|
||||||
If a package is not provided for your platform, you can build Neovim from source. See [BUILD.md](./BUILD.md) for details. If you have the [prerequisites](./BUILD.md#build-prerequisites) then building is easy:
|
|
||||||
|
|
||||||
make CMAKE_BUILD_TYPE=Release
|
|
||||||
sudo make install
|
|
||||||
|
|
||||||
For Unix-like systems this installs Neovim to `/usr/local`, while for Windows to `C:\Program Files`. Note, however, that this can complicate uninstallation. The following example avoids this by isolating an installation under `$HOME/neovim`:
|
|
||||||
|
|
||||||
rm -r build/ # clear the CMake cache
|
|
||||||
make CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX=$HOME/neovim"
|
|
||||||
make install
|
|
||||||
export PATH="$HOME/neovim/bin:$PATH"
|
|
||||||
|
|
||||||
## Uninstall
|
|
||||||
|
|
||||||
There is a CMake target to _uninstall_ after `make install`:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
sudo cmake --build build/ --target uninstall
|
|
||||||
```
|
|
||||||
|
|
||||||
Alternatively, just delete the `CMAKE_INSTALL_PREFIX` artifacts:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
sudo rm /usr/local/bin/nvim
|
|
||||||
sudo rm -r /usr/local/share/nvim/
|
|
||||||
```
|
|
@@ -233,8 +233,8 @@ II) It is allowed to distribute a modified (or extended) version of Vim,
|
|||||||
maintainer will do with your changes and under what license they
|
maintainer will do with your changes and under what license they
|
||||||
will be distributed is negotiable. If there has been no negotiation
|
will be distributed is negotiable. If there has been no negotiation
|
||||||
then this license, or a later version, also applies to your changes.
|
then this license, or a later version, also applies to your changes.
|
||||||
The current maintainers are listed here: https://github.com/orgs/vim/people.
|
The current maintainer is Bram Moolenaar <Bram@vim.org>. If this
|
||||||
If this changes it will be announced in appropriate places (most likely
|
changes it will be announced in appropriate places (most likely
|
||||||
vim.sf.net, www.vim.org and/or comp.editors). When it is completely
|
vim.sf.net, www.vim.org and/or comp.editors). When it is completely
|
||||||
impossible to contact the maintainer, the obligation to send him
|
impossible to contact the maintainer, the obligation to send him
|
||||||
your changes ceases. Once the maintainer has confirmed that he has
|
your changes ceases. Once the maintainer has confirmed that he has
|
||||||
|
169
MAINTAIN.md
169
MAINTAIN.md
@@ -22,10 +22,10 @@ In practice we haven't found a way to forecast more precisely than "next" and
|
|||||||
* 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
|
||||||
Vim'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.
|
||||||
* Issue labels. E.g. the `has: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.
|
||||||
@@ -50,92 +50,35 @@ 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` (requires [git cliff](https://github.com/orhun/git-cliff))
|
* Run `./scripts/release.sh`
|
||||||
|
* Update (force-push) the remote `stable` tag.
|
||||||
* The [CI job](https://github.com/neovim/neovim/blob/3d45706478cd030c3ee05b4f336164bb96138095/.github/workflows/release.yml#L11-L13)
|
* The [CI job](https://github.com/neovim/neovim/blob/3d45706478cd030c3ee05b4f336164bb96138095/.github/workflows/release.yml#L11-L13)
|
||||||
will update the release assets and [force-push to the "stable" tag](https://github.com/neovim/neovim/blob/cdd87222c86c5b2274a13d36f23de0637462e317/.github/workflows/release.yml#L229).
|
will update the release assets and force-push to the `stable` tag.
|
||||||
|
|
||||||
### Release automation
|
### Release automation
|
||||||
|
|
||||||
Neovim automation includes a [backport bot](https://github.com/korthout/backport-action).
|
Neovim automation includes a [backport bot](https://github.com/zeebe-io/backport-action).
|
||||||
Trigger the action by labeling a PR with `ci:backport release-x.y`. See `.github/workflows/backport.yml`.
|
Trigger the action by labeling a PR with `backport release-X.Y`. See `.github/workflows/backport.yml`.
|
||||||
|
|
||||||
Deprecating and removing features
|
|
||||||
---------------------------------
|
|
||||||
|
|
||||||
Neovim inherits many features and design decisions from Vim, not all of which
|
|
||||||
align with the goals of this project. It is sometimes desired or necessary to
|
|
||||||
remove existing features, or refactor parts of the code that would change
|
|
||||||
user's workflow. In these cases, a deprecation policy is needed to properly
|
|
||||||
inform users of the change.
|
|
||||||
|
|
||||||
When a (non-experimental) feature is slated to be removed it should:
|
|
||||||
|
|
||||||
1. Be _soft_ deprecated in the _next_ release
|
|
||||||
- Use of the deprecated feature will still work.
|
|
||||||
- This means deprecating via documentation and annotation (`@deprecated`).
|
|
||||||
- Include a note in `deprecated.txt`.
|
|
||||||
- For Lua features, use `vim.deprecate()`. The specified version is the
|
|
||||||
current minor version + 2. For example, if the current version is
|
|
||||||
`v0.10.0-dev-1957+gd676746c33` then use `0.12`.
|
|
||||||
- For Vimscript features, use `v:lua.vim.deprecate()`. Use the same version
|
|
||||||
as described for Lua features.
|
|
||||||
2. Be _hard_ deprecated in a following a release in which it was soft deprecated.
|
|
||||||
- Use of the deprecated feature will still work but should issue a warning.
|
|
||||||
- Features implemented in C will need bespoke implementations to communicate
|
|
||||||
to users that the feature is deprecated.
|
|
||||||
3. Be removed in a release following the release in which it was hard deprecated
|
|
||||||
- Usually this will be the next release, but it may be a later release if
|
|
||||||
a longer deprecation cycle is desired
|
|
||||||
- If possible, keep the feature as a stub (e.g. function API) and issue an
|
|
||||||
error when it is accessed.
|
|
||||||
|
|
||||||
Example:
|
|
||||||
|
|
||||||
Deprecation Removal
|
|
||||||
┆ ┆ ┆
|
|
||||||
┆ Soft ┆ Hard ┆
|
|
||||||
┆ Deprecation ┆ Deprecation ┆
|
|
||||||
┆ Period ┆ Period ┆
|
|
||||||
────────────────────────────────────────────────────────────
|
|
||||||
Version: 0.10 0.11 0.12
|
|
||||||
────────────────────────────────────────────────────────────
|
|
||||||
Old code Old code Old code
|
|
||||||
+ +
|
|
||||||
New code New code New code
|
|
||||||
|
|
||||||
Feature removals which may benefit from community input or further discussion
|
|
||||||
should also have a tracking issue (which should be linked to in the release
|
|
||||||
notes).
|
|
||||||
|
|
||||||
Exceptions to this policy may be made (for experimental subsystems or when
|
|
||||||
there is broad consensus among maintainers). The rationale for the exception
|
|
||||||
should be stated explicitly and publicly.
|
|
||||||
|
|
||||||
Third-party dependencies
|
Third-party dependencies
|
||||||
------------------------
|
------------------------
|
||||||
|
|
||||||
For some dependencies we maintain temporary "forks", which are simply private
|
These "bundled" dependencies can be updated by bumping their versions in `cmake.deps/CMakeLists.txt`.
|
||||||
branches with a few extra patches, while we wait for the upstream project to
|
Some can be auto-bumped by `scripts/bump-deps.sh`.
|
||||||
merge the patches. This is done instead of maintaining the patches as (fragile)
|
|
||||||
CMake `PATCH_COMMAND` steps.
|
|
||||||
|
|
||||||
These "bundled" dependencies can be updated by bumping their versions in `cmake.deps/deps.txt`.
|
|
||||||
Some can be auto-bumped by `scripts/bump_deps.lua`.
|
|
||||||
|
|
||||||
* [LuaJIT](https://github.com/LuaJIT/LuaJIT)
|
* [LuaJIT](https://github.com/LuaJIT/LuaJIT)
|
||||||
* [Lua](https://www.lua.org/download.html)
|
* [Lua](https://www.lua.org/download.html)
|
||||||
* [Luv](https://github.com/luvit/luv)
|
* [Luv](https://github.com/luvit/luv)
|
||||||
* When bumping, also sync [our bundled documentation](https://github.com/neovim/neovim/blob/master/runtime/doc/luvref.txt) with [the upstream documentation](https://github.com/luvit/luv/blob/master/docs.md).
|
|
||||||
* [gettext](https://ftp.gnu.org/pub/gnu/gettext/)
|
* [gettext](https://ftp.gnu.org/pub/gnu/gettext/)
|
||||||
* [libiconv](https://ftp.gnu.org/pub/gnu/libiconv)
|
* [libiconv](https://ftp.gnu.org/pub/gnu/libiconv)
|
||||||
|
* [libtermkey](https://github.com/neovim/libtermkey)
|
||||||
* [libuv](https://github.com/libuv/libuv)
|
* [libuv](https://github.com/libuv/libuv)
|
||||||
* [libvterm](https://www.leonerd.org.uk/code/libvterm/)
|
* [libvterm](http://www.leonerd.org.uk/code/libvterm/)
|
||||||
* Downloading from the original source is unreliable, so we use our [mirror](https://github.com/neovim/libvterm) instead.
|
|
||||||
* [lua-compat](https://github.com/keplerproject/lua-compat-5.3)
|
* [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)
|
* [tree-sitter](https://github.com/tree-sitter/tree-sitter)
|
||||||
* [unibilium](https://github.com/neovim/unibilium)
|
* [unibilium](https://github.com/neovim/unibilium)
|
||||||
* The original project [was abandoned](https://github.com/neovim/neovim/issues/10302), so the [neovim/unibilium](https://github.com/neovim/unibilium) fork is considered "upstream" and is maintained on the `master` branch.
|
|
||||||
* [treesitter parsers](https://github.com/neovim/neovim/blob/7e97c773e3ba78fcddbb2a0b9b0d572c8210c83e/cmake.deps/deps.txt#L47-L62)
|
|
||||||
|
|
||||||
### Vendored dependencies
|
### Vendored dependencies
|
||||||
|
|
||||||
@@ -145,93 +88,15 @@ These dependencies are "vendored" (inlined), we must update the sources manually
|
|||||||
* send improvements upstream!
|
* send improvements upstream!
|
||||||
* `src/xdiff/`: [xdiff](https://github.com/git/git/tree/master/xdiff)
|
* `src/xdiff/`: [xdiff](https://github.com/git/git/tree/master/xdiff)
|
||||||
* `src/cjson/`: [lua-cjson](https://github.com/openresty/lua-cjson)
|
* `src/cjson/`: [lua-cjson](https://github.com/openresty/lua-cjson)
|
||||||
* `src/klib/`: [Klib](https://github.com/attractivechaos/klib)
|
* `src/nvim/lib/`: [Klib](https://github.com/attractivechaos/klib)
|
||||||
* `runtime/lua/vim/inspect.lua`: [inspect.lua](https://github.com/kikito/inspect.lua)
|
* `runtime/lua/vim/inspect.lua`: [inspect.lua](https://github.com/kikito/inspect.lua)
|
||||||
* `src/nvim/tui/terminfo_defs.h`: terminfo definitions
|
* `src/nvim/tui/terminfo_defs.h`: terminfo definitions
|
||||||
* Run `scripts/update_terminfo.sh` to update these definitions.
|
* Run `scripts/update_terminfo.sh` to update these definitions.
|
||||||
* `runtime/lua/vim/lsp/_meta/protocol.lua`: LSP specification
|
* [treesitter parsers](https://github.com/neovim/neovim/blob/fcc24e43e0b5f9d801a01ff2b8f78ce8c16dd551/cmake.deps/CMakeLists.txt#L197-L210)
|
||||||
* Run `scripts/gen_lsp.lua` to update.
|
|
||||||
* `runtime/lua/vim/_meta/lpeg.lua`: LPeg definitions.
|
|
||||||
* Refer to [`LuaCATS/lpeg`](https://github.com/LuaCATS/lpeg) for updates.
|
|
||||||
* Update the git SHA revision from which the documentation was taken.
|
|
||||||
* `runtime/lua/vim/re.lua`: LPeg regex module.
|
|
||||||
* Vendored from LPeg. Needs to be updated when LPeg is updated.
|
|
||||||
* `runtime/lua/vim/_meta/re.lua`: docs for LPeg regex module.
|
|
||||||
* Needs to be updated when LPeg is updated.
|
|
||||||
* `src/bit.c`: only for PUC lua: port of `require'bit'` from luajit https://bitop.luajit.org/
|
|
||||||
* `runtime/lua/coxpcall.lua`: coxpcall (only needed for PUC lua, builtin to luajit)
|
|
||||||
* `src/termkey`: [libtermkey](https://github.com/neovim/libtermkey)
|
|
||||||
|
|
||||||
Other dependencies
|
### Forks
|
||||||
--------------------------
|
|
||||||
|
|
||||||
* GitHub users:
|
We may maintain forks, if we are waiting on upstream changes: https://github.com/neovim/neovim/wiki/Deps
|
||||||
* https://github.com/marvim
|
|
||||||
* https://github.com/nvim-winget
|
|
||||||
* Org secrets/tokens:
|
|
||||||
* `CODECOV_TOKEN`
|
|
||||||
* Domain names (held in https://namecheap.com):
|
|
||||||
* neovim.org
|
|
||||||
* neovim.io
|
|
||||||
* packspec.org
|
|
||||||
* pkgjson.org
|
|
||||||
* DNS for the above domains is managed in https://cloudflare.com (not the domain registrar)
|
|
||||||
|
|
||||||
|
|
||||||
Refactoring
|
|
||||||
-----------
|
|
||||||
|
|
||||||
### Frozen legacy modules
|
|
||||||
|
|
||||||
Refactoring Vim structurally and aesthetically is an important goal of Neovim.
|
|
||||||
But there are some modules that should not be changed significantly, because
|
|
||||||
they are maintained Vim, at present. Until someone takes "ownership" of these
|
|
||||||
modules, the cost of any significant changes (including style or structural
|
|
||||||
changes that re-arrange the code) to these modules outweighs the benefit. The
|
|
||||||
modules are:
|
|
||||||
|
|
||||||
- `regexp.c`
|
|
||||||
- `indent_c.c`
|
|
||||||
|
|
||||||
Automation (CI)
|
|
||||||
---------------
|
|
||||||
|
|
||||||
### Backup
|
|
||||||
|
|
||||||
Discussions from issues and PRs are backed up here:
|
|
||||||
https://github.com/neovim/neovim-backup
|
|
||||||
|
|
||||||
### Development guidelines
|
|
||||||
|
|
||||||
* CI and automation jobs are primarily driven by GitHub Actions.
|
|
||||||
* Avoid macOS if an Ubuntu or a Windows runner can be used instead. This is
|
|
||||||
because macOS runners have [tighter restrictions on the number of concurrent
|
|
||||||
jobs](https://docs.github.com/en/actions/learn-github-actions/usage-limits-billing-and-administration#usage-limits).
|
|
||||||
* Runner versions:
|
|
||||||
* For special-purpose jobs where the runner version doesn't really matter,
|
|
||||||
prefer `-latest` tags so we don't need to manually bump the versions. An
|
|
||||||
example of a special-purpose workflow is `labeler_pr.yml`.
|
|
||||||
* For our testing job `test.yml`, prefer to use the latest version
|
|
||||||
explicitly. Avoid using the `-latest` tags here as it makes it difficult
|
|
||||||
to determine from an unrelated PR if a failure is due to the PR itself or
|
|
||||||
due to GitHub bumping the `-latest` tag without our knowledge. There's
|
|
||||||
also a high risk that automatically bumping the CI versions will fail due
|
|
||||||
to manual work being required from experience.
|
|
||||||
* For our release job, which is `release.yml`, prefer to use the oldest
|
|
||||||
stable (i.e. non-deprecated) versions available. The reason is that we're
|
|
||||||
trying to produce images that work in the broadest number of environments,
|
|
||||||
and therefore want to use older releases.
|
|
||||||
|
|
||||||
### Special labels
|
|
||||||
|
|
||||||
Some github labels are used to trigger certain jobs:
|
|
||||||
|
|
||||||
* `ci:backport release-x.y` - backport to branch `release-x.y`
|
|
||||||
* `ci:s390x` - enable s390x CI
|
|
||||||
* `ci:skip-news` - skip news.yml workflows
|
|
||||||
* `ci:windows-asan` - test windows with ASAN enabled
|
|
||||||
* `needs:response` - close PR after a certain amount of time if author doesn't
|
|
||||||
respond
|
|
||||||
|
|
||||||
See also
|
See also
|
||||||
--------
|
--------
|
||||||
|
138
Makefile
138
Makefile
@@ -1,26 +1,3 @@
|
|||||||
ifeq ($(OS),Windows_NT)
|
|
||||||
SHELL := powershell.exe
|
|
||||||
.SHELLFLAGS := -NoProfile -NoLogo
|
|
||||||
MKDIR := @$$null = new-item -itemtype directory -force
|
|
||||||
TOUCH := @$$null = new-item -force
|
|
||||||
RM := remove-item -force
|
|
||||||
CMAKE := cmake
|
|
||||||
CMAKE_GENERATOR := Ninja
|
|
||||||
define rmdir
|
|
||||||
if (Test-Path $1) { remove-item -recurse $1 }
|
|
||||||
endef
|
|
||||||
else
|
|
||||||
MKDIR := mkdir -p
|
|
||||||
TOUCH := touch
|
|
||||||
RM := rm -rf
|
|
||||||
CMAKE := $(shell (command -v cmake3 || command -v cmake || echo cmake))
|
|
||||||
CMAKE_GENERATOR ?= "$(shell (command -v ninja > /dev/null 2>&1 && echo "Ninja") || echo "Unix Makefiles")"
|
|
||||||
GENERATOR_CMD ?= "$(shell (command -v ninja > /dev/null 2>&1 && echo "ninja") || echo "make")"
|
|
||||||
define rmdir
|
|
||||||
rm -rf $1
|
|
||||||
endef
|
|
||||||
endif
|
|
||||||
|
|
||||||
MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
|
MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
|
||||||
MAKEFILE_DIR := $(dir $(MAKEFILE_PATH))
|
MAKEFILE_DIR := $(dir $(MAKEFILE_PATH))
|
||||||
|
|
||||||
@@ -32,6 +9,8 @@ filter-true = $(strip $(filter-out 1 on ON true TRUE,$1))
|
|||||||
|
|
||||||
all: nvim
|
all: nvim
|
||||||
|
|
||||||
|
CMAKE_PRG ?= $(shell (command -v cmake3 || echo cmake))
|
||||||
|
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 ?=
|
||||||
@@ -49,7 +28,7 @@ override CMAKE_EXTRA_FLAGS += -DCMAKE_INSTALL_PREFIX=$(CMAKE_INSTALL_PREFIX)
|
|||||||
|
|
||||||
checkprefix:
|
checkprefix:
|
||||||
@if [ -f build/.ran-cmake ]; then \
|
@if [ -f build/.ran-cmake ]; then \
|
||||||
cached_prefix=$(shell $(CMAKE) -L -N build | 2>/dev/null grep 'CMAKE_INSTALL_PREFIX' | cut -d '=' -f2); \
|
cached_prefix=$(shell $(CMAKE_PRG) -L -N build | 2>/dev/null grep 'CMAKE_INSTALL_PREFIX' | cut -d '=' -f2); \
|
||||||
if ! [ "$(CMAKE_INSTALL_PREFIX)" = "$$cached_prefix" ]; then \
|
if ! [ "$(CMAKE_INSTALL_PREFIX)" = "$$cached_prefix" ]; then \
|
||||||
printf "Re-running CMake: CMAKE_INSTALL_PREFIX '$(CMAKE_INSTALL_PREFIX)' does not match cached value '%s'.\n" "$$cached_prefix"; \
|
printf "Re-running CMake: CMAKE_INSTALL_PREFIX '$(CMAKE_INSTALL_PREFIX)' does not match cached value '%s'.\n" "$$cached_prefix"; \
|
||||||
$(RM) build/.ran-cmake; \
|
$(RM) build/.ran-cmake; \
|
||||||
@@ -59,13 +38,36 @@ else
|
|||||||
checkprefix: ;
|
checkprefix: ;
|
||||||
endif
|
endif
|
||||||
|
|
||||||
DEPS_BUILD_DIR ?= ".deps"
|
CMAKE_GENERATOR ?= $(shell (command -v ninja > /dev/null 2>&1 && echo "Ninja") || \
|
||||||
|
echo "Unix Makefiles")
|
||||||
|
DEPS_BUILD_DIR ?= .deps
|
||||||
ifneq (1,$(words [$(DEPS_BUILD_DIR)]))
|
ifneq (1,$(words [$(DEPS_BUILD_DIR)]))
|
||||||
$(error DEPS_BUILD_DIR must not contain whitespace)
|
$(error DEPS_BUILD_DIR must not contain whitespace)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq (,$(BUILD_TOOL))
|
||||||
|
ifeq (Ninja,$(CMAKE_GENERATOR))
|
||||||
|
BUILD_TOOL = ninja
|
||||||
|
else
|
||||||
|
BUILD_TOOL = $(MAKE)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
# Only need to handle Ninja here. Make will inherit the VERBOSE variable, and the -j, -l, and -n flags.
|
||||||
|
ifeq ($(CMAKE_GENERATOR),Ninja)
|
||||||
|
ifneq ($(VERBOSE),)
|
||||||
|
BUILD_TOOL += -v
|
||||||
|
endif
|
||||||
|
BUILD_TOOL += $(shell printf '%s' '$(MAKEFLAGS)' | grep -o -- ' *-[jl][0-9]\+ *')
|
||||||
|
ifeq (n,$(findstring n,$(firstword -$(MAKEFLAGS))))
|
||||||
|
BUILD_TOOL += -n
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
DEPS_CMAKE_FLAGS ?=
|
DEPS_CMAKE_FLAGS ?=
|
||||||
USE_BUNDLED ?=
|
# Back-compat: USE_BUNDLED_DEPS was the old name.
|
||||||
|
USE_BUNDLED ?= $(USE_BUNDLED_DEPS)
|
||||||
|
|
||||||
ifneq (,$(USE_BUNDLED))
|
ifneq (,$(USE_BUNDLED))
|
||||||
BUNDLED_CMAKE_FLAG := -DUSE_BUNDLED=$(USE_BUNDLED)
|
BUNDLED_CMAKE_FLAG := -DUSE_BUNDLED=$(USE_BUNDLED)
|
||||||
@@ -73,7 +75,7 @@ endif
|
|||||||
|
|
||||||
ifneq (,$(findstring functionaltest-lua,$(MAKECMDGOALS)))
|
ifneq (,$(findstring functionaltest-lua,$(MAKECMDGOALS)))
|
||||||
BUNDLED_LUA_CMAKE_FLAG := -DUSE_BUNDLED_LUA=ON
|
BUNDLED_LUA_CMAKE_FLAG := -DUSE_BUNDLED_LUA=ON
|
||||||
$(shell [ -x $(DEPS_BUILD_DIR)/usr/bin/lua ] || $(RM) build/.ran-*)
|
$(shell [ -x $(DEPS_BUILD_DIR)/usr/bin/lua ] || rm build/.ran-*)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# For use where we want to make sure only a single job is run. This does issue
|
# For use where we want to make sure only a single job is run. This does issue
|
||||||
@@ -81,84 +83,70 @@ endif
|
|||||||
SINGLE_MAKE = export MAKEFLAGS= ; $(MAKE)
|
SINGLE_MAKE = export MAKEFLAGS= ; $(MAKE)
|
||||||
|
|
||||||
nvim: build/.ran-cmake deps
|
nvim: build/.ran-cmake deps
|
||||||
$(CMAKE) --build build
|
+$(BUILD_TOOL) -C build
|
||||||
|
|
||||||
libnvim: build/.ran-cmake deps
|
libnvim: build/.ran-cmake deps
|
||||||
$(CMAKE) --build build --target libnvim
|
+$(BUILD_TOOL) -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
|
||||||
$(CMAKE) -B build -G $(CMAKE_GENERATOR) $(CMAKE_FLAGS) $(CMAKE_EXTRA_FLAGS) $(MAKEFILE_DIR)
|
cd build && $(CMAKE_PRG) -G '$(CMAKE_GENERATOR)' $(CMAKE_FLAGS) $(CMAKE_EXTRA_FLAGS) $(MAKEFILE_DIR)
|
||||||
$(TOUCH) $@
|
touch $@
|
||||||
|
|
||||||
deps: | build/.ran-deps-cmake
|
deps: | build/.ran-deps-cmake
|
||||||
ifeq ($(call filter-true,$(USE_BUNDLED)),)
|
ifeq ($(call filter-true,$(USE_BUNDLED)),)
|
||||||
$(CMAKE) --build $(DEPS_BUILD_DIR)
|
+$(BUILD_TOOL) -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) $@
|
mkdir -p "$@"
|
||||||
build/.ran-deps-cmake:: $(DEPS_BUILD_DIR)
|
build/.ran-deps-cmake:: $(DEPS_BUILD_DIR)
|
||||||
$(CMAKE) -S $(MAKEFILE_DIR)/cmake.deps -B $(DEPS_BUILD_DIR) -G $(CMAKE_GENERATOR) $(BUNDLED_CMAKE_FLAG) $(BUNDLED_LUA_CMAKE_FLAG) $(DEPS_CMAKE_FLAGS)
|
cd $(DEPS_BUILD_DIR) && \
|
||||||
|
$(CMAKE_PRG) -G '$(CMAKE_GENERATOR)' $(BUNDLED_CMAKE_FLAG) $(BUNDLED_LUA_CMAKE_FLAG) \
|
||||||
|
$(DEPS_CMAKE_FLAGS) $(MAKEFILE_DIR)/cmake.deps
|
||||||
endif
|
endif
|
||||||
build/.ran-deps-cmake::
|
build/.ran-deps-cmake::
|
||||||
$(MKDIR) build
|
mkdir -p build
|
||||||
$(TOUCH) "$@"
|
touch $@
|
||||||
|
|
||||||
# TODO: cmake 3.2+ add_custom_target() has a USES_TERMINAL flag.
|
# TODO: cmake 3.2+ add_custom_target() has a USES_TERMINAL flag.
|
||||||
oldtest: | nvim
|
oldtest: | nvim build/runtime/doc/tags
|
||||||
$(SINGLE_MAKE) -C test/old/testdir clean
|
+$(SINGLE_MAKE) -C src/nvim/testdir clean
|
||||||
ifeq ($(strip $(TEST_FILE)),)
|
ifeq ($(strip $(TEST_FILE)),)
|
||||||
$(SINGLE_MAKE) -C test/old/testdir NVIM_PRG=$(NVIM_PRG) $(MAKEOVERRIDES)
|
+$(SINGLE_MAKE) -C src/nvim/testdir NVIM_PRG=$(NVIM_PRG) $(MAKEOVERRIDES)
|
||||||
else
|
else
|
||||||
@# Handle TEST_FILE=test_foo{,.res,.vim}.
|
@# Handle TEST_FILE=test_foo{,.res,.vim}.
|
||||||
$(SINGLE_MAKE) -C test/old/testdir NVIM_PRG=$(NVIM_PRG) SCRIPTS= $(MAKEOVERRIDES) $(patsubst %.vim,%,$(patsubst %.res,%,$(TEST_FILE)))
|
+$(SINGLE_MAKE) -C src/nvim/testdir NVIM_PRG=$(NVIM_PRG) 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
|
||||||
test/old/testdir/%.vim: phony_force nvim
|
src/nvim/testdir/%.vim: phony_force
|
||||||
$(SINGLE_MAKE) -C test/old/testdir NVIM_PRG=$(NVIM_PRG) SCRIPTS= $(MAKEOVERRIDES) $(patsubst test/old/testdir/%.vim,%,$@)
|
+$(SINGLE_MAKE) -C src/nvim/testdir NVIM_PRG=$(NVIM_PRG) SCRIPTS= $(MAKEOVERRIDES) $(patsubst src/nvim/testdir/%.vim,%,$@)
|
||||||
|
|
||||||
functionaltest-lua: | nvim
|
functionaltest functionaltest-lua unittest benchmark: | nvim
|
||||||
$(CMAKE) --build build --target functionaltest
|
$(BUILD_TOOL) -C build $@
|
||||||
|
|
||||||
FORMAT=formatc formatlua format
|
lintlua lintsh lintpy lintuncrustify lintc lintcfull check-single-includes generated-sources lintcommit lint formatc formatlua format: | build/.ran-cmake
|
||||||
LINT=lintlua lintsh lintc clang-analyzer lintcommit lintdoc lint
|
$(CMAKE_PRG) --build build --target $@
|
||||||
TEST=functionaltest unittest
|
|
||||||
generated-sources benchmark $(FORMAT) $(LINT) $(TEST) doc: | build/.ran-cmake
|
|
||||||
$(CMAKE) --build build --target $@
|
|
||||||
|
|
||||||
test: $(TEST)
|
test: functionaltest unittest
|
||||||
|
|
||||||
iwyu: build/.ran-cmake
|
|
||||||
$(CMAKE) --preset iwyu
|
|
||||||
$(CMAKE) --build build > build/iwyu.log
|
|
||||||
iwyu-fix-includes --only_re="src/nvim" --ignore_re="(src/nvim/eval/encode.c\
|
|
||||||
|src/nvim/auto/\
|
|
||||||
|src/nvim/os/lang.c\
|
|
||||||
|src/nvim/map.c\
|
|
||||||
)" --nosafe_headers < build/iwyu.log
|
|
||||||
$(CMAKE) -B build -U ENABLE_IWYU
|
|
||||||
$(CMAKE) --build build
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
ifneq ($(wildcard build),)
|
+test -d build && $(BUILD_TOOL) -C build clean || true
|
||||||
$(CMAKE) --build build --target clean
|
$(MAKE) -C src/nvim/testdir clean
|
||||||
endif
|
$(MAKE) -C runtime/doc clean
|
||||||
$(MAKE) -C test/old/testdir clean
|
|
||||||
$(MAKE) -C runtime/indent clean
|
$(MAKE) -C runtime/indent clean
|
||||||
|
|
||||||
distclean:
|
distclean:
|
||||||
$(call rmdir, $(DEPS_BUILD_DIR))
|
rm -rf $(DEPS_BUILD_DIR) build
|
||||||
$(call rmdir, build)
|
|
||||||
$(MAKE) clean
|
$(MAKE) clean
|
||||||
|
|
||||||
install: checkprefix nvim
|
install: checkprefix nvim
|
||||||
$(GENERATOR_CMD) -C build install
|
+$(BUILD_TOOL) -C build install
|
||||||
|
|
||||||
appimage:
|
appimage:
|
||||||
bash scripts/genappimage.sh
|
bash scripts/genappimage.sh
|
||||||
@@ -169,4 +157,14 @@ appimage:
|
|||||||
appimage-%:
|
appimage-%:
|
||||||
bash scripts/genappimage.sh $*
|
bash scripts/genappimage.sh $*
|
||||||
|
|
||||||
.PHONY: test clean distclean nvim libnvim cmake deps install appimage checkprefix benchmark $(FORMAT) $(LINT) $(TEST)
|
# Generic pattern rules, allowing for `make build/bin/nvim` etc.
|
||||||
|
# Does not work with "Unix Makefiles".
|
||||||
|
ifeq ($(CMAKE_GENERATOR),Ninja)
|
||||||
|
build/%: phony_force
|
||||||
|
$(BUILD_TOOL) -C build $(patsubst build/%,%,$@)
|
||||||
|
|
||||||
|
$(DEPS_BUILD_DIR)/%: phony_force
|
||||||
|
$(BUILD_TOOL) -C $(DEPS_BUILD_DIR) $(patsubst $(DEPS_BUILD_DIR)/%,%,$@)
|
||||||
|
endif
|
||||||
|
|
||||||
|
.PHONY: test lintlua lintpy lintsh functionaltest unittest lint lintc clean distclean nvim libnvim cmake deps install appimage checkprefix lintcommit formatc formatlua format
|
||||||
|
36
README.md
36
README.md
@@ -1,21 +1,27 @@
|
|||||||
<h1 align="center">
|
<h1 align="center">
|
||||||
<img src="https://raw.githubusercontent.com/neovim/neovim.github.io/master/logos/neovim-logo-300x87.png" alt="Neovim">
|
<img src="https://raw.githubusercontent.com/neovim/neovim.github.io/master/logos/neovim-logo-300x87.png" alt="Neovim">
|
||||||
|
|
||||||
<a href="https://neovim.io/doc/">Documentation</a> |
|
|
||||||
<a href="https://app.element.io/#/room/#neovim:matrix.org">Chat</a>
|
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
|
[Documentation](https://neovim.io/doc/general/) |
|
||||||
|
[Chat](https://app.element.io/#/room/#neovim:matrix.org) |
|
||||||
|
[Twitter](https://twitter.com/Neovim)
|
||||||
|
|
||||||
|
[](https://github.com/neovim/neovim/actions?query=workflow%3ACI+branch%3Amaster+event%3Apush)
|
||||||
[](https://scan.coverity.com/projects/2227)
|
[](https://scan.coverity.com/projects/2227)
|
||||||
|
[](https://neovim.io/doc/reports/clang)
|
||||||
|
[](https://neovim.io/doc/reports/pvs/PVS-studio.html.d)
|
||||||
|
|
||||||
[](https://repology.org/metapackage/neovim)
|
[](https://repology.org/metapackage/neovim)
|
||||||
[](https://buildd.debian.org/neovim)
|
[](https://buildd.debian.org/neovim)
|
||||||
[](https://github.com/neovim/neovim/releases/)
|
[](https://github.com/neovim/neovim/releases/)
|
||||||
|
[](https://snapcraft.io/nvim)
|
||||||
|
|
||||||
Neovim is a project that seeks to aggressively refactor [Vim](https://www.vim.org/) in order to:
|
Neovim is a project that seeks to aggressively refactor Vim in order to:
|
||||||
|
|
||||||
- Simplify maintenance and encourage [contributions](CONTRIBUTING.md)
|
- Simplify maintenance and encourage [contributions](CONTRIBUTING.md)
|
||||||
- Split the work between multiple developers
|
- Split the work between multiple developers
|
||||||
- Enable [advanced UIs] without modifications to the core
|
- Enable [advanced UIs] without modifications to the core
|
||||||
- Maximize [extensibility](https://neovim.io/doc/user/ui.html)
|
- Maximize [extensibility](https://github.com/neovim/neovim/wiki/Plugin-UI-architecture)
|
||||||
|
|
||||||
See the [Introduction](https://github.com/neovim/neovim/wiki/Introduction) wiki page and [Roadmap]
|
See the [Introduction](https://github.com/neovim/neovim/wiki/Introduction) wiki page and [Roadmap]
|
||||||
for more information.
|
for more information.
|
||||||
@@ -25,7 +31,7 @@ Features
|
|||||||
|
|
||||||
- Modern [GUIs](https://github.com/neovim/neovim/wiki/Related-projects#gui)
|
- Modern [GUIs](https://github.com/neovim/neovim/wiki/Related-projects#gui)
|
||||||
- [API access](https://github.com/neovim/neovim/wiki/Related-projects#api-clients)
|
- [API access](https://github.com/neovim/neovim/wiki/Related-projects#api-clients)
|
||||||
from any language including C/C++, C#, Clojure, D, Elixir, Go, Haskell, Java/Kotlin,
|
from any language including C/C++, C#, Clojure, D, Elixir, Go, Haskell, Java,
|
||||||
JavaScript/Node.js, Julia, Lisp, Lua, Perl, Python, Racket, Ruby, Rust
|
JavaScript/Node.js, Julia, Lisp, Lua, Perl, Python, Racket, Ruby, Rust
|
||||||
- Embedded, scriptable [terminal emulator](https://neovim.io/doc/user/nvim_terminal_emulator.html)
|
- Embedded, scriptable [terminal emulator](https://neovim.io/doc/user/nvim_terminal_emulator.html)
|
||||||
- Asynchronous [job control](https://github.com/neovim/neovim/pull/2247)
|
- Asynchronous [job control](https://github.com/neovim/neovim/pull/2247)
|
||||||
@@ -33,7 +39,7 @@ Features
|
|||||||
- [XDG base directories](https://github.com/neovim/neovim/pull/3470) support
|
- [XDG base directories](https://github.com/neovim/neovim/pull/3470) support
|
||||||
- Compatible with most Vim plugins, including Ruby and Python plugins
|
- Compatible with most Vim plugins, including Ruby and Python plugins
|
||||||
|
|
||||||
See [`:help nvim-features`][nvim-features] for the full list, and [`:help news`][nvim-news] for noteworthy changes in the latest version!
|
See [`:help nvim-features`][nvim-features] for the full list!
|
||||||
|
|
||||||
Install from package
|
Install from package
|
||||||
--------------------
|
--------------------
|
||||||
@@ -46,7 +52,7 @@ Pre-built packages for Windows, macOS, and Linux are found on the
|
|||||||
Install from source
|
Install from source
|
||||||
-------------------
|
-------------------
|
||||||
|
|
||||||
See [BUILD.md](./BUILD.md) and [supported platforms](https://neovim.io/doc/user/support.html#supported-platforms) for details.
|
See the [Building Neovim](https://github.com/neovim/neovim/wiki/Building-Neovim) wiki page for details.
|
||||||
|
|
||||||
The build is CMake-based, but a Makefile is provided as a convenience.
|
The build is CMake-based, but a Makefile is provided as a convenience.
|
||||||
After installing the dependencies, run the following command.
|
After installing the dependencies, run the following command.
|
||||||
@@ -73,13 +79,14 @@ See [`:help nvim-from-vim`](https://neovim.io/doc/user/nvim.html#nvim-from-vim)
|
|||||||
Project layout
|
Project layout
|
||||||
--------------
|
--------------
|
||||||
|
|
||||||
|
├─ ci/ build automation
|
||||||
├─ cmake/ CMake utils
|
├─ cmake/ CMake utils
|
||||||
├─ cmake.config/ CMake defines
|
├─ cmake.config/ CMake defines
|
||||||
├─ cmake.deps/ subproject to fetch and build dependencies (optional)
|
├─ cmake.deps/ subproject to fetch and build dependencies (optional)
|
||||||
├─ runtime/ plugins and docs
|
├─ 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/ Vimscript subsystem
|
│ ├─ eval/ VimL subsystem
|
||||||
│ ├─ event/ event-loop subsystem
|
│ ├─ event/ event-loop subsystem
|
||||||
│ ├─ generators/ code generation (pre-compilation)
|
│ ├─ generators/ code generation (pre-compilation)
|
||||||
│ ├─ lib/ generic data structures
|
│ ├─ lib/ generic data structures
|
||||||
@@ -100,21 +107,20 @@ Apache 2.0 license, except for contributions copied from Vim (identified by the
|
|||||||
encouraged to make a donation for needy children in Uganda. Please see the
|
encouraged to make a donation for needy children in Uganda. Please see the
|
||||||
kcc section of the vim docs or visit the ICCF web site, available at these URLs:
|
kcc section of the vim docs or visit the ICCF web site, available at these URLs:
|
||||||
|
|
||||||
https://iccf-holland.org/
|
http://iccf-holland.org/
|
||||||
https://www.vim.org/iccf/
|
http://www.vim.org/iccf/
|
||||||
https://www.iccf.nl/
|
http://www.iccf.nl/
|
||||||
|
|
||||||
You can also sponsor the development of Vim. Vim sponsors can vote for
|
You can also sponsor the development of Vim. Vim sponsors can vote for
|
||||||
features. The money goes to Uganda anyway.
|
features. The money goes to Uganda anyway.
|
||||||
|
|
||||||
[license-commit]: https://github.com/neovim/neovim/commit/b17d9691a24099c9210289f16afb1a498a89d803
|
[license-commit]: https://github.com/neovim/neovim/commit/b17d9691a24099c9210289f16afb1a498a89d803
|
||||||
[nvim-features]: https://neovim.io/doc/user/vim_diff.html#nvim-features
|
[nvim-features]: https://neovim.io/doc/user/vim_diff.html#nvim-features
|
||||||
[nvim-news]: https://neovim.io/doc/user/news.html
|
|
||||||
[Roadmap]: https://neovim.io/roadmap/
|
[Roadmap]: https://neovim.io/roadmap/
|
||||||
[advanced UIs]: https://github.com/neovim/neovim/wiki/Related-projects#gui
|
[advanced UIs]: https://github.com/neovim/neovim/wiki/Related-projects#gui
|
||||||
[Managed packages]: ./INSTALL.md#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]: https://packages.ubuntu.com/search?keywords=neovim
|
[Ubuntu]: http://packages.ubuntu.com/search?keywords=neovim
|
||||||
[Fedora]: https://packages.fedoraproject.org/pkgs/neovim/neovim/
|
[Fedora]: https://packages.fedoraproject.org/pkgs/neovim/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
|
[Void Linux]: https://voidlinux.org/packages/?arch=x86_64&q=neovim
|
||||||
|
24
ci/before_cache.sh
Executable file
24
ci/before_cache.sh
Executable file
@@ -0,0 +1,24 @@
|
|||||||
|
#!/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"
|
||||||
|
|
||||||
|
mkdir -p "${HOME}/.cache"
|
||||||
|
|
||||||
|
echo "before_cache.sh: cache size"
|
||||||
|
du -chd 1 "${HOME}/.cache" | sort -rh | head -20
|
||||||
|
|
||||||
|
# Update the third-party dependency cache only if the build was successful.
|
||||||
|
if ended_successfully && [ -d "${DEPS_BUILD_DIR}" ]; then
|
||||||
|
# Do not cache downloads. They should not be needed with up-to-date deps.
|
||||||
|
rm -rf "${DEPS_BUILD_DIR}/build/downloads"
|
||||||
|
rm -rf "${CACHE_NVIM_DEPS_DIR}"
|
||||||
|
mv "${DEPS_BUILD_DIR}" "${CACHE_NVIM_DEPS_DIR}"
|
||||||
|
|
||||||
|
touch "${CACHE_MARKER}"
|
||||||
|
echo "Updated third-party dependencies (timestamp: $(_stat "${CACHE_MARKER}"))."
|
||||||
|
fi
|
28
ci/before_script.sh
Executable file
28
ci/before_script.sh
Executable file
@@ -0,0 +1,28 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
set -o pipefail
|
||||||
|
|
||||||
|
CI_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
|
source "${CI_DIR}/common/build.sh"
|
||||||
|
|
||||||
|
# Test some of the configuration variables.
|
||||||
|
if [[ -n "${GCOV}" ]] && [[ ! $(type -P "${GCOV}") ]]; then
|
||||||
|
echo "\$GCOV: '${GCOV}' is not executable."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [[ -n "${LLVM_SYMBOLIZER}" ]] && [[ ! $(type -P "${LLVM_SYMBOLIZER}") ]]; then
|
||||||
|
echo "\$LLVM_SYMBOLIZER: '${LLVM_SYMBOLIZER}' is not executable."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Compile dependencies.
|
||||||
|
build_deps
|
||||||
|
|
||||||
|
# Install cluacov for Lua coverage.
|
||||||
|
if [[ "$USE_LUACOV" == 1 ]]; then
|
||||||
|
"${DEPS_BUILD_DIR}/usr/bin/luarocks" install cluacov
|
||||||
|
fi
|
||||||
|
|
||||||
|
rm -rf "${LOG_DIR}"
|
||||||
|
mkdir -p "${LOG_DIR}"
|
146
ci/build.ps1
Normal file
146
ci/build.ps1
Normal file
@@ -0,0 +1,146 @@
|
|||||||
|
[CmdletBinding(DefaultParameterSetName = "Build")]
|
||||||
|
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
|
||||||
|
$ErrorActionPreference = 'Stop'
|
||||||
|
$ProgressPreference = 'SilentlyContinue'
|
||||||
|
|
||||||
|
$projectDir = [System.IO.Path]::GetFullPath("$(Get-Location)")
|
||||||
|
$buildDir = Join-Path -Path $projectDir -ChildPath "build"
|
||||||
|
|
||||||
|
# $env:CMAKE_BUILD_TYPE is ignored by cmake when not using ninja
|
||||||
|
$cmakeBuildType = $(if ($null -ne $env:CMAKE_BUILD_TYPE) {$env:CMAKE_BUILD_TYPE} else {'RelWithDebInfo'});
|
||||||
|
$depsCmakeVars = @{
|
||||||
|
CMAKE_BUILD_TYPE=$cmakeBuildType;
|
||||||
|
}
|
||||||
|
$nvimCmakeVars = @{
|
||||||
|
CMAKE_BUILD_TYPE=$cmakeBuildType;
|
||||||
|
BUSTED_OUTPUT_TYPE = 'nvim';
|
||||||
|
DEPS_PREFIX=$(if ($null -ne $env:DEPS_PREFIX) {$env:DEPS_PREFIX} else {".deps/usr"});
|
||||||
|
}
|
||||||
|
if ($null -eq $env:DEPS_BUILD_DIR) {
|
||||||
|
$env:DEPS_BUILD_DIR = Join-Path -Path $projectDir -ChildPath ".deps"
|
||||||
|
}
|
||||||
|
$uploadToCodeCov = $false
|
||||||
|
|
||||||
|
function exitIfFailed() {
|
||||||
|
if ($LastExitCode -ne 0) {
|
||||||
|
exit $LastExitCode
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function convertToCmakeArgs($vars) {
|
||||||
|
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
|
||||||
|
npm.cmd --version
|
||||||
|
|
||||||
|
npm.cmd install -g neovim; exitIfFailed
|
||||||
|
Get-Command -CommandType Application neovim-node-host.cmd; exitIfFailed
|
||||||
|
npm.cmd link neovim
|
||||||
|
|
||||||
|
if ($env:USE_LUACOV -eq 1) {
|
||||||
|
& $env:DEPS_PREFIX\luarocks\luarocks.bat install cluacov
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function Test {
|
||||||
|
# Functional tests
|
||||||
|
# The $LastExitCode from MSBuild can't be trusted
|
||||||
|
$failed = $false
|
||||||
|
|
||||||
|
# Run only this test file:
|
||||||
|
# $env:TEST_FILE = "test\functional\foo.lua"
|
||||||
|
cmake --build $buildDir --target functionaltest 2>&1 |
|
||||||
|
ForEach-Object { $failed = $failed -or
|
||||||
|
$_ -match 'functional tests failed with error'; $_ }
|
||||||
|
|
||||||
|
if ($failed) {
|
||||||
|
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
|
||||||
|
# Add MSYS to path, required for e.g. `find` used in test scripts.
|
||||||
|
# But would break functionaltests, where its `more` would be used then.
|
||||||
|
$OldPath = $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
|
||||||
|
$env:PATH = $OldPath
|
||||||
|
|
||||||
|
if ($uploadToCodecov) {
|
||||||
|
bash -l /c/projects/neovim/ci/common/submit_coverage.sh oldtest
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function Package {
|
||||||
|
cmake -S $projectDir -B $buildDir $(convertToCmakeArgs($nvimCmakeVars)) -G Ninja; exitIfFailed
|
||||||
|
cmake --build $buildDir --target package; exitIfFailed
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($PSCmdlet.ParameterSetName) {
|
||||||
|
& (Get-ChildItem "Function:$($PSCmdlet.ParameterSetName)")
|
||||||
|
exit
|
||||||
|
}
|
85
ci/common/build.sh
Normal file
85
ci/common/build.sh
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
_stat() {
|
||||||
|
if test "${CI_OS_NAME}" = osx ; then
|
||||||
|
stat -f %Sm "${@}"
|
||||||
|
else
|
||||||
|
stat -c %y "${@}"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
top_make() {
|
||||||
|
printf '%78s\n' | tr ' ' '='
|
||||||
|
ninja "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
build_make() {
|
||||||
|
top_make -C "${BUILD_DIR}" "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
build_deps() {
|
||||||
|
if test "${FUNCTIONALTEST}" = "functionaltest-lua" \
|
||||||
|
|| test "${CLANG_SANITIZER}" = "ASAN_UBSAN" ; then
|
||||||
|
DEPS_CMAKE_FLAGS="${DEPS_CMAKE_FLAGS} -DUSE_BUNDLED_LUA=ON"
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir -p "${DEPS_BUILD_DIR}"
|
||||||
|
|
||||||
|
# Use cached dependencies if $CACHE_MARKER exists.
|
||||||
|
if test -f "${CACHE_MARKER}"; then
|
||||||
|
echo "Using third-party dependencies from cache (last update: $(_stat "${CACHE_MARKER}"))."
|
||||||
|
cp -a "${CACHE_NVIM_DEPS_DIR}"/. "${DEPS_BUILD_DIR}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Even if we're using cached dependencies, run CMake and make to
|
||||||
|
# update CMake configuration and update to newer deps versions.
|
||||||
|
cd "${DEPS_BUILD_DIR}"
|
||||||
|
echo "Configuring with '${DEPS_CMAKE_FLAGS}'."
|
||||||
|
CC= cmake -G Ninja ${DEPS_CMAKE_FLAGS} "${CI_BUILD_DIR}/cmake.deps/"
|
||||||
|
|
||||||
|
if ! top_make; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
cd "${CI_BUILD_DIR}"
|
||||||
|
}
|
||||||
|
|
||||||
|
build_nvim() {
|
||||||
|
check_core_dumps --delete quiet
|
||||||
|
|
||||||
|
if test -n "${CLANG_SANITIZER}" ; then
|
||||||
|
CMAKE_FLAGS="${CMAKE_FLAGS} -DCLANG_${CLANG_SANITIZER}=ON"
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir -p "${BUILD_DIR}"
|
||||||
|
cd "${BUILD_DIR}"
|
||||||
|
echo "Configuring with '${CMAKE_FLAGS} $@'."
|
||||||
|
cmake -G Ninja ${CMAKE_FLAGS} "$@" "${CI_BUILD_DIR}"
|
||||||
|
|
||||||
|
|
||||||
|
echo "Building nvim."
|
||||||
|
if ! top_make nvim ; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test "$CLANG_SANITIZER" != "TSAN" ; then
|
||||||
|
echo "Building libnvim."
|
||||||
|
if ! top_make libnvim ; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test "${FUNCTIONALTEST}" != "functionaltest-lua"; then
|
||||||
|
echo "Building nvim-test."
|
||||||
|
if ! top_make nvim-test ; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Invoke nvim to trigger *San early.
|
||||||
|
if ! (bin/nvim --version && bin/nvim -u NONE -e -cq | cat -vet) ; then
|
||||||
|
check_sanitizer "${LOG_DIR}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
check_sanitizer "${LOG_DIR}"
|
||||||
|
|
||||||
|
cd "${CI_BUILD_DIR}"
|
||||||
|
}
|
56
ci/common/submit_coverage.sh
Executable file
56
ci/common/submit_coverage.sh
Executable file
@@ -0,0 +1,56 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# Collect and submit coverage reports.
|
||||||
|
#
|
||||||
|
# Args:
|
||||||
|
# $1: Flag(s) for codecov, separated by comma.
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Change to grandparent dir (POSIXly).
|
||||||
|
CDPATH='' cd -P -- "$(dirname -- "$0")/../.." || exit
|
||||||
|
|
||||||
|
echo "=== running submit_coverage in $PWD: $* ==="
|
||||||
|
"$GCOV" --version
|
||||||
|
|
||||||
|
# Download/install codecov-bash and gcovr once.
|
||||||
|
codecov_sh="${TEMP:-/tmp}/codecov.bash"
|
||||||
|
if ! [ -f "$codecov_sh" ]; then
|
||||||
|
curl --retry 5 --silent --fail -o "$codecov_sh" https://codecov.io/bash
|
||||||
|
chmod +x "$codecov_sh"
|
||||||
|
|
||||||
|
python -m pip install --quiet --user gcovr
|
||||||
|
fi
|
||||||
|
|
||||||
|
(
|
||||||
|
cd build
|
||||||
|
python -m gcovr --branches --exclude-unreachable-branches --print-summary -j 2 --exclude '.*/auto/.*' --root .. --delete -o ../coverage.xml --xml
|
||||||
|
)
|
||||||
|
|
||||||
|
# Upload to codecov.
|
||||||
|
# -X gcov: disable gcov, done manually above.
|
||||||
|
# -X fix: disable fixing of reports (not necessary, rather slow)
|
||||||
|
# -Z: exit non-zero on failure
|
||||||
|
# -F: flag(s)
|
||||||
|
# NOTE: ignoring flags for now, since this causes timeouts on codecov.io then,
|
||||||
|
# which they know about for about a year already...
|
||||||
|
# Flags must match pattern ^[\w\,]+$ ("," as separator).
|
||||||
|
codecov_flags="$(uname -s),${1}"
|
||||||
|
codecov_flags=$(echo "$codecov_flags" | sed 's/[^,_a-zA-Z0-9]/_/g')
|
||||||
|
if ! "$codecov_sh" -f coverage.xml -X gcov -X fix -Z -F "${codecov_flags}"; then
|
||||||
|
echo "codecov upload failed."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Cleanup always, especially collected data.
|
||||||
|
find . \( -name '*.gcov' -o -name '*.gcda' \) -ls -delete | wc -l
|
||||||
|
rm -f coverage.xml
|
||||||
|
|
||||||
|
# Upload Lua coverage (generated manually on AppVeyor/Windows).
|
||||||
|
if [ "$USE_LUACOV" = 1 ] && [ "$1" != "oldtest" ]; then
|
||||||
|
if [ -x "${DEPS_BUILD_DIR}/usr/bin/luacov" ]; then
|
||||||
|
"${DEPS_BUILD_DIR}/usr/bin/luacov"
|
||||||
|
fi
|
||||||
|
if ! "$codecov_sh" -f luacov.report.out -X gcov -X fix -Z -F "lua,${codecov_flags}"; then
|
||||||
|
echo "codecov upload failed."
|
||||||
|
fi
|
||||||
|
rm luacov.stats.out
|
||||||
|
fi
|
41
ci/common/suite.sh
Normal file
41
ci/common/suite.sh
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
# 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
|
||||||
|
# file will contain information about failed tests. Build is considered
|
||||||
|
# successful if tests ended without any of them failing.
|
||||||
|
END_MARKER="$BUILD_DIR/.tests_finished"
|
||||||
|
FAIL_SUMMARY_FILE="$BUILD_DIR/.test_errors"
|
||||||
|
|
||||||
|
fail() {
|
||||||
|
local test_name="$1"
|
||||||
|
local message="$2"
|
||||||
|
|
||||||
|
: ${message:=Test $test_name failed}
|
||||||
|
|
||||||
|
local full_msg="$test_name :: $message"
|
||||||
|
echo "${full_msg}" >> "${FAIL_SUMMARY_FILE}"
|
||||||
|
echo "Failed: $full_msg"
|
||||||
|
FAILED=1
|
||||||
|
}
|
||||||
|
|
||||||
|
ended_successfully() {
|
||||||
|
if test -f "${FAIL_SUMMARY_FILE}" ; then
|
||||||
|
echo 'Test failed, complete summary:'
|
||||||
|
cat "${FAIL_SUMMARY_FILE}"
|
||||||
|
|
||||||
|
if [[ "$GITHUB_ACTIONS" == "true" ]]; then
|
||||||
|
rm -f "$FAIL_SUMMARY_FILE"
|
||||||
|
fi
|
||||||
|
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
if ! test -f "${END_MARKER}" ; then
|
||||||
|
echo 'ended_successfully called before end marker was touched'
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
end_tests() {
|
||||||
|
touch "${END_MARKER}"
|
||||||
|
ended_successfully
|
||||||
|
}
|
173
ci/common/test.sh
Normal file
173
ci/common/test.sh
Normal file
@@ -0,0 +1,173 @@
|
|||||||
|
. "${CI_DIR}/common/build.sh"
|
||||||
|
. "${CI_DIR}/common/suite.sh"
|
||||||
|
|
||||||
|
submit_coverage() {
|
||||||
|
if [ -n "${GCOV}" ]; then
|
||||||
|
"${CI_DIR}/common/submit_coverage.sh" "$@" || echo 'codecov upload failed.'
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
print_core() {
|
||||||
|
local app="$1"
|
||||||
|
local core="$2"
|
||||||
|
if test "$app" = quiet ; then
|
||||||
|
echo "Found core $core"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
echo "======= Core file $core ======="
|
||||||
|
if test "${CI_OS_NAME}" = osx ; then
|
||||||
|
lldb -Q -o "bt all" -f "${app}" -c "${core}"
|
||||||
|
else
|
||||||
|
gdb -n -batch -ex 'thread apply all bt full' "${app}" -c "${core}"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
check_core_dumps() {
|
||||||
|
local del=
|
||||||
|
if test "$1" = "--delete" ; then
|
||||||
|
del=1
|
||||||
|
shift
|
||||||
|
fi
|
||||||
|
local app="${1:-${BUILD_DIR}/bin/nvim}"
|
||||||
|
local cores
|
||||||
|
if test "${CI_OS_NAME}" = osx ; then
|
||||||
|
cores="$(find /cores/ -type f -print)"
|
||||||
|
local _sudo='sudo'
|
||||||
|
else
|
||||||
|
cores="$(find ./ -type f \( -name 'core.*' -o -name core -o -name nvim.core \) -print)"
|
||||||
|
local _sudo=
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test -z "${cores}" ; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
local core
|
||||||
|
for core in $cores; do
|
||||||
|
if test "$del" = "1" ; then
|
||||||
|
print_core "$app" "$core" >&2
|
||||||
|
"$_sudo" rm "$core"
|
||||||
|
else
|
||||||
|
print_core "$app" "$core"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
if test "$app" != quiet ; then
|
||||||
|
fail 'cores' 'Core dumps found'
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
check_logs() {
|
||||||
|
# Iterate through each log to remove an useless warning.
|
||||||
|
for log in $(find "${1}" -type f -name "${2}"); do
|
||||||
|
sed -i "${log}" \
|
||||||
|
-e '/Warning: noted but unhandled ioctl/d' \
|
||||||
|
-e '/could cause spurious value errors to appear/d' \
|
||||||
|
-e '/See README_MISSING_SYSCALL_OR_IOCTL for guidance/d'
|
||||||
|
done
|
||||||
|
|
||||||
|
# Now do it again, but only consider files with size > 0.
|
||||||
|
local err=""
|
||||||
|
for log in $(find "${1}" -type f -name "${2}" -size +0); do
|
||||||
|
cat "${log}"
|
||||||
|
err=1
|
||||||
|
rm "${log}"
|
||||||
|
done
|
||||||
|
if test -n "${err}" ; then
|
||||||
|
fail 'logs' 'Runtime errors detected.'
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
valgrind_check() {
|
||||||
|
check_logs "${1}" "valgrind-*"
|
||||||
|
}
|
||||||
|
|
||||||
|
check_sanitizer() {
|
||||||
|
if test -n "${CLANG_SANITIZER}"; then
|
||||||
|
check_logs "${1}" "*san.*" | ${SYMBOLIZER:-cat}
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
unittests() {(
|
||||||
|
ulimit -c unlimited || true
|
||||||
|
if ! build_make unittest ; then
|
||||||
|
fail 'unittests' 'Unit tests failed'
|
||||||
|
fi
|
||||||
|
submit_coverage unittest
|
||||||
|
check_core_dumps "$(command -v luajit)"
|
||||||
|
)}
|
||||||
|
|
||||||
|
functionaltests() {(
|
||||||
|
ulimit -c unlimited || true
|
||||||
|
if ! build_make ${FUNCTIONALTEST}; then
|
||||||
|
fail 'functionaltests' 'Functional tests failed'
|
||||||
|
fi
|
||||||
|
submit_coverage functionaltest
|
||||||
|
check_sanitizer "${LOG_DIR}"
|
||||||
|
valgrind_check "${LOG_DIR}"
|
||||||
|
check_core_dumps
|
||||||
|
)}
|
||||||
|
|
||||||
|
oldtests() {(
|
||||||
|
ulimit -c unlimited || true
|
||||||
|
if ! make oldtest; then
|
||||||
|
reset
|
||||||
|
fail 'oldtests' 'Legacy tests failed'
|
||||||
|
fi
|
||||||
|
submit_coverage oldtest
|
||||||
|
check_sanitizer "${LOG_DIR}"
|
||||||
|
valgrind_check "${LOG_DIR}"
|
||||||
|
check_core_dumps
|
||||||
|
)}
|
||||||
|
|
||||||
|
check_runtime_files() {(
|
||||||
|
local test_name="$1" ; shift
|
||||||
|
local message="$1" ; shift
|
||||||
|
local tst="$1" ; shift
|
||||||
|
|
||||||
|
cd runtime
|
||||||
|
for file in $(git ls-files "$@") ; do
|
||||||
|
# Check that test is not trying to work with files with spaces/etc
|
||||||
|
# Prefer failing the build over using more robust construct because files
|
||||||
|
# with IFS are not welcome.
|
||||||
|
if ! test -e "$file" ; then
|
||||||
|
fail "$test_name" "It appears that $file is only a part of the file name"
|
||||||
|
fi
|
||||||
|
if ! test "$tst" "$INSTALL_PREFIX/share/nvim/runtime/$file" ; then
|
||||||
|
fail "$test_name" "$(printf "$message" "$file")"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
)}
|
||||||
|
|
||||||
|
install_nvim() {(
|
||||||
|
if ! build_make install ; then
|
||||||
|
fail 'install' 'make install failed'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
"${INSTALL_PREFIX}/bin/nvim" --version
|
||||||
|
if ! "${INSTALL_PREFIX}/bin/nvim" -u NONE -e -c ':help' -c ':qall' ; then
|
||||||
|
echo "Running ':help' in the installed nvim failed."
|
||||||
|
echo "Maybe the helptags have not been generated properly."
|
||||||
|
fail 'help' 'Failed running :help'
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check that all runtime files were installed
|
||||||
|
check_runtime_files \
|
||||||
|
'runtime-install' \
|
||||||
|
'It appears that %s is not installed.' \
|
||||||
|
-e \
|
||||||
|
'*.vim' '*.ps' '*.dict' '*.py' '*.tutor'
|
||||||
|
|
||||||
|
# Check that some runtime files are installed and are executables
|
||||||
|
check_runtime_files \
|
||||||
|
'not-exe' \
|
||||||
|
'It appears that %s is not installed or is not executable.' \
|
||||||
|
-x \
|
||||||
|
'*.awk' '*.sh' '*.bat'
|
||||||
|
|
||||||
|
# Check that generated syntax file has function names, #5060.
|
||||||
|
local genvimsynf=syntax/vim/generated.vim
|
||||||
|
local gpat='syn keyword vimFuncName .*eval'
|
||||||
|
if ! grep -q "$gpat" "${INSTALL_PREFIX}/share/nvim/runtime/$genvimsynf" ; then
|
||||||
|
fail 'funcnames' "It appears that $genvimsynf does not contain $gpat."
|
||||||
|
fi
|
||||||
|
)}
|
20
ci/install.sh
Executable file
20
ci/install.sh
Executable file
@@ -0,0 +1,20 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
set -o pipefail
|
||||||
|
|
||||||
|
# Use default CC to avoid compilation problems when installing Python modules.
|
||||||
|
echo "Install neovim module for Python."
|
||||||
|
CC=cc python3 -m pip -q install --user --upgrade pynvim
|
||||||
|
|
||||||
|
echo "Install neovim RubyGem."
|
||||||
|
gem install --no-document --bindir "$HOME/.local/bin" --user-install --pre neovim
|
||||||
|
|
||||||
|
echo "Install neovim npm package"
|
||||||
|
npm install -g neovim
|
||||||
|
npm link neovim
|
||||||
|
|
||||||
|
if [[ $CI_OS_NAME != osx ]]; then
|
||||||
|
sudo cpanm -n Neovim::Ext || cat "$HOME/.cpanm/build.log"
|
||||||
|
perl -W -e 'use Neovim::Ext; print $Neovim::Ext::VERSION'
|
||||||
|
fi
|
41
ci/run_tests.sh
Executable file
41
ci/run_tests.sh
Executable file
@@ -0,0 +1,41 @@
|
|||||||
|
#!/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/test.sh"
|
||||||
|
source "${CI_DIR}/common/suite.sh"
|
||||||
|
|
||||||
|
rm -f "$END_MARKER"
|
||||||
|
|
||||||
|
# Run all tests (with some caveats) if no input argument is given
|
||||||
|
if (($# == 0)); then
|
||||||
|
tests=('build_nvim')
|
||||||
|
|
||||||
|
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
|
||||||
|
tests+=('unittests')
|
||||||
|
fi
|
||||||
|
tests+=('functionaltests')
|
||||||
|
fi
|
||||||
|
|
||||||
|
tests+=('oldtests' 'install_nvim')
|
||||||
|
else
|
||||||
|
tests=("$@")
|
||||||
|
fi
|
||||||
|
|
||||||
|
for i in "${tests[@]}"; do
|
||||||
|
eval "$i" || fail "$i"
|
||||||
|
done
|
||||||
|
|
||||||
|
end_tests
|
||||||
|
|
||||||
|
if [[ -s "${GCOV_ERROR_FILE}" ]]; then
|
||||||
|
echo '=== Unexpected gcov errors: ==='
|
||||||
|
cat "${GCOV_ERROR_FILE}"
|
||||||
|
exit 1
|
||||||
|
fi
|
194
ci/snap/.snapcraft_payload
Normal file
194
ci/snap/.snapcraft_payload
Normal file
@@ -0,0 +1,194 @@
|
|||||||
|
{
|
||||||
|
"ref": "refs/heads/master",
|
||||||
|
"before": "66b136c43c12df3dcf8f19ff48f206ad2e4f43fc",
|
||||||
|
"after": "1bf69c32217cc455603ce8aa2b5415d9717f0fa2",
|
||||||
|
"repository": {
|
||||||
|
"id": 292861950,
|
||||||
|
"node_id": "MDEwOlJlcG9zaXRvcnkyOTI4NjE5NTA=",
|
||||||
|
"name": "neovim-snap",
|
||||||
|
"full_name": "hurricanehrndz/neovim-snap",
|
||||||
|
"private": false,
|
||||||
|
"owner": {
|
||||||
|
"name": "hurricanehrndz",
|
||||||
|
"email": "hurricanehrndz@users.noreply.github.com",
|
||||||
|
"login": "hurricanehrndz",
|
||||||
|
"id": 5804237,
|
||||||
|
"node_id": "MDQ6VXNlcjU4MDQyMzc=",
|
||||||
|
"avatar_url": "https://avatars0.githubusercontent.com/u/5804237?v=4",
|
||||||
|
"gravatar_id": "",
|
||||||
|
"url": "https://api.github.com/users/hurricanehrndz",
|
||||||
|
"html_url": "https://github.com/hurricanehrndz",
|
||||||
|
"followers_url": "https://api.github.com/users/hurricanehrndz/followers",
|
||||||
|
"following_url": "https://api.github.com/users/hurricanehrndz/following{/other_user}",
|
||||||
|
"gists_url": "https://api.github.com/users/hurricanehrndz/gists{/gist_id}",
|
||||||
|
"starred_url": "https://api.github.com/users/hurricanehrndz/starred{/owner}{/repo}",
|
||||||
|
"subscriptions_url": "https://api.github.com/users/hurricanehrndz/subscriptions",
|
||||||
|
"organizations_url": "https://api.github.com/users/hurricanehrndz/orgs",
|
||||||
|
"repos_url": "https://api.github.com/users/hurricanehrndz/repos",
|
||||||
|
"events_url": "https://api.github.com/users/hurricanehrndz/events{/privacy}",
|
||||||
|
"received_events_url": "https://api.github.com/users/hurricanehrndz/received_events",
|
||||||
|
"type": "User",
|
||||||
|
"site_admin": false
|
||||||
|
},
|
||||||
|
"html_url": "https://github.com/hurricanehrndz/neovim-snap",
|
||||||
|
"description": "snap build for neovim",
|
||||||
|
"fork": false,
|
||||||
|
"url": "https://github.com/hurricanehrndz/neovim-snap",
|
||||||
|
"forks_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/forks",
|
||||||
|
"keys_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/keys{/key_id}",
|
||||||
|
"collaborators_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/collaborators{/collaborator}",
|
||||||
|
"teams_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/teams",
|
||||||
|
"hooks_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/hooks",
|
||||||
|
"issue_events_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/issues/events{/number}",
|
||||||
|
"events_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/events",
|
||||||
|
"assignees_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/assignees{/user}",
|
||||||
|
"branches_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/branches{/branch}",
|
||||||
|
"tags_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/tags",
|
||||||
|
"blobs_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/git/blobs{/sha}",
|
||||||
|
"git_tags_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/git/tags{/sha}",
|
||||||
|
"git_refs_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/git/refs{/sha}",
|
||||||
|
"trees_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/git/trees{/sha}",
|
||||||
|
"statuses_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/statuses/{sha}",
|
||||||
|
"languages_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/languages",
|
||||||
|
"stargazers_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/stargazers",
|
||||||
|
"contributors_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/contributors",
|
||||||
|
"subscribers_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/subscribers",
|
||||||
|
"subscription_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/subscription",
|
||||||
|
"commits_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/commits{/sha}",
|
||||||
|
"git_commits_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/git/commits{/sha}",
|
||||||
|
"comments_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/comments{/number}",
|
||||||
|
"issue_comment_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/issues/comments{/number}",
|
||||||
|
"contents_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/contents/{+path}",
|
||||||
|
"compare_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/compare/{base}...{head}",
|
||||||
|
"merges_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/merges",
|
||||||
|
"archive_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/{archive_format}{/ref}",
|
||||||
|
"downloads_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/downloads",
|
||||||
|
"issues_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/issues{/number}",
|
||||||
|
"pulls_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/pulls{/number}",
|
||||||
|
"milestones_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/milestones{/number}",
|
||||||
|
"notifications_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/notifications{?since,all,participating}",
|
||||||
|
"labels_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/labels{/name}",
|
||||||
|
"releases_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/releases{/id}",
|
||||||
|
"deployments_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/deployments",
|
||||||
|
"created_at": 1599227980,
|
||||||
|
"updated_at": "2020-09-04T14:02:38Z",
|
||||||
|
"pushed_at": 1599228352,
|
||||||
|
"git_url": "git://github.com/hurricanehrndz/neovim-snap.git",
|
||||||
|
"ssh_url": "git@github.com:hurricanehrndz/neovim-snap.git",
|
||||||
|
"clone_url": "https://github.com/hurricanehrndz/neovim-snap.git",
|
||||||
|
"svn_url": "https://github.com/hurricanehrndz/neovim-snap",
|
||||||
|
"homepage": null,
|
||||||
|
"size": 0,
|
||||||
|
"stargazers_count": 0,
|
||||||
|
"watchers_count": 0,
|
||||||
|
"language": null,
|
||||||
|
"has_issues": true,
|
||||||
|
"has_projects": true,
|
||||||
|
"has_downloads": true,
|
||||||
|
"has_wiki": true,
|
||||||
|
"has_pages": false,
|
||||||
|
"forks_count": 0,
|
||||||
|
"mirror_url": null,
|
||||||
|
"archived": false,
|
||||||
|
"disabled": false,
|
||||||
|
"open_issues_count": 0,
|
||||||
|
"license": {
|
||||||
|
"key": "mit",
|
||||||
|
"name": "MIT License",
|
||||||
|
"spdx_id": "MIT",
|
||||||
|
"url": "https://api.github.com/licenses/mit",
|
||||||
|
"node_id": "MDc6TGljZW5zZTEz"
|
||||||
|
},
|
||||||
|
"forks": 0,
|
||||||
|
"open_issues": 0,
|
||||||
|
"watchers": 0,
|
||||||
|
"default_branch": "master",
|
||||||
|
"stargazers": 0,
|
||||||
|
"master_branch": "master"
|
||||||
|
},
|
||||||
|
"pusher": {
|
||||||
|
"name": "hurricanehrndz",
|
||||||
|
"email": "hurricanehrndz@users.noreply.github.com"
|
||||||
|
},
|
||||||
|
"sender": {
|
||||||
|
"login": "hurricanehrndz",
|
||||||
|
"id": 5804237,
|
||||||
|
"node_id": "MDQ6VXNlcjU4MDQyMzc=",
|
||||||
|
"avatar_url": "https://avatars0.githubusercontent.com/u/5804237?v=4",
|
||||||
|
"gravatar_id": "",
|
||||||
|
"url": "https://api.github.com/users/hurricanehrndz",
|
||||||
|
"html_url": "https://github.com/hurricanehrndz",
|
||||||
|
"followers_url": "https://api.github.com/users/hurricanehrndz/followers",
|
||||||
|
"following_url": "https://api.github.com/users/hurricanehrndz/following{/other_user}",
|
||||||
|
"gists_url": "https://api.github.com/users/hurricanehrndz/gists{/gist_id}",
|
||||||
|
"starred_url": "https://api.github.com/users/hurricanehrndz/starred{/owner}{/repo}",
|
||||||
|
"subscriptions_url": "https://api.github.com/users/hurricanehrndz/subscriptions",
|
||||||
|
"organizations_url": "https://api.github.com/users/hurricanehrndz/orgs",
|
||||||
|
"repos_url": "https://api.github.com/users/hurricanehrndz/repos",
|
||||||
|
"events_url": "https://api.github.com/users/hurricanehrndz/events{/privacy}",
|
||||||
|
"received_events_url": "https://api.github.com/users/hurricanehrndz/received_events",
|
||||||
|
"type": "User",
|
||||||
|
"site_admin": false
|
||||||
|
},
|
||||||
|
"created": false,
|
||||||
|
"deleted": false,
|
||||||
|
"forced": false,
|
||||||
|
"base_ref": null,
|
||||||
|
"compare": "https://github.com/hurricanehrndz/neovim-snap/compare/66b136c43c12...1bf69c32217c",
|
||||||
|
"commits": [
|
||||||
|
{
|
||||||
|
"id": "1bf69c32217cc455603ce8aa2b5415d9717f0fa2",
|
||||||
|
"tree_id": "62ea83a2349be8c930c45fdc199f71b08bf5927e",
|
||||||
|
"distinct": true,
|
||||||
|
"message": "Build of latest tag",
|
||||||
|
"timestamp": "2020-09-04T14:05:40Z",
|
||||||
|
"url": "https://github.com/hurricanehrndz/neovim-snap/commit/1bf69c32217cc455603ce8aa2b5415d9717f0fa2",
|
||||||
|
"author": {
|
||||||
|
"name": "Carlos Hernandez",
|
||||||
|
"email": "carlos@techbyte.ca",
|
||||||
|
"username": "hurricanehrndz"
|
||||||
|
},
|
||||||
|
"committer": {
|
||||||
|
"name": "Carlos Hernandez",
|
||||||
|
"email": "carlos@techbyte.ca",
|
||||||
|
"username": "hurricanehrndz"
|
||||||
|
},
|
||||||
|
"added": [
|
||||||
|
|
||||||
|
],
|
||||||
|
"removed": [
|
||||||
|
|
||||||
|
],
|
||||||
|
"modified": [
|
||||||
|
"snap/snapcraft.yaml"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"head_commit": {
|
||||||
|
"id": "1bf69c32217cc455603ce8aa2b5415d9717f0fa2",
|
||||||
|
"tree_id": "62ea83a2349be8c930c45fdc199f71b08bf5927e",
|
||||||
|
"distinct": true,
|
||||||
|
"message": "Build of latest tag",
|
||||||
|
"timestamp": "2020-09-04T14:05:40Z",
|
||||||
|
"url": "https://github.com/hurricanehrndz/neovim-snap/commit/1bf69c32217cc455603ce8aa2b5415d9717f0fa2",
|
||||||
|
"author": {
|
||||||
|
"name": "Carlos Hernandez",
|
||||||
|
"email": "carlos@techbyte.ca",
|
||||||
|
"username": "hurricanehrndz"
|
||||||
|
},
|
||||||
|
"committer": {
|
||||||
|
"name": "Carlos Hernandez",
|
||||||
|
"email": "carlos@techbyte.ca",
|
||||||
|
"username": "hurricanehrndz"
|
||||||
|
},
|
||||||
|
"added": [
|
||||||
|
|
||||||
|
],
|
||||||
|
"removed": [
|
||||||
|
|
||||||
|
],
|
||||||
|
"modified": [
|
||||||
|
"snap/snapcraft.yaml"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
14
ci/snap/after_success.sh
Executable file
14
ci/snap/after_success.sh
Executable file
@@ -0,0 +1,14 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
set -o pipefail
|
||||||
|
|
||||||
|
|
||||||
|
RESULT_SNAP=$(find ./ -name "*.snap")
|
||||||
|
|
||||||
|
sudo snap install "$RESULT_SNAP" --dangerous --classic
|
||||||
|
|
||||||
|
/snap/bin/nvim --version
|
||||||
|
|
||||||
|
SHA256=$(sha256sum "$RESULT_SNAP")
|
||||||
|
echo "SHA256: ${SHA256} ."
|
39
ci/snap/deploy.sh
Executable file
39
ci/snap/deploy.sh
Executable file
@@ -0,0 +1,39 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
set -o pipefail
|
||||||
|
|
||||||
|
SNAP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
|
WEBHOOK_PAYLOAD="$(cat "${SNAP_DIR}/.snapcraft_payload")"
|
||||||
|
PAYLOAD_SIG="${SECRET_SNAP_SIG}"
|
||||||
|
|
||||||
|
|
||||||
|
snap_release_needed() {
|
||||||
|
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')"
|
||||||
|
git fetch -f --tags
|
||||||
|
git checkout "${last_committed_tag}" 2> /dev/null
|
||||||
|
last_git_release="$(git describe --first-parent 2> /dev/null | perl -lpe 's/v\d.\d.\d-//g')"
|
||||||
|
|
||||||
|
if [[ -z "$(echo $last_snap_release | perl -ne "print if /${last_git_release}.*/")" ]]; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
trigger_snapcraft_webhook() {
|
||||||
|
[[ -n "${PAYLOAD_SIG}" ]] || exit
|
||||||
|
echo "Triggering new snap release via webhook..."
|
||||||
|
curl -X POST \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-H "X-Hub-Signature: sha1=${PAYLOAD_SIG}" \
|
||||||
|
--data "${WEBHOOK_PAYLOAD}" \
|
||||||
|
https://snapcraft.io/nvim/webhook/notify
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if $(snap_release_needed); then
|
||||||
|
echo "New snap release required"
|
||||||
|
trigger_snapcraft_webhook
|
||||||
|
fi
|
11
ci/snap/install.sh
Executable file
11
ci/snap/install.sh
Executable file
@@ -0,0 +1,11 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
set -o pipefail
|
||||||
|
|
||||||
|
sudo apt update
|
||||||
|
sudo usermod -aG lxd $USER
|
||||||
|
sudo /snap/bin/lxd.migrate -yes
|
||||||
|
sudo /snap/bin/lxd waitready
|
||||||
|
sudo /snap/bin/lxd init --auto
|
||||||
|
|
8
ci/snap/script.sh
Executable file
8
ci/snap/script.sh
Executable file
@@ -0,0 +1,8 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
set -o pipefail
|
||||||
|
|
||||||
|
mkdir -p "$CI_BUILD_DIR/snaps-cache"
|
||||||
|
sg lxd -c snapcraft
|
||||||
|
|
BIN
ci/snap/travis_snapcraft.cfg
Normal file
BIN
ci/snap/travis_snapcraft.cfg
Normal file
Binary file not shown.
@@ -4,93 +4,53 @@ include(CheckFunctionExists)
|
|||||||
include(CheckIncludeFiles)
|
include(CheckIncludeFiles)
|
||||||
include(CheckCSourceRuns)
|
include(CheckCSourceRuns)
|
||||||
include(CheckCSourceCompiles)
|
include(CheckCSourceCompiles)
|
||||||
include(TestBigEndian)
|
|
||||||
|
|
||||||
check_c_source_compiles("
|
|
||||||
#include <execinfo.h>
|
|
||||||
int main(void)
|
|
||||||
{
|
|
||||||
void *trace[1];
|
|
||||||
backtrace(trace, 1);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
" HAVE_EXECINFO_BACKTRACE)
|
|
||||||
|
|
||||||
check_c_source_compiles("
|
|
||||||
int main(void)
|
|
||||||
{
|
|
||||||
int a = 42;
|
|
||||||
__builtin_add_overflow(a, a, &a);
|
|
||||||
__builtin_sub_overflow(a, a, &a);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
" HAVE_BUILTIN_ADD_OVERFLOW)
|
|
||||||
|
|
||||||
check_type_size("int" SIZEOF_INT LANGUAGE C)
|
check_type_size("int" SIZEOF_INT LANGUAGE C)
|
||||||
check_type_size("long" SIZEOF_LONG LANGUAGE C)
|
check_type_size("long" SIZEOF_LONG LANGUAGE C)
|
||||||
check_type_size("intmax_t" SIZEOF_INTMAX_T LANGUAGE C)
|
check_type_size("intmax_t" SIZEOF_INTMAX_T LANGUAGE C)
|
||||||
|
check_type_size("int32_t" SIZEOF_INT32_T LANGUAGE C)
|
||||||
check_type_size("size_t" SIZEOF_SIZE_T LANGUAGE C)
|
check_type_size("size_t" SIZEOF_SIZE_T LANGUAGE C)
|
||||||
|
check_type_size("long long" SIZEOF_LONG_LONG LANGUAGE C)
|
||||||
check_type_size("void *" SIZEOF_VOID_PTR LANGUAGE C)
|
check_type_size("void *" SIZEOF_VOID_PTR LANGUAGE C)
|
||||||
|
|
||||||
check_symbol_exists(_NSGetEnviron crt_externs.h HAVE__NSGETENVIRON)
|
check_symbol_exists(_NSGetEnviron crt_externs.h HAVE__NSGETENVIRON)
|
||||||
|
|
||||||
# Headers
|
# Headers
|
||||||
check_include_files(langinfo.h HAVE_LANGINFO_H)
|
check_include_files(langinfo.h HAVE_LANGINFO_H)
|
||||||
|
check_include_files(locale.h HAVE_LOCALE_H)
|
||||||
|
check_include_files(pwd.h HAVE_PWD_H)
|
||||||
check_include_files(strings.h HAVE_STRINGS_H)
|
check_include_files(strings.h HAVE_STRINGS_H)
|
||||||
|
check_include_files(sys/wait.h HAVE_SYS_WAIT_H)
|
||||||
|
if(NOT HAVE_SYS_WAIT_H AND UNIX)
|
||||||
|
# See if_cscope.c
|
||||||
|
message(SEND_ERROR "header sys/wait.h is required for Unix")
|
||||||
|
endif()
|
||||||
check_include_files(sys/utsname.h HAVE_SYS_UTSNAME_H)
|
check_include_files(sys/utsname.h HAVE_SYS_UTSNAME_H)
|
||||||
check_include_files(termios.h HAVE_TERMIOS_H)
|
check_include_files(termios.h HAVE_TERMIOS_H)
|
||||||
check_include_files(sys/uio.h HAVE_SYS_UIO_H)
|
check_include_files(sys/uio.h HAVE_SYS_UIO_H)
|
||||||
check_include_files(sys/sdt.h HAVE_SYS_SDT_H)
|
check_include_files(sys/sdt.h HAVE_SYS_SDT_H)
|
||||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
|
||||||
check_include_files(sys/xattr.h HAVE_XATTR)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Functions
|
# Functions
|
||||||
check_function_exists(fseeko HAVE_FSEEKO)
|
check_function_exists(fseeko HAVE_FSEEKO)
|
||||||
|
check_function_exists(getpwent HAVE_GETPWENT)
|
||||||
|
check_function_exists(getpwnam HAVE_GETPWNAM)
|
||||||
|
check_function_exists(getpwuid HAVE_GETPWUID)
|
||||||
check_function_exists(readv HAVE_READV)
|
check_function_exists(readv HAVE_READV)
|
||||||
|
|
||||||
|
if(Iconv_FOUND)
|
||||||
|
set(HAVE_ICONV 1)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
check_function_exists(opendir HAVE_OPENDIR)
|
||||||
check_function_exists(readlink HAVE_READLINK)
|
check_function_exists(readlink HAVE_READLINK)
|
||||||
|
check_function_exists(setpgid HAVE_SETPGID)
|
||||||
|
check_function_exists(setsid HAVE_SETSID)
|
||||||
|
check_function_exists(sigaction HAVE_SIGACTION)
|
||||||
check_function_exists(strnlen HAVE_STRNLEN)
|
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)
|
||||||
|
|
||||||
check_c_source_compiles("
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <dirent.h>
|
|
||||||
#include <sys/file.h>
|
|
||||||
int main(void)
|
|
||||||
{
|
|
||||||
DIR *dir = opendir(\"dirname\");
|
|
||||||
dirfd(dir);
|
|
||||||
flock(10, LOCK_SH);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
" HAVE_DIRFD_AND_FLOCK)
|
|
||||||
|
|
||||||
|
|
||||||
check_c_source_compiles("
|
|
||||||
#include <pwd.h>
|
|
||||||
int main(void)
|
|
||||||
{
|
|
||||||
getpwent();
|
|
||||||
getpwuid(0);
|
|
||||||
getpwnam(\"root\");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
" HAVE_PWD_FUNCS)
|
|
||||||
|
|
||||||
check_c_source_compiles("
|
|
||||||
#include <intrin.h>
|
|
||||||
|
|
||||||
int main(void)
|
|
||||||
{
|
|
||||||
unsigned long index;
|
|
||||||
unsigned char mask = 0x8000;
|
|
||||||
_BitScanForward64(&index, mask);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
" HAVE_BITSCANFORWARD64)
|
|
||||||
|
|
||||||
if(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
|
if(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
|
||||||
check_c_source_compiles("
|
check_c_source_compiles("
|
||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
@@ -111,14 +71,12 @@ if(HAVE_LANGINFO_H)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
check_include_files("endian.h" HAVE_ENDIAN_H)
|
check_include_files("endian.h" HAVE_ENDIAN_H)
|
||||||
|
check_include_files("sys/endian.h" HAVE_SYS_ENDIAN_H)
|
||||||
|
|
||||||
set(ENDIAN_INCLUDE_FILE "endian.h")
|
set(ENDIAN_INCLUDE_FILE "endian.h")
|
||||||
if(NOT HAVE_ENDIAN_H)
|
if(HAVE_SYS_ENDIAN_H AND NOT HAVE_ENDIAN_H)
|
||||||
check_include_files("sys/endian.h" HAVE_SYS_ENDIAN_H)
|
|
||||||
if (HAVE_SYS_ENDIAN_H)
|
|
||||||
set(ENDIAN_INCLUDE_FILE "sys/endian.h")
|
set(ENDIAN_INCLUDE_FILE "sys/endian.h")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
|
||||||
|
|
||||||
set(SI "#include <stdint.h>\n")
|
set(SI "#include <stdint.h>\n")
|
||||||
set(MS "int main(int argc,char**argv)\n{\n uint64_t i=0x0102030405060708ULL;")
|
set(MS "int main(int argc,char**argv)\n{\n uint64_t i=0x0102030405060708ULL;")
|
||||||
@@ -142,58 +100,64 @@ endif()
|
|||||||
if("${HAVE_BE64TOH_MACROS}" OR "${HAVE_BE64TOH_FUNC}")
|
if("${HAVE_BE64TOH_MACROS}" OR "${HAVE_BE64TOH_FUNC}")
|
||||||
set(HAVE_BE64TOH 1)
|
set(HAVE_BE64TOH 1)
|
||||||
endif()
|
endif()
|
||||||
|
if (NOT "${HAVE_BE64TOH}")
|
||||||
|
if (NOT "${CMAKE_CROSSCOMPILING}")
|
||||||
|
# It is safe to make ORDER_BIG_ENDIAN not defined if
|
||||||
|
# - HAVE_BE64TOH is true. In this case be64toh will be used unconditionally in
|
||||||
|
# any case and ORDER_BIG_ENDIAN will not be examined.
|
||||||
|
# - CMAKE_CROSSCOMPILING *and* HAVE_BE64TOH are both false. In this case
|
||||||
|
# be64toh function which uses cycle and arithmetic operations is used which
|
||||||
|
# will work regardless of endianness. Function is sub-optimal though.
|
||||||
|
check_c_source_runs("
|
||||||
|
${SI}
|
||||||
|
${MS}
|
||||||
|
char *s = (char *) &i;
|
||||||
|
return (
|
||||||
|
s[0] == 0x01
|
||||||
|
&& s[1] == 0x02
|
||||||
|
&& s[2] == 0x03
|
||||||
|
&& s[3] == 0x04
|
||||||
|
&& s[4] == 0x05
|
||||||
|
&& s[5] == 0x06
|
||||||
|
&& s[6] == 0x07
|
||||||
|
&& s[7] == 0x08) ? 0 : 1;
|
||||||
|
${ME}"
|
||||||
|
ORDER_BIG_ENDIAN)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
test_big_endian(ORDER_BIG_ENDIAN)
|
# generate configuration header and update include directories
|
||||||
|
|
||||||
configure_file (
|
configure_file (
|
||||||
"${PROJECT_SOURCE_DIR}/cmake.config/config.h.in"
|
"${PROJECT_SOURCE_DIR}/cmake.config/config.h.in"
|
||||||
"${PROJECT_BINARY_DIR}/cmake.config/auto/config.h"
|
"${PROJECT_BINARY_DIR}/cmake.config/auto/config.h"
|
||||||
)
|
)
|
||||||
|
|
||||||
set(VERSION_STRING "${CMAKE_C_COMPILER} ${CMAKE_C_FLAGS} ")
|
# generate version definitions
|
||||||
|
configure_file (
|
||||||
|
"${PROJECT_SOURCE_DIR}/cmake.config/versiondef.h.in"
|
||||||
|
"${PROJECT_BINARY_DIR}/cmake.config/auto/versiondef.h"
|
||||||
|
)
|
||||||
|
|
||||||
foreach(BUILD_TYPE Debug Release RelWithDebInfo MinSizeRel)
|
# generate pathdef.c
|
||||||
string(TOUPPER ${BUILD_TYPE} BUILD_TYPE_UPPER)
|
find_program(WHOAMI_PROG whoami)
|
||||||
set(GEN_CONFIG "$<CONFIG:${BUILD_TYPE}>")
|
find_program(HOSTNAME_PROG hostname)
|
||||||
|
|
||||||
set(GEN_RHS "${CMAKE_C_FLAGS_${BUILD_TYPE_UPPER}} ")
|
if (DEFINED ENV{USERNAME})
|
||||||
string(APPEND VERSION_STRING "$<${GEN_CONFIG}:${GEN_RHS}>")
|
set(USERNAME $ENV{USERNAME})
|
||||||
|
elseif (NOT DEFINED USERNAME AND EXISTS ${WHOAMI_PROG})
|
||||||
set(GEN_RHS "$<$<BOOL:$<TARGET_PROPERTY:nvim_bin,INTERPROCEDURAL_OPTIMIZATION_${BUILD_TYPE_UPPER}>>:${CMAKE_C_COMPILE_OPTIONS_IPO}>")
|
execute_process(COMMAND ${WHOAMI_PROG}
|
||||||
string(APPEND VERSION_STRING "$<${GEN_CONFIG}:${GEN_RHS}>")
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||||
endforeach()
|
OUTPUT_VARIABLE USERNAME)
|
||||||
|
endif()
|
||||||
string(APPEND VERSION_STRING " ")
|
if (DEFINED ENV{HOSTNAME})
|
||||||
|
set(HOSTNAME $ENV{HOSTNAME})
|
||||||
function(append_target_expression)
|
elseif (EXISTS ${HOSTNAME_PROG})
|
||||||
cmake_parse_arguments(ARG
|
execute_process(COMMAND ${HOSTNAME_PROG}
|
||||||
""
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||||
"PREFIX;PROPERTY"
|
OUTPUT_VARIABLE HOSTNAME)
|
||||||
""
|
|
||||||
${ARGN})
|
|
||||||
|
|
||||||
set(TARGET_EXPRESSION "$<TARGET_PROPERTY:nvim_bin,${ARG_PROPERTY}>")
|
|
||||||
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL 3.15)
|
|
||||||
set(TARGET_EXPRESSION "$<REMOVE_DUPLICATES:${TARGET_EXPRESSION}>")
|
|
||||||
endif()
|
endif()
|
||||||
set(TARGET_EXPRESSION "${ARG_PREFIX}$<JOIN:${TARGET_EXPRESSION}, ${ARG_PREFIX}>")
|
|
||||||
|
|
||||||
set(VERSION_STRING "${VERSION_STRING} ${TARGET_EXPRESSION} " PARENT_SCOPE)
|
|
||||||
endfunction()
|
|
||||||
append_target_expression(PROPERTY COMPILE_OPTIONS)
|
|
||||||
append_target_expression(PROPERTY LINK_OPTIONS)
|
|
||||||
append_target_expression(PREFIX "-D" PROPERTY COMPILE_DEFINITIONS)
|
|
||||||
append_target_expression(PREFIX "-I" PROPERTY INCLUDE_DIRECTORIES)
|
|
||||||
string(REPLACE ";" " " VERSION_STRING "${VERSION_STRING}")
|
|
||||||
string(REPLACE " " " " VERSION_STRING "${VERSION_STRING}")
|
|
||||||
|
|
||||||
configure_file(versiondef.h.in auto/versiondef.h.gen)
|
|
||||||
|
|
||||||
file(GENERATE
|
|
||||||
OUTPUT "${PROJECT_BINARY_DIR}/cmake.config/auto/versiondef-$<CONFIG>.h"
|
|
||||||
INPUT "${PROJECT_BINARY_DIR}/cmake.config/auto/versiondef.h.gen")
|
|
||||||
|
|
||||||
configure_file (
|
configure_file (
|
||||||
"${PROJECT_SOURCE_DIR}/cmake.config/pathdef.h.in"
|
"${PROJECT_SOURCE_DIR}/cmake.config/pathdef.c.in"
|
||||||
"${PROJECT_BINARY_DIR}/cmake.config/auto/pathdef.h"
|
"${PROJECT_BINARY_DIR}/cmake.config/auto/pathdef.c"
|
||||||
ESCAPE_QUOTES)
|
ESCAPE_QUOTES)
|
||||||
|
@@ -1,8 +1,13 @@
|
|||||||
#pragma once
|
#ifndef AUTO_CONFIG_H
|
||||||
|
#define AUTO_CONFIG_H
|
||||||
|
|
||||||
|
#cmakedefine DEBUG
|
||||||
|
|
||||||
#cmakedefine SIZEOF_INT @SIZEOF_INT@
|
#cmakedefine SIZEOF_INT @SIZEOF_INT@
|
||||||
#cmakedefine SIZEOF_INTMAX_T @SIZEOF_INTMAX_T@
|
#cmakedefine SIZEOF_INTMAX_T @SIZEOF_INTMAX_T@
|
||||||
|
#cmakedefine SIZEOF_INT32_T @SIZEOF_INT32_T@
|
||||||
#cmakedefine SIZEOF_LONG @SIZEOF_LONG@
|
#cmakedefine SIZEOF_LONG @SIZEOF_LONG@
|
||||||
|
#cmakedefine SIZEOF_LONG_LONG @SIZEOF_LONG_LONG@
|
||||||
#cmakedefine SIZEOF_SIZE_T @SIZEOF_SIZE_T@
|
#cmakedefine SIZEOF_SIZE_T @SIZEOF_SIZE_T@
|
||||||
|
|
||||||
#if @SIZEOF_VOID_PTR@ == 8
|
#if @SIZEOF_VOID_PTR@ == 8
|
||||||
@@ -16,17 +21,24 @@
|
|||||||
#cmakedefine HAVE__NSGETENVIRON
|
#cmakedefine HAVE__NSGETENVIRON
|
||||||
#cmakedefine HAVE_FD_CLOEXEC
|
#cmakedefine HAVE_FD_CLOEXEC
|
||||||
#cmakedefine HAVE_FSEEKO
|
#cmakedefine HAVE_FSEEKO
|
||||||
|
#cmakedefine HAVE_GETPWENT
|
||||||
|
#cmakedefine HAVE_GETPWNAM
|
||||||
|
#cmakedefine HAVE_GETPWUID
|
||||||
|
#cmakedefine HAVE_ICONV
|
||||||
#cmakedefine HAVE_LANGINFO_H
|
#cmakedefine HAVE_LANGINFO_H
|
||||||
|
#cmakedefine HAVE_LOCALE_H
|
||||||
#cmakedefine HAVE_NL_LANGINFO_CODESET
|
#cmakedefine HAVE_NL_LANGINFO_CODESET
|
||||||
#cmakedefine HAVE_NL_MSG_CAT_CNTR
|
#cmakedefine HAVE_NL_MSG_CAT_CNTR
|
||||||
#cmakedefine HAVE_PWD_FUNCS
|
#cmakedefine HAVE_PWD_H
|
||||||
#cmakedefine HAVE_READLINK
|
#cmakedefine HAVE_READLINK
|
||||||
|
#cmakedefine HAVE_SETPGID
|
||||||
|
#cmakedefine HAVE_SETSID
|
||||||
|
#cmakedefine HAVE_SIGACTION
|
||||||
#cmakedefine HAVE_STRNLEN
|
#cmakedefine HAVE_STRNLEN
|
||||||
#cmakedefine HAVE_STRCASECMP
|
#cmakedefine HAVE_STRCASECMP
|
||||||
#cmakedefine HAVE_STRINGS_H
|
#cmakedefine HAVE_STRINGS_H
|
||||||
#cmakedefine HAVE_STRNCASECMP
|
#cmakedefine HAVE_STRNCASECMP
|
||||||
#cmakedefine HAVE_STRPTIME
|
#cmakedefine HAVE_STRPTIME
|
||||||
#cmakedefine HAVE_XATTR
|
|
||||||
#cmakedefine HAVE_SYS_SDT_H
|
#cmakedefine HAVE_SYS_SDT_H
|
||||||
#cmakedefine HAVE_SYS_UTSNAME_H
|
#cmakedefine HAVE_SYS_UTSNAME_H
|
||||||
#cmakedefine HAVE_SYS_WAIT_H
|
#cmakedefine HAVE_SYS_WAIT_H
|
||||||
@@ -42,9 +54,14 @@
|
|||||||
# undef HAVE_SYS_UIO_H
|
# undef HAVE_SYS_UIO_H
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
#cmakedefine HAVE_DIRFD_AND_FLOCK
|
|
||||||
#cmakedefine HAVE_FORKPTY
|
#cmakedefine HAVE_FORKPTY
|
||||||
|
|
||||||
|
#cmakedefine FEAT_TUI
|
||||||
|
|
||||||
|
#ifndef UNIT_TESTING
|
||||||
|
#cmakedefine LOG_LIST_ACTIONS
|
||||||
|
#endif
|
||||||
|
|
||||||
#cmakedefine HAVE_BE64TOH
|
#cmakedefine HAVE_BE64TOH
|
||||||
#cmakedefine ORDER_BIG_ENDIAN
|
#cmakedefine ORDER_BIG_ENDIAN
|
||||||
#define ENDIAN_INCLUDE_FILE <@ENDIAN_INCLUDE_FILE@>
|
#define ENDIAN_INCLUDE_FILE <@ENDIAN_INCLUDE_FILE@>
|
||||||
@@ -52,4 +69,5 @@
|
|||||||
#cmakedefine HAVE_EXECINFO_BACKTRACE
|
#cmakedefine HAVE_EXECINFO_BACKTRACE
|
||||||
#cmakedefine HAVE_BUILTIN_ADD_OVERFLOW
|
#cmakedefine HAVE_BUILTIN_ADD_OVERFLOW
|
||||||
#cmakedefine HAVE_WIMPLICIT_FALLTHROUGH_FLAG
|
#cmakedefine HAVE_WIMPLICIT_FALLTHROUGH_FLAG
|
||||||
#cmakedefine HAVE_BITSCANFORWARD64
|
|
||||||
|
#endif // AUTO_CONFIG_H
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,30 +0,0 @@
|
|||||||
[
|
|
||||||
{ ref: "c99.imp" },
|
|
||||||
{ ref: "posix.imp" },
|
|
||||||
|
|
||||||
{ symbol: [ "FUNC_ATTR_ALLOC_ALIGN", private, '"nvim/func_attr.h"', public ] },
|
|
||||||
{ symbol: [ "FUNC_ATTR_ALLOC_SIZE", private, '"nvim/func_attr.h"', public ] },
|
|
||||||
{ symbol: [ "FUNC_ATTR_ALLOC_SIZE_PROD", private, '"nvim/func_attr.h"', public ] },
|
|
||||||
{ symbol: [ "FUNC_ATTR_ALWAYS_INLINE", private, '"nvim/func_attr.h"', public ] },
|
|
||||||
{ symbol: [ "FUNC_ATTR_CONST", private, '"nvim/func_attr.h"', public ] },
|
|
||||||
{ symbol: [ "FUNC_ATTR_MALLOC", private, '"nvim/func_attr.h"', public ] },
|
|
||||||
{ symbol: [ "FUNC_ATTR_NONNULL_ALL", private, '"nvim/func_attr.h"', public ] },
|
|
||||||
{ symbol: [ "FUNC_ATTR_NONNULL_ARG", private, '"nvim/func_attr.h"', public ] },
|
|
||||||
{ symbol: [ "FUNC_ATTR_NONNULL_RET", private, '"nvim/func_attr.h"', public ] },
|
|
||||||
{ symbol: [ "FUNC_ATTR_NORETURN", private, '"nvim/func_attr.h"', public ] },
|
|
||||||
{ symbol: [ "FUNC_ATTR_NO_SANITIZE_ADDRESS", private, '"nvim/func_attr.h"', public ] },
|
|
||||||
{ symbol: [ "FUNC_ATTR_NO_SANITIZE_UNDEFINED", private, '"nvim/func_attr.h"', public ] },
|
|
||||||
{ symbol: [ "FUNC_ATTR_PRINTF", private, '"nvim/func_attr.h"', public ] },
|
|
||||||
{ symbol: [ "FUNC_ATTR_PURE", private, '"nvim/func_attr.h"', public ] },
|
|
||||||
{ symbol: [ "FUNC_ATTR_UNUSED", private, '"nvim/func_attr.h"', public ] },
|
|
||||||
{ symbol: [ "FUNC_ATTR_WARN_UNUSED_RESULT", private, '"nvim/func_attr.h"', public ] },
|
|
||||||
{ symbol: [ "MAX", private, '"nvim/macros_defs.h"', public ] },
|
|
||||||
{ symbol: [ "MIN", private, '"nvim/macros_defs.h"', public ] },
|
|
||||||
{ symbol: [ "extern_proc", private, '<uv.h>', public ] },
|
|
||||||
{ symbol: [ "iovec", private, '<sys/uio.h>', public ] },
|
|
||||||
{ symbol: [ "ssize_t", private, '<uv.h>', public ] },
|
|
||||||
|
|
||||||
{ include: [ '<uv/unix.h>', private, '<uv.h>', public ] },
|
|
||||||
]
|
|
||||||
|
|
||||||
# vim: set ft=toml:
|
|
@@ -1,33 +0,0 @@
|
|||||||
[
|
|
||||||
{ include: [ "<arm/limits.h>", private, "<limits.h>", public ] },
|
|
||||||
{ include: [ "<asm/ioctls.h>", private, "<bits/ioctls.h>", private ] },
|
|
||||||
{ include: [ "<bits/termios-c_lflag.h>", private, "<termios.h>", public ] },
|
|
||||||
{ include: [ "<bits/termios-struct.h>", private, "<termios.h>", public ] },
|
|
||||||
{ include: [ "<sys/errno.h>", private, "<errno.h>", public ] },
|
|
||||||
{ include: [ "<sys/fcntl.h>", private, "<fcntl.h>", public ] },
|
|
||||||
{ include: [ "<sys/signal.h>", private, "<signal.h>", public ] },
|
|
||||||
{ include: [ "<sys/termios.h>", private, "<termios.h>", public ] },
|
|
||||||
{ include: [ '<asm/errno-base.h>', private, '<errno.h>', public ] },
|
|
||||||
{ include: [ '<asm/errno.h>', private, '<errno.h>', public ] },
|
|
||||||
{ include: [ '<bits/termios-c_cc.h>', private, '<termios.h>', public ] },
|
|
||||||
{ include: [ '<bits/termios-c_cflag.h>', private, '<termios.h>', public ] },
|
|
||||||
{ include: [ '<bits/termios-c_iflag.h>', private, '<termios.h>', public ] },
|
|
||||||
{ include: [ '<bits/termios-c_oflag.h>', private, '<termios.h>', public ] },
|
|
||||||
{ include: [ '<sys/ttycom.h>', private, '<sys/ioctl.h>', public ] },
|
|
||||||
{ include: [ '<sys/unistd.h>', private, '<unistd.h>', private ] },
|
|
||||||
|
|
||||||
{ symbol: ["SOCK_STREAM", private, "<sys/socket.h>", public ] },
|
|
||||||
{ symbol: ["SSIZE_MAX", private, "<limits.h>", public ] },
|
|
||||||
{ symbol: ["S_IREAD", private, "<sys/stat.h>", public ] },
|
|
||||||
{ symbol: ["S_IWRITE", private, "<sys/stat.h>", public ] },
|
|
||||||
{ symbol: ["_POSIX_VDISABLE", private, "<unistd.h>", private ] },
|
|
||||||
{ symbol: ["flock", private, "<sys/file.h>", public ] },
|
|
||||||
{ symbol: ["iovec", private, "<sys/uio.h>", public ] },
|
|
||||||
{ symbol: ["mode_t", private, "<sys/types.h>", public ] },
|
|
||||||
{ symbol: ["ntohs", private, "<arpa/inet.h>", public ] },
|
|
||||||
{ symbol: ["pthread_sigmask", private, "<signal.h>", public ] },
|
|
||||||
{ symbol: ["sigset_t", private, "<signal.h>", public ] },
|
|
||||||
{ symbol: ["uid_t", private, "<sys/types.h>", public ] },
|
|
||||||
]
|
|
||||||
|
|
||||||
# vim: set ft=toml:
|
|
8
cmake.config/pathdef.c.in
Normal file
8
cmake.config/pathdef.c.in
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
// This is an open source non-commercial project. Dear PVS-Studio, please check
|
||||||
|
// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
|
||||||
|
#include "${PROJECT_SOURCE_DIR}/src/nvim/vim.h"
|
||||||
|
char *default_vim_dir = "${CMAKE_INSTALL_FULL_DATAROOTDIR}/nvim";
|
||||||
|
char *default_vimruntime_dir = "";
|
||||||
|
char *default_lib_dir = "${CMAKE_INSTALL_FULL_LIBDIR}/nvim";
|
||||||
|
char_u *compiled_user = (char_u *)"${USERNAME}";
|
||||||
|
char_u *compiled_sys = (char_u *)"${HOSTNAME}";
|
@@ -1,3 +0,0 @@
|
|||||||
char *default_vim_dir = "${CMAKE_INSTALL_FULL_DATAROOTDIR}/nvim";
|
|
||||||
char *default_vimruntime_dir = "";
|
|
||||||
char *default_lib_dir = "${CMAKE_INSTALL_FULL_LIBDIR}/nvim";
|
|
@@ -11,7 +11,11 @@
|
|||||||
# include "auto/versiondef_git.h"
|
# include "auto/versiondef_git.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define NVIM_VERSION_CFLAGS "${VERSION_STRING}"
|
#define NVIM_API_LEVEL @NVIM_API_LEVEL@
|
||||||
#define NVIM_VERSION_BUILD_TYPE "$<CONFIG>"
|
#define NVIM_API_LEVEL_COMPAT @NVIM_API_LEVEL_COMPAT@
|
||||||
|
#define NVIM_API_PRERELEASE @NVIM_API_PRERELEASE@
|
||||||
|
|
||||||
|
#define NVIM_VERSION_CFLAGS "@NVIM_VERSION_CFLAGS@"
|
||||||
|
#define NVIM_VERSION_BUILD_TYPE "@NVIM_VERSION_BUILD_TYPE@"
|
||||||
|
|
||||||
#endif // AUTO_VERSIONDEF_H
|
#endif // AUTO_VERSIONDEF_H
|
||||||
|
@@ -1,42 +1,59 @@
|
|||||||
# This is not meant to be included by the top-level.
|
# This is not meant to be included by the top-level.
|
||||||
cmake_minimum_required (VERSION 3.13)
|
cmake_minimum_required (VERSION 3.10)
|
||||||
project(NVIM_DEPS C)
|
project(NVIM_DEPS C)
|
||||||
|
|
||||||
if(POLICY CMP0135)
|
|
||||||
cmake_policy(SET CMP0135 NEW)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Point CMake at any custom modules we may ship
|
# Point CMake at any custom modules we may ship
|
||||||
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" "${PROJECT_SOURCE_DIR}/../cmake")
|
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" "${PROJECT_SOURCE_DIR}/../cmake")
|
||||||
|
|
||||||
include(CheckCCompilerFlag)
|
include(CheckCCompilerFlag)
|
||||||
include(ExternalProject)
|
|
||||||
include(FindPackageHandleStandardArgs)
|
|
||||||
|
|
||||||
include(Deps)
|
|
||||||
include(Find)
|
|
||||||
include(Util)
|
include(Util)
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
get_property(isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
||||||
# User settings
|
if(NOT isMultiConfig)
|
||||||
#-------------------------------------------------------------------------------
|
set(BUILD_TYPE_STRING -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE})
|
||||||
|
endif()
|
||||||
|
|
||||||
set(DEPS_IGNORE_SHA FALSE)
|
set_default_buildtype()
|
||||||
|
|
||||||
|
set(DEFAULT_MAKE_CFLAGS CFLAGS+=-g)
|
||||||
|
|
||||||
|
check_c_compiler_flag(-Og HAS_OG_FLAG)
|
||||||
|
if(HAS_OG_FLAG)
|
||||||
|
set(DEFAULT_MAKE_CFLAGS CFLAGS+=-Og ${DEFAULT_MAKE_CFLAGS})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
|
||||||
|
# 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
|
||||||
|
# "/usr/include" as "/_usr/include".
|
||||||
|
# This check is also performed in the root CMakeLists.txt
|
||||||
|
# https://github.com/neovim/neovim/pull/14745#issuecomment-860201794
|
||||||
|
set(DEPS_INSTALL_DIR "${CMAKE_BINARY_DIR}/_usr" CACHE PATH "Dependencies install directory.")
|
||||||
|
else()
|
||||||
|
set(DEPS_INSTALL_DIR "${CMAKE_BINARY_DIR}/usr" CACHE PATH "Dependencies install directory.")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(DEPS_BIN_DIR "${DEPS_INSTALL_DIR}/bin" CACHE PATH "Dependencies binary install directory.")
|
||||||
|
set(DEPS_LIB_DIR "${DEPS_INSTALL_DIR}/lib" CACHE PATH "Dependencies library install directory.")
|
||||||
|
set(DEPS_BUILD_DIR "${CMAKE_BINARY_DIR}/build" CACHE PATH "Dependencies build directory.")
|
||||||
|
set(DEPS_DOWNLOAD_DIR "${DEPS_BUILD_DIR}/downloads" CACHE PATH "Dependencies download directory.")
|
||||||
|
|
||||||
# Options
|
|
||||||
option(USE_BUNDLED "Use bundled dependencies." ON)
|
option(USE_BUNDLED "Use bundled dependencies." ON)
|
||||||
|
|
||||||
option(USE_BUNDLED_LIBUV "Use the bundled libuv." ${USE_BUNDLED})
|
|
||||||
option(USE_BUNDLED_LIBVTERM "Use the bundled libvterm." ${USE_BUNDLED})
|
|
||||||
option(USE_BUNDLED_LPEG "Use the bundled lpeg." ${USE_BUNDLED})
|
|
||||||
# PUC Lua is only used for tests, unless explicitly requested.
|
|
||||||
option(USE_BUNDLED_LUA "Use the bundled version of lua." OFF)
|
|
||||||
option(USE_BUNDLED_LUAJIT "Use the bundled version of luajit." ${USE_BUNDLED})
|
|
||||||
option(USE_BUNDLED_LUV "Use the bundled version of luv." ${USE_BUNDLED})
|
|
||||||
option(USE_BUNDLED_MSGPACK "Use the bundled msgpack." ${USE_BUNDLED})
|
|
||||||
option(USE_BUNDLED_TS "Use the bundled treesitter runtime." ${USE_BUNDLED})
|
|
||||||
option(USE_BUNDLED_TS_PARSERS "Use the bundled treesitter parsers." ${USE_BUNDLED})
|
|
||||||
option(USE_BUNDLED_UNIBILIUM "Use the bundled unibilium." ${USE_BUNDLED})
|
option(USE_BUNDLED_UNIBILIUM "Use the bundled unibilium." ${USE_BUNDLED})
|
||||||
|
option(USE_BUNDLED_LIBTERMKEY "Use the bundled libtermkey." ${USE_BUNDLED})
|
||||||
|
option(USE_BUNDLED_LIBVTERM "Use the bundled libvterm." ${USE_BUNDLED})
|
||||||
|
option(USE_BUNDLED_LIBUV "Use the bundled libuv." ${USE_BUNDLED})
|
||||||
|
option(USE_BUNDLED_MSGPACK "Use the bundled msgpack." ${USE_BUNDLED})
|
||||||
|
option(USE_BUNDLED_LUAJIT "Use the bundled version of luajit." ${USE_BUNDLED})
|
||||||
|
option(USE_BUNDLED_LUAROCKS "Use the bundled version of luarocks." ${USE_BUNDLED})
|
||||||
|
option(USE_BUNDLED_LUV "Use the bundled version of luv." ${USE_BUNDLED})
|
||||||
|
#XXX(tarruda): Lua is only used for debugging the functional test client, no
|
||||||
|
# build it unless explicitly requested
|
||||||
|
option(USE_BUNDLED_LUA "Use the bundled version of lua." OFF)
|
||||||
|
option(USE_BUNDLED_TS_PARSERS "Use the bundled treesitter parsers." ${USE_BUNDLED})
|
||||||
|
option(USE_BUNDLED_TS "Use the bundled treesitter runtime." ${USE_BUNDLED})
|
||||||
|
|
||||||
if(USE_BUNDLED AND MSVC)
|
if(USE_BUNDLED AND MSVC)
|
||||||
option(USE_BUNDLED_GETTEXT "Use the bundled version of gettext." ON)
|
option(USE_BUNDLED_GETTEXT "Use the bundled version of gettext." ON)
|
||||||
option(USE_BUNDLED_LIBICONV "Use the bundled version of libiconv." ON)
|
option(USE_BUNDLED_LIBICONV "Use the bundled version of libiconv." ON)
|
||||||
@@ -47,55 +64,169 @@ endif()
|
|||||||
|
|
||||||
option(USE_EXISTING_SRC_DIR "Skip download of deps sources in case of existing source directory." OFF)
|
option(USE_EXISTING_SRC_DIR "Skip download of deps sources in case of existing source directory." OFF)
|
||||||
|
|
||||||
set_default_buildtype(Release)
|
find_package(Git)
|
||||||
get_property(isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
if(NOT Git_FOUND)
|
||||||
if(NOT isMultiConfig)
|
message(FATAL_ERROR "Git is required to apply patches.")
|
||||||
list(APPEND DEPS_CMAKE_ARGS -D CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE})
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(DEFAULT_MAKE_CFLAGS CFLAGS+=-g)
|
if(UNIX)
|
||||||
|
find_program(MAKE_PRG NAMES gmake make)
|
||||||
check_c_compiler_flag(-Og HAS_OG_FLAG)
|
if(MAKE_PRG)
|
||||||
if(HAS_OG_FLAG)
|
execute_process(
|
||||||
set(DEFAULT_MAKE_CFLAGS CFLAGS+=-Og ${DEFAULT_MAKE_CFLAGS})
|
COMMAND "${MAKE_PRG}" --version
|
||||||
|
OUTPUT_VARIABLE MAKE_VERSION_INFO)
|
||||||
|
if(NOT "${OUTPUT_VARIABLE}" MATCHES ".*GNU.*")
|
||||||
|
unset(MAKE_PRG)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
if(NOT MAKE_PRG)
|
||||||
|
message(FATAL_ERROR "GNU Make is required to build the dependencies.")
|
||||||
|
else()
|
||||||
|
message(STATUS "Found GNU Make at ${MAKE_PRG}")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(DEPS_INCLUDE_FLAGS "-I${DEPS_INSTALL_DIR}/include -I${DEPS_INSTALL_DIR}/include/luajit-2.1")
|
# When using make, use the $(MAKE) variable to avoid warning about the job
|
||||||
|
# server.
|
||||||
|
if(CMAKE_GENERATOR MATCHES "Makefiles")
|
||||||
|
set(MAKE_PRG "$(MAKE)")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(MINGW AND CMAKE_GENERATOR MATCHES "Ninja")
|
||||||
|
find_program(MAKE_PRG NAMES mingw32-make)
|
||||||
|
if(NOT MAKE_PRG)
|
||||||
|
message(FATAL_ERROR "GNU Make for mingw32 is required to build the dependencies.")
|
||||||
|
else()
|
||||||
|
message(STATUS "Found GNU Make for mingw32: ${MAKE_PRG}")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(CMAKE_C_COMPILER_ARG1)
|
||||||
|
set(DEPS_C_COMPILER "${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1}")
|
||||||
|
else()
|
||||||
|
set(DEPS_C_COMPILER "${CMAKE_C_COMPILER}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(CMAKE_CXX_COMPILER)
|
||||||
|
set(DEPS_CXX_COMPILER "${CMAKE_CXX_COMPILER}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(CMAKE_OSX_SYSROOT)
|
||||||
|
set(DEPS_C_COMPILER "${DEPS_C_COMPILER} -isysroot${CMAKE_OSX_SYSROOT}")
|
||||||
|
if(DEPS_CXX_COMPILER)
|
||||||
|
set(DEPS_CXX_COMPILER "${DEPS_CXX_COMPILER} -isysroot${CMAKE_OSX_SYSROOT}")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(CMAKE_OSX_ARCHITECTURES)
|
||||||
|
string(REPLACE ";" "|" CMAKE_OSX_ARCHITECTURES_ALT_SEP "${CMAKE_OSX_ARCHITECTURES}")
|
||||||
|
# The LuaJIT build does not like being passed multiple `-arch` flags
|
||||||
|
# so we handle a universal build the old-fashioned way.
|
||||||
|
set(LUAJIT_C_COMPILER "${DEPS_C_COMPILER}")
|
||||||
|
foreach(ARCH IN LISTS CMAKE_OSX_ARCHITECTURES)
|
||||||
|
set(DEPS_C_COMPILER "${DEPS_C_COMPILER} -arch ${ARCH}")
|
||||||
|
if(DEPS_CXX_COMPILER)
|
||||||
|
set(DEPS_CXX_COMPILER "${DEPS_CXX_COMPILER} -arch ${ARCH}")
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
endif()
|
||||||
|
|
||||||
# If the macOS deployment target is not set manually (via $MACOSX_DEPLOYMENT_TARGET),
|
# If the macOS deployment target is not set manually (via $MACOSX_DEPLOYMENT_TARGET),
|
||||||
# fall back to local system version. Needs to be done here and in top-level CMakeLists.txt.
|
# fall back to local system version. Needs to be done here and in top-level CMakeLists.txt.
|
||||||
if(APPLE)
|
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
||||||
if(NOT CMAKE_OSX_DEPLOYMENT_TARGET)
|
if(NOT CMAKE_OSX_DEPLOYMENT_TARGET)
|
||||||
execute_process(COMMAND sw_vers -productVersion
|
execute_process(COMMAND sw_vers -productVersion
|
||||||
OUTPUT_VARIABLE MACOS_VERSION
|
OUTPUT_VARIABLE MACOS_VERSION
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
set(CMAKE_OSX_DEPLOYMENT_TARGET "${MACOS_VERSION}")
|
set(CMAKE_OSX_DEPLOYMENT_TARGET "${MACOS_VERSION}")
|
||||||
endif()
|
endif()
|
||||||
message(STATUS "Using deployment target ${CMAKE_OSX_DEPLOYMENT_TARGET}")
|
message("-- Using deployment target ${CMAKE_OSX_DEPLOYMENT_TARGET}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(USE_BUNDLED_LUAJIT)
|
set(HOSTDEPS_INSTALL_DIR "${DEPS_INSTALL_DIR}")
|
||||||
set(LUA_ENGINE LuaJit)
|
set(HOSTDEPS_BIN_DIR "${DEPS_BIN_DIR}")
|
||||||
elseif(USE_BUNDLED_LUA)
|
set(HOSTDEPS_LIB_DIR "${DEPS_LIB_DIR}")
|
||||||
set(LUA_ENGINE Lua)
|
set(HOSTDEPS_C_COMPILER "${DEPS_C_COMPILER}")
|
||||||
else()
|
set(HOSTDEPS_CXX_COMPILER "${DEPS_CXX_COMPILER}")
|
||||||
find_package(Luajit)
|
|
||||||
find_package(Lua 5.1 EXACT)
|
include(ExternalProject)
|
||||||
if(LUAJIT_FOUND)
|
|
||||||
set(LUA_ENGINE LuaJit)
|
set(LIBUV_URL https://github.com/libuv/libuv/archive/v1.44.2.tar.gz)
|
||||||
string(APPEND DEPS_INCLUDE_FLAGS " -I${LUAJIT_INCLUDE_DIR}")
|
set(LIBUV_SHA256 e6e2ba8b4c349a4182a33370bb9be5e23c51b32efb9b9e209d0e8556b73a48da)
|
||||||
elseif(LUA_FOUND)
|
|
||||||
set(LUA_ENGINE Lua)
|
set(MSGPACK_URL https://github.com/msgpack/msgpack-c/releases/download/c-4.0.0/msgpack-c-4.0.0.tar.gz)
|
||||||
string(APPEND DEPS_INCLUDE_FLAGS " -I${LUA_INCLUDE_DIR}")
|
set(MSGPACK_SHA256 420fe35e7572f2a168d17e660ef981a589c9cbe77faa25eb34a520e1fcc032c8)
|
||||||
else()
|
|
||||||
message(FATAL_ERROR "Could not find system lua or luajit")
|
# https://github.com/LuaJIT/LuaJIT/tree/v2.1
|
||||||
endif()
|
set(LUAJIT_URL https://github.com/LuaJIT/LuaJIT/archive/633f265f67f322cbe2c5fd11d3e46d968ac220f7.tar.gz)
|
||||||
endif()
|
set(LUAJIT_SHA256 2681f0a6f624a64a8dfb70a5a377d494daf38960442c547d9c468674c1afa3c2)
|
||||||
|
|
||||||
|
set(LUA_URL https://www.lua.org/ftp/lua-5.1.5.tar.gz)
|
||||||
|
set(LUA_SHA256 2640fc56a795f29d28ef15e13c34a47e223960b0240e8cb0a82d9b0738695333)
|
||||||
|
|
||||||
|
set(LUAROCKS_URL https://github.com/luarocks/luarocks/archive/v3.8.0.tar.gz)
|
||||||
|
set(LUAROCKS_SHA256 ab6612ca9ab87c6984871d2712d05525775e8b50172701a0a1cabddf76de2be7)
|
||||||
|
|
||||||
|
set(UNIBILIUM_URL https://github.com/neovim/unibilium/archive/92d929f.tar.gz)
|
||||||
|
set(UNIBILIUM_SHA256 29815283c654277ef77a3adcc8840db79ddbb20a0f0b0c8f648bd8cd49a02e4b)
|
||||||
|
|
||||||
|
set(LIBTERMKEY_URL https://www.leonerd.org.uk/code/libtermkey/libtermkey-0.22.tar.gz)
|
||||||
|
set(LIBTERMKEY_SHA256 6945bd3c4aaa83da83d80a045c5563da4edd7d0374c62c0d35aec09eb3014600)
|
||||||
|
|
||||||
|
set(LIBVTERM_URL https://www.leonerd.org.uk/code/libvterm/libvterm-0.3.tar.gz)
|
||||||
|
set(LIBVTERM_SHA256 61eb0d6628c52bdf02900dfd4468aa86a1a7125228bab8a67328981887483358)
|
||||||
|
|
||||||
|
set(LUV_VERSION 1.44.2-1)
|
||||||
|
set(LUV_URL https://github.com/luvit/luv/archive/1.44.2-1.tar.gz)
|
||||||
|
set(LUV_SHA256 f8c69908e17ec8ab370253d1508e23deaecfc0c4752d2efb77e427e579501104)
|
||||||
|
|
||||||
|
set(LUA_COMPAT53_URL https://github.com/keplerproject/lua-compat-5.3/archive/v0.9.tar.gz)
|
||||||
|
set(LUA_COMPAT53_SHA256 ad05540d2d96a48725bb79a1def35cf6652a4e2ec26376e2617c8ce2baa6f416)
|
||||||
|
|
||||||
|
# cat.exe curl.exe curl-ca-bundle.crt diff.exe tee.exe xxd.exe
|
||||||
|
set(WINTOOLS_URL https://github.com/neovim/deps/raw/c1e7dd8de9e1b18d11dcfa0a192cd029262e5303/opt/win32tools.zip)
|
||||||
|
set(WINTOOLS_SHA256 3c4c490a3d392ceeb1347cb77cc821a31900b688a2189276d3a1131a3f21daf1)
|
||||||
|
|
||||||
|
set(WINGUI_URL https://github.com/equalsraf/neovim-qt/releases/download/v0.2.17/neovim-qt.zip)
|
||||||
|
set(WINGUI_SHA256 502e386eef677c2c2e0c11d8cbb27f3e12b4d96818369417e8da4129c4580c25)
|
||||||
|
|
||||||
|
set(WIN32YANK_X86_URL https://github.com/equalsraf/win32yank/releases/download/v0.0.4/win32yank-x86.zip)
|
||||||
|
set(WIN32YANK_X86_SHA256 62f34e5a46c5d4a7b3f3b512e1ff7b77fedd432f42581cbe825233a996eed62c)
|
||||||
|
set(WIN32YANK_X86_64_URL https://github.com/equalsraf/win32yank/releases/download/v0.0.4/win32yank-x64.zip)
|
||||||
|
set(WIN32YANK_X86_64_SHA256 33a747a92da60fb65e668edbf7661d3d902411a2d545fe9dc08623cecd142a20)
|
||||||
|
|
||||||
|
set(GETTEXT_URL https://ftp.gnu.org/pub/gnu/gettext/gettext-0.20.1.tar.gz)
|
||||||
|
set(GETTEXT_SHA256 66415634c6e8c3fa8b71362879ec7575e27da43da562c798a8a2f223e6e47f5c)
|
||||||
|
|
||||||
|
set(LIBICONV_URL https://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.15.tar.gz)
|
||||||
|
set(LIBICONV_SHA256 ccf536620a45458d26ba83887a983b96827001e92a13847b45e4925cc8913178)
|
||||||
|
|
||||||
|
set(TREESITTER_C_URL https://github.com/tree-sitter/tree-sitter-c/archive/v0.20.2.tar.gz)
|
||||||
|
set(TREESITTER_C_SHA256 af66fde03feb0df4faf03750102a0d265b007e5d957057b6b293c13116a70af2 )
|
||||||
|
|
||||||
|
set(TREESITTER_LUA_URL https://github.com/MunifTanjim/tree-sitter-lua/archive/v0.0.13.tar.gz)
|
||||||
|
set(TREESITTER_LUA_SHA256 564594fe0ffd2f2fb3578a15019b723e1bc94ac82cb6a0103a6b3b9ddcc6f315)
|
||||||
|
|
||||||
|
set(TREESITTER_VIM_URL https://github.com/vigoux/tree-sitter-viml/archive/v0.2.0.tar.gz)
|
||||||
|
set(TREESITTER_VIM_SHA256 608dcc31a7948cb66ae7f45494620e2e9face1af75598205541f80d782ec4501)
|
||||||
|
|
||||||
|
set(TREESITTER_HELP_URL https://github.com/neovim/tree-sitter-vimdoc/archive/ce20f13c3f12506185754888feaae3f2ad54c287.tar.gz)
|
||||||
|
set(TREESITTER_HELP_SHA256 2b8b166438cce66064aab56a744430b1f44871f43e47f70b51246d14bb826609)
|
||||||
|
|
||||||
|
set(TREESITTER_URL https://github.com/tree-sitter/tree-sitter/archive/v0.20.7.tar.gz)
|
||||||
|
set(TREESITTER_SHA256 b355e968ec2d0241bbd96748e00a9038f83968f85d822ecb9940cbe4c42e182e)
|
||||||
|
|
||||||
if(USE_BUNDLED_UNIBILIUM)
|
if(USE_BUNDLED_UNIBILIUM)
|
||||||
include(BuildUnibilium)
|
include(BuildUnibilium)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(USE_BUNDLED_LIBTERMKEY)
|
||||||
|
include(BuildLibtermkey)
|
||||||
|
if(USE_BUNDLED_UNIBILIUM)
|
||||||
|
add_dependencies(libtermkey unibilium)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
if(USE_BUNDLED_LIBVTERM)
|
if(USE_BUNDLED_LIBVTERM)
|
||||||
include(BuildLibvterm)
|
include(BuildLibvterm)
|
||||||
endif()
|
endif()
|
||||||
@@ -116,12 +247,12 @@ if(USE_BUNDLED_LUA)
|
|||||||
include(BuildLua)
|
include(BuildLua)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(USE_BUNDLED_LUV)
|
if(USE_BUNDLED_LUAROCKS)
|
||||||
include(BuildLuv)
|
include(BuildLuarocks)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(USE_BUNDLED_LPEG)
|
if(USE_BUNDLED_LUV)
|
||||||
include(BuildLpeg)
|
include(BuildLuv)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(USE_BUNDLED_GETTEXT)
|
if(USE_BUNDLED_GETTEXT)
|
||||||
@@ -143,10 +274,40 @@ endif()
|
|||||||
if(WIN32)
|
if(WIN32)
|
||||||
include(GetBinaryDeps)
|
include(GetBinaryDeps)
|
||||||
|
|
||||||
GetExecutable(TARGET cat)
|
GetBinaryDep(TARGET wintools
|
||||||
GetExecutable(TARGET tee)
|
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory . ${DEPS_INSTALL_DIR}/bin)
|
||||||
GetExecutable(TARGET xxd)
|
|
||||||
|
|
||||||
GetBinaryDep(TARGET win32yank_X86_64
|
GetBinaryDep(TARGET wingui
|
||||||
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy win32yank.exe ${DEPS_BIN_DIR})
|
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory bin ${DEPS_INSTALL_DIR}/bin
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy_directory share ${DEPS_INSTALL_DIR}/share)
|
||||||
|
|
||||||
|
include(TargetArch)
|
||||||
|
GetBinaryDep(TARGET "win32yank_${TARGET_ARCH}"
|
||||||
|
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy win32yank.exe ${DEPS_INSTALL_DIR}/bin)
|
||||||
|
|
||||||
|
if("${TARGET_ARCH}" STREQUAL "X86_64")
|
||||||
|
set(TARGET_ARCH x64)
|
||||||
|
elseif(TARGET_ARCH STREQUAL "X86")
|
||||||
|
set(TARGET_ARCH ia32)
|
||||||
endif()
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# clean-shared-libraries removes ${DEPS_INSTALL_DIR}/lib/nvim/parser/c.dll,
|
||||||
|
# resulting in MSVC build failure in CI.
|
||||||
|
if (MSVC)
|
||||||
|
set(ALL_DEPS ${THIRD_PARTY_DEPS})
|
||||||
|
else()
|
||||||
|
add_custom_target(clean-shared-libraries
|
||||||
|
COMMAND ${CMAKE_COMMAND}
|
||||||
|
-DREMOVE_FILE_GLOB=${DEPS_INSTALL_DIR}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}*${CMAKE_SHARED_LIBRARY_SUFFIX}*
|
||||||
|
-P ${PROJECT_SOURCE_DIR}/cmake/RemoveFiles.cmake
|
||||||
|
DEPENDS ${THIRD_PARTY_DEPS}
|
||||||
|
)
|
||||||
|
set(ALL_DEPS clean-shared-libraries)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# TODO(justinmk): does anyone use this target?
|
||||||
|
add_custom_target(third-party ALL
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E touch .third-party
|
||||||
|
DEPENDS ${ALL_DEPS}
|
||||||
|
)
|
||||||
|
@@ -1,25 +0,0 @@
|
|||||||
{
|
|
||||||
"version": 3,
|
|
||||||
"configurePresets": [
|
|
||||||
{
|
|
||||||
"name": "base",
|
|
||||||
"generator": "Ninja",
|
|
||||||
"binaryDir": "${sourceDir}/../.deps",
|
|
||||||
"hidden": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "ci",
|
|
||||||
"inherits": ["base"]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "external_deps",
|
|
||||||
"description": "Build neovim with external deps on ubuntu",
|
|
||||||
"cacheVariables": {
|
|
||||||
"USE_BUNDLED":"OFF",
|
|
||||||
"USE_BUNDLED_LIBVTERM":"ON",
|
|
||||||
"USE_BUNDLED_TS":"ON"
|
|
||||||
},
|
|
||||||
"inherits": ["base"]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
@@ -1,18 +1,35 @@
|
|||||||
if(MSVC)
|
if(MSVC)
|
||||||
get_externalproject_options(gettext ${DEPS_IGNORE_SHA})
|
|
||||||
ExternalProject_Add(gettext
|
ExternalProject_Add(gettext
|
||||||
|
PREFIX ${DEPS_BUILD_DIR}
|
||||||
|
URL ${GETTEXT_URL}
|
||||||
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/gettext
|
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/gettext
|
||||||
PATCH_COMMAND ${CMAKE_COMMAND} -E copy
|
DOWNLOAD_COMMAND ${CMAKE_COMMAND}
|
||||||
|
-DPREFIX=${DEPS_BUILD_DIR}
|
||||||
|
-DDOWNLOAD_DIR=${DEPS_DOWNLOAD_DIR}/gettext
|
||||||
|
-DURL=${GETTEXT_URL}
|
||||||
|
-DEXPECTED_SHA256=${GETTEXT_SHA256}
|
||||||
|
-DTARGET=gettext
|
||||||
|
-DUSE_EXISTING_SRC_DIR=${USE_EXISTING_SRC_DIR}
|
||||||
|
-P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/DownloadAndExtractFile.cmake
|
||||||
|
CONFIGURE_COMMAND ${CMAKE_COMMAND} -E copy
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/cmake/GettextCMakeLists.txt
|
${CMAKE_CURRENT_SOURCE_DIR}/cmake/GettextCMakeLists.txt
|
||||||
${DEPS_BUILD_DIR}/src/gettext/CMakeLists.txt
|
${DEPS_BUILD_DIR}/src/gettext/CMakeLists.txt
|
||||||
CMAKE_ARGS ${DEPS_CMAKE_ARGS}
|
COMMAND ${CMAKE_COMMAND} ${DEPS_BUILD_DIR}/src/gettext
|
||||||
|
-DCMAKE_INSTALL_PREFIX=${DEPS_INSTALL_DIR}
|
||||||
|
# Pass toolchain
|
||||||
|
-DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN}
|
||||||
|
${BUILD_TYPE_STRING}
|
||||||
|
-DCMAKE_GENERATOR=${CMAKE_GENERATOR}
|
||||||
|
-DCMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM}
|
||||||
-DLIBICONV_INCLUDE_DIRS=${DEPS_INSTALL_DIR}/include
|
-DLIBICONV_INCLUDE_DIRS=${DEPS_INSTALL_DIR}/include
|
||||||
-DLIBICONV_LIBRARIES=${DEPS_LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}libcharset${CMAKE_STATIC_LIBRARY_SUFFIX}$<SEMICOLON>${DEPS_LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}libiconv${CMAKE_STATIC_LIBRARY_SUFFIX}
|
-DLIBICONV_LIBRARIES=${DEPS_LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}libcharset${CMAKE_STATIC_LIBRARY_SUFFIX}$<SEMICOLON>${DEPS_LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}libiconv${CMAKE_STATIC_LIBRARY_SUFFIX}
|
||||||
${EXTERNALPROJECT_OPTIONS})
|
BUILD_COMMAND ${CMAKE_COMMAND} --build . --config $<CONFIG>
|
||||||
|
INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install --config $<CONFIG>)
|
||||||
else()
|
else()
|
||||||
message(FATAL_ERROR "Trying to build gettext in an unsupported system ${CMAKE_SYSTEM_NAME}/${CMAKE_C_COMPILER_ID}")
|
message(FATAL_ERROR "Trying to build gettext in an unsupported system ${CMAKE_SYSTEM_NAME}/${CMAKE_C_COMPILER_ID}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
list(APPEND THIRD_PARTY_DEPS gettext)
|
||||||
if(USE_BUNDLED_LIBICONV)
|
if(USE_BUNDLED_LIBICONV)
|
||||||
add_dependencies(gettext libiconv)
|
add_dependencies(gettext libiconv)
|
||||||
endif()
|
endif()
|
||||||
|
@@ -1,12 +1,30 @@
|
|||||||
if(MSVC)
|
if(MSVC)
|
||||||
get_externalproject_options(libiconv ${DEPS_IGNORE_SHA})
|
|
||||||
ExternalProject_Add(libiconv
|
ExternalProject_Add(libiconv
|
||||||
|
PREFIX ${DEPS_BUILD_DIR}
|
||||||
|
URL ${LIBICONV_URL}
|
||||||
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/libiconv
|
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/libiconv
|
||||||
PATCH_COMMAND ${CMAKE_COMMAND} -E copy
|
DOWNLOAD_COMMAND ${CMAKE_COMMAND}
|
||||||
|
-DPREFIX=${DEPS_BUILD_DIR}
|
||||||
|
-DDOWNLOAD_DIR=${DEPS_DOWNLOAD_DIR}/libiconv
|
||||||
|
-DURL=${LIBICONV_URL}
|
||||||
|
-DEXPECTED_SHA256=${LIBICONV_SHA256}
|
||||||
|
-DTARGET=libiconv
|
||||||
|
-DUSE_EXISTING_SRC_DIR=${USE_EXISTING_SRC_DIR}
|
||||||
|
-P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/DownloadAndExtractFile.cmake
|
||||||
|
CONFIGURE_COMMAND ${CMAKE_COMMAND} -E copy
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/cmake/LibiconvCMakeLists.txt
|
${CMAKE_CURRENT_SOURCE_DIR}/cmake/LibiconvCMakeLists.txt
|
||||||
${DEPS_BUILD_DIR}/src/libiconv/CMakeLists.txt
|
${DEPS_BUILD_DIR}/src/libiconv/CMakeLists.txt
|
||||||
CMAKE_ARGS ${DEPS_CMAKE_ARGS}
|
COMMAND ${CMAKE_COMMAND} ${DEPS_BUILD_DIR}/src/libiconv
|
||||||
${EXTERNALPROJECT_OPTIONS})
|
-DCMAKE_INSTALL_PREFIX=${DEPS_INSTALL_DIR}
|
||||||
|
# Pass toolchain
|
||||||
|
-DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN}
|
||||||
|
${BUILD_TYPE_STRING}
|
||||||
|
-DCMAKE_GENERATOR=${CMAKE_GENERATOR}
|
||||||
|
-DCMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM}
|
||||||
|
BUILD_COMMAND ${CMAKE_COMMAND} --build . --config $<CONFIG>
|
||||||
|
INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install --config $<CONFIG>)
|
||||||
else()
|
else()
|
||||||
message(FATAL_ERROR "Trying to build libiconv in an unsupported system ${CMAKE_SYSTEM_NAME}/${CMAKE_C_COMPILER_ID}")
|
message(FATAL_ERROR "Trying to build libiconv in an unsupported system ${CMAKE_SYSTEM_NAME}/${CMAKE_C_COMPILER_ID}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
list(APPEND THIRD_PARTY_DEPS libiconv)
|
||||||
|
43
cmake.deps/cmake/BuildLibtermkey.cmake
Normal file
43
cmake.deps/cmake/BuildLibtermkey.cmake
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
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)
|
@@ -1,9 +1,26 @@
|
|||||||
get_externalproject_options(libuv ${DEPS_IGNORE_SHA})
|
|
||||||
ExternalProject_Add(libuv
|
ExternalProject_Add(libuv
|
||||||
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/libuv
|
PREFIX ${DEPS_BUILD_DIR}
|
||||||
CMAKE_ARGS ${DEPS_CMAKE_ARGS}
|
URL ${LIBUV_URL}
|
||||||
|
CMAKE_ARGS
|
||||||
|
-DCMAKE_INSTALL_PREFIX=${DEPS_INSTALL_DIR}
|
||||||
-DCMAKE_INSTALL_LIBDIR=lib
|
-DCMAKE_INSTALL_LIBDIR=lib
|
||||||
-DBUILD_TESTING=OFF
|
-DBUILD_TESTING=OFF
|
||||||
|
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
|
||||||
-DLIBUV_BUILD_SHARED=OFF
|
-DLIBUV_BUILD_SHARED=OFF
|
||||||
-D UV_LINT_W4=OFF
|
CMAKE_CACHE_ARGS
|
||||||
${EXTERNALPROJECT_OPTIONS})
|
-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)
|
||||||
|
@@ -1,8 +1,46 @@
|
|||||||
get_externalproject_options(libvterm ${DEPS_IGNORE_SHA})
|
if(WIN32)
|
||||||
ExternalProject_Add(libvterm
|
set(LIBVTERM_CONFIGURE_COMMAND ${CMAKE_COMMAND} -E copy
|
||||||
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/libvterm
|
|
||||||
PATCH_COMMAND ${CMAKE_COMMAND} -E copy
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/cmake/LibvtermCMakeLists.txt
|
${CMAKE_CURRENT_SOURCE_DIR}/cmake/LibvtermCMakeLists.txt
|
||||||
${DEPS_BUILD_DIR}/src/libvterm/CMakeLists.txt
|
${DEPS_BUILD_DIR}/src/libvterm/CMakeLists.txt
|
||||||
CMAKE_ARGS ${DEPS_CMAKE_ARGS}
|
COMMAND ${CMAKE_COMMAND} -E copy
|
||||||
${EXTERNALPROJECT_OPTIONS})
|
${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)
|
||||||
|
@@ -1,14 +0,0 @@
|
|||||||
get_externalproject_options(lpeg ${DEPS_IGNORE_SHA})
|
|
||||||
ExternalProject_Add(lpeg
|
|
||||||
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/lpeg
|
|
||||||
PATCH_COMMAND ${CMAKE_COMMAND} -E copy
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/cmake/LpegCMakeLists.txt
|
|
||||||
${DEPS_BUILD_DIR}/src/lpeg/CMakeLists.txt
|
|
||||||
CMAKE_ARGS ${DEPS_CMAKE_ARGS} -DCMAKE_C_FLAGS=${DEPS_INCLUDE_FLAGS}
|
|
||||||
${EXTERNALPROJECT_OPTIONS})
|
|
||||||
|
|
||||||
if(USE_BUNDLED_LUAJIT)
|
|
||||||
add_dependencies(lpeg luajit)
|
|
||||||
elseif(USE_BUNDLED_LUA)
|
|
||||||
add_dependencies(lpeg lua)
|
|
||||||
endif()
|
|
@@ -1,13 +1,13 @@
|
|||||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||||
set(LUA_TARGET linux)
|
set(LUA_TARGET linux)
|
||||||
elseif(APPLE)
|
elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
||||||
set(LUA_TARGET macosx)
|
set(LUA_TARGET macosx)
|
||||||
elseif(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
|
elseif(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
|
||||||
set(LUA_TARGET freebsd)
|
set(LUA_TARGET freebsd)
|
||||||
elseif(CMAKE_SYSTEM_NAME MATCHES "BSD")
|
elseif(CMAKE_SYSTEM_NAME MATCHES "BSD")
|
||||||
set(LUA_TARGET bsd)
|
set(CMAKE_LUA_TARGET bsd)
|
||||||
elseif(CMAKE_SYSTEM_NAME MATCHES "^MINGW")
|
elseif(CMAKE_SYSTEM_NAME MATCHES "^MINGW")
|
||||||
set(LUA_TARGET mingw)
|
set(CMAKE_LUA_TARGET mingw)
|
||||||
else()
|
else()
|
||||||
if(UNIX)
|
if(UNIX)
|
||||||
set(LUA_TARGET posix)
|
set(LUA_TARGET posix)
|
||||||
@@ -16,10 +16,10 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(LUA_CFLAGS "-O2 -g3 -fPIC")
|
set(LUA_CFLAGS "-O0 -g3 -fPIC")
|
||||||
set(LUA_LDFLAGS "")
|
set(LUA_LDFLAGS "")
|
||||||
|
|
||||||
if(ENABLE_ASAN_UBSAN)
|
if(CLANG_ASAN_UBSAN)
|
||||||
set(LUA_CFLAGS "${LUA_CFLAGS} -fsanitize=address")
|
set(LUA_CFLAGS "${LUA_CFLAGS} -fsanitize=address")
|
||||||
set(LUA_CFLAGS "${LUA_CFLAGS} -fno-omit-frame-pointer")
|
set(LUA_CFLAGS "${LUA_CFLAGS} -fno-omit-frame-pointer")
|
||||||
set(LUA_CFLAGS "${LUA_CFLAGS} -fno-optimize-sibling-calls")
|
set(LUA_CFLAGS "${LUA_CFLAGS} -fno-optimize-sibling-calls")
|
||||||
@@ -28,7 +28,7 @@ if(ENABLE_ASAN_UBSAN)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(LUA_CONFIGURE_COMMAND
|
set(LUA_CONFIGURE_COMMAND
|
||||||
sed -e "/^CC/s@gcc@${CMAKE_C_COMPILER}@"
|
sed -e "/^CC/s@gcc@${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1}@"
|
||||||
-e "/^CFLAGS/s@-O2@${LUA_CFLAGS}@"
|
-e "/^CFLAGS/s@-O2@${LUA_CFLAGS}@"
|
||||||
-e "/^MYLDFLAGS/s@$@${LUA_LDFLAGS}@"
|
-e "/^MYLDFLAGS/s@$@${LUA_LDFLAGS}@"
|
||||||
-e "s@-lreadline@@g"
|
-e "s@-lreadline@@g"
|
||||||
@@ -40,11 +40,34 @@ set(LUA_CONFIGURE_COMMAND
|
|||||||
-i ${DEPS_BUILD_DIR}/src/lua/src/luaconf.h)
|
-i ${DEPS_BUILD_DIR}/src/lua/src/luaconf.h)
|
||||||
set(LUA_INSTALL_TOP_ARG "INSTALL_TOP=${DEPS_INSTALL_DIR}")
|
set(LUA_INSTALL_TOP_ARG "INSTALL_TOP=${DEPS_INSTALL_DIR}")
|
||||||
|
|
||||||
get_externalproject_options(lua ${DEPS_IGNORE_SHA})
|
message(STATUS "Lua target is ${LUA_TARGET}")
|
||||||
|
|
||||||
ExternalProject_Add(lua
|
ExternalProject_Add(lua
|
||||||
|
PREFIX ${DEPS_BUILD_DIR}
|
||||||
|
URL ${LUA_URL}
|
||||||
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/lua
|
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/lua
|
||||||
|
DOWNLOAD_COMMAND ${CMAKE_COMMAND}
|
||||||
|
-DPREFIX=${DEPS_BUILD_DIR}
|
||||||
|
-DDOWNLOAD_DIR=${DEPS_DOWNLOAD_DIR}/lua
|
||||||
|
-DURL=${LUA_URL}
|
||||||
|
-DEXPECTED_SHA256=${LUA_SHA256}
|
||||||
|
-DTARGET=lua
|
||||||
|
-DUSE_EXISTING_SRC_DIR=${USE_EXISTING_SRC_DIR}
|
||||||
|
-P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/DownloadAndExtractFile.cmake
|
||||||
CONFIGURE_COMMAND "${LUA_CONFIGURE_COMMAND}"
|
CONFIGURE_COMMAND "${LUA_CONFIGURE_COMMAND}"
|
||||||
BUILD_IN_SOURCE 1
|
BUILD_IN_SOURCE 1
|
||||||
BUILD_COMMAND ${MAKE_PRG} ${LUA_INSTALL_TOP_ARG} ${LUA_TARGET}
|
BUILD_COMMAND ${MAKE_PRG} ${LUA_INSTALL_TOP_ARG} ${LUA_TARGET}
|
||||||
INSTALL_COMMAND ${MAKE_PRG} ${LUA_INSTALL_TOP_ARG} install
|
INSTALL_COMMAND ${MAKE_PRG} ${LUA_INSTALL_TOP_ARG} install)
|
||||||
${EXTERNALPROJECT_OPTIONS})
|
|
||||||
|
list(APPEND THIRD_PARTY_DEPS lua)
|
||||||
|
|
||||||
|
set(BUSTED ${DEPS_INSTALL_DIR}/bin/busted)
|
||||||
|
set(BUSTED_LUA ${BUSTED}-lua)
|
||||||
|
|
||||||
|
add_custom_command(OUTPUT ${BUSTED_LUA}
|
||||||
|
COMMAND sed -e 's/^exec/exec $$LUA_DEBUGGER/' -e 's/jit//g' < ${BUSTED} > ${BUSTED_LUA} && chmod +x ${BUSTED_LUA}
|
||||||
|
DEPENDS lua busted ${BUSTED})
|
||||||
|
add_custom_target(busted-lua
|
||||||
|
DEPENDS ${DEPS_INSTALL_DIR}/bin/busted-lua)
|
||||||
|
|
||||||
|
list(APPEND THIRD_PARTY_DEPS busted-lua)
|
||||||
|
@@ -1,23 +1,48 @@
|
|||||||
|
# BuildLuajit(TARGET targetname CONFIGURE_COMMAND ... BUILD_COMMAND ... INSTALL_COMMAND ...)
|
||||||
|
# Reusable function to build luajit, wraps ExternalProject_Add.
|
||||||
|
# Failing to pass a command argument will result in no command being run
|
||||||
function(BuildLuajit)
|
function(BuildLuajit)
|
||||||
cmake_parse_arguments(_luajit
|
cmake_parse_arguments(_luajit
|
||||||
""
|
""
|
||||||
""
|
"TARGET"
|
||||||
"CONFIGURE_COMMAND;BUILD_COMMAND;INSTALL_COMMAND;DEPENDS"
|
"CONFIGURE_COMMAND;BUILD_COMMAND;INSTALL_COMMAND;DEPENDS"
|
||||||
${ARGN})
|
${ARGN})
|
||||||
|
if(NOT _luajit_CONFIGURE_COMMAND AND NOT _luajit_BUILD_COMMAND
|
||||||
|
AND NOT _luajit_INSTALL_COMMAND)
|
||||||
|
message(FATAL_ERROR "Must pass at least one of CONFIGURE_COMMAND, BUILD_COMMAND, INSTALL_COMMAND")
|
||||||
|
endif()
|
||||||
|
if(NOT _luajit_TARGET)
|
||||||
|
set(_luajit_TARGET "luajit")
|
||||||
|
endif()
|
||||||
|
|
||||||
get_externalproject_options(luajit ${DEPS_IGNORE_SHA})
|
ExternalProject_Add(${_luajit_TARGET}
|
||||||
ExternalProject_Add(luajit
|
PREFIX ${DEPS_BUILD_DIR}
|
||||||
|
URL ${LUAJIT_URL}
|
||||||
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/luajit
|
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/luajit
|
||||||
|
DOWNLOAD_COMMAND ${CMAKE_COMMAND}
|
||||||
|
-DPREFIX=${DEPS_BUILD_DIR}
|
||||||
|
-DDOWNLOAD_DIR=${DEPS_DOWNLOAD_DIR}/luajit
|
||||||
|
-DURL=${LUAJIT_URL}
|
||||||
|
-DEXPECTED_SHA256=${LUAJIT_SHA256}
|
||||||
|
-DTARGET=${_luajit_TARGET}
|
||||||
|
-DUSE_EXISTING_SRC_DIR=${USE_EXISTING_SRC_DIR}
|
||||||
|
-P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/DownloadAndExtractFile.cmake
|
||||||
CONFIGURE_COMMAND "${_luajit_CONFIGURE_COMMAND}"
|
CONFIGURE_COMMAND "${_luajit_CONFIGURE_COMMAND}"
|
||||||
BUILD_IN_SOURCE 1
|
BUILD_IN_SOURCE 1
|
||||||
BUILD_COMMAND "${_luajit_BUILD_COMMAND}"
|
BUILD_COMMAND "${_luajit_BUILD_COMMAND}"
|
||||||
INSTALL_COMMAND "${_luajit_INSTALL_COMMAND}"
|
INSTALL_COMMAND "${_luajit_INSTALL_COMMAND}"
|
||||||
DEPENDS "${_luajit_DEPENDS}"
|
DEPENDS "${_luajit_DEPENDS}")
|
||||||
${EXTERNALPROJECT_OPTIONS})
|
|
||||||
|
# Create symlink for development version manually.
|
||||||
|
if(UNIX)
|
||||||
|
add_custom_command(
|
||||||
|
TARGET ${_luajit_TARGET}
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E create_symlink luajit-2.1.0-beta3 ${DEPS_BIN_DIR}/${_luajit_TARGET})
|
||||||
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
check_c_compiler_flag(-fno-stack-check HAS_NO_STACK_CHECK)
|
check_c_compiler_flag(-fno-stack-check HAS_NO_STACK_CHECK)
|
||||||
if(APPLE AND HAS_NO_STACK_CHECK)
|
if(CMAKE_SYSTEM_NAME MATCHES "Darwin" AND HAS_NO_STACK_CHECK)
|
||||||
set(NO_STACK_CHECK "CFLAGS+=-fno-stack-check")
|
set(NO_STACK_CHECK "CFLAGS+=-fno-stack-check")
|
||||||
else()
|
else()
|
||||||
set(NO_STACK_CHECK "")
|
set(NO_STACK_CHECK "")
|
||||||
@@ -27,7 +52,7 @@ if(CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
|
|||||||
else()
|
else()
|
||||||
set(AMD64_ABI "")
|
set(AMD64_ABI "")
|
||||||
endif()
|
endif()
|
||||||
set(BUILDCMD_UNIX ${MAKE_PRG} -j CFLAGS=-fPIC
|
set(BUILDCMD_UNIX ${MAKE_PRG} CFLAGS=-fPIC
|
||||||
CFLAGS+=-DLUA_USE_APICHECK
|
CFLAGS+=-DLUA_USE_APICHECK
|
||||||
CFLAGS+=-funwind-tables
|
CFLAGS+=-funwind-tables
|
||||||
${NO_STACK_CHECK}
|
${NO_STACK_CHECK}
|
||||||
@@ -37,15 +62,48 @@ set(BUILDCMD_UNIX ${MAKE_PRG} -j CFLAGS=-fPIC
|
|||||||
|
|
||||||
# Setting MACOSX_DEPLOYMENT_TARGET is mandatory for LuaJIT; use version set by
|
# Setting MACOSX_DEPLOYMENT_TARGET is mandatory for LuaJIT; use version set by
|
||||||
# cmake.deps/CMakeLists.txt (either environment variable or current system version).
|
# cmake.deps/CMakeLists.txt (either environment variable or current system version).
|
||||||
if(APPLE)
|
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
||||||
set(DEPLOYMENT_TARGET "MACOSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}")
|
set(DEPLOYMENT_TARGET "MACOSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(UNIX)
|
if((UNIX AND NOT APPLE) OR (APPLE AND NOT CMAKE_OSX_ARCHITECTURES))
|
||||||
BuildLuaJit(INSTALL_COMMAND ${BUILDCMD_UNIX}
|
BuildLuaJit(INSTALL_COMMAND ${BUILDCMD_UNIX}
|
||||||
CC=${DEPS_C_COMPILER} PREFIX=${DEPS_INSTALL_DIR}
|
CC=${DEPS_C_COMPILER} PREFIX=${DEPS_INSTALL_DIR}
|
||||||
${DEPLOYMENT_TARGET} install)
|
${DEPLOYMENT_TARGET} install)
|
||||||
|
|
||||||
|
elseif(CMAKE_OSX_ARCHITECTURES AND APPLE)
|
||||||
|
|
||||||
|
# Passing multiple `-arch` flags to the LuaJIT build will cause it to fail.
|
||||||
|
# To get a working universal build, we build each requested architecture slice
|
||||||
|
# individually then `lipo` them all up.
|
||||||
|
set(LUAJIT_SRC_DIR "${DEPS_BUILD_DIR}/src/luajit")
|
||||||
|
foreach(ARCH IN LISTS CMAKE_OSX_ARCHITECTURES)
|
||||||
|
set(STATIC_CC "${LUAJIT_C_COMPILER} -arch ${ARCH}")
|
||||||
|
set(DYNAMIC_CC "${LUAJIT_C_COMPILER} -arch ${ARCH} -fPIC")
|
||||||
|
set(TARGET_LD "${LUAJIT_C_COMPILER} -arch ${ARCH}")
|
||||||
|
list(APPEND LUAJIT_THIN_EXECUTABLES "${LUAJIT_SRC_DIR}-${ARCH}/src/luajit")
|
||||||
|
list(APPEND LUAJIT_THIN_STATIC_LIBS "${LUAJIT_SRC_DIR}-${ARCH}/src/libluajit.a")
|
||||||
|
list(APPEND LUAJIT_THIN_DYLIBS "${LUAJIT_SRC_DIR}-${ARCH}/src/libluajit.so")
|
||||||
|
list(APPEND LUAJIT_THIN_TARGETS "luajit-${ARCH}")
|
||||||
|
|
||||||
|
# See https://luajit.org/install.html#cross.
|
||||||
|
BuildLuaJit(TARGET "luajit-${ARCH}"
|
||||||
|
BUILD_COMMAND ${BUILDCMD_UNIX}
|
||||||
|
CC=${LUAJIT_C_COMPILER} STATIC_CC=${STATIC_CC}
|
||||||
|
DYNAMIC_CC=${DYNAMIC_CC} TARGET_LD=${TARGET_LD}
|
||||||
|
PREFIX=${DEPS_INSTALL_DIR}
|
||||||
|
${DEPLOYMENT_TARGET})
|
||||||
|
endforeach()
|
||||||
|
BuildLuaJit(
|
||||||
|
CONFIGURE_COMMAND ${BUILDCMD_UNIX} CC=${LUAJIT_C_COMPILER} PREFIX=${DEPS_INSTALL_DIR} ${DEPLOYMENT_TARGET}
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E rm -f ${LUAJIT_SRC_DIR}/src/luajit ${LUAJIT_SRC_DIR}/src/libluajit.so ${LUAJIT_SRC_DIR}/src/libluajit.a
|
||||||
|
BUILD_COMMAND lipo ${LUAJIT_THIN_EXECUTABLES} -create -output ${LUAJIT_SRC_DIR}/src/luajit
|
||||||
|
COMMAND lipo ${LUAJIT_THIN_STATIC_LIBS} -create -output ${LUAJIT_SRC_DIR}/src/libluajit.a
|
||||||
|
COMMAND lipo ${LUAJIT_THIN_DYLIBS} -create -output ${LUAJIT_SRC_DIR}/src/libluajit.so
|
||||||
|
INSTALL_COMMAND ${BUILDCMD_UNIX} CC=${LUAJIT_C_COMPILER} PREFIX=${DEPS_INSTALL_DIR} ${DEPLOYMENT_TARGET} install
|
||||||
|
DEPENDS ${LUAJIT_THIN_TARGETS}
|
||||||
|
)
|
||||||
|
|
||||||
elseif(MINGW)
|
elseif(MINGW)
|
||||||
|
|
||||||
if(CMAKE_GENERATOR MATCHES "Ninja")
|
if(CMAKE_GENERATOR MATCHES "Ninja")
|
||||||
@@ -62,33 +120,37 @@ elseif(MINGW)
|
|||||||
# Build a DLL too
|
# Build a DLL too
|
||||||
COMMAND ${LUAJIT_MAKE_PRG} CC=${DEPS_C_COMPILER} BUILDMODE=dynamic
|
COMMAND ${LUAJIT_MAKE_PRG} CC=${DEPS_C_COMPILER} BUILDMODE=dynamic
|
||||||
|
|
||||||
INSTALL_COMMAND ${CMAKE_COMMAND} -E make_directory ${DEPS_BIN_DIR}
|
INSTALL_COMMAND ${CMAKE_COMMAND} -E make_directory ${DEPS_INSTALL_DIR}/bin
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${DEPS_BUILD_DIR}/src/luajit/src/luajit.exe ${DEPS_BIN_DIR}
|
COMMAND ${CMAKE_COMMAND} -E copy ${DEPS_BUILD_DIR}/src/luajit/src/luajit.exe ${DEPS_INSTALL_DIR}/bin
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${DEPS_BUILD_DIR}/src/luajit/src/lua51.dll ${DEPS_BIN_DIR}
|
COMMAND ${CMAKE_COMMAND} -E copy ${DEPS_BUILD_DIR}/src/luajit/src/lua51.dll ${DEPS_INSTALL_DIR}/bin
|
||||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${DEPS_LIB_DIR}
|
COMMAND ${CMAKE_COMMAND} -E make_directory ${DEPS_INSTALL_DIR}/lib
|
||||||
# Luarocks searches for lua51.dll in lib
|
# Luarocks searches for lua51.dll in lib
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${DEPS_BUILD_DIR}/src/luajit/src/lua51.dll ${DEPS_LIB_DIR}
|
COMMAND ${CMAKE_COMMAND} -E copy ${DEPS_BUILD_DIR}/src/luajit/src/lua51.dll ${DEPS_INSTALL_DIR}/lib
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${DEPS_BUILD_DIR}/src/luajit/src/libluajit.a ${DEPS_LIB_DIR}
|
COMMAND ${CMAKE_COMMAND} -E copy ${DEPS_BUILD_DIR}/src/luajit/src/libluajit.a ${DEPS_INSTALL_DIR}/lib
|
||||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${DEPS_INSTALL_DIR}/include/luajit-2.1
|
COMMAND ${CMAKE_COMMAND} -E make_directory ${DEPS_INSTALL_DIR}/include/luajit-2.1
|
||||||
COMMAND ${CMAKE_COMMAND} -DFROM_GLOB=${DEPS_BUILD_DIR}/src/luajit/src/*.h -DTO=${DEPS_INSTALL_DIR}/include/luajit-2.1 -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/CopyFilesGlob.cmake
|
COMMAND ${CMAKE_COMMAND} -DFROM_GLOB=${DEPS_BUILD_DIR}/src/luajit/src/*.h -DTO=${DEPS_INSTALL_DIR}/include/luajit-2.1 -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/CopyFilesGlob.cmake
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${DEPS_BUILD_DIR}/src/luajit/src/jit ${DEPS_INSTALL_DIR}/share/luajit-2.1/jit
|
COMMAND ${CMAKE_COMMAND} -E make_directory ${DEPS_INSTALL_DIR}/bin/lua/jit
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy_directory ${DEPS_BUILD_DIR}/src/luajit/src/jit ${DEPS_INSTALL_DIR}/bin/lua/jit
|
||||||
)
|
)
|
||||||
elseif(MSVC)
|
elseif(MSVC)
|
||||||
|
|
||||||
BuildLuaJit(
|
BuildLuaJit(
|
||||||
BUILD_COMMAND ${CMAKE_COMMAND} -E chdir ${DEPS_BUILD_DIR}/src/luajit/src ${DEPS_BUILD_DIR}/src/luajit/src/msvcbuild.bat
|
BUILD_COMMAND ${CMAKE_COMMAND} -E chdir ${DEPS_BUILD_DIR}/src/luajit/src ${DEPS_BUILD_DIR}/src/luajit/src/msvcbuild.bat
|
||||||
INSTALL_COMMAND ${CMAKE_COMMAND} -E make_directory ${DEPS_BIN_DIR}
|
INSTALL_COMMAND ${CMAKE_COMMAND} -E make_directory ${DEPS_INSTALL_DIR}/bin
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${DEPS_BUILD_DIR}/src/luajit/src/luajit.exe ${DEPS_BIN_DIR}
|
COMMAND ${CMAKE_COMMAND} -E copy ${DEPS_BUILD_DIR}/src/luajit/src/luajit.exe ${DEPS_INSTALL_DIR}/bin
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${DEPS_BUILD_DIR}/src/luajit/src/lua51.dll ${DEPS_BIN_DIR}
|
COMMAND ${CMAKE_COMMAND} -E copy ${DEPS_BUILD_DIR}/src/luajit/src/lua51.dll ${DEPS_INSTALL_DIR}/bin
|
||||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${DEPS_LIB_DIR}
|
COMMAND ${CMAKE_COMMAND} -E make_directory ${DEPS_INSTALL_DIR}/lib
|
||||||
# Luarocks searches for lua51.lib
|
# Luarocks searches for lua51.lib
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${DEPS_BUILD_DIR}/src/luajit/src/lua51.lib ${DEPS_LIB_DIR}/lua51.lib
|
COMMAND ${CMAKE_COMMAND} -E copy ${DEPS_BUILD_DIR}/src/luajit/src/lua51.lib ${DEPS_INSTALL_DIR}/lib/lua51.lib
|
||||||
# Luv searches for luajit.lib
|
# Luv searches for luajit.lib
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${DEPS_BUILD_DIR}/src/luajit/src/lua51.lib ${DEPS_LIB_DIR}/luajit.lib
|
COMMAND ${CMAKE_COMMAND} -E copy ${DEPS_BUILD_DIR}/src/luajit/src/lua51.lib ${DEPS_INSTALL_DIR}/lib/luajit.lib
|
||||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${DEPS_INSTALL_DIR}/include/luajit-2.1
|
COMMAND ${CMAKE_COMMAND} -E make_directory ${DEPS_INSTALL_DIR}/include/luajit-2.1
|
||||||
COMMAND ${CMAKE_COMMAND} -DFROM_GLOB=${DEPS_BUILD_DIR}/src/luajit/src/*.h -DTO=${DEPS_INSTALL_DIR}/include/luajit-2.1 -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/CopyFilesGlob.cmake
|
COMMAND ${CMAKE_COMMAND} -DFROM_GLOB=${DEPS_BUILD_DIR}/src/luajit/src/*.h -DTO=${DEPS_INSTALL_DIR}/include/luajit-2.1 -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/CopyFilesGlob.cmake
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${DEPS_BUILD_DIR}/src/luajit/src/jit ${DEPS_INSTALL_DIR}/share/luajit-2.1/jit
|
COMMAND ${CMAKE_COMMAND} -E make_directory ${DEPS_INSTALL_DIR}/bin/lua/jit
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy_directory ${DEPS_BUILD_DIR}/src/luajit/src/jit ${DEPS_INSTALL_DIR}/bin/lua/jit
|
||||||
)
|
)
|
||||||
else()
|
else()
|
||||||
message(FATAL_ERROR "Trying to build luajit in an unsupported system ${CMAKE_SYSTEM_NAME}/${CMAKE_C_COMPILER_ID}")
|
message(FATAL_ERROR "Trying to build luajit in an unsupported system ${CMAKE_SYSTEM_NAME}/${CMAKE_C_COMPILER_ID}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
list(APPEND THIRD_PARTY_DEPS luajit)
|
||||||
|
188
cmake.deps/cmake/BuildLuarocks.cmake
Normal file
188
cmake.deps/cmake/BuildLuarocks.cmake
Normal file
@@ -0,0 +1,188 @@
|
|||||||
|
# Luarocks recipe. Luarocks is only required when building Neovim, when
|
||||||
|
# cross compiling we still want to build for the HOST system, whenever
|
||||||
|
# writing a recipe that is meant for cross-compile, use the HOSTDEPS_* variables
|
||||||
|
# instead of DEPS_* - check the main CMakeLists.txt for a list.
|
||||||
|
#
|
||||||
|
# NOTE: LuaRocks rocks need to "DEPENDS" on the previous module, because
|
||||||
|
# running luarocks in parallel will break, e.g. when some rocks have
|
||||||
|
# the same dependency..
|
||||||
|
|
||||||
|
option(USE_BUNDLED_BUSTED "Use the bundled version of busted to run tests." ON)
|
||||||
|
|
||||||
|
# The luarocks binary location
|
||||||
|
set(LUAROCKS_BINARY ${HOSTDEPS_BIN_DIR}/luarocks)
|
||||||
|
|
||||||
|
# Arguments for calls to 'luarocks build'
|
||||||
|
if(NOT MSVC)
|
||||||
|
# In MSVC don't pass the compiler/linker to luarocks, the bundled
|
||||||
|
# version already knows, and passing them here breaks the build
|
||||||
|
set(LUAROCKS_BUILDARGS CC=${HOSTDEPS_C_COMPILER} LD=${HOSTDEPS_C_COMPILER})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Lua version, used with rocks directories.
|
||||||
|
# Defaults to 5.1 for bundled LuaJIT/Lua.
|
||||||
|
set(LUA_VERSION "5.1")
|
||||||
|
|
||||||
|
if(UNIX)
|
||||||
|
|
||||||
|
if(USE_BUNDLED_LUAJIT)
|
||||||
|
list(APPEND LUAROCKS_OPTS
|
||||||
|
--with-lua=${HOSTDEPS_INSTALL_DIR}
|
||||||
|
--with-lua-include=${HOSTDEPS_INSTALL_DIR}/include/luajit-2.1
|
||||||
|
--with-lua-interpreter=luajit)
|
||||||
|
elseif(USE_BUNDLED_LUA)
|
||||||
|
list(APPEND LUAROCKS_OPTS
|
||||||
|
--with-lua=${HOSTDEPS_INSTALL_DIR})
|
||||||
|
else()
|
||||||
|
find_package(LuaJit)
|
||||||
|
if(LUAJIT_FOUND)
|
||||||
|
list(APPEND LUAROCKS_OPTS
|
||||||
|
--with-lua-include=${LUAJIT_INCLUDE_DIRS}
|
||||||
|
--with-lua-interpreter=luajit)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Get LUA_VERSION used with rocks output.
|
||||||
|
if(LUAJIT_FOUND)
|
||||||
|
set(LUA_EXE "luajit")
|
||||||
|
else()
|
||||||
|
set(LUA_EXE "lua")
|
||||||
|
endif()
|
||||||
|
execute_process(
|
||||||
|
COMMAND ${LUA_EXE} -e "print(string.sub(_VERSION, 5))"
|
||||||
|
OUTPUT_VARIABLE LUA_VERSION
|
||||||
|
ERROR_VARIABLE ERR
|
||||||
|
RESULT_VARIABLE RES)
|
||||||
|
if(NOT RES EQUAL 0)
|
||||||
|
message(FATAL_ERROR "Could not get LUA_VERSION with ${LUA_EXE}: ${ERR}")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(LUAROCKS_CONFIGURE_COMMAND ${DEPS_BUILD_DIR}/src/luarocks/configure
|
||||||
|
--prefix=${HOSTDEPS_INSTALL_DIR} --force-config ${LUAROCKS_OPTS})
|
||||||
|
set(LUAROCKS_INSTALL_COMMAND ${MAKE_PRG} -j1 bootstrap)
|
||||||
|
elseif(MSVC OR MINGW)
|
||||||
|
|
||||||
|
if(MINGW)
|
||||||
|
set(COMPILER_FLAG /MW)
|
||||||
|
elseif(MSVC)
|
||||||
|
set(COMPILER_FLAG /MSVC)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Ignore USE_BUNDLED_LUAJIT - always ON for native Win32
|
||||||
|
set(LUAROCKS_INSTALL_COMMAND install.bat /FORCECONFIG /NOREG /NOADMIN /Q /F
|
||||||
|
/LUA ${DEPS_INSTALL_DIR}
|
||||||
|
/LIB ${DEPS_LIB_DIR}
|
||||||
|
/BIN ${DEPS_BIN_DIR}
|
||||||
|
/INC ${DEPS_INSTALL_DIR}/include/luajit-2.1
|
||||||
|
/P ${DEPS_INSTALL_DIR}/luarocks /TREE ${DEPS_INSTALL_DIR}
|
||||||
|
/SCRIPTS ${DEPS_BIN_DIR}
|
||||||
|
/CMOD ${DEPS_BIN_DIR}
|
||||||
|
${COMPILER_FLAG}
|
||||||
|
/LUAMOD ${DEPS_BIN_DIR}/lua)
|
||||||
|
|
||||||
|
set(LUAROCKS_BINARY ${DEPS_INSTALL_DIR}/luarocks/luarocks.bat)
|
||||||
|
else()
|
||||||
|
message(FATAL_ERROR "Trying to build luarocks in an unsupported system ${CMAKE_SYSTEM_NAME}/${CMAKE_C_COMPILER_ID}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
ExternalProject_Add(luarocks
|
||||||
|
PREFIX ${DEPS_BUILD_DIR}
|
||||||
|
URL ${LUAROCKS_URL}
|
||||||
|
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/luarocks
|
||||||
|
DOWNLOAD_COMMAND ${CMAKE_COMMAND}
|
||||||
|
-DPREFIX=${DEPS_BUILD_DIR}
|
||||||
|
-DDOWNLOAD_DIR=${DEPS_DOWNLOAD_DIR}/luarocks
|
||||||
|
-DURL=${LUAROCKS_URL}
|
||||||
|
-DEXPECTED_SHA256=${LUAROCKS_SHA256}
|
||||||
|
-DTARGET=luarocks
|
||||||
|
-DUSE_EXISTING_SRC_DIR=${USE_EXISTING_SRC_DIR}
|
||||||
|
-P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/DownloadAndExtractFile.cmake
|
||||||
|
BUILD_IN_SOURCE 1
|
||||||
|
CONFIGURE_COMMAND "${LUAROCKS_CONFIGURE_COMMAND}"
|
||||||
|
BUILD_COMMAND ""
|
||||||
|
INSTALL_COMMAND "${LUAROCKS_INSTALL_COMMAND}")
|
||||||
|
|
||||||
|
list(APPEND THIRD_PARTY_DEPS luarocks)
|
||||||
|
|
||||||
|
if(USE_BUNDLED_LUAJIT)
|
||||||
|
add_dependencies(luarocks luajit)
|
||||||
|
elseif(USE_BUNDLED_LUA)
|
||||||
|
add_dependencies(luarocks lua)
|
||||||
|
endif()
|
||||||
|
set(ROCKS_DIR ${HOSTDEPS_LIB_DIR}/luarocks/rocks-${LUA_VERSION})
|
||||||
|
|
||||||
|
# mpack
|
||||||
|
add_custom_command(OUTPUT ${ROCKS_DIR}/mpack
|
||||||
|
COMMAND ${LUAROCKS_BINARY} build mpack 1.0.8-0 ${LUAROCKS_BUILDARGS}
|
||||||
|
DEPENDS luarocks)
|
||||||
|
add_custom_target(mpack DEPENDS ${ROCKS_DIR}/mpack)
|
||||||
|
list(APPEND THIRD_PARTY_DEPS mpack)
|
||||||
|
|
||||||
|
# lpeg
|
||||||
|
add_custom_command(OUTPUT ${ROCKS_DIR}/lpeg
|
||||||
|
COMMAND ${LUAROCKS_BINARY} build lpeg 1.0.2-1 ${LUAROCKS_BUILDARGS}
|
||||||
|
DEPENDS mpack)
|
||||||
|
add_custom_target(lpeg DEPENDS ${ROCKS_DIR}/lpeg)
|
||||||
|
list(APPEND THIRD_PARTY_DEPS lpeg)
|
||||||
|
|
||||||
|
if((NOT USE_BUNDLED_LUAJIT) AND USE_BUNDLED_LUA)
|
||||||
|
# luabitop
|
||||||
|
add_custom_command(OUTPUT ${ROCKS_DIR}/luabitop
|
||||||
|
COMMAND ${LUAROCKS_BINARY} build luabitop 1.0.2-3 ${LUAROCKS_BUILDARGS}
|
||||||
|
DEPENDS lpeg)
|
||||||
|
add_custom_target(luabitop DEPENDS ${ROCKS_DIR}/luabitop)
|
||||||
|
list(APPEND THIRD_PARTY_DEPS luabitop)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(USE_BUNDLED_BUSTED)
|
||||||
|
if((NOT USE_BUNDLED_LUAJIT) AND USE_BUNDLED_LUA)
|
||||||
|
set(PENLIGHT_DEPENDS luabitop)
|
||||||
|
else()
|
||||||
|
set(PENLIGHT_DEPENDS lpeg)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# penlight
|
||||||
|
add_custom_command(OUTPUT ${ROCKS_DIR}/penlight
|
||||||
|
COMMAND ${LUAROCKS_BINARY} build penlight 1.5.4-1 ${LUAROCKS_BUILDARGS}
|
||||||
|
DEPENDS ${PENLIGHT_DEPENDS})
|
||||||
|
add_custom_target(penlight DEPENDS ${ROCKS_DIR}/penlight)
|
||||||
|
|
||||||
|
# busted
|
||||||
|
if(WIN32)
|
||||||
|
set(BUSTED_EXE "${HOSTDEPS_BIN_DIR}/busted.bat")
|
||||||
|
set(LUACHECK_EXE "${HOSTDEPS_BIN_DIR}/luacheck.bat")
|
||||||
|
else()
|
||||||
|
set(BUSTED_EXE "${HOSTDEPS_BIN_DIR}/busted")
|
||||||
|
set(LUACHECK_EXE "${HOSTDEPS_BIN_DIR}/luacheck")
|
||||||
|
endif()
|
||||||
|
add_custom_command(OUTPUT ${BUSTED_EXE}
|
||||||
|
COMMAND ${LUAROCKS_BINARY} build busted 2.0.0 ${LUAROCKS_BUILDARGS}
|
||||||
|
DEPENDS penlight)
|
||||||
|
add_custom_target(busted DEPENDS ${BUSTED_EXE})
|
||||||
|
|
||||||
|
# luacheck
|
||||||
|
add_custom_command(OUTPUT ${LUACHECK_EXE}
|
||||||
|
COMMAND ${LUAROCKS_BINARY} build luacheck 0.23.0-1 ${LUAROCKS_BUILDARGS}
|
||||||
|
DEPENDS busted)
|
||||||
|
add_custom_target(luacheck DEPENDS ${LUACHECK_EXE})
|
||||||
|
|
||||||
|
# luv
|
||||||
|
set(LUV_DEPS luacheck)
|
||||||
|
if(USE_BUNDLED_LUV)
|
||||||
|
set(NVIM_CLIENT_DEPS luacheck luv-static lua-compat-5.3)
|
||||||
|
else()
|
||||||
|
add_custom_command(OUTPUT ${ROCKS_DIR}/luv
|
||||||
|
COMMAND ${LUAROCKS_BINARY} build luv ${LUV_VERSION} ${LUAROCKS_BUILDARGS}
|
||||||
|
DEPENDS luacheck)
|
||||||
|
add_custom_target(luv DEPENDS ${ROCKS_DIR}/luv)
|
||||||
|
set(NVIM_CLIENT_DEPS luv)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# nvim-client: https://github.com/neovim/lua-client
|
||||||
|
add_custom_command(OUTPUT ${ROCKS_DIR}/nvim-client
|
||||||
|
COMMAND ${LUAROCKS_BINARY} build nvim-client 0.2.4-1 ${LUAROCKS_BUILDARGS}
|
||||||
|
DEPENDS ${NVIM_CLIENT_DEPS})
|
||||||
|
add_custom_target(nvim-client DEPENDS ${ROCKS_DIR}/nvim-client)
|
||||||
|
|
||||||
|
list(APPEND THIRD_PARTY_DEPS busted luacheck nvim-client)
|
||||||
|
endif()
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user