mirror of
https://github.com/neovim/neovim
synced 2025-07-25 07:41:53 +00:00
Compare commits
46 Commits
Author | SHA1 | Date | |
---|---|---|---|
5b839ced69 | |||
844872cc0a | |||
0e96f7d04c | |||
1cc63abf4a | |||
9f51da3442 | |||
857678c2ec | |||
03bd9147f0 | |||
ee9e3420fd | |||
7b60ec79ea | |||
14357c83c5 | |||
571609fb89 | |||
37a00be7c0 | |||
09306f07c4 | |||
ec101b9fd9 | |||
222d1414dc | |||
7f4fa077cd | |||
00889948dd | |||
1bb861c7a1 | |||
d547d874af | |||
060eeaa14c | |||
9dae939b1f | |||
8c6a4fab66 | |||
1b54344c11 | |||
8f68548384 | |||
25da2430f9 | |||
93f1ec0a59 | |||
5c8e5432c0 | |||
e86997a812 | |||
a0ebba7052 | |||
ae249d81fb | |||
785baceaee | |||
aa0ddc6690 | |||
2cd272decb | |||
08ddfa9851 | |||
beac24d6f3 | |||
5dcf2c77a9 | |||
ce4c8010cc | |||
270f71b571 | |||
3c0f239c3e | |||
1d32521135 | |||
bd057d4b40 | |||
096f8418c5 | |||
84784a8391 | |||
fb11ef0aad | |||
faf3159ab0 | |||
a4699892af |
44
.builds/freebsd.yml
Normal file
44
.builds/freebsd.yml
Normal file
@ -0,0 +1,44 @@
|
||||
image: freebsd/12.x
|
||||
|
||||
packages:
|
||||
- cmake
|
||||
- gmake
|
||||
- ninja
|
||||
- libtool
|
||||
- sha
|
||||
- automake
|
||||
- pkgconf
|
||||
- unzip
|
||||
- wget
|
||||
- gettext
|
||||
- python
|
||||
- libffi
|
||||
|
||||
sources:
|
||||
- https://github.com/neovim/neovim
|
||||
|
||||
environment:
|
||||
SOURCEHUT: 1
|
||||
LANG: en_US.UTF-8
|
||||
CMAKE_EXTRA_FLAGS: -DCI_BUILD=ON -DMIN_LOG_LEVEL=3
|
||||
|
||||
tasks:
|
||||
- build-deps: |
|
||||
cd neovim
|
||||
gmake deps
|
||||
- build: |
|
||||
cd neovim
|
||||
gmake CMAKE_BUILD_TYPE=RelWithDebInfo CMAKE_EXTRA_FLAGS="${CMAKE_EXTRA_FLAGS}" nvim
|
||||
- functionaltest: |
|
||||
cd neovim
|
||||
gmake functionaltest
|
||||
- unittest: |
|
||||
cd neovim
|
||||
gmake unittest
|
||||
|
||||
# Unfortunately, oldtest is tanking hard on sourcehut's FreeBSD instance
|
||||
# and not producing any logs as a result. So don't do this task for now.
|
||||
# Ref: https://github.com/neovim/neovim/pull/11477#discussion_r352095005.
|
||||
# - test-oldtest: |
|
||||
# cd neovim
|
||||
# gmake oldtest
|
43
.builds/openbsd.yml
Normal file
43
.builds/openbsd.yml
Normal file
@ -0,0 +1,43 @@
|
||||
# sourcehut CI: https://builds.sr.ht/~jmk/neovim
|
||||
|
||||
image: openbsd/6.9
|
||||
|
||||
packages:
|
||||
- autoconf-2.71
|
||||
- automake-1.16.3
|
||||
- cmake
|
||||
- gettext-runtime-0.21p1
|
||||
- gettext-tools-0.21p1
|
||||
- gmake
|
||||
- libtool
|
||||
- ninja-1.10.2p0
|
||||
- unzip-6.0p14
|
||||
|
||||
sources:
|
||||
- https://github.com/neovim/neovim
|
||||
|
||||
environment:
|
||||
SOURCEHUT: 1
|
||||
LC_CTYPE: en_US.UTF-8
|
||||
CMAKE_EXTRA_FLAGS: -DCI_BUILD=ON -DMIN_LOG_LEVEL=3
|
||||
|
||||
tasks:
|
||||
- build-deps: |
|
||||
export AUTOCONF_VERSION=2.71
|
||||
export AUTOMAKE_VERSION=1.16
|
||||
mkdir neovim/.deps
|
||||
cd neovim/.deps
|
||||
cmake -G Ninja ../third-party/
|
||||
cmake --build . --config RelWithDebInfo
|
||||
- build: |
|
||||
mkdir neovim/build
|
||||
cd neovim/build
|
||||
cmake -G Ninja $CMAKE_EXTRA_FLAGS ..
|
||||
cmake --build . --config RelWithDebInfo
|
||||
./bin/nvim --version
|
||||
- functionaltest: |
|
||||
cd neovim/build
|
||||
cmake --build . --config RelWithDebInfo --target functionaltest
|
||||
- oldtest: |
|
||||
cd neovim
|
||||
gmake oldtest
|
27
.cirrus.yml
27
.cirrus.yml
@ -1,27 +0,0 @@
|
||||
env:
|
||||
CIRRUS_CLONE_DEPTH: '2'
|
||||
LANG: en_US.UTF-8
|
||||
|
||||
freebsd_task:
|
||||
name: FreeBSD
|
||||
only_if: $BRANCH != "master"
|
||||
freebsd_instance:
|
||||
image_family: freebsd-13-1
|
||||
timeout_in: 30m
|
||||
install_script:
|
||||
- pkg install -y cmake gmake ninja pkgconf unzip wget gettext python libffi git
|
||||
build_deps_script:
|
||||
- gmake deps
|
||||
build_script:
|
||||
- gmake CMAKE_EXTRA_FLAGS="-DCI_BUILD=ON" nvim
|
||||
workaround_script:
|
||||
# Run tests as user "cirrus" instead of root. This is required for the
|
||||
# permission-related tests to work correctly.
|
||||
- pw useradd cirrus -m
|
||||
- chown -R cirrus:cirrus .
|
||||
functionaltest_script:
|
||||
- sudo -u cirrus gmake functionaltest
|
||||
unittest_script:
|
||||
- sudo -u cirrus gmake unittest
|
||||
oldtest_script:
|
||||
- sudo -u cirrus gmake oldtest
|
@ -2,10 +2,10 @@ BasedOnStyle: Google
|
||||
Language: Cpp
|
||||
ColumnLimit: 100
|
||||
IndentWidth: 2
|
||||
TabWidth: 8
|
||||
TabWidth: 2
|
||||
UseTab: Never
|
||||
IndentCaseLabels: false
|
||||
BreakBeforeBraces: Custom
|
||||
IndentCaseLabels: true
|
||||
BreakBeforeBraces: Linux
|
||||
AlignEscapedNewlinesLeft: false
|
||||
AllowShortFunctionsOnASingleLine: false
|
||||
AlignTrailingComments: true
|
||||
@ -17,51 +17,4 @@ AllowShortLoopsOnASingleLine: false
|
||||
BinPackParameters: false
|
||||
BreakBeforeBinaryOperators: true
|
||||
BreakBeforeTernaryOperators: true
|
||||
ContinuationIndentWidth: 2
|
||||
AlwaysBreakAfterDefinitionReturnType: None
|
||||
AlwaysBreakAfterReturnType: None
|
||||
AlwaysBreakBeforeMultilineStrings: No
|
||||
AlwaysBreakTemplateDeclarations: No
|
||||
AlignEscapedNewlines: DontAlign
|
||||
BinPackArguments: false
|
||||
BraceWrapping:
|
||||
AfterClass: false
|
||||
AfterControlStatement: false
|
||||
AfterEnum: false
|
||||
AfterFunction: true
|
||||
AfterObjCDeclaration: false
|
||||
AfterStruct: false
|
||||
AfterUnion: false
|
||||
BeforeCatch: false
|
||||
BeforeElse: false
|
||||
IndentBraces: false
|
||||
PointerAlignment: Right
|
||||
SortIncludes: true
|
||||
Cpp11BracedListStyle: false
|
||||
IncludeCategories:
|
||||
- Regex: '<[/[:alnum:].]+>'
|
||||
Priority: 0
|
||||
- Regex: '^"(nvim|vim)/'
|
||||
Priority: 1
|
||||
SortPriority: 1
|
||||
CaseSensitive: false
|
||||
AlignConsecutiveMacros: AcrossEmptyLines
|
||||
IndentPPDirectives: AfterHash
|
||||
SpaceBeforeParens: ControlStatementsExceptControlMacros
|
||||
PPIndentWidth: 1
|
||||
ForEachMacros:
|
||||
- FOR_ALL_AUEVENTS
|
||||
- FOR_ALL_AUPATS_IN_EVENT
|
||||
- FOR_ALL_BUFFERS
|
||||
- FOR_ALL_BUFFERS_BACKWARDS
|
||||
- FOR_ALL_FRAMES
|
||||
- FOR_ALL_QFL_ITEMS
|
||||
- FOR_ALL_SIGNS_IN_BUF
|
||||
- FOR_ALL_TABS
|
||||
- FOR_ALL_TAB_WINDOWS
|
||||
- FOR_ALL_WINDOWS_IN_TAB
|
||||
- RBUFFER_EACH
|
||||
- RBUFFER_EACH_REVERSE
|
||||
- RBUFFER_UNTIL_EMPTY
|
||||
- RBUFFER_UNTIL_FULL
|
||||
- kl_iter
|
||||
ContinuationIndentWidth: 4
|
||||
|
43
.clang-tidy
43
.clang-tidy
@ -1,43 +0,0 @@
|
||||
WarningsAsErrors: '*'
|
||||
Checks: >
|
||||
-*,
|
||||
|
||||
bugprone-*,
|
||||
google-*,
|
||||
misc-*,
|
||||
modernize-*,
|
||||
performance-*,
|
||||
portability-*,
|
||||
readability-*,
|
||||
|
||||
-bugprone-assignment-in-if-condition,
|
||||
-bugprone-branch-clone,
|
||||
-bugprone-easily-swappable-parameters,
|
||||
-bugprone-implicit-widening-of-multiplication-result,
|
||||
-bugprone-macro-parentheses,
|
||||
-bugprone-narrowing-conversions,
|
||||
-bugprone-not-null-terminated-result,
|
||||
-bugprone-reserved-identifier,
|
||||
-bugprone-sizeof-expression,
|
||||
-bugprone-suspicious-include,
|
||||
-bugprone-suspicious-memory-comparison,
|
||||
-bugprone-unused-return-value,
|
||||
-google-readability-braces-around-statements,
|
||||
-google-readability-function-size,
|
||||
-misc-misplaced-const,
|
||||
-misc-no-recursion,
|
||||
-misc-unused-parameters,
|
||||
-modernize-macro-to-enum,
|
||||
-performance-no-int-to-ptr,
|
||||
-readability-avoid-const-params-in-decls,
|
||||
-readability-braces-around-statements,
|
||||
-readability-else-after-return,
|
||||
-readability-function-cognitive-complexity,
|
||||
-readability-function-size,
|
||||
-readability-identifier-length,
|
||||
-readability-isolate-declaration,
|
||||
-readability-magic-numbers,
|
||||
-readability-misleading-indentation,
|
||||
-readability-redundant-declaration,
|
||||
-readability-redundant-function-ptr-dereference,
|
||||
-readability-suspicious-call-argument,
|
@ -6,12 +6,7 @@ indent_size = 2
|
||||
tab_width = 8
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
|
||||
[*.{c,h,in,lua}]
|
||||
max_line_length = 100
|
||||
|
||||
[*.py]
|
||||
indent_size = 4
|
||||
charset = utf-8
|
||||
|
||||
[{Makefile,**/Makefile,runtime/doc/*.txt}]
|
||||
indent_style = tab
|
||||
|
@ -36,46 +36,3 @@ d90fb1c0bfc1e64c783c385a79e7de87013dadba
|
||||
9c268263b1792d00b3ffdfd7495af2575862656e
|
||||
8c74c895b300bcee5fa937a2329d1d4756567b42
|
||||
40be47e0faef7aa015eb4ba44ceb1ee1a03e97cf
|
||||
4472c56d54f447040f6e8610b261b7efa0d04eb6
|
||||
a68faed02dc8e37b8f10da14dc02e33e6ed93947
|
||||
725cbe7d414f609e769081276f2a034e32a4337b
|
||||
7e3bdc75e44b9139d8afaea4381b53ae78b15746
|
||||
4ba12b3dda34472c193c9fa8ffd7d3bd5b6c04d6
|
||||
849f104c2789c884428fd45501912c6591a78e12
|
||||
38dd53c525054daf83dba27d7d46e90e8b41fa50
|
||||
6059784770c4c88fb6fe528b9f7634192fa1164e
|
||||
ee031eb5256bb83e0d6add2bae6fd943a4186ffe
|
||||
69e11b58b4db0952f11a5ff85aa7150b5f5b8db8
|
||||
271bb32855853b011fceaf0ad2f829bce66b2a19
|
||||
aefdc6783cb77f09786542c90901a9e7120bea42
|
||||
aa4f9c5341f5280f16cce0630ea54b84eef717b3
|
||||
0adc66171a355a12494d87ebb767d509540c7ef9
|
||||
93f24403f8cc760ff47979c596976b53a8b16358
|
||||
1ffd527c837fb2465c9659273bbe5447a1352db2
|
||||
2498e9feb025361576603a0101c86393d211e31e
|
||||
0b3ae64480ea28bb57783c2269a61f0a60ffc55e
|
||||
0fc8597f011e0927e529abd11bf0ddd8d0d1eaab
|
||||
6ff245732a5a8ab821598a38fb0c5805e6bd3779
|
||||
abf758a2977c4e6cab4dfa217f56da853d85851c
|
||||
cb84f5ee530f0f32b92bed5b4ad41344e8b551aa
|
||||
|
||||
# typos
|
||||
d238b8f6003d34cae7f65ff7585b48a2cd9449fb
|
||||
4547137aaff32b20172870a549d3a28a3c7adf1c
|
||||
08616571f47cc367a5fe59b52295708b9fda3b09
|
||||
09c6ce8c4e4c6415cca9b834539ed0df461373f6
|
||||
0b0c4f7dfa4a9a564cbf44262d4bea9bdefe2dc9
|
||||
4a96e7809f4d9f6ce21869817eb95ff6dcaa1693
|
||||
61205c1defb64ac5466496b5451e4a7f3171e21e
|
||||
64116d78502e0ca611e13adf9323ef2d3fe708c2
|
||||
abc087f4c65ca547cae58518b42aee82ff4a07f6
|
||||
b8dcbcc732baf84fc48d6b272c3ade0bcb129b3b
|
||||
c815aadfccd6bada47ecfb09fe188ee7f7c5caf3
|
||||
caa6992a1071a2ac373bec21085685da4a1790d6
|
||||
df646572c53f55268a5dbb61628d7c3b302d5663
|
||||
e63e5d1dbd3dd4711efa0ecf9e844ff308b370a6
|
||||
eb123b565e201418dd135d2602dc20eea3cead39
|
||||
ff20d40321399fa187bd350f9619cf6418d7eb6e
|
||||
|
||||
# generated docs
|
||||
ea333badd24f691c753d8048f911d1db349bc2cd
|
||||
|
17
.gitattributes
vendored
17
.gitattributes
vendored
@ -1,11 +1,6 @@
|
||||
*.h.in linguist-language=C
|
||||
*.c.in linguist-language=C
|
||||
*CMakeLists.txt linguist-language=CMake
|
||||
|
||||
runtime/doc/* linguist-documentation
|
||||
|
||||
src/xdiff/** linguist-vendored
|
||||
src/cjson/** linguist-vendored
|
||||
src/unicode/** linguist-vendored
|
||||
|
||||
.github/ export-ignore
|
||||
*.h linguist-language=C
|
||||
src/nvim/testdir/test42.in diff
|
||||
.github/ export-ignore
|
||||
.travis.yml export-ignore
|
||||
codecov.yml export-ignore
|
||||
.builds/ export-ignore
|
||||
|
53
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
53
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@ -6,32 +6,7 @@ body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
_Before reporting:_ search [existing issues](https://github.com/neovim/neovim/issues?q=is%3Aissue+is%3Aopen+label%3Abug) and check the [FAQ](https://github.com/neovim/neovim/wiki/FAQ). Usage or "How to" questions belong on the [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).
|
||||
- For startup or 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."
|
||||
validations:
|
||||
required: true
|
||||
_Before reporting:_ search [existing issues](https://github.com/neovim/neovim/issues?q=is%3Aissue+is%3Aopen+label%3Abug) and check the [FAQ](https://github.com/neovim/neovim/wiki/FAQ). Usage questions such as "How do I...?" belong on the [Neovim Discourse](https://neovim.discourse.group/c/7-category/7) and will be closed.
|
||||
|
||||
- type: input
|
||||
attributes:
|
||||
@ -72,3 +47,29 @@ body:
|
||||
placeholder: "Arch User Repository (AUR)"
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: "How to reproduce the issue"
|
||||
description: |
|
||||
- Steps to reproduce using `nvim --clean` ("factory defaults").
|
||||
- For build failures: list the exact steps including CMake flags (if any).
|
||||
- For shell-related problems: try `env -i TERM=ansi-256color "$(which nvim)"`.
|
||||
placeholder: |
|
||||
nvim --clean
|
||||
:edit foo
|
||||
yiwp
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: "Expected behavior"
|
||||
description: "Describe the behavior you expect. May include logs, images, or videos."
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: "Actual behavior"
|
||||
validations:
|
||||
required: true
|
||||
|
2
.github/ISSUE_TEMPLATE/config.yml
vendored
2
.github/ISSUE_TEMPLATE/config.yml
vendored
@ -1,5 +1,5 @@
|
||||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: Question
|
||||
url: https://vi.stackexchange.com/
|
||||
url: https://neovim.discourse.group/
|
||||
about: Ask questions about configuration and usage of Neovim
|
||||
|
13
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
13
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
@ -8,17 +8,14 @@ body:
|
||||
value: |
|
||||
Before requesting: search [existing issues](https://github.com/neovim/neovim/labels/enhancement) and check the [FAQ](https://github.com/neovim/neovim/wiki/FAQ).
|
||||
|
||||
- type: textarea
|
||||
- type: input
|
||||
attributes:
|
||||
label: "Problem"
|
||||
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
|
||||
label: "Feature already in Vim?"
|
||||
description: "Does the feature already exist in Vim? If possible, specify which version (or commit) that introduced it."
|
||||
placeholder: "Yes, Vim 7.3.432"
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: "Expected behavior"
|
||||
description: "Describe what the new feature or behavior would look like. How does it solve the problem? Is it worth the cost?"
|
||||
label: "Feature description"
|
||||
validations:
|
||||
required: true
|
||||
|
75
.github/ISSUE_TEMPLATE/lsp_bug_report.yml
vendored
75
.github/ISSUE_TEMPLATE/lsp_bug_report.yml
vendored
@ -6,56 +6,7 @@ body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
_Before reporting:_ search [existing issues](https://github.com/neovim/neovim/issues?q=is%3Aissue+is%3Aopen+label%3Abug) and check the [FAQ](https://github.com/neovim/neovim/wiki/FAQ). Usage questions or "Why isn't X language server/feature working?" belong on [stackoverflow](https://vi.stackexchange.com/) 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."
|
||||
_Before reporting:_ search [existing issues](https://github.com/neovim/neovim/issues?q=is%3Aissue+is%3Aopen+label%3Abug) and check the [FAQ](https://github.com/neovim/neovim/wiki/FAQ). Usage questions such as "How do I...?" or "Why isn't X language server/feature working?" belong on the [Neovim Discourse](https://neovim.discourse.group/c/7-category/7) and will be closed.
|
||||
|
||||
- type: input
|
||||
attributes:
|
||||
@ -76,6 +27,30 @@ body:
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: ':checkhealth'
|
||||
description: |
|
||||
Paste the results from `nvim -c ":checkhealth nvim lspconfig"`
|
||||
render: markdown
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: 'Steps to reproduce using "nvim -u minimal_init.lua"'
|
||||
description: |
|
||||
- Download the minimal config with `curl -LO https://raw.githubusercontent.com/neovim/nvim-lspconfig/master/test/minimal_init.lua` and modify it to include any specific commands or servers pertaining to your issues.
|
||||
- _Note_: if the issue is with an autocompletion or other LSP plugin, report to that plugin's issue tracker.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: "Expected behavior"
|
||||
description: "Describe the behavior you expect. May include logs, images, or videos."
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: "Actual behavior"
|
||||
|
||||
- type: input
|
||||
attributes:
|
||||
label: "Log file"
|
||||
|
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
|
26
.github/actions/cache/action.yml
vendored
26
.github/actions/cache/action.yml
vendored
@ -1,26 +0,0 @@
|
||||
name: 'Cache'
|
||||
description: "This action caches neovim dependencies"
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- run: echo "CACHE_KEY=${{ github.job }}" >> $GITHUB_ENV
|
||||
shell: bash
|
||||
|
||||
- if: ${{ matrix }}
|
||||
run: echo "CACHE_KEY=$CACHE_KEY-${{ join(matrix.*, '-') }}" >> $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@v3
|
||||
with:
|
||||
path: .deps
|
||||
key: ${{ env.CACHE_KEY }}-${{ steps.image.outputs.version }}-${{ hashFiles('cmake**',
|
||||
'.github/workflows/test.yml', 'CMakeLists.txt',
|
||||
'runtime/CMakeLists.txt', 'src/nvim/**/CMakeLists.txt') }}
|
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"
|
21
.github/labeler.yml
vendored
21
.github/labeler.yml
vendored
@ -2,6 +2,10 @@
|
||||
- runtime/lua/vim/lsp.lua
|
||||
- runtime/lua/vim/lsp/*
|
||||
|
||||
"lua":
|
||||
- runtime/lua/**/*
|
||||
- src/nvim/lua/*
|
||||
|
||||
"tui":
|
||||
- src/nvim/tui/tui.*
|
||||
|
||||
@ -9,13 +13,12 @@
|
||||
- src/nvim/lua/treesitter.*
|
||||
- runtime/lua/vim/treesitter.lua
|
||||
- runtime/lua/vim/treesitter/*
|
||||
- runtime/queries/**/*
|
||||
|
||||
"diagnostic":
|
||||
- runtime/lua/vim/diagnostic.lua
|
||||
|
||||
"dependencies":
|
||||
- cmake.deps/**/*
|
||||
- third-party/**/*
|
||||
|
||||
"spell":
|
||||
- src/nvim/spell*
|
||||
@ -24,6 +27,8 @@
|
||||
- src/nvim/terminal.*
|
||||
|
||||
"column":
|
||||
- src/nvim/mark.h
|
||||
- src/nvim/mark.c
|
||||
- src/nvim/sign*
|
||||
|
||||
"folds":
|
||||
@ -34,7 +39,6 @@
|
||||
|
||||
"documentation":
|
||||
- all: ["runtime/doc/*"]
|
||||
- all: ["**/*.md"]
|
||||
|
||||
"clipboard":
|
||||
- runtime/autoload/provider/clipboard.vim
|
||||
@ -45,10 +49,9 @@
|
||||
"build":
|
||||
- CMakeLists.txt
|
||||
- "**/CMakeLists.txt"
|
||||
- "**/Makefile"
|
||||
- "**/*.cmake"
|
||||
|
||||
"test":
|
||||
"tests":
|
||||
- all: ["test/**/*"]
|
||||
|
||||
"ci":
|
||||
@ -56,11 +59,3 @@
|
||||
- .github/workflows/**/*
|
||||
- .builds/*
|
||||
- ci/**/*
|
||||
|
||||
"filetype":
|
||||
- runtime/lua/vim/filetype.lua
|
||||
- runtime/lua/vim/filetype/detect.lua
|
||||
|
||||
"platform:nix":
|
||||
- contrib/flake.lock
|
||||
- contrib/flake.nix
|
||||
|
34
.github/scripts/build_universal_macos.sh
vendored
34
.github/scripts/build_universal_macos.sh
vendored
@ -1,34 +0,0 @@
|
||||
#!/bin/bash -e
|
||||
|
||||
echo "Provision universal libintl"
|
||||
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/
|
||||
|
||||
echo "Ensure static linkage to libintl"
|
||||
# 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"
|
||||
|
||||
echo "Build release"
|
||||
cd "$GITHUB_WORKSPACE"
|
||||
MACOSX_DEPLOYMENT_TARGET="$(sw_vers -productVersion | cut -f1 -d.)"
|
||||
export MACOSX_DEPLOYMENT_TARGET
|
||||
cmake -S cmake.deps -B .deps -G Ninja -D CMAKE_BUILD_TYPE=${NVIM_BUILD_TYPE} -D CMAKE_OSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} -D CMAKE_OSX_ARCHITECTURES=arm64\;x86_64
|
||||
cmake --build .deps
|
||||
cmake -B build -G Ninja -D CMAKE_BUILD_TYPE=${NVIM_BUILD_TYPE} -D CMAKE_OSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} -D CMAKE_OSX_ARCHITECTURES=arm64\;x86_64
|
||||
cmake --build build
|
||||
# Make sure we build everything for M1 as well
|
||||
for macho in build/bin/* build/lib/nvim/parser/*.so; do
|
||||
lipo -info "$macho" | grep -q arm64 || exit 1
|
||||
done
|
||||
cpack --config build/CPackConfig.cmake
|
55
.github/scripts/close_unresponsive.js
vendored
55
.github/scripts/close_unresponsive.js
vendored
@ -1,55 +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: "closed",
|
||||
});
|
||||
|
||||
github.rest.issues.createComment({
|
||||
owner: owner,
|
||||
repo: repo,
|
||||
issue_number: number,
|
||||
body: close_message,
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
10
.github/scripts/install_deps.sh
vendored
10
.github/scripts/install_deps.sh
vendored
@ -1,10 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
os=$(uname -s)
|
||||
if [[ $os == Linux ]]; then
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y build-essential cmake curl gettext locales-all ninja-build pkg-config unzip "$@"
|
||||
elif [[ $os == Darwin ]]; then
|
||||
brew update --quiet
|
||||
brew install ninja "$@"
|
||||
fi
|
16
.github/scripts/remove-reviewers.js
vendored
16
.github/scripts/remove-reviewers.js
vendored
@ -1,16 +0,0 @@
|
||||
module.exports = async ({ github, context }) => {
|
||||
const requestedReviewers = await github.rest.pulls.listRequestedReviewers({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
pull_number: context.issue.number,
|
||||
});
|
||||
|
||||
const reviewers = requestedReviewers.data.users.map((e) => e.login);
|
||||
|
||||
github.rest.pulls.removeRequestedReviewers({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
pull_number: context.issue.number,
|
||||
reviewers: reviewers,
|
||||
});
|
||||
};
|
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",
|
||||
});
|
||||
}
|
||||
};
|
114
.github/scripts/reviews.js
vendored
114
.github/scripts/reviews.js
vendored
@ -1,114 +0,0 @@
|
||||
module.exports = async ({ github, context }) => {
|
||||
const pr_data = await github.rest.pulls.get({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
pull_number: context.issue.number,
|
||||
});
|
||||
const labels = pr_data.data.labels.map((e) => e.name);
|
||||
const reviewers = new Set();
|
||||
|
||||
if (labels.includes("api")) {
|
||||
reviewers.add("bfredl");
|
||||
reviewers.add("famiu");
|
||||
}
|
||||
|
||||
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("dependencies")) {
|
||||
reviewers.add("jamessan");
|
||||
}
|
||||
|
||||
if (labels.includes("diagnostic")) {
|
||||
reviewers.add("gpanders");
|
||||
}
|
||||
|
||||
if (labels.includes("diff")) {
|
||||
reviewers.add("lewis6991");
|
||||
}
|
||||
|
||||
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");
|
||||
reviewers.add("smjonas");
|
||||
}
|
||||
|
||||
if (labels.includes("lsp")) {
|
||||
reviewers.add("folke");
|
||||
reviewers.add("glepnir");
|
||||
reviewers.add("mfussenegger");
|
||||
}
|
||||
|
||||
if (labels.includes("platform:nix")) {
|
||||
reviewers.add("teto");
|
||||
}
|
||||
|
||||
if (labels.includes("project-management")) {
|
||||
reviewers.add("bfredl");
|
||||
reviewers.add("justinmk");
|
||||
}
|
||||
|
||||
if (labels.includes("statusline")) {
|
||||
reviewers.add("famiu");
|
||||
}
|
||||
|
||||
if (labels.includes("test")) {
|
||||
reviewers.add("justinmk");
|
||||
}
|
||||
|
||||
if (labels.includes("treesitter")) {
|
||||
reviewers.add("bfredl");
|
||||
reviewers.add("clason");
|
||||
reviewers.add("lewis6991");
|
||||
}
|
||||
|
||||
if (labels.includes("typo")) {
|
||||
reviewers.add("dundargoc");
|
||||
}
|
||||
|
||||
if (labels.includes("ui")) {
|
||||
reviewers.add("bfredl");
|
||||
reviewers.add("famiu");
|
||||
}
|
||||
|
||||
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/add-reviewers.yml
vendored
18
.github/workflows/add-reviewers.yml
vendored
@ -1,18 +0,0 @@
|
||||
name: "Request reviews"
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [labeled, ready_for_review, reopened]
|
||||
jobs:
|
||||
request-reviewer:
|
||||
if: github.event.pull_request.state == 'open' && github.event.pull_request.draft == false
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
pull-requests: write
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: 'Request reviewers'
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
script: |
|
||||
const script = require('./.github/scripts/reviews.js')
|
||||
await script({github, context})
|
43
.github/workflows/api-docs.yml
vendored
43
.github/workflows/api-docs.yml
vendored
@ -1,38 +1,53 @@
|
||||
# Check if any PR needs to run the autogenerate script
|
||||
name: Autogenerate API docs
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
paths:
|
||||
- 'src/nvim/api/*.[ch]'
|
||||
- 'src/nvim/**.lua'
|
||||
- 'runtime/lua/**.lua'
|
||||
- 'runtime/doc/**'
|
||||
branches:
|
||||
- 'master'
|
||||
- 'release-[0-9]+.[0-9]+'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
regen-api-docs:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-20.04
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
steps:
|
||||
- uses: rhysd/action-setup-vim@v1
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
neovim: true
|
||||
version: nightly
|
||||
- uses: actions/checkout@v3
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo env DEBIAN_FRONTEND=noninteractive apt-get install -y doxygen python3 python3-msgpack
|
||||
sudo env DEBIAN_FRONTEND=noninteractive apt-get install -y python3 luajit
|
||||
conda install -c conda-forge doxygen=1.9.2 msgpack-python
|
||||
echo "$CONDA/bin" >> $GITHUB_PATH
|
||||
|
||||
- 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 'UPDATED_DOCS=%s\n' $([ -z "$(git diff)" ]; echo $?) >> $GITHUB_OUTPUT
|
||||
printf '::set-output name=UPDATED_DOCS::%s\n' $([ -z "$(git diff)" ]; echo $?)
|
||||
|
||||
- name: FAIL, PR has not committed doc changes
|
||||
- name: Automatic PR
|
||||
if: ${{ steps.docs.outputs.UPDATED_DOCS != 0 }}
|
||||
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
|
||||
git add -u
|
||||
git commit -m 'docs: regenerate'
|
||||
git push --force https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY} ${DOC_BRANCH}
|
||||
gh pr create --fill --base ${GITHUB_REF#refs/heads/} --head ${DOC_BRANCH} || true
|
||||
|
23
.github/workflows/backport.yml
vendored
23
.github/workflows/backport.yml
vendored
@ -2,15 +2,32 @@ name: Backport
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [closed, labeled]
|
||||
issue_comment:
|
||||
types: [created]
|
||||
jobs:
|
||||
backport:
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
name: Backport Pull Request
|
||||
if: github.event.pull_request.merged
|
||||
if: >
|
||||
github.repository_owner == 'neovim' && (
|
||||
github.event_name == 'pull_request' &&
|
||||
github.event.pull_request.merged
|
||||
) || (
|
||||
github.event_name == 'issue_comment' &&
|
||||
github.event.issue.pull_request &&
|
||||
contains(github.event.comment.body, '/backport')
|
||||
)
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
# required to find all branches
|
||||
fetch-depth: 0
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
- name: Create backport PRs
|
||||
uses: korthout/backport-action@v1
|
||||
uses: zeebe-io/backport-action@v0.0.7
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
github_workspace: ${{ github.workspace }}
|
||||
|
73
.github/workflows/build.yml
vendored
73
.github/workflows/build.yml
vendored
@ -1,73 +0,0 @@
|
||||
name: build
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- 'master'
|
||||
- 'release-[0-9]+.[0-9]+'
|
||||
paths:
|
||||
- '**.cmake'
|
||||
- '**/CMakeLists.txt'
|
||||
- '**/CMakePresets.json'
|
||||
- 'cmake.*/**'
|
||||
- '.github/**'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
BIN_DIR: ${{ github.workspace }}/bin
|
||||
INSTALL_PREFIX: ${{ github.workspace }}/nvim-install
|
||||
|
||||
jobs:
|
||||
macos-universal:
|
||||
runs-on: macos-latest
|
||||
timeout-minutes: 20
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Install dependencies
|
||||
run: ./.github/scripts/install_deps.sh
|
||||
|
||||
- run: printf 'NVIM_BUILD_TYPE=Release\n' >> $GITHUB_ENV
|
||||
|
||||
- name: Build universal binary
|
||||
run: ./.github/scripts/build_universal_macos.sh
|
||||
|
||||
old-cmake:
|
||||
name: Test oldest supported cmake
|
||||
runs-on: ubuntu-22.04
|
||||
timeout-minutes: 15
|
||||
env:
|
||||
CMAKE_URL: 'https://cmake.org/files/v3.10/cmake-3.10.0-Linux-x86_64.sh'
|
||||
CMAKE_VERSION: '3.10.0'
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Set up environment
|
||||
run: echo "$BIN_DIR" >> $GITHUB_PATH
|
||||
|
||||
- name: Install dependencies
|
||||
run: ./.github/scripts/install_deps.sh
|
||||
|
||||
- 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
|
185
.github/workflows/ci.yml
vendored
Normal file
185
.github/workflows/ci.yml
vendored
Normal file
@ -0,0 +1,185 @@
|
||||
name: CI
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
- 'release-[0-9]+.[0-9]+'
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened, ready_for_review]
|
||||
branches:
|
||||
- 'master'
|
||||
- 'release-[0-9]+.[0-9]+'
|
||||
|
||||
jobs:
|
||||
unixish:
|
||||
name: ${{ matrix.runner }} ${{ matrix.flavor }} (cc=${{ matrix.cc }})
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- flavor: asan
|
||||
cc: clang-12
|
||||
runner: ubuntu-20.04
|
||||
os: linux
|
||||
- flavor: lint
|
||||
cc: gcc
|
||||
runner: ubuntu-20.04
|
||||
os: linux
|
||||
- flavor: tsan
|
||||
cc: clang-12
|
||||
runner: ubuntu-20.04
|
||||
os: linux
|
||||
- cc: clang
|
||||
runner: macos-10.15
|
||||
os: osx
|
||||
- cc: clang
|
||||
runner: macos-11.0
|
||||
os: osx
|
||||
runs-on: ${{ matrix.runner }}
|
||||
timeout-minutes: 45
|
||||
if: github.event.pull_request.draft == false
|
||||
env:
|
||||
CC: ${{ matrix.cc }}
|
||||
CI_OS_NAME: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- 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 ccache cmake cpanminus cscope gcc-multilib gdb gettext gperf language-pack-tr libtool-bin locales ninja-build pkg-config python3 python3-pip python3-setuptools unzip valgrind xclip
|
||||
|
||||
- name: Install 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 12
|
||||
rm llvm.sh
|
||||
|
||||
- name: Install brew packages
|
||||
if: matrix.os == 'osx'
|
||||
run: |
|
||||
# Workaround brew issues
|
||||
rm -f /usr/local/bin/2to3
|
||||
brew update >/dev/null
|
||||
brew upgrade
|
||||
brew install automake ccache perl cpanminus ninja
|
||||
|
||||
- name: Setup interpreter packages
|
||||
run: |
|
||||
./ci/before_install.sh
|
||||
./ci/install.sh
|
||||
|
||||
- name: Cache dependencies
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: |
|
||||
${{ env.CACHE_NVIM_DEPS_DIR }}
|
||||
~/.ccache
|
||||
key: ${{ matrix.runner }}-${{ matrix.flavor }}-${{ matrix.cc }}-${{ hashFiles('cmake/*', 'third-party/**', '**/CMakeLists.txt') }}-${{ github.base_ref }}
|
||||
|
||||
- name: Build third-party
|
||||
run: ./ci/before_script.sh
|
||||
|
||||
- name: Build and test
|
||||
run: ./ci/script.sh
|
||||
|
||||
- name: Cache dependencies
|
||||
if: ${{ success() }}
|
||||
run: ./ci/before_cache.sh
|
||||
|
||||
windows:
|
||||
runs-on: windows-2016
|
||||
if: github.event.pull_request.draft == false
|
||||
env:
|
||||
DEPS_BUILD_DIR: ${{ format('{0}/nvim-deps', github.workspace) }}
|
||||
DEPS_PREFIX: ${{ format('{0}/nvim-deps/usr', github.workspace) }}
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
config: [ MINGW_64-gcov, MSVC_64 ]
|
||||
name: windows (${{ matrix.config }})
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: ${{ env.DEPS_BUILD_DIR }}
|
||||
key: ${{ matrix.config }}-${{ hashFiles('third-party\**') }}
|
||||
|
||||
- name: Run CI
|
||||
run: powershell ci\build.ps1
|
||||
env:
|
||||
CONFIGURATION: ${{ matrix.config }}
|
||||
|
||||
functionaltest:
|
||||
name: ${{ matrix.runner }} ${{ matrix.flavor }} (cc=${{ matrix.cc }})
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- flavor: functionaltest-lua
|
||||
cc: gcc
|
||||
runner: ubuntu-20.04
|
||||
os: linux
|
||||
runs-on: ${{ matrix.runner }}
|
||||
timeout-minutes: 45
|
||||
env:
|
||||
CC: ${{ matrix.cc }}
|
||||
CI_OS_NAME: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Setup commom environment variables
|
||||
run: ./.github/workflows/env.sh ${{ matrix.flavor }}
|
||||
|
||||
- name: Install apt packages
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y autoconf automake build-essential ccache cmake cpanminus cscope gcc-multilib gdb gettext gperf language-pack-tr libtool-bin locales ninja-build pkg-config python3 python3-pip python3-setuptools unzip valgrind xclip
|
||||
|
||||
- name: Install minimum required version of cmake
|
||||
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: Setup interpreter packages
|
||||
run: |
|
||||
./ci/before_install.sh
|
||||
./ci/install.sh
|
||||
|
||||
- name: Cache dependencies
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: |
|
||||
${{ env.CACHE_NVIM_DEPS_DIR }}
|
||||
~/.ccache
|
||||
key: ${{ matrix.runner }}-${{ matrix.flavor }}-${{ matrix.cc }}-${{ hashFiles('cmake/*', 'third-party/**', '**/CMakeLists.txt') }}-${{ github.base_ref }}
|
||||
|
||||
- name: Build third-party
|
||||
run: ./ci/before_script.sh
|
||||
|
||||
- name: Build and test
|
||||
run: ./ci/script.sh
|
||||
|
||||
- name: Cache dependencies
|
||||
if: ${{ success() }}
|
||||
run: ./ci/before_cache.sh
|
31
.github/workflows/codeql.yml
vendored
31
.github/workflows/codeql.yml
vendored
@ -1,31 +0,0 @@
|
||||
name: "CodeQL"
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '42 0 * * 0'
|
||||
workflow_dispatch:
|
||||
jobs:
|
||||
analyze:
|
||||
name: Analyze
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
actions: read
|
||||
contents: read
|
||||
security-events: write
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install dependencies
|
||||
run: ./.github/scripts/install_deps.sh
|
||||
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v2
|
||||
with:
|
||||
languages: cpp
|
||||
|
||||
- run: make
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v2
|
@ -2,18 +2,18 @@ name: "Commit Linter"
|
||||
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
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v2.3.1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
- uses: rhysd/action-setup-vim@v1
|
||||
with:
|
||||
neovim: true
|
||||
- run: nvim --clean -es +"lua require('scripts.lintcommit').main({trace=false})"
|
||||
- run: nvim --clean -es +"lua require('scripts.lintcommit').main({trace=true})"
|
@ -1,17 +1,19 @@
|
||||
name: Coverity
|
||||
on:
|
||||
schedule:
|
||||
- cron: '10 0 * * *' # Run every day at 00:10
|
||||
- cron: '0 10 * * 1' # Run every Monday at 00:10
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
scan:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-18.04
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Install dependencies
|
||||
run: ./.github/scripts/install_deps.sh
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y autoconf automake build-essential cmake gettext gperf libtool-bin locales ninja-build pkg-config unzip
|
||||
|
||||
- name: Download Coverity
|
||||
run: |
|
||||
@ -35,7 +37,7 @@ jobs:
|
||||
--form email=$EMAIL \
|
||||
--form file=@cov-scan.tgz \
|
||||
--form version="$(git rev-parse HEAD)" \
|
||||
--form description="Daily GHA scan" \
|
||||
--form description="Weekly GHA scan" \
|
||||
'https://scan.coverity.com/builds?project=neovim%2Fneovim'
|
||||
env:
|
||||
TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
|
65
.github/workflows/env.sh
vendored
Executable file
65
.github/workflows/env.sh
vendored
Executable file
@ -0,0 +1,65 @@
|
||||
#!/bin/bash
|
||||
set -e -u
|
||||
|
||||
FLAVOR=${1:-}
|
||||
|
||||
cat <<EOF >> "$GITHUB_PATH"
|
||||
$HOME/.local/bin
|
||||
EOF
|
||||
|
||||
cat <<EOF >> "$GITHUB_ENV"
|
||||
CACHE_ENABLE=true
|
||||
CI_TARGET=tests
|
||||
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
|
||||
CCACHE_BASEDIR=$GITHUB_WORKSPACE
|
||||
CCACHE_COMPRESS=1
|
||||
CCACHE_SLOPPINESS=time_macros,file_macro
|
||||
CCACHE_DIR=$HOME/.ccache
|
||||
EOF
|
||||
|
||||
DEPS_CMAKE_FLAGS=-DUSE_BUNDLED_GPERF=OFF
|
||||
FUNCTIONALTEST=functionaltest
|
||||
BUILD_FLAGS="CMAKE_FLAGS=-DCI_BUILD=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX:PATH=$HOME/nvim-install -DBUSTED_OUTPUT_TYPE=nvim -DDEPS_PREFIX=$HOME/nvim-deps/usr -DMIN_LOG_LEVEL=3"
|
||||
|
||||
case "$FLAVOR" in
|
||||
asan)
|
||||
BUILD_FLAGS="$BUILD_FLAGS -DPREFER_LUA=ON"
|
||||
cat <<EOF >> "$GITHUB_ENV"
|
||||
CLANG_SANITIZER=ASAN_UBSAN
|
||||
SYMBOLIZER=asan_symbolize-12
|
||||
ASAN_OPTIONS=detect_leaks=1:check_initialization_order=1:log_path=$GITHUB_WORKSPACE/build/log/asan
|
||||
UBSAN_OPTIONS=print_stacktrace=1 log_path=$GITHUB_WORKSPACE/build/log/ubsan
|
||||
EOF
|
||||
;;
|
||||
tsan)
|
||||
cat <<EOF >> "$GITHUB_ENV"
|
||||
TSAN_OPTIONS=log_path=$GITHUB_WORKSPACE/build/log/tsan
|
||||
EOF
|
||||
;;
|
||||
lint)
|
||||
cat <<EOF >> "$GITHUB_ENV"
|
||||
CI_TARGET=lint
|
||||
EOF
|
||||
;;
|
||||
functionaltest-lua)
|
||||
BUILD_FLAGS="$BUILD_FLAGS -DPREFER_LUA=ON"
|
||||
FUNCTIONALTEST=functionaltest-lua
|
||||
DEPS_CMAKE_FLAGS="$DEPS_CMAKE_FLAGS -DUSE_BUNDLED_LUAJIT=OFF"
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
cat <<EOF >> "$GITHUB_ENV"
|
||||
$BUILD_FLAGS
|
||||
DEPS_CMAKE_FLAGS=$DEPS_CMAKE_FLAGS
|
||||
FUNCTIONALTEST=$FUNCTIONALTEST
|
||||
EOF
|
34
.github/workflows/issue-open-check.yml
vendored
34
.github/workflows/issue-open-check.yml
vendored
@ -1,34 +0,0 @@
|
||||
name: Issue Open Check
|
||||
|
||||
on:
|
||||
issues:
|
||||
types: [opened]
|
||||
|
||||
jobs:
|
||||
issue-open-check:
|
||||
permissions:
|
||||
issues: write
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: check issue title
|
||||
id: check-issue
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
script: |
|
||||
const title = context.payload.issue.title;
|
||||
const titleSplit = title.split(/\s+/).map(e => e.toLowerCase());
|
||||
const keywords = ['api', 'treesitter', 'ui', 'lsp', 'doc'];
|
||||
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)
|
||||
})
|
||||
}
|
32
.github/workflows/labeler.yml
vendored
32
.github/workflows/labeler.yml
vendored
@ -1,19 +1,17 @@
|
||||
name: "Pull Request Labeler"
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [opened]
|
||||
types: opened
|
||||
jobs:
|
||||
|
||||
triage:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
steps:
|
||||
- uses: actions/labeler@v4
|
||||
- uses: actions/labeler@main
|
||||
with:
|
||||
sync-labels: ""
|
||||
|
||||
repo-token: "${{ secrets.GITHUB_TOKEN }}"
|
||||
type-scope:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
@ -25,24 +23,8 @@ jobs:
|
||||
PR_NUMBER: ${{ github.event.pull_request.number }}
|
||||
PR_TITLE: ${{ github.event.pull_request.title }}
|
||||
steps:
|
||||
- name: "Extract commit type and add as label"
|
||||
run: gh pr edit "$PR_NUMBER" --add-label "$(echo "$PR_TITLE" | sed -E 's|([[:alpha:]]+)(\(.*\))?!?:.*|\1|')" || true
|
||||
- name: "Extract commit scope and add as label"
|
||||
run: gh pr edit "$PR_NUMBER" --add-label "$(echo "$PR_TITLE" | sed -E 's|[[:alpha:]]+\((.+)\)!?:.*|\1|')" || true
|
||||
- name: "Extract if the PR is a breaking change and add it as label"
|
||||
run: gh pr edit "$PR_NUMBER" --add-label "$(echo "$PR_TITLE" | sed -E 's|[[:alpha:]]+(\(.*\))?!:.*|breaking-change|')" || true
|
||||
# Extract type and try to add it as a label
|
||||
- run: gh pr edit "$PR_NUMBER" --add-label "$(echo "$PR_TITLE" | sed -E 's|([[:alpha:]]+)(\(.*\))?!?:.*|\1|')" || true
|
||||
|
||||
request-reviewer:
|
||||
if: github.event.pull_request.state == 'open' && github.event.pull_request.draft == false
|
||||
runs-on: ubuntu-latest
|
||||
needs: ["triage", "type-scope"]
|
||||
permissions:
|
||||
pull-requests: write
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: 'Request reviewers'
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
script: |
|
||||
const script = require('./.github/scripts/reviews.js')
|
||||
await script({github, context})
|
||||
# Extract scope and try to add it as a label
|
||||
- run: gh pr edit "$PR_NUMBER" --add-label "$(echo "$PR_TITLE" | sed -E 's|[[:alpha:]]+\((.+)\)!?:.*|\1|')" || true
|
||||
|
34
.github/workflows/news.yml
vendored
34
.github/workflows/news.yml
vendored
@ -1,34 +0,0 @@
|
||||
name: "news.txt check"
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened, ready_for_review]
|
||||
branches:
|
||||
- 'master'
|
||||
jobs:
|
||||
check:
|
||||
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 }}
|
||||
- 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
|
30
.github/workflows/notes.md
vendored
30
.github/workflows/notes.md
vendored
@ -6,28 +6,17 @@ ${NVIM_VERSION}
|
||||
|
||||
### Windows
|
||||
|
||||
#### Zip
|
||||
|
||||
1. Download **nvim-win64.zip**
|
||||
2. Extract the zip
|
||||
3. Run `nvim-qt.exe`
|
||||
|
||||
#### MSI
|
||||
|
||||
1. Download **nvim-win64.msi**
|
||||
2. Run the MSI
|
||||
3. Search and run `nvim-qt.exe` or run `nvim.exe` on your CLI of choice
|
||||
1. Extract **nvim-win64.zip**
|
||||
2. Run `nvim-qt.exe`
|
||||
|
||||
### macOS
|
||||
|
||||
1. Download **nvim-macos.tar.gz**
|
||||
2. Run `xattr -c ./nvim-macos.tar.gz` (to avoid "unknown developer" warning)
|
||||
3. Extract: `tar xzvf nvim-macos.tar.gz`
|
||||
4. Run `./nvim-macos/bin/nvim`
|
||||
2. Extract: `tar xzvf nvim-macos.tar.gz`
|
||||
3. Run `./nvim-osx64/bin/nvim`
|
||||
|
||||
### Linux (x64)
|
||||
|
||||
#### AppImage
|
||||
1. Download **nvim.appimage**
|
||||
2. Run `chmod u+x nvim.appimage && ./nvim.appimage`
|
||||
- If your system does not have FUSE you can [extract the appimage](https://github.com/AppImage/AppImageKit/wiki/FUSE#type-2-appimage):
|
||||
@ -36,12 +25,6 @@ ${NVIM_VERSION}
|
||||
./squashfs-root/usr/bin/nvim
|
||||
```
|
||||
|
||||
#### Tarball
|
||||
|
||||
1. Download **nvim-linux64.tar.gz**
|
||||
2. Extract: `tar xzvf nvim-linux64.tar.gz`
|
||||
3. Run `./nvim-linux64/bin/nvim`
|
||||
|
||||
### Other
|
||||
|
||||
- Install by [package manager](https://github.com/neovim/neovim/wiki/Installing-Neovim)
|
||||
@ -49,10 +32,9 @@ ${NVIM_VERSION}
|
||||
## SHA256 Checksums
|
||||
|
||||
```
|
||||
${SHA_LINUX_64_TAR}
|
||||
${SHA_LINUX_64}
|
||||
${SHA_APP_IMAGE}
|
||||
${SHA_APP_IMAGE_ZSYNC}
|
||||
${SHA_MACOS}
|
||||
${SHA_WIN_64_ZIP}
|
||||
${SHA_WIN_64_MSI}
|
||||
${SHA_WIN_64}
|
||||
```
|
||||
|
246
.github/workflows/release.yml
vendored
246
.github/workflows/release.yml
vendored
@ -13,137 +13,151 @@ on:
|
||||
- v[0-9]+.[0-9]+.[0-9]+
|
||||
|
||||
# Build on the oldest supported images, so we have broader compatibility
|
||||
# Build with gcc-10 to prevent triggering #14150 (default is still gcc-9 on 20.04)
|
||||
# Upgrade to gcc-11 to prevent it from using its builtins (#14150)
|
||||
jobs:
|
||||
linux:
|
||||
runs-on: ubuntu-20.04
|
||||
env:
|
||||
CC: gcc-10
|
||||
runs-on: ubuntu-18.04
|
||||
outputs:
|
||||
version: ${{ steps.build.outputs.version }}
|
||||
container:
|
||||
image: ubuntu:18.04
|
||||
options: --privileged # Privileged mode is needed to load fuse module.
|
||||
release: ${{ steps.build.outputs.release }}
|
||||
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
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
apt-get update
|
||||
apt-get install -y build-essential cmake gettext ninja-build unzip
|
||||
- if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name != 'nightly')
|
||||
run: |
|
||||
echo 'NVIM_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 'NVIM_BUILD_TYPE=RelWithDebInfo' >> $GITHUB_ENV
|
||||
echo 'APPIMAGE_TAG=nightly' >> $GITHUB_ENV
|
||||
- name: appimage
|
||||
run: ./scripts/genappimage.sh ${APPIMAGE_TAG}
|
||||
- name: tar.gz
|
||||
run: cpack --config build/CPackConfig.cmake -G TGZ
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: appimage
|
||||
path: |
|
||||
build/bin/nvim.appimage
|
||||
build/bin/nvim.appimage.zsync
|
||||
retention-days: 1
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: nvim-linux64
|
||||
path: |
|
||||
build/nvim-linux64.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:
|
||||
runs-on: macos-11
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Install dependencies
|
||||
run: ./.github/scripts/install_deps.sh
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y autoconf automake build-essential cmake gcc-11 gettext gperf libtool-bin locales ninja-build pkg-config unzip
|
||||
- if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name != 'nightly')
|
||||
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: Build universal binary
|
||||
run: ./.github/scripts/build_universal_macos.sh
|
||||
- uses: actions/upload-artifact@v3
|
||||
- name: Build release
|
||||
id: build
|
||||
run: |
|
||||
CC=gcc-11 make CMAKE_BUILD_TYPE=${NVIM_BUILD_TYPE} CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX:PATH="
|
||||
printf '::set-output name=version::%s\n' "$(./build/bin/nvim --version | head -n 3 | sed -z 's/\n/%0A/g')"
|
||||
printf '::set-output name=release::%s\n' "$(./build/bin/nvim --version | head -n 1)"
|
||||
make DESTDIR="$GITHUB_WORKSPACE/build/release/nvim-linux64" install
|
||||
cd "$GITHUB_WORKSPACE/build/release"
|
||||
tar cfz nvim-linux64.tar.gz nvim-linux64
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: nvim-linux64
|
||||
path: build/release/nvim-linux64.tar.gz
|
||||
retention-days: 1
|
||||
|
||||
appimage:
|
||||
runs-on: ubuntu-18.04
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y autoconf automake build-essential cmake gcc-11 gettext gperf libtool-bin locales ninja-build pkg-config unzip
|
||||
- if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name != 'nightly')
|
||||
run: CC=gcc-11 make appimage-latest
|
||||
- if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly')
|
||||
run: CC=gcc-11 make appimage-nightly
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: appimage
|
||||
path: build/bin/nvim.appimage
|
||||
retention-days: 1
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: appimage
|
||||
path: build/bin/nvim.appimage.zsync
|
||||
retention-days: 1
|
||||
|
||||
macOS:
|
||||
runs-on: macos-10.15
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Install brew packages
|
||||
run: |
|
||||
rm -f /usr/local/bin/2to3
|
||||
brew update >/dev/null
|
||||
brew upgrade
|
||||
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: Build release
|
||||
run: |
|
||||
make CMAKE_BUILD_TYPE=${NVIM_BUILD_TYPE} CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX:PATH= -DCMAKE_OSX_DEPLOYMENT_TARGET=10.11"
|
||||
make DESTDIR="$GITHUB_WORKSPACE/build/release/nvim-osx64" install
|
||||
- name: Create package
|
||||
run: |
|
||||
cd "$GITHUB_WORKSPACE/build/release"
|
||||
mkdir -p nvim-osx64/libs
|
||||
libs=($(otool -L nvim-osx64/bin/nvim | sed 1d | sed -E -e 's|^[[:space:]]*||' -e 's| .*||'))
|
||||
echo "libs:"
|
||||
for lib in "${libs[@]}"; do
|
||||
if echo "$lib" | grep -q -E 'libSystem|CoreFoundation' 2>/dev/null; then
|
||||
echo " [skipped] $lib"
|
||||
else
|
||||
echo " $lib"
|
||||
relname="libs/${lib##*/}"
|
||||
cp -L "$lib" "nvim-osx64/$relname"
|
||||
install_name_tool -change "$lib" "@executable_path/../$relname" nvim-osx64/bin/nvim
|
||||
fi
|
||||
done
|
||||
tar cfz nvim-macos.tar.gz nvim-osx64
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: nvim-macos
|
||||
path: build/nvim-macos.tar.gz
|
||||
path: build/release/nvim-macos.tar.gz
|
||||
retention-days: 1
|
||||
|
||||
windows:
|
||||
runs-on: windows-2019
|
||||
name: windows (MSVC_64)
|
||||
runs-on: windows-2016
|
||||
env:
|
||||
DEPS_BUILD_DIR: ${{ format('{0}/nvim-deps', github.workspace) }}
|
||||
DEPS_PREFIX: ${{ format('{0}/nvim-deps/usr', github.workspace) }}
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- config: MSVC_64
|
||||
archive: nvim-win64
|
||||
name: windows (${{ matrix.config }})
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Set env
|
||||
run: |
|
||||
$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
|
||||
}
|
||||
}
|
||||
- name: Build deps
|
||||
run: |
|
||||
cmake -S cmake.deps -B .deps -G Ninja -DCMAKE_BUILD_TYPE='RelWithDebInfo'
|
||||
cmake --build .deps
|
||||
- name: build package
|
||||
run: |
|
||||
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE='RelWithDebInfo'
|
||||
cmake --build build --target package
|
||||
- uses: actions/upload-artifact@v3
|
||||
- run: powershell ci\build.ps1 -NoTests
|
||||
env:
|
||||
CONFIGURATION: ${{ matrix.config }}
|
||||
- run: move build\Neovim.zip build\${{ matrix.archive }}.zip
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: nvim-win64
|
||||
path: |
|
||||
build/nvim-win64.msi
|
||||
build/nvim-win64.zip
|
||||
name: ${{ matrix.archive }}
|
||||
path: build/${{ matrix.archive }}.zip
|
||||
retention-days: 1
|
||||
|
||||
publish:
|
||||
needs: [linux, macOS, windows]
|
||||
runs-on: ubuntu-latest
|
||||
needs: [linux, appimage, macOS, windows]
|
||||
runs-on: ubuntu-20.04
|
||||
env:
|
||||
GH_REPO: ${{ github.repository }}
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
# Must perform checkout first, since it deletes the target directory
|
||||
# before running, and would therefore delete the downloaded artifacts
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- uses: actions/download-artifact@v3
|
||||
- uses: actions/download-artifact@v2
|
||||
|
||||
- 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
|
||||
|
||||
- if: github.event_name == 'workflow_dispatch'
|
||||
run: echo "TAG_NAME=${{ github.event.inputs.tag_name }}" >> $GITHUB_ENV
|
||||
@ -154,12 +168,16 @@ jobs:
|
||||
TAG_NAME=${{ github.ref }}
|
||||
echo "TAG_NAME=${TAG_NAME#refs/tags/}" >> $GITHUB_ENV
|
||||
- if: env.TAG_NAME == 'nightly'
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
(echo 'SUBJECT=Nvim development (prerelease) build';
|
||||
echo 'PRERELEASE=--prerelease') >> $GITHUB_ENV
|
||||
gh release delete nightly --yes || true
|
||||
git push origin :nightly || true
|
||||
- if: env.TAG_NAME != 'nightly'
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
(echo 'SUBJECT=Nvim release build';
|
||||
echo 'PRERELEASE=') >> $GITHUB_ENV
|
||||
@ -171,7 +189,7 @@ jobs:
|
||||
run: |
|
||||
cd ./nvim-linux64
|
||||
sha256sum nvim-linux64.tar.gz > nvim-linux64.tar.gz.sha256sum
|
||||
echo "SHA_LINUX_64_TAR=$(cat nvim-linux64.tar.gz.sha256sum)" >> $GITHUB_ENV
|
||||
echo "SHA_LINUX_64=$(cat nvim-linux64.tar.gz.sha256sum)" >> $GITHUB_ENV
|
||||
- name: Generate App Image SHA256 checksums
|
||||
run: |
|
||||
cd ./appimage
|
||||
@ -191,44 +209,14 @@ jobs:
|
||||
run: |
|
||||
cd ./nvim-win64
|
||||
sha256sum nvim-win64.zip > nvim-win64.zip.sha256sum
|
||||
echo "SHA_WIN_64_ZIP=$(cat nvim-win64.zip.sha256sum)" >> $GITHUB_ENV
|
||||
sha256sum nvim-win64.msi > nvim-win64.msi.sha256sum
|
||||
echo "SHA_WIN_64_MSI=$(cat nvim-win64.msi.sha256sum)" >> $GITHUB_ENV
|
||||
echo "SHA_WIN_64=$(cat nvim-win64.zip.sha256sum)" >> $GITHUB_ENV
|
||||
- name: Publish release
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
NVIM_VERSION: ${{ needs.linux.outputs.version }}
|
||||
DEBUG: api
|
||||
run: |
|
||||
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
|
||||
gh release create stable $PRERELEASE --notes-file "$RUNNER_TEMP/notes.md" --title "$SUBJECT" --target $GITHUB_SHA nvim-macos/* nvim-linux64/* appimage/* nvim-win64/*
|
||||
fi
|
||||
|
||||
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@v2
|
||||
with:
|
||||
identifier: Neovim.Neovim
|
||||
release-tag: ${{ github.event.inputs.tag_name || github.ref_name }}
|
||||
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
|
||||
"version=$VERSION" >> $env:GITHUB_OUTPUT
|
||||
- if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly')
|
||||
name: Publish nightly
|
||||
uses: vedantmgoyal2009/winget-releaser@v2
|
||||
with:
|
||||
identifier: Neovim.Neovim.Nightly
|
||||
version: ${{ steps.get-version.outputs.version }}
|
||||
release-tag: nightly
|
||||
token: ${{ secrets.WINGET_TOKEN }}
|
||||
|
17
.github/workflows/remove-reviewers.yml
vendored
17
.github/workflows/remove-reviewers.yml
vendored
@ -1,17 +0,0 @@
|
||||
name: "Remove reviewers"
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [converted_to_draft, closed]
|
||||
jobs:
|
||||
remove-reviewers:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
pull-requests: write
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: 'Remove reviewers'
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
script: |
|
||||
const script = require('./.github/scripts/remove-reviewers.js')
|
||||
await script({github, context})
|
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@v3
|
||||
- uses: actions/github-script@v6
|
||||
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@v3
|
||||
- uses: actions/github-script@v6
|
||||
with:
|
||||
script: |
|
||||
const script = require('./.github/scripts/remove_response_label.js')
|
||||
await script({github, context})
|
33
.github/workflows/squash-typos.yml
vendored
Normal file
33
.github/workflows/squash-typos.yml
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
name: Squash Typo Pull Requests
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
types: labeled
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}
|
||||
jobs:
|
||||
build:
|
||||
if: github.event.label.name == 'typo'
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-python@v2
|
||||
|
||||
- name: Setup git config
|
||||
run: |
|
||||
git config --global user.name 'marvim'
|
||||
git config --global user.email 'marvim@users.noreply.github.com'
|
||||
|
||||
- run: python scripts/squash_typos.py
|
||||
env:
|
||||
PR_NUMBER: ${{ github.event.number }}
|
400
.github/workflows/test.yml
vendored
400
.github/workflows/test.yml
vendored
@ -1,400 +0,0 @@
|
||||
name: test
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
- 'release-[0-9]+.[0-9]+'
|
||||
pull_request:
|
||||
branches:
|
||||
- 'master'
|
||||
- 'release-[0-9]+.[0-9]+'
|
||||
paths-ignore:
|
||||
- 'contrib/**'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
ASAN_OPTIONS: detect_leaks=1:check_initialization_order=1:handle_abort=1:handle_sigill=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
|
||||
UBSAN_OPTIONS: "print_stacktrace=1 log_path=${{ github.workspace }}/build/log/ubsan"
|
||||
VALGRIND_LOG: ${{ github.workspace }}/build/log/valgrind-%p.log
|
||||
# TEST_FILE: test/functional/core/startup_spec.lua
|
||||
# TEST_FILTER: foo
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
if: (github.event_name == 'pull_request' && github.base_ref == 'master') || (github.event_name == 'push' && github.ref == 'refs/heads/master')
|
||||
runs-on: ubuntu-22.04
|
||||
timeout-minutes: 10
|
||||
env:
|
||||
CACHE_UNCRUSTIFY: ${{ github.workspace }}/.cache/uncrustify
|
||||
UNCRUSTIFY_VERSION: uncrustify-0.75.0
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Install dependencies
|
||||
run: ./.github/scripts/install_deps.sh lua-check
|
||||
|
||||
- name: Set up Homebrew
|
||||
id: homebrew
|
||||
uses: Homebrew/actions/setup-homebrew@master
|
||||
|
||||
- run: |
|
||||
brew install stylua
|
||||
|
||||
- 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 -D CMAKE_BUILD_TYPE=Release
|
||||
cmake --build $build_dir
|
||||
mkdir -p .cache
|
||||
cp $build_dir/uncrustify ${{ env.CACHE_UNCRUSTIFY }}
|
||||
|
||||
- uses: ./.github/actions/cache
|
||||
|
||||
- name: Build third-party deps
|
||||
run: |
|
||||
cmake -S cmake.deps -B .deps -G Ninja
|
||||
cmake --build .deps
|
||||
|
||||
- if: success() || failure() && steps.abort_job.outputs.status == 'success'
|
||||
name: configure
|
||||
run: cmake -B build -G Ninja
|
||||
|
||||
- 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'
|
||||
run: cmake --build build --target clang-tidy
|
||||
|
||||
- if: success() || failure() && steps.abort_job.outputs.status == 'success'
|
||||
name: uncrustify
|
||||
run: |
|
||||
${{ env.CACHE_UNCRUSTIFY }} -c ./src/uncrustify.cfg -q --replace --no-backup $(find ./src/nvim -name "*.[ch]")
|
||||
|
||||
posix:
|
||||
name: ${{ matrix.runner }} ${{ matrix.flavor }} (cc=${{ matrix.cc }})
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- flavor: asan
|
||||
cc: clang
|
||||
runner: ubuntu-22.04
|
||||
flags: -D ENABLE_ASAN_UBSAN=ON
|
||||
- flavor: tsan
|
||||
cc: clang
|
||||
runner: ubuntu-22.04
|
||||
flags: -D ENABLE_TSAN=ON
|
||||
- flavor: uchar
|
||||
cc: gcc
|
||||
runner: ubuntu-22.04
|
||||
flags: -D UNSIGNED_CHAR=ON
|
||||
- cc: clang
|
||||
runner: macos-12
|
||||
|
||||
# functionaltest-lua is our dumping ground for non-mainline configurations.
|
||||
# 1. Check that the tests pass with PUC Lua instead of LuaJIT.
|
||||
# 2. No treesitter parsers installed.
|
||||
- flavor: functionaltest-lua
|
||||
cc: gcc
|
||||
runner: ubuntu-22.04
|
||||
deps_flags: -D USE_BUNDLED_LUAJIT=OFF -D USE_BUNDLED_LUA=ON
|
||||
flags: -D PREFER_LUA=ON
|
||||
runs-on: ${{ matrix.runner }}
|
||||
timeout-minutes: 45
|
||||
env:
|
||||
CC: ${{ matrix.cc }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Set up environment
|
||||
run: |
|
||||
ulimit -c unlimited
|
||||
echo "$BIN_DIR" >> $GITHUB_PATH
|
||||
|
||||
- name: Create log dir
|
||||
run: mkdir -p "$LOG_DIR"
|
||||
|
||||
- name: Install dependencies
|
||||
run: ./.github/scripts/install_deps.sh cpanminus
|
||||
|
||||
- name: Setup interpreter packages
|
||||
run: |
|
||||
# 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 "$BIN_DIR" --user-install --pre neovim
|
||||
|
||||
echo "Install neovim npm package"
|
||||
npm install -g neovim
|
||||
npm link neovim
|
||||
|
||||
if [[ $RUNNER_OS != macOS ]]; then
|
||||
sudo cpanm -n Neovim::Ext || cat "$HOME/.cpanm/build.log"
|
||||
perl -W -e 'use Neovim::Ext; print $Neovim::Ext::VERSION'
|
||||
fi
|
||||
|
||||
- uses: ./.github/actions/cache
|
||||
|
||||
- name: Build third-party deps
|
||||
run: |
|
||||
cmake -S cmake.deps -B .deps -G Ninja ${{ matrix.deps_flags }}
|
||||
cmake --build .deps
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
cmake -B build -G Ninja -D CMAKE_INSTALL_PREFIX:PATH=$INSTALL_PREFIX ${{ matrix.flags }} -D CI_BUILD=ON
|
||||
cmake --build build
|
||||
|
||||
- if: "!cancelled()"
|
||||
name: Determine if run should be aborted
|
||||
id: abort_job
|
||||
run: echo "status=${{ job.status }}" >> $GITHUB_OUTPUT
|
||||
|
||||
- if: matrix.flavor != 'tsan' && matrix.flavor != 'functionaltest-lua' && (success() || failure() && steps.abort_job.outputs.status == 'success')
|
||||
name: Unittest
|
||||
timeout-minutes: 5
|
||||
run: cmake --build build --target unittest
|
||||
|
||||
- if: matrix.flavor != 'functionaltest-lua' && (success() || failure() && steps.abort_job.outputs.status == 'success')
|
||||
name: Functionaltest
|
||||
timeout-minutes: 20
|
||||
run: cmake --build build --target functionaltest
|
||||
|
||||
- if: matrix.flavor == 'functionaltest-lua' && (success() || failure() && steps.abort_job.outputs.status == 'success')
|
||||
name: Functionaltest with PUC Lua
|
||||
timeout-minutes: 20
|
||||
run: cmake --build build --target functionaltest-lua
|
||||
|
||||
- if: matrix.flavor != 'tsan' && (success() || failure() && steps.abort_job.outputs.status == 'success')
|
||||
name: Oldtest
|
||||
run: make oldtest
|
||||
|
||||
- if: success() || failure() && steps.abort_job.outputs.status == 'success'
|
||||
name: Install
|
||||
run: cmake --install build
|
||||
|
||||
- if: success() || failure() && steps.abort_job.outputs.status == 'success'
|
||||
name: Installtests
|
||||
run: |
|
||||
"$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: success() || failure() && steps.abort_job.outputs.status == 'success'
|
||||
name: Show logs
|
||||
run: cat $(find "$LOG_DIR" -type f)
|
||||
|
||||
build-types:
|
||||
runs-on: ubuntu-22.04
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Install dependencies
|
||||
run: ./.github/scripts/install_deps.sh
|
||||
|
||||
- uses: ./.github/actions/cache
|
||||
|
||||
- name: Build third-party deps
|
||||
run: |
|
||||
cmake -S cmake.deps -B .deps -G "Ninja Multi-Config"
|
||||
cmake --build .deps
|
||||
|
||||
- name: Configure
|
||||
run: cmake -B build -G "Ninja Multi-Config" -D CMAKE_C_COMPILER=gcc -D CI_BUILD=ON
|
||||
|
||||
- name: Release
|
||||
run: cmake --build build --config Release
|
||||
|
||||
- name: RelWithDebInfo
|
||||
run: cmake --build build --config RelWithDebInfo
|
||||
|
||||
- name: MinSizeRel
|
||||
run: cmake --build build --config MinSizeRel
|
||||
|
||||
windows:
|
||||
runs-on: windows-2022
|
||||
timeout-minutes: 45
|
||||
name: windows
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- uses: ./.github/actions/cache
|
||||
|
||||
- name: Set env
|
||||
run: |
|
||||
$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
|
||||
}
|
||||
}
|
||||
|
||||
- name: Build deps
|
||||
run: |
|
||||
cmake -S cmake.deps -B .deps -G Ninja -D CMAKE_BUILD_TYPE='RelWithDebInfo'
|
||||
cmake --build .deps
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
cmake -B build -G Ninja -D CMAKE_BUILD_TYPE='RelWithDebInfo' -D CI_BUILD=ON
|
||||
cmake --build build
|
||||
|
||||
- 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: "!cancelled()"
|
||||
name: Determine if run should be aborted
|
||||
id: abort_job
|
||||
run: |
|
||||
"status=${{ job.status }}" >> $env:GITHUB_OUTPUT
|
||||
|
||||
- if: success() || failure() && steps.abort_job.outputs.status == 'success'
|
||||
name: Run functionaltest
|
||||
timeout-minutes: 20
|
||||
run: cmake --build build --target functionaltest
|
||||
|
||||
- if: success() || failure() && steps.abort_job.outputs.status == 'success'
|
||||
uses: msys2/setup-msys2@v2
|
||||
with:
|
||||
update: true
|
||||
pacboy: >-
|
||||
make:p gcc:p
|
||||
release: false
|
||||
|
||||
- if: success() || failure() && steps.abort_job.outputs.status == 'success'
|
||||
name: Run oldtest
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
cd test/old/testdir
|
||||
mingw32-make VERBOSE=1
|
||||
|
||||
with-external-deps:
|
||||
runs-on: ubuntu-22.04
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo add-apt-repository ppa:neovim-ppa/stable
|
||||
./.github/scripts/install_deps.sh
|
||||
sudo apt-get install -y \
|
||||
libluajit-5.1-dev \
|
||||
libmsgpack-dev \
|
||||
libtermkey-dev \
|
||||
libunibilium-dev \
|
||||
libuv1-dev \
|
||||
lua-filesystem \
|
||||
lua-lpeg \
|
||||
lua-mpack \
|
||||
luajit
|
||||
# libtree-sitter-dev \
|
||||
# libvterm-dev \
|
||||
# lua-luv-dev
|
||||
|
||||
# Remove comments from packages once we start using these external
|
||||
# dependencies.
|
||||
|
||||
- uses: ./.github/actions/cache
|
||||
|
||||
- name: Build third-party deps
|
||||
run: |
|
||||
# Ideally all dependencies should external for this job, but some
|
||||
# dependencies don't have the required version available. We use the
|
||||
# bundled versions for these with the hopes of being able to remove them
|
||||
# later on.
|
||||
cmake -S cmake.deps -B .deps -G Ninja -D USE_BUNDLED=OFF \
|
||||
-D USE_BUNDLED_LUV=ON \
|
||||
-D USE_BUNDLED_LIBVTERM=ON \
|
||||
-D USE_BUNDLED_TS=ON
|
||||
cmake --build .deps
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
cmake -B build -G Ninja -D CI_BUILD=ON
|
||||
cmake --build build
|
19
.github/workflows/vim-patches.yml
vendored
19
.github/workflows/vim-patches.yml
vendored
@ -2,31 +2,28 @@ name: vim-patches
|
||||
on:
|
||||
schedule:
|
||||
- cron: '3 3 * * *'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
update-vim-patches:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-20.04
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
env:
|
||||
VIM_SOURCE_DIR: ${{ github.workspace }}/vim-src
|
||||
VIM_SOURCE_DIR: ${{ format('{0}/vim-src', github.workspace) }}
|
||||
VERSION_BRANCH: marvim/ci-version-update
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
repository: vim/vim
|
||||
path: ${{ env.VIM_SOURCE_DIR }}
|
||||
fetch-depth: 0
|
||||
|
||||
- run: sudo apt-get install libfuse2
|
||||
|
||||
- run: |
|
||||
gh release download -R neovim/neovim -p nvim.appimage
|
||||
chmod a+x nvim.appimage
|
||||
@ -34,7 +31,7 @@ jobs:
|
||||
mv nvim.appimage $HOME/.local/bin/nvim
|
||||
printf '%s\n' "$HOME/.local/bin" >> $GITHUB_PATH
|
||||
|
||||
- name: Set up git config
|
||||
- name: Setup git config
|
||||
run: |
|
||||
git config --global user.name 'marvim'
|
||||
git config --global user.email 'marvim@users.noreply.github.com'
|
||||
@ -43,8 +40,8 @@ jobs:
|
||||
id: update-version
|
||||
run: |
|
||||
git checkout -b ${VERSION_BRANCH}
|
||||
nvim -V1 -es -i NONE +'luafile scripts/vimpatch.lua' +q
|
||||
printf 'NEW_PATCHES=%s\n' $([ -z "$(git diff)" ]; echo $?) >> $GITHUB_OUTPUT
|
||||
nvim -i NONE -u NONE --headless +'luafile scripts/vimpatch.lua' +q
|
||||
printf '::set-output name=NEW_PATCHES::%s\n' $([ -z "$(git diff)" ]; echo $?)
|
||||
|
||||
- name: Automatic PR
|
||||
if: ${{ steps.update-version.outputs.NEW_PATCHES != 0 }}
|
||||
@ -52,4 +49,4 @@ jobs:
|
||||
git add -u
|
||||
git commit -m 'version.c: update [skip ci]'
|
||||
git push --force https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY} ${VERSION_BRANCH}
|
||||
gh pr create --draft --fill --label vim-patch --base ${GITHUB_REF#refs/heads/} --head ${VERSION_BRANCH} || true
|
||||
gh pr create --fill --label vim-patch --base ${GITHUB_REF#refs/heads/} --head ${VERSION_BRANCH} || true
|
||||
|
36
.gitignore
vendored
36
.gitignore
vendored
@ -1,7 +1,6 @@
|
||||
# Tools
|
||||
/venv/
|
||||
compile_commands.json
|
||||
/.luarc.json
|
||||
|
||||
# IDEs
|
||||
/.vs/
|
||||
@ -15,7 +14,6 @@ compile_commands.json
|
||||
/.clangd/
|
||||
/.cache/clangd/
|
||||
/.ccls-cache/
|
||||
/.clang-tidy
|
||||
|
||||
.DS_Store
|
||||
*.mo
|
||||
@ -36,21 +34,21 @@ compile_commands.json
|
||||
*.rej
|
||||
|
||||
# Generated by old (Vim) tests.
|
||||
/test/old/testdir/del
|
||||
/test/old/testdir/test*.out
|
||||
/test/old/testdir/test*.res
|
||||
/test/old/testdir/test*.log
|
||||
/test/old/testdir/messages
|
||||
/test/old/testdir/viminfo
|
||||
/test/old/testdir/test.ok
|
||||
/test/old/testdir/*.failed
|
||||
/test/old/testdir/X*
|
||||
/test/old/testdir/valgrind.*
|
||||
/test/old/testdir/.gdbinit
|
||||
/src/nvim/testdir/del
|
||||
/src/nvim/testdir/test*.out
|
||||
/src/nvim/testdir/test*.res
|
||||
/src/nvim/testdir/test*.log
|
||||
/src/nvim/testdir/messages
|
||||
/src/nvim/testdir/viminfo
|
||||
/src/nvim/testdir/test.ok
|
||||
/src/nvim/testdir/*.failed
|
||||
/src/nvim/testdir/X*
|
||||
/src/nvim/testdir/valgrind.*
|
||||
/src/nvim/testdir/.gdbinit
|
||||
/runtime/indent/testdir/*.out
|
||||
+runtime/indent/testdir/*.fail
|
||||
# Generated by test/old/testdir/runnvim.sh.
|
||||
/test/old/testdir/*.tlog
|
||||
# Generated by src/nvim/testdir/runnvim.sh.
|
||||
/src/nvim/testdir/*.tlog
|
||||
|
||||
# Generated by unit tests.
|
||||
/test/includes/post/
|
||||
@ -73,11 +71,3 @@ tags
|
||||
|
||||
# vim patches
|
||||
/vim-*.patch
|
||||
|
||||
# nix build results
|
||||
/result
|
||||
/result-*
|
||||
/contrib/result
|
||||
/contrib/result-*
|
||||
|
||||
CMakeUserPresets.json
|
||||
|
16
.luacheckrc
16
.luacheckrc
@ -19,10 +19,6 @@ cache = true
|
||||
ignore = {
|
||||
"631", -- max_line_length
|
||||
"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
|
||||
@ -30,18 +26,6 @@ read_globals = {
|
||||
"vim",
|
||||
}
|
||||
|
||||
globals = {
|
||||
"vim.g",
|
||||
"vim.b",
|
||||
"vim.w",
|
||||
"vim.o",
|
||||
"vim.bo",
|
||||
"vim.wo",
|
||||
"vim.go",
|
||||
"vim.env"
|
||||
}
|
||||
|
||||
exclude_files = {
|
||||
'test/functional/fixtures/lua/syntax_error.lua',
|
||||
'runtime/lua/vim/treesitter/_meta.lua'
|
||||
}
|
||||
|
137
.mailmap
137
.mailmap
@ -1,137 +0,0 @@
|
||||
Abdelhakeem <abdelhakeem.osama@hotmail.com> Abdelhakeem Osama
|
||||
Alvaro Muñoz <alvaro@pwntester.com> Alvaro Muñoz
|
||||
Andreas Johansson <andreas@ndrs.xyz> <ndreas@users.noreply.github.com>
|
||||
Andrew Pyatkov <mrbiggfoot@gmail.com> <mrbiggfoot@users.noreply.github.com>
|
||||
Anmol Sethi <hi@nhooyr.io> <anmol@aubble.com>
|
||||
Anmol Sethi <hi@nhooyr.io> <me@anmol.io>
|
||||
Anmol Sethi <hi@nhooyr.io> <nhooyr@users.noreply.github.com>
|
||||
BK1603 <chouhan.shreyansh2702@gmail.com> Shreyansh Chouhan
|
||||
Billy Su <g4691821@gmail.com> Billy SU
|
||||
Billy Vong <billyvg@gmail.com> <billyvg@users.noreply.github.com>
|
||||
bfredl <bjorn.linse@gmail.com>
|
||||
Carlos Hernandez <carlos@techbyte.ca> <hurricanehrndz@users.noreply.github.com>
|
||||
Chris Kipp <ckipp@pm.me> ckipp01
|
||||
Christian Clason <c.clason@uni-graz.at> <christian.clason@uni-due.de>
|
||||
Cédric Barreteau <> <cbarrete@users.noreply.github.com>
|
||||
Dan Aloni <alonid@gmail.com> <dan@kernelim.com>
|
||||
Daniel Hahler <git@thequod.de> <github@thequod.de>
|
||||
dundargoc <gocdundar@gmail.com> <33953936+dundargoc@users.noreply.github.com>
|
||||
dundargoc <gocdundar@gmail.com> Dundar Goc
|
||||
Eisuke Kawashima <e-kwsm@users.noreply.github.com> E Kawashima
|
||||
ElPiloto <luis.r.piloto@gmail.com> Luis Piloto
|
||||
Eliseo Martínez <eliseomarmol@gmail.com> Eliseo Martínez
|
||||
Fabian Viöl <f.vioel@googlemail.com> Fabian
|
||||
Florian Walch <florian@fwalch.com> <fwalch@users.noreply.github.com>
|
||||
Gabriel Cruz <gabs.oficial98@gmail.com> <LTKills@users.noreply.github.com>
|
||||
Gaelan Steele <gbs@canishe.com> Gaelan
|
||||
Gavin D. Howard <gavin@schedmd.com> <yzena.tech@gmail.com>
|
||||
George Zhao <zhaozg@gmail.com> <zhaozg@aliyun.com>
|
||||
George Zhao <zhaozg@gmail.com> George Zhao
|
||||
Gregory Anders <greg@gpanders.com> <8965202+gpanders@users.noreply.github.com>
|
||||
Gregory Anders <greg@gpanders.com> Greg Anders
|
||||
Grzegorz Milka <grzegorzmilka@gmail.com> Grzegorz
|
||||
Harm te Hennepe <dhtehennepe@gmail.com> <d.h.tehennepe@student.utwente.nl>
|
||||
Harm te Hennepe <dhtehennepe@gmail.com> <harm@tehennepe.org>
|
||||
Hirokazu Hata <h.hata.ai.t@gmail.com> <h-michael@users.noreply.github.com>
|
||||
Ihor Antonov <ngortheone@gmail.com> <ngortheone@users.noreply.github.com>
|
||||
J Phani Mahesh <phanimahesh@gmail.com> <github@phanimahesh.me>
|
||||
Jack Bracewell <FriedSock@users.noreply.github.com> <jack.bracewell@unboxedconsulting.com>
|
||||
Jack Bracewell <FriedSock@users.noreply.github.com> <jbtwentythree@gmail.com>
|
||||
Jacques Germishuys <jacquesg@striata.com> <jacquesg@users.noreply.github.com>
|
||||
Jakub Łuczyński <doubleloop@o2.pl> <doubleloop@users.noreply.github.com>
|
||||
James McCoy <jamessan@jamessan.com> <vega.james@gmail.com>
|
||||
Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> <janedmundlazo@hotmail.com>
|
||||
Jan Viljanen <jan.a.viljanen@gmail.com> <jan.viljanen@greenpeace.org>
|
||||
Javier Lopez <graulopezjavier@gmail.com> Javier López
|
||||
Jit Yao Yap <jityao@gmail.com> <jityao+github@gmail.com>
|
||||
Jit Yao Yap <jityao@gmail.com> Jit
|
||||
John Gehrig <jdg.gehrig@gmail.com> <jgehrig@users.noreply.github.com>
|
||||
John Schmidt <john.schmidt.h@gmail.com> John
|
||||
John Szakmeister <john@szakmeister.net> <jszakmeister@users.noreply.github.com>
|
||||
Jonathan de Boyne Pollard <J.deBoynePollard-newsgroups@NTLWorld.com> <jdebp@users.noreply.github.com>
|
||||
Jonathan de Boyne Pollard <J.deBoynePollard-newsgroups@NTLWorld.com> <postmaster@localhost>
|
||||
Jurica Bradaric <jbradaric@gmail.com> <jbradaric@users.noreply.github.com>
|
||||
Jurica Bradaric <jbradaric@gmail.com> <jurica.bradaric@avl.com>
|
||||
KillTheMule <KillTheMule@users.noreply.github.com> <github@pipsfrank.de>
|
||||
Kwon-Young Choi <kwon-young.choi@hotmail.fr> Kwon-Young
|
||||
Lewis Russell <lewis6991@gmail.com> <me@lewisr.dev>
|
||||
Lucas Hoffmann <l-m-h@web.de> <lucc@posteo.de>
|
||||
Lucas Hoffmann <l-m-h@web.de> <lucc@users.noreply.github.com>
|
||||
Marco Hinz <mh.codebro@gmail.com> <mh.codebro+github@gmail.com>
|
||||
Marvim the Paranoid Android <marvim@users.noreply.github.com> marvim
|
||||
Mateusz Czapliński <czapkofan@gmail.com> Mateusz Czaplinski
|
||||
Mathias Fussenegger <f.mathias@zignar.net> <mfussenegger@users.noreply.github.com>
|
||||
Mathias Fussenegger <f.mathias@zignar.net> Mathias Fußenegger
|
||||
Matt Wozniski <godlygeek@gmail.com> <godlygeek+git@gmail.com>
|
||||
Matthieu Coudron <mattator@gmail.com> <coudron@iij.ad.jp>
|
||||
Matthieu Coudron <mattator@gmail.com> <matthieu.coudron@upmc.fr>
|
||||
Matthieu Coudron <mattator@gmail.com> <mcoudron@hotmail.com>
|
||||
Matthieu Coudron <mattator@gmail.com> <teto@users.noreply.github.com>
|
||||
MichaHoffmann <michoffmann.potsdam@gmail.com> Michael Hoffmann
|
||||
MichaHoffmann <michoffmann.potsdam@gmail.com> micha
|
||||
Michael Ennen <mike.ennen@gmail.com> <brcolow@users.noreply.github.com>
|
||||
Michael Ennen <mike.ennen@gmail.com> brcolow
|
||||
Michael Reed <m.reed@mykolab.com> <Pyrohh@users.noreply.github.com>
|
||||
Michael Schupikov <michael@schupikov.de> <DarkDeepBlue@users.noreply.github.com>
|
||||
Nicolas Hillegeer <nicolas@hillegeer.com> <nicolashillegeer@gmail.com>
|
||||
Panashe M. Fundira <fundirap@gmail.com> Panashe Fundira
|
||||
Patrice Peterson <patrice.peterson@mailbox.org> runiq
|
||||
Pavel Platto <hinidu@gmail.com> Hinidu
|
||||
Petter Wahlman <petter@wahlman.no> <pwahlman@cisco.com>
|
||||
Poh Zi How <poh.zihow@gmail.com> pohzipohzi
|
||||
Rich Wareham <rjw57@cam.ac.uk> <rjw57@cantab.net>
|
||||
Rui Abreu Ferreira <equalsraf@users.noreply.github.com> @equalsraf
|
||||
Rui Abreu Ferreira <raf-ep@gmx.com> <equalsraf@users.noreply.github.com>
|
||||
Rui Abreu Ferreira <raf-ep@gmx.com> <rap-ep@gmx.com>
|
||||
Sam Wilson <tecywiz121@hotmail.com> <sawilson@akamai.com>
|
||||
Sander Bosma <sanderbosma@gmail.com> sander2
|
||||
Santos Gallegos <stsewd@protonmail.com> <santos_g@outlook.com>
|
||||
Sebastian Parborg <darkdefende@gmail.com> DarkDefender
|
||||
Shirasaka <tk.shirasaka@gmail.com> tk-shirasaka
|
||||
Shota <shotat@users.noreply.github.com> shotat
|
||||
Shougo Matsushita <Shougo.Matsu@gmail.com> Shougo
|
||||
Stephan Seitz <stephan.seitz@fau.de> <stephan.lauf@yahoo.de>
|
||||
Steven Sojka <Steven.Sojka@tdameritrade.com> <steelsojka@gmail.com>
|
||||
Steven Sojka <steelsojka@gmail.com> <steelsojka@users.noreply.github.com>
|
||||
TJ DeVries <devries.timothyj@gmail.com> <timothydvrs1234@gmail.com>
|
||||
Thomas Fehér <thomas.feher@yahoo.de> <thomasfeher@web.de>
|
||||
Thomas Vigouroux <thomas.vigouroux@protonmail.com> <tomvig38@gmail.com> <39092278+vigoux@users.noreply.github.com>
|
||||
Utkarsh Maheshwari <UtkarshME96@gmail.com> UTkarsh Maheshwari
|
||||
Utkarsh Maheshwari <utkarshme96@gmail.com> <UtkarshME96@gmail.com>
|
||||
VVKot <volodymyr.kot.ua@gmail.com> Volodymyr Kot
|
||||
Victor Adam <victor.adam@cofelyineo-gdfsuez.com> <Victor.Adam@derpymail.org>
|
||||
Wang Shidong <wsdjeg@outlook.com> <wsdjeg@users.noreply.github.com>
|
||||
Wei Huang <daviseago@gmail.com> davix
|
||||
Xu Cheng <xucheng@me.com> <xu-cheng@users.noreply.github.com>
|
||||
Yamakaky <yamakaky@gmail.com> <yamakaky@yamaworld.fr>
|
||||
Yegappan Lakshmanan <yegappan@yahoo.com> <4298407+yegappan@users.noreply.github.com>
|
||||
Yichao Zhou <broken.zhoug@gmail.com> Yichao Zhou <broken.zhou@gmail.com>
|
||||
Yichao Zhou <broken.zhoug@gmail.com> zhou13 <broken.zhou@gmail.com>
|
||||
Yorick Peterse <git@yorickpeterse.com> <yorick@yorickpeterse.com>
|
||||
ZyX <kp-pav@yandex.ru> <kp-pav@ya.ru>
|
||||
ZyX <kp-pav@yandex.ru> Nikolai Aleksandrovich Pavlov
|
||||
aph <a.hewson@gmail.com> Ashley Hewson
|
||||
butwerenotthereyet <58348703+butwerenotthereyet@users.noreply.github.com> We're Yet
|
||||
chemzqm <chemzqm@gmail.com> Qiming zhao
|
||||
chentau <tchen1998@gmail.com> Tony Chen
|
||||
dedmass <carlo.abelli@gmail.com> Carlo Abelli
|
||||
equal-l2 <eng.equall2@gmail.com> <equal-l2@users.noreply.github.com>
|
||||
francisco souza <fsouza@users.noreply.github.com> <108725+fsouza@users.noreply.github.com>
|
||||
glacambre <code@lacamb.re> <me@r4>
|
||||
glacambre <code@lacamb.re> Ghjuvan Lacambre
|
||||
ii14 <ii14@users.noreply.github.com> <59243201+ii14@users.noreply.github.com>
|
||||
jdrouhard <john@jmdtech.org> <github@jmdtech.org>
|
||||
kuuote <znmxodq1@gmail.com> <36663503+kuuote@users.noreply.github.com>
|
||||
matveyt <matthewtarasov@gmail.com> <35012635+matveyt@users.noreply.github.com>
|
||||
nate <nateozemon@gmail.com> nateozem
|
||||
ray-x <rayx.cn@gmail.com> rayx
|
||||
relnod <mail@paul-schiffers.de> <relnod@users.noreply.github.com>
|
||||
rockerBOO <rockerboo@gmail.com> Dave Lage
|
||||
rpigott <rpigott@berkeley.edu> Ronan Pigott
|
||||
sach1t <sach0010t@gmail.com> <sach1t@users.noreply.github.com>
|
||||
shade-of-noon <73705427+shade-of-noon@users.noreply.github.com> Edwin Pujols
|
||||
shadmansaleh <shadmansaleh3@gmail.com> <13149513+shadmansaleh@users.noreply.github.com>
|
||||
shadmansaleh <shadmansaleh3@gmail.com> Shadman
|
||||
sohnryang <loop.infinitely@gmail.com> 손량
|
||||
timeyyy <timeyyy_da_man@hotmail.com> Timothy C Eichler
|
||||
timeyyy <timeyyy_da_man@hotmail.com> timothy eichler
|
@ -1,6 +0,0 @@
|
||||
column_width = 100
|
||||
line_endings = "Unix"
|
||||
indent_type = "Spaces"
|
||||
indent_width = 2
|
||||
quote_style = "AutoPreferSingle"
|
||||
call_parentheses = "Always"
|
@ -1,3 +0,0 @@
|
||||
/scripts
|
||||
/src
|
||||
/test
|
220
.travis.yml
Normal file
220
.travis.yml
Normal file
@ -0,0 +1,220 @@
|
||||
dist: bionic
|
||||
|
||||
language: c
|
||||
|
||||
env:
|
||||
global:
|
||||
# Encrypted environment variables, see
|
||||
# http://docs.travis-ci.com/user/encryption-keys/
|
||||
#
|
||||
# SNAP_SECRET_KEY: generated by:
|
||||
# travis encrypt SNAP_SECRET_KEY=xx --add
|
||||
# https://github.com/neovim/neovim/pull/11428
|
||||
# snapcraft key expires after 1 year. Steps to refresh it:
|
||||
# 1. snapcraft enable-ci travis --refresh
|
||||
# 2. mv .snapcraft/travis_snapcraft.cfg ci/snap/travis_snapcraft.cfg
|
||||
# 3. Copy after_success command to ci/snap/deploy.sh from .travis.yml
|
||||
# 4. Undo changes to .travis.yml
|
||||
- secure: hd0qn2u8ABbJg5Bx4pBRcUQbKYFmcSHoecyHIPTCnGJT+NI41Bvm/IkN/N5DhBF+LbD3Q2nmR/dzI5H/dqS7RxMFvEx1DuFLendFHHX3MYf0AuKpXYY3gwgMTmqx8p/v6srlU7RBGWNGzHCWqksAem+EIWCe3I7WvfdKo1/DV/Y=
|
||||
|
||||
- PATH="$HOME/.local/bin:$PATH"
|
||||
# Set "false" to force rebuild of third-party dependencies.
|
||||
- CACHE_ENABLE=true
|
||||
# Build directory for Neovim.
|
||||
- BUILD_DIR="$TRAVIS_BUILD_DIR/build"
|
||||
# Build directory for third-party dependencies.
|
||||
- DEPS_BUILD_DIR="$HOME/nvim-deps"
|
||||
# Install directory for Neovim.
|
||||
- INSTALL_PREFIX="$HOME/nvim-install"
|
||||
# Log directory for Clang sanitizers and Valgrind.
|
||||
- LOG_DIR="$BUILD_DIR/log"
|
||||
# Nvim log file.
|
||||
- NVIM_LOG_FILE="$BUILD_DIR/.nvimlog"
|
||||
# Default CMake flags.
|
||||
- CMAKE_FLAGS="-DCI_BUILD=ON
|
||||
-DCMAKE_BUILD_TYPE=Debug
|
||||
-DCMAKE_INSTALL_PREFIX:PATH=$INSTALL_PREFIX
|
||||
-DBUSTED_OUTPUT_TYPE=nvim
|
||||
-DDEPS_PREFIX=$DEPS_BUILD_DIR/usr
|
||||
-DMIN_LOG_LEVEL=3"
|
||||
- DEPS_CMAKE_FLAGS="-DUSE_BUNDLED_GPERF=OFF"
|
||||
# Environment variables for Clang sanitizers.
|
||||
- ASAN_OPTIONS="detect_leaks=1:check_initialization_order=1:log_path=$LOG_DIR/asan"
|
||||
- TSAN_OPTIONS="log_path=$LOG_DIR/tsan"
|
||||
- UBSAN_OPTIONS="print_stacktrace=1 log_path=$LOG_DIR/ubsan"
|
||||
# Environment variables for Valgrind.
|
||||
- VALGRIND_LOG="$LOG_DIR/valgrind-%p.log"
|
||||
- CACHE_NVIM_DEPS_DIR="$HOME/.cache/nvim-deps"
|
||||
# If this file exists, the cache is valid (compile was successful).
|
||||
- CACHE_MARKER="$CACHE_NVIM_DEPS_DIR/.ci_cache_marker"
|
||||
# default target name for functional tests
|
||||
- FUNCTIONALTEST=functionaltest
|
||||
- CI_TARGET=tests
|
||||
# Environment variables for ccache
|
||||
- CCACHE_COMPRESS=1
|
||||
- CCACHE_SLOPPINESS=time_macros,file_macro
|
||||
- CCACHE_BASEDIR="$TRAVIS_BUILD_DIR"
|
||||
- CI_OS_NAME="$TRAVIS_OS_NAME"
|
||||
|
||||
anchors:
|
||||
envs: &common-job-env
|
||||
# Do not fall back to cache for "master" for PR on "release" branch:
|
||||
# adds the target branch to the cache key.
|
||||
FOR_TRAVIS_CACHE=v1-$TRAVIS_BRANCH
|
||||
|
||||
addons:
|
||||
apt:
|
||||
packages: &common-apt-packages
|
||||
- apport
|
||||
- autoconf
|
||||
- automake
|
||||
- build-essential
|
||||
- clang
|
||||
- cmake
|
||||
- cpanminus
|
||||
- cscope
|
||||
- gcc-multilib
|
||||
- gdb
|
||||
- gperf
|
||||
- language-pack-tr
|
||||
- libtool-bin
|
||||
- locales
|
||||
- ninja-build
|
||||
- pkg-config
|
||||
- unzip
|
||||
- valgrind
|
||||
- xclip
|
||||
homebrew:
|
||||
update: true
|
||||
casks:
|
||||
- powershell
|
||||
packages:
|
||||
- ccache
|
||||
- cpanminus
|
||||
- ninja
|
||||
- perl
|
||||
|
||||
jobs:
|
||||
include:
|
||||
- name: gcc-coverage (gcc 9)
|
||||
os: linux
|
||||
compiler: gcc-9
|
||||
env:
|
||||
- GCOV=gcov-9
|
||||
- CMAKE_FLAGS="$CMAKE_FLAGS -DUSE_GCOV=ON"
|
||||
- GCOV_ERROR_FILE="/tmp/libgcov-errors.log"
|
||||
- USE_LUACOV=1
|
||||
- BUSTED_ARGS="--coverage"
|
||||
- *common-job-env
|
||||
addons:
|
||||
snaps:
|
||||
- name: powershell
|
||||
confinement: classic
|
||||
apt:
|
||||
sources:
|
||||
- sourceline: 'ppa:ubuntu-toolchain-r/test'
|
||||
packages:
|
||||
- *common-apt-packages
|
||||
- gcc-9
|
||||
- name: gcc-functionaltest-lua
|
||||
os: linux
|
||||
compiler: gcc
|
||||
env:
|
||||
- FUNCTIONALTEST=functionaltest-lua
|
||||
- CMAKE_FLAGS="$CMAKE_FLAGS -DPREFER_LUA=ON"
|
||||
- DEPS_CMAKE_FLAGS="$DEPS_CMAKE_FLAGS -DUSE_BUNDLED_LUAJIT=OFF"
|
||||
- *common-job-env
|
||||
- name: gcc-32bit
|
||||
os: linux
|
||||
# Travis creates a cache per compiler. Set a different value here to
|
||||
# store 32-bit dependencies in a separate cache.
|
||||
compiler: gcc
|
||||
env:
|
||||
- BUILD_32BIT=ON
|
||||
- CMAKE_FLAGS="$CMAKE_FLAGS -m32 -DCMAKE_TOOLCHAIN_FILE=$TRAVIS_BUILD_DIR/cmake/i386-linux-gnu.toolchain.cmake"
|
||||
- DEPS_CMAKE_FLAGS="$DEPS_CMAKE_FLAGS -m32 -DCMAKE_TOOLCHAIN_FILE=$TRAVIS_BUILD_DIR/cmake/i386-linux-gnu.toolchain.cmake"
|
||||
- *common-job-env
|
||||
- name: big-endian
|
||||
os: linux
|
||||
arch: s390x
|
||||
compiler: gcc
|
||||
env:
|
||||
- FUNCTIONALTEST=functionaltest-lua
|
||||
- CMAKE_FLAGS="$CMAKE_FLAGS -DPREFER_LUA=ON"
|
||||
- DEPS_CMAKE_FLAGS="$DEPS_CMAKE_FLAGS -DUSE_BUNDLED_LUAJIT=OFF"
|
||||
- *common-job-env
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- *common-apt-packages
|
||||
- gettext
|
||||
- python-pip
|
||||
- python3-pip
|
||||
- python-setuptools
|
||||
- python3-setuptools
|
||||
- python-dev
|
||||
- python3-dev
|
||||
- if: type != pull_request
|
||||
name: snap
|
||||
os: linux
|
||||
env:
|
||||
- LC_ALL: C.UTF-8
|
||||
- LANG: C.UTF-8
|
||||
- SNAPCRAFT_ENABLE_SILENT_REPORT: y
|
||||
- SNAPCRAFT_ENABLE_DEVELOPER_DEBUG: y
|
||||
- SNAPCRAFT_BUILD_ENVIRONMENT: lxd
|
||||
addons:
|
||||
snaps:
|
||||
- name: snapcraft
|
||||
channel: stable
|
||||
classic: true
|
||||
- name: http
|
||||
- name: transfer
|
||||
- name: lxd
|
||||
channel: stable
|
||||
# Override default before_install, before_cache.
|
||||
before_install: /bin/true
|
||||
before_cache: /bin/true
|
||||
install: ci/snap/install.sh
|
||||
before_script: echo "Building snap..."
|
||||
script: ci/snap/script.sh
|
||||
after_success: ci/snap/after_success.sh
|
||||
deploy:
|
||||
skip_cleanup: true
|
||||
provider: script
|
||||
script: ci/snap/deploy.sh
|
||||
on:
|
||||
branch: master
|
||||
allow_failures:
|
||||
- env:
|
||||
- LC_ALL: C.UTF-8
|
||||
- LANG: C.UTF-8
|
||||
- SNAPCRAFT_ENABLE_SILENT_REPORT: y
|
||||
- SNAPCRAFT_ENABLE_DEVELOPER_DEBUG: y
|
||||
- SNAPCRAFT_BUILD_ENVIRONMENT: lxd
|
||||
fast_finish: true
|
||||
|
||||
before_install: ci/before_install.sh
|
||||
install: ci/install.sh
|
||||
before_script: ci/before_script.sh
|
||||
script: ci/script.sh
|
||||
before_cache: ci/before_cache.sh
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- /^release-\d+\.\d+$/
|
||||
|
||||
cache:
|
||||
apt: true
|
||||
ccache: true
|
||||
directories:
|
||||
- "$CACHE_NVIM_DEPS_DIR"
|
||||
|
||||
git:
|
||||
quiet: true
|
||||
|
||||
notifications:
|
||||
webhooks:
|
||||
urls:
|
||||
- https://webhooks.gitter.im/e/b5c38c99f9677aa3d031
|
755
CMakeLists.txt
755
CMakeLists.txt
@ -1,49 +1,45 @@
|
||||
# CMAKE REFERENCE
|
||||
# intro: https://codingnest.com/basic-cmake/
|
||||
# best practices (3.0+): https://gist.github.com/mbinna/c61dbb39bca0e4fb7d1f73b0d66a4fd1
|
||||
# pitfalls: https://izzys.casa/2019/02/everything-you-never-wanted-to-know-about-cmake/
|
||||
|
||||
# Version should match the tested CMAKE_URL in .github/workflows/build.yml.
|
||||
# Version should match the tested CMAKE_URL in .github/workflows/ci.yml.
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
|
||||
# Can be removed once minimum version is at least 3.15
|
||||
if(POLICY CMP0092)
|
||||
cmake_policy(SET CMP0092 NEW)
|
||||
endif()
|
||||
|
||||
project(nvim C)
|
||||
|
||||
if(POLICY CMP0075)
|
||||
cmake_policy(SET CMP0075 NEW)
|
||||
if(POLICY CMP0065)
|
||||
cmake_policy(SET CMP0065 NEW)
|
||||
endif()
|
||||
if(POLICY CMP0060)
|
||||
cmake_policy(SET CMP0060 NEW)
|
||||
endif()
|
||||
|
||||
# Point CMake at any custom modules we may ship
|
||||
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
|
||||
|
||||
include(CheckCCompilerFlag)
|
||||
include(CheckCSourceCompiles)
|
||||
include(FindPackageHandleStandardArgs)
|
||||
include(InstallHelpers)
|
||||
include(LuaHelpers)
|
||||
# We don't support building in-tree.
|
||||
include(PreventInTreeBuilds)
|
||||
include(Util)
|
||||
|
||||
set(TOUCHES_DIR ${PROJECT_BINARY_DIR}/touches)
|
||||
|
||||
find_program(CCACHE_PRG ccache)
|
||||
if(CCACHE_PRG)
|
||||
set(CMAKE_C_COMPILER_LAUNCHER ${CMAKE_COMMAND} -E env CCACHE_SLOPPINESS=pch_defines,time_macros ${CCACHE_PRG})
|
||||
endif()
|
||||
|
||||
if(NOT CI_BUILD)
|
||||
set(CMAKE_INSTALL_MESSAGE NEVER)
|
||||
endif()
|
||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
|
||||
# Prefer our bundled versions of dependencies.
|
||||
if(DEFINED ENV{DEPS_BUILD_DIR})
|
||||
set(DEPS_PREFIX "$ENV{DEPS_BUILD_DIR}/usr" CACHE PATH "Path prefix for finding dependencies")
|
||||
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 third-party/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")
|
||||
endif()
|
||||
else()
|
||||
set(DEPS_PREFIX "${CMAKE_CURRENT_SOURCE_DIR}/.deps/usr" CACHE PATH "Path prefix for finding dependencies")
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
|
||||
set(DEPS_PREFIX "${CMAKE_CURRENT_SOURCE_DIR}/.deps/_usr" CACHE PATH "Path prefix for finding dependencies")
|
||||
else()
|
||||
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,
|
||||
# build bundled dependencies automatically.
|
||||
if(NOT EXISTS ${DEPS_PREFIX}
|
||||
@ -54,16 +50,16 @@ else()
|
||||
file(MAKE_DIRECTORY ${DEPS_BUILD_DIR})
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_COMMAND} -G ${CMAKE_GENERATOR}
|
||||
-D CMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
|
||||
-D CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
|
||||
-D CMAKE_C_COMPILER=${CMAKE_C_COMPILER}
|
||||
-D CMAKE_C_FLAGS=${CMAKE_C_FLAGS}
|
||||
-D CMAKE_C_FLAGS_DEBUG=${CMAKE_C_FLAGS_DEBUG}
|
||||
-D CMAKE_C_FLAGS_MINSIZEREL=${CMAKE_C_FLAGS_MINSIZEREL}
|
||||
-D CMAKE_C_FLAGS_RELWITHDEBINFO=${CMAKE_C_FLAGS_RELWITHDEBINFO}
|
||||
-D CMAKE_C_FLAGS_RELEASE=${CMAKE_C_FLAGS_RELEASE}
|
||||
-D CMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}
|
||||
${PROJECT_SOURCE_DIR}/cmake.deps
|
||||
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
|
||||
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
|
||||
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
|
||||
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
|
||||
-DCMAKE_C_FLAGS_DEBUG=${CMAKE_C_FLAGS_DEBUG}
|
||||
-DCMAKE_C_FLAGS_MINSIZEREL=${CMAKE_C_FLAGS_MINSIZEREL}
|
||||
-DCMAKE_C_FLAGS_RELWITHDEBINFO=${CMAKE_C_FLAGS_RELWITHDEBINFO}
|
||||
-DCMAKE_C_FLAGS_RELEASE=${CMAKE_C_FLAGS_RELEASE}
|
||||
-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}
|
||||
${PROJECT_SOURCE_DIR}/third-party
|
||||
WORKING_DIRECTORY ${DEPS_BUILD_DIR})
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_COMMAND} --build ${DEPS_BUILD_DIR}
|
||||
@ -72,27 +68,43 @@ else()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
list(INSERT CMAKE_PREFIX_PATH 0 ${DEPS_PREFIX})
|
||||
|
||||
if(APPLE)
|
||||
# If the macOS deployment target is not set manually (via $MACOSX_DEPLOYMENT_TARGET),
|
||||
# fall back to local system version. Needs to be done both here and in cmake.deps.
|
||||
if(NOT CMAKE_OSX_DEPLOYMENT_TARGET)
|
||||
execute_process(COMMAND sw_vers -productVersion
|
||||
OUTPUT_VARIABLE MACOS_VERSION
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET "${MACOS_VERSION}")
|
||||
endif()
|
||||
message(STATUS "Using deployment target ${CMAKE_OSX_DEPLOYMENT_TARGET}")
|
||||
if(CMAKE_CROSSCOMPILING AND NOT UNIX)
|
||||
list(INSERT CMAKE_FIND_ROOT_PATH 0 ${DEPS_PREFIX})
|
||||
list(INSERT CMAKE_PREFIX_PATH 0 ${DEPS_PREFIX}/../host/bin)
|
||||
else()
|
||||
list(INSERT CMAKE_PREFIX_PATH 0 ${DEPS_PREFIX})
|
||||
set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:${DEPS_PREFIX}/lib/pkgconfig")
|
||||
endif()
|
||||
|
||||
if(WIN32 OR APPLE)
|
||||
# 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)
|
||||
|
||||
# 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_COMPILER_IS_GNUCC)
|
||||
set(CMAKE_INCLUDE_SYSTEM_FLAG_C "-isystem ")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WIN32 OR CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
||||
# Ignore case when comparing filenames on Windows and Mac.
|
||||
set(CASE_INSENSITIVE_FILENAME TRUE)
|
||||
# Enable fixing case-insensitive filenames for Windows and Mac.
|
||||
set(USE_FNAME_CASE TRUE)
|
||||
endif()
|
||||
|
||||
option(ENABLE_LIBINTL "enable libintl" ON)
|
||||
option(ENABLE_LIBICONV "enable libiconv" ON)
|
||||
if (MINGW)
|
||||
# Disable LTO by default as it may not compile
|
||||
# See https://github.com/Alexpux/MINGW-packages/issues/3516
|
||||
@ -104,58 +116,394 @@ endif()
|
||||
|
||||
message(STATUS "CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}")
|
||||
|
||||
set_default_buildtype()
|
||||
# Build type.
|
||||
if(NOT CMAKE_BUILD_TYPE)
|
||||
message(STATUS "CMAKE_BUILD_TYPE not specified, default is 'Debug'")
|
||||
set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Choose the type of build" FORCE)
|
||||
else()
|
||||
message(STATUS "CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}")
|
||||
endif()
|
||||
if(CMAKE_BUILD_TYPE MATCHES Debug)
|
||||
set(DEBUG 1)
|
||||
else()
|
||||
set(DEBUG 0)
|
||||
endif()
|
||||
# Set available build types for CMake GUIs.
|
||||
# Other build types can still be set by -DCMAKE_BUILD_TYPE=...
|
||||
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY
|
||||
STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
|
||||
|
||||
# If not in a git repo (e.g., a tarball) these tokens define the complete
|
||||
# version string, else they are combined with the result of `git describe`.
|
||||
set(NVIM_VERSION_MAJOR 0)
|
||||
set(NVIM_VERSION_MINOR 9)
|
||||
set(NVIM_VERSION_PATCH 2)
|
||||
set(NVIM_VERSION_MINOR 6)
|
||||
set(NVIM_VERSION_PATCH 1)
|
||||
set(NVIM_VERSION_PRERELEASE "") # for package maintainers
|
||||
|
||||
# API level
|
||||
set(NVIM_API_LEVEL 11) # Bump this after any API change.
|
||||
set(NVIM_API_LEVEL 8) # Bump this after any API change.
|
||||
set(NVIM_API_LEVEL_COMPAT 0) # Adjust this after a _breaking_ API change.
|
||||
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()
|
||||
|
||||
# Build-type: RelWithDebInfo
|
||||
if(CMAKE_COMPILER_IS_GNUCC)
|
||||
check_c_compiler_flag(-Og HAS_OG_FLAG)
|
||||
else()
|
||||
set(HAS_OG_FLAG 0)
|
||||
endif()
|
||||
|
||||
# /Og means something different in MSVC
|
||||
if(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -Og -g")
|
||||
#
|
||||
# Build-type: RelWithDebInfo
|
||||
#
|
||||
if(HAS_OG_FLAG)
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -Og -g")
|
||||
endif()
|
||||
# We _want_ assertions in RelWithDebInfo build-type.
|
||||
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 " " " " CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}") # Remove duplicate whitespace
|
||||
endif()
|
||||
|
||||
# gcc 4.0+ sets _FORTIFY_SOURCE=2 automatically. This currently
|
||||
# does not work with Neovim due to some uses of dynamically-sized structures.
|
||||
# https://github.com/neovim/neovim/issues/223
|
||||
include(CheckCSourceCompiles)
|
||||
|
||||
# Include the build type's default flags in the check for _FORTIFY_SOURCE,
|
||||
# otherwise we may incorrectly identify the level as acceptable and find out
|
||||
# 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)
|
||||
|
||||
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(-DWIN32)
|
||||
else()
|
||||
add_compile_options(-Wall -Wextra -pedantic -Wno-unused-parameter
|
||||
-Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion
|
||||
-Wmissing-prototypes)
|
||||
|
||||
check_c_compiler_flag(-Wimplicit-fallthrough HAVE_WIMPLICIT_FALLTHROUGH_FLAG)
|
||||
if(HAVE_WIMPLICIT_FALLTHROUGH_FLAG)
|
||||
add_compile_options(-Wimplicit-fallthrough)
|
||||
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)
|
||||
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_32BIT})
|
||||
# Get some test coverage for unsigned char
|
||||
add_compile_options(-funsigned-char)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
option(LOG_LIST_ACTIONS "Add list actions logging" OFF)
|
||||
|
||||
option(ENABLE_ASAN_UBSAN "Enable Clang address & undefined behavior sanitizer for nvim binary." OFF)
|
||||
option(LOG_DEBUG "Enable debug log messages even in a release build" OFF)
|
||||
option(ENABLE_MSAN "Enable Clang memory sanitizer for nvim binary." OFF)
|
||||
option(ENABLE_TSAN "Enable Clang thread sanitizer for nvim binary." OFF)
|
||||
add_definitions(-DINCLUDE_GENERATED_DECLARATIONS)
|
||||
|
||||
if((ENABLE_ASAN_UBSAN AND ENABLE_MSAN)
|
||||
OR (ENABLE_ASAN_UBSAN AND ENABLE_TSAN)
|
||||
OR (ENABLE_MSAN AND ENABLE_TSAN))
|
||||
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}/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.30.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()
|
||||
|
||||
# Note: The test lib requires LuaJIT; it will be skipped if LuaJIT is missing.
|
||||
option(PREFER_LUA "Prefer Lua over LuaJIT in the nvim executable." OFF)
|
||||
|
||||
if(PREFER_LUA)
|
||||
find_package(Lua 5.1 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)
|
||||
{
|
||||
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.18 REQUIRED)
|
||||
include_directories(SYSTEM ${LIBTERMKEY_INCLUDE_DIRS})
|
||||
endif()
|
||||
|
||||
find_package(LIBVTERM 0.1 REQUIRED)
|
||||
include_directories(SYSTEM ${LIBVTERM_INCLUDE_DIRS})
|
||||
|
||||
if(WIN32)
|
||||
find_package(Winpty 0.4.3 REQUIRED)
|
||||
include_directories(SYSTEM ${WINPTY_INCLUDE_DIRS})
|
||||
endif()
|
||||
|
||||
option(CLANG_ASAN_UBSAN "Enable Clang address & undefined behavior sanitizer for nvim binary." OFF)
|
||||
option(CLANG_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")
|
||||
endif()
|
||||
|
||||
if(ENABLE_ASAN_UBSAN OR ENABLE_MSAN OR ENABLE_TSAN)
|
||||
if(NOT CMAKE_C_COMPILER_ID MATCHES "Clang" AND NOT CMAKE_C_COMPILER_ID MATCHES "GNU")
|
||||
message(FATAL_ERROR "Sanitizers are only supported for Clang and GCC")
|
||||
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
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
||||
@ -167,6 +515,8 @@ foreach(CFGNAME ${CMAKE_CONFIGURATION_TYPES})
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CFGNAME} ${CMAKE_BINARY_DIR}/lib)
|
||||
endforeach()
|
||||
|
||||
# Find Lua interpreter
|
||||
include(LuaHelpers)
|
||||
set(LUA_DEPENDENCIES lpeg mpack bit)
|
||||
if(NOT LUA_PRG)
|
||||
foreach(CURRENT_LUA_PRG luajit lua5.1 lua5.2 lua)
|
||||
@ -193,125 +543,178 @@ endif()
|
||||
|
||||
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.")
|
||||
# Setup busted.
|
||||
find_program(BUSTED_PRG NAMES busted busted.bat)
|
||||
find_program(BUSTED_LUA_PRG busted-lua)
|
||||
if(NOT BUSTED_OUTPUT_TYPE)
|
||||
set(BUSTED_OUTPUT_TYPE "nvim")
|
||||
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)
|
||||
|
||||
if(COMPILE_LUA AND NOT WIN32)
|
||||
if(PREFER_LUA)
|
||||
foreach(CURRENT_LUAC_PRG luac5.1 luac)
|
||||
find_program(_CHECK_LUAC_PRG ${CURRENT_LUAC_PRG})
|
||||
if(_CHECK_LUAC_PRG)
|
||||
set(LUAC_PRG "${_CHECK_LUAC_PRG} -s -o - %s" CACHE STRING "Format for compiling to Lua bytecode")
|
||||
break()
|
||||
endif()
|
||||
endforeach()
|
||||
elseif(LUA_PRG MATCHES "luajit")
|
||||
check_lua_module(${LUA_PRG} "jit.bcsave" LUAJIT_HAS_JIT_BCSAVE)
|
||||
if(LUAJIT_HAS_JIT_BCSAVE)
|
||||
set(LUAC_PRG "${LUA_PRG} -b -s %s -" CACHE STRING "Format for compiling to Lua bytecode")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(LUAC_PRG)
|
||||
message(STATUS "Using Lua compiler: ${LUAC_PRG}")
|
||||
endif()
|
||||
|
||||
#
|
||||
# Lint
|
||||
#
|
||||
find_program(LUACHECK_PRG luacheck)
|
||||
find_program(SHELLCHECK_PRG shellcheck)
|
||||
find_program(STYLUA_PRG stylua)
|
||||
find_program(UNCRUSTIFY_PRG uncrustify)
|
||||
find_program(FLAKE8_PRG flake8)
|
||||
find_program(GPERF_PRG gperf)
|
||||
|
||||
add_glob_target(
|
||||
REQUIRED
|
||||
TARGET lintlua-luacheck
|
||||
COMMAND ${LUACHECK_PRG}
|
||||
FLAGS -q
|
||||
GLOB_DIRS runtime/ scripts/ src/ test/
|
||||
GLOB_PAT *.lua
|
||||
TOUCH_STRATEGY SINGLE)
|
||||
|
||||
add_glob_target(
|
||||
TARGET lintlua-stylua
|
||||
COMMAND ${STYLUA_PRG}
|
||||
FLAGS --color=always --check
|
||||
GLOB_DIRS runtime/
|
||||
GLOB_PAT *.lua
|
||||
EXCLUDE
|
||||
/runtime/lua/vim/re.lua
|
||||
TOUCH_STRATEGY SINGLE)
|
||||
|
||||
add_custom_target(lintlua)
|
||||
add_dependencies(lintlua lintlua-luacheck lintlua-stylua)
|
||||
|
||||
add_glob_target(
|
||||
TARGET lintsh
|
||||
COMMAND ${SHELLCHECK_PRG}
|
||||
FLAGS -x -a
|
||||
GLOB_DIRS scripts
|
||||
GLOB_PAT *.sh
|
||||
EXCLUDE
|
||||
scripts/pvscheck.sh
|
||||
TOUCH_STRATEGY SINGLE)
|
||||
|
||||
add_custom_target(lintcommit
|
||||
COMMAND ${PROJECT_BINARY_DIR}/bin/nvim -u NONE -es -c [[lua require('scripts.lintcommit').main({trace=false})]]
|
||||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
||||
VERBATIM)
|
||||
add_dependencies(lintcommit nvim)
|
||||
|
||||
add_custom_target(lint)
|
||||
add_dependencies(lint clang-tidy lintc lintlua lintsh lintcommit)
|
||||
|
||||
#
|
||||
# Format
|
||||
#
|
||||
add_custom_target(formatlua
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
-D FORMAT_PRG=${STYLUA_PRG}
|
||||
-D LANG=lua
|
||||
-P ${PROJECT_SOURCE_DIR}/cmake/Format.cmake
|
||||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
|
||||
|
||||
add_custom_target(format)
|
||||
add_dependencies(format formatc formatlua)
|
||||
include(InstallHelpers)
|
||||
|
||||
file(GLOB MANPAGES
|
||||
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
man/nvim.1)
|
||||
install_helper(
|
||||
FILES ${CMAKE_SOURCE_DIR}/src/man/nvim.1
|
||||
FILES ${MANPAGES}
|
||||
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
|
||||
|
||||
if(EXISTS "${DEPS_PREFIX}/share/nvim-qt")
|
||||
option(USE_BUNDLED_NVIMQT "Bundle neovim-qt" ON)
|
||||
else()
|
||||
option(USE_BUNDLED_NVIMQT "Bundle neovim-qt" OFF)
|
||||
endif()
|
||||
#
|
||||
# Go down the tree.
|
||||
#
|
||||
|
||||
add_subdirectory(src/nvim)
|
||||
add_subdirectory(cmake.config)
|
||||
get_directory_property(NVIM_VERSION_CFLAGS DIRECTORY src/nvim DEFINITION NVIM_VERSION_CFLAGS)
|
||||
add_subdirectory(test/includes)
|
||||
add_subdirectory(config)
|
||||
add_subdirectory(test/functional/fixtures) # compile test programs
|
||||
add_subdirectory(runtime)
|
||||
add_subdirectory(test)
|
||||
if(WIN32 AND USE_BUNDLED_NVIMQT)
|
||||
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()
|
||||
|
||||
add_custom_target(uninstall
|
||||
COMMAND ${CMAKE_COMMAND} -P ${PROJECT_SOURCE_DIR}/cmake/UninstallHelper.cmake)
|
||||
# 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)
|
||||
|
||||
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
add_subdirectory(cmake.packaging)
|
||||
# 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 streams-test tty-test ${GENERATED_HELP_TAGS})
|
||||
set(BENCHMARK_PREREQS nvim tty-test)
|
||||
|
||||
# Useful for automated build systems, if they want to manually run the tests.
|
||||
add_custom_target(unittest-prereqs
|
||||
DEPENDS ${UNITTEST_PREREQS})
|
||||
set_target_properties(unittest-prereqs PROPERTIES FOLDER test)
|
||||
|
||||
add_custom_target(functionaltest-prereqs
|
||||
DEPENDS ${FUNCTIONALTEST_PREREQS})
|
||||
|
||||
add_custom_target(benchmark-prereqs
|
||||
DEPENDS ${BENCHMARK_PREREQS})
|
||||
|
||||
check_lua_module(${LUA_PRG} "ffi" LUA_HAS_FFI)
|
||||
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/config/paths.lua.in
|
||||
${CMAKE_BINARY_DIR}/test/config/paths.lua.gen)
|
||||
file(GENERATE
|
||||
OUTPUT ${CMAKE_BINARY_DIR}/test/config/paths.lua
|
||||
INPUT ${CMAKE_BINARY_DIR}/test/config/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 functionaltest-prereqs
|
||||
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 benchmark-prereqs 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()
|
||||
|
||||
if(LUACHECK_PRG)
|
||||
add_custom_target(lualint
|
||||
COMMAND ${LUACHECK_PRG} -q runtime/ scripts/ src/ test/
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
else()
|
||||
add_custom_target(lualint false
|
||||
COMMENT "lualint: LUACHECK_PRG not defined")
|
||||
endif()
|
||||
|
||||
set(CPACK_PACKAGE_NAME "Neovim")
|
||||
set(CPACK_PACKAGE_VENDOR "neovim.io")
|
||||
set(CPACK_PACKAGE_VERSION ${NVIM_VERSION_MEDIUM})
|
||||
set(CPACK_PACKAGE_INSTALL_DIRECTORY "Neovim")
|
||||
# Set toplevel directory/installer name as Neovim
|
||||
set(CPACK_PACKAGE_FILE_NAME "Neovim")
|
||||
set(CPACK_TOPLEVEL_TAG "Neovim")
|
||||
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE")
|
||||
set(CPACK_NSIS_MODIFY_PATH ON)
|
||||
set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON)
|
||||
include(CPack)
|
||||
|
||||
#add uninstall target
|
||||
if(NOT TARGET uninstall)
|
||||
configure_file(
|
||||
"cmake/UninstallHelper.cmake.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/UninstallHelper.cmake"
|
||||
IMMEDIATE @ONLY)
|
||||
|
||||
add_custom_target(uninstall
|
||||
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/UninstallHelper.cmake)
|
||||
endif()
|
||||
|
@ -1,98 +0,0 @@
|
||||
{
|
||||
"version": 3,
|
||||
"configurePresets": [
|
||||
{
|
||||
"name": "base",
|
||||
"generator": "Ninja",
|
||||
"binaryDir": "${sourceDir}/build",
|
||||
"hidden": true
|
||||
},
|
||||
{
|
||||
"name": "default",
|
||||
"displayName": "RelWithDebInfo",
|
||||
"description": "Enables optimizations (-Og or -O2) with debug information",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
|
||||
},
|
||||
"inherits": ["base"]
|
||||
},
|
||||
{
|
||||
"name": "debug",
|
||||
"displayName": "Debug",
|
||||
"description": "Disables optimizations (-O0), enables debug information",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Debug"
|
||||
},
|
||||
"inherits": ["base"]
|
||||
},
|
||||
{
|
||||
"name": "release",
|
||||
"displayName": "Release",
|
||||
"description": "Same as RelWithDebInfo, but disables debug information",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Release"
|
||||
},
|
||||
"inherits": ["base"]
|
||||
},
|
||||
{
|
||||
"name": "windows-default",
|
||||
"displayName": "Windows x64 RelWithDebInfo",
|
||||
"description": "Sets Ninja generator, enables optimizations with debug information for x64",
|
||||
"generator": "Ninja",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
|
||||
},
|
||||
"architecture": {
|
||||
"value": "x64",
|
||||
"strategy": "external"
|
||||
},
|
||||
"vendor": {
|
||||
"microsoft.com/VisualStudioSettings/CMake/1.0": {
|
||||
"hostOS": ["Windows"]
|
||||
}
|
||||
},
|
||||
"condition": {
|
||||
"type": "equals",
|
||||
"lhs": "${hostSystemName}",
|
||||
"rhs": "Windows"
|
||||
},
|
||||
"inherits": ["base"]
|
||||
},
|
||||
{
|
||||
"name": "iwyu",
|
||||
"displayName": "IWYU",
|
||||
"description": "Run include-what-you-use with the compiler",
|
||||
"cacheVariables": {
|
||||
"ENABLE_IWYU": "ON"
|
||||
},
|
||||
"inherits": ["base"]
|
||||
}
|
||||
],
|
||||
"buildPresets": [
|
||||
{
|
||||
"name": "default",
|
||||
"configurePreset": "default"
|
||||
},
|
||||
{
|
||||
"name": "debug",
|
||||
"configurePreset": "debug"
|
||||
},
|
||||
{
|
||||
"name": "release",
|
||||
"configurePreset": "release"
|
||||
},
|
||||
{
|
||||
"name": "windows-default",
|
||||
"configurePreset": "windows-default",
|
||||
"condition": {
|
||||
"type": "equals",
|
||||
"lhs": "${hostSystemName}",
|
||||
"rhs": "Windows"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "iwyu",
|
||||
"configurePreset": "iwyu"
|
||||
}
|
||||
]
|
||||
}
|
186
CONTRIBUTING.md
186
CONTRIBUTING.md
@ -7,14 +7,11 @@ Getting started
|
||||
If you want to help but don't know where to start, here are some
|
||||
low-risk/isolated tasks:
|
||||
|
||||
- Try a [complexity:low] issue.
|
||||
- [Merge a Vim patch].
|
||||
- Try a [good first issue](../../labels/good-first-issue) or [complexity:low] issue.
|
||||
- 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)
|
||||
- NOTE: read the above link before sending improvements to "runtime files" (anything in `runtime/`).
|
||||
- Vimscript and documentation files are (mostly) maintained by [Vim](https://github.com/vim/vim), not Nvim.
|
||||
- Lua files are maintained by Nvim.
|
||||
- [Improve documentation][wiki-contribute-help]
|
||||
|
||||
Reporting problems
|
||||
------------------
|
||||
@ -33,20 +30,15 @@ Reporting problems
|
||||
Developer guidelines
|
||||
--------------------
|
||||
|
||||
- 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-api-client](https://neovim.io/doc/user/develop.html#dev-api-client) if you are developing an API client.
|
||||
- Read `:help dev` if you are working on Nvim core.
|
||||
- Read `:help dev-ui` if you are developing a UI.
|
||||
- Read `:help dev-api-client` if you are developing an API client.
|
||||
- Install `ninja` for faster builds of Nvim.
|
||||
```
|
||||
sudo apt-get install ninja-build
|
||||
make distclean
|
||||
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:
|
||||
```
|
||||
CCACHE_DISABLE=true make
|
||||
```
|
||||
|
||||
Pull requests (PRs)
|
||||
---------------------
|
||||
@ -55,19 +47,21 @@ Pull requests (PRs)
|
||||
- Your PR must include [test coverage][run-tests].
|
||||
- Avoid cosmetic changes to unrelated files in the same commit.
|
||||
- Use a [feature branch][git-feature-branch] instead of the master branch.
|
||||
- Use a _rebase workflow_ for small PRs.
|
||||
- After addressing review comments, it's fine to force-push.
|
||||
- Use a _merge workflow_ (as opposed to "rebase") for big, high-risk PRs.
|
||||
- Use a **rebase workflow** for small PRs.
|
||||
- After addressing review comments, it's fine to rebase and force-push.
|
||||
- Use a **merge workflow** for big, high-risk PRs.
|
||||
- Merge `master` into your PR when there are conflicts or when master
|
||||
introduces breaking changes.
|
||||
- Use the `ri` git alias:
|
||||
```
|
||||
[alias]
|
||||
ri = "!sh -c 't=\"${1:-master}\"; s=\"${2:-HEAD}\"; mb=\"$(git merge-base \"$t\" \"$s\")\"; if test \"x$mb\" = x ; then o=\"$t\"; else lm=\"$(git log -n1 --merges \"$t..$s\" --pretty=%H)\"; if test \"x$lm\" = x ; then o=\"$mb\"; else o=\"$lm\"; fi; fi; test $# -gt 0 && shift; test $# -gt 0 && shift; git rebase --interactive \"$o\" \"$@\"'"
|
||||
```
|
||||
This avoids unnecessary rebases yet still allows you to combine related
|
||||
commits, separate monolithic commits, etc.
|
||||
- Do not edit commits that come before the merge commit.
|
||||
|
||||
### Merging to master
|
||||
|
||||
For maintainers: when a PR is ready to merge to master,
|
||||
|
||||
- prefer _Squash Merge_ for "single-commit PRs" (when the PR has only one meaningful commit).
|
||||
- prefer _Merge_ for "multi-commit PRs" (when the PR has multiple meaningful commits).
|
||||
- During a squash/fixup, use `exec make -C build unittest` between each
|
||||
pick/edit/reword.
|
||||
|
||||
### Stages: Draft and Ready for review
|
||||
|
||||
@ -98,7 +92,7 @@ the VCS/git logs more valuable. The general structure of a commit message is:
|
||||
```
|
||||
|
||||
- Prefix the commit subject with one of these [_types_](https://github.com/commitizen/conventional-commit-types/blob/master/index.json):
|
||||
- `build`, `ci`, `docs`, `feat`, `fix`, `perf`, `refactor`, `revert`, `test`, `vim-patch`
|
||||
- `build`, `ci`, `docs`, `feat`, `fix`, `perf`, `refactor`, `revert`, `test`, `vim-patch`, `chore`
|
||||
- You can **ignore this for "fixup" commits** or any commits you expect to be squashed.
|
||||
- Append optional scope to _type_ such as `(lsp)`, `(treesitter)`, `(float)`, …
|
||||
- _Description_ shouldn't start with a capital letter or end in a period.
|
||||
@ -117,20 +111,34 @@ the VCS/git logs more valuable. The general structure of a commit message is:
|
||||
|
||||
### Automated builds (CI)
|
||||
|
||||
Each pull request must pass the automated builds on [Cirrus CI] and [GitHub Actions].
|
||||
Each pull request must pass the automated builds on [sourcehut] and [GitHub Actions].
|
||||
|
||||
- CI builds are compiled with [`-Werror`][gcc-warnings], so compiler warnings
|
||||
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.
|
||||
- To run valgrind locally: `VALGRIND=1 make test`
|
||||
- To run Clang 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"`
|
||||
- The [lint](#lint) build checks modified lines _and their immediate
|
||||
neighbors_, to encourage incrementally updating the legacy style to meet our
|
||||
[style](#style). (See [#3174][3174] for background.)
|
||||
- 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).
|
||||
- CI for freebsd and openbsd runs on [sourcehut].
|
||||
- To get a backtrace on freebsd (after connecting via ssh):
|
||||
```sh
|
||||
sudo pkg install tmux # If you want tmux.
|
||||
lldb build/bin/nvim -c nvim.core
|
||||
|
||||
# To get a full backtrace:
|
||||
# 1. Rebuild with debug info.
|
||||
rm -rf nvim.core build
|
||||
gmake CMAKE_BUILD_TYPE=RelWithDebInfo CMAKE_EXTRA_FLAGS="-DCI_BUILD=ON -DMIN_LOG_LEVEL=3" nvim
|
||||
# 2. Run the failing test to generate a new core file.
|
||||
TEST_FILE=test/functional/foo.lua gmake functionaltest
|
||||
lldb build/bin/nvim -c nvim.core
|
||||
```
|
||||
|
||||
### Clang scan-build
|
||||
|
||||
@ -183,11 +191,11 @@ master build. To view the defects, just request access; you will be approved.
|
||||
|
||||
- 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
|
||||
```
|
||||
UBSAN_OPTIONS=print_stacktrace=1 ASAN_OPTIONS=log_path=/tmp/nvim_asan,handle_abort=1,handle_sigill=1 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.
|
||||
|
||||
@ -210,11 +218,6 @@ You can lint a single file (but this will _not_ exclude legacy errors):
|
||||
|
||||
### Style
|
||||
|
||||
- You can format files by using:
|
||||
```
|
||||
make format
|
||||
```
|
||||
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
|
||||
the [style-guide]. To use the Nvim `gq` command with `uncrustify`:
|
||||
```
|
||||
@ -237,67 +240,11 @@ You can lint a single file (but this will _not_ exclude legacy errors):
|
||||
```
|
||||
git config blame.ignoreRevsFile .git-blame-ignore-revs
|
||||
```
|
||||
|
||||
- Recommendation is to use **[clangd]**.
|
||||
Can use the maintained config in [nvim-lspconfig/clangd].
|
||||
- Use **[universal-ctags](https://github.com/universal-ctags/ctags).**
|
||||
("Exuberant ctags", the typical `ctags` binary provided by your distro, is
|
||||
unmaintained and won't recognize many function signatures in Neovim source.)
|
||||
- Explore the source code [on the web](https://sourcegraph.com/github.com/neovim/neovim).
|
||||
- If using [lua-language-server], symlink `contrib/luarc.json` into the
|
||||
project root:
|
||||
|
||||
$ ln -s contrib/luarc.json .luarc.json
|
||||
|
||||
### Includes
|
||||
|
||||
For managing includes in C files, use [include-what-you-use].
|
||||
|
||||
- [Install include-what-you-use][include-what-you-use-install]
|
||||
- To see which includes needs fixing use the cmake preset `iwyu`:
|
||||
```
|
||||
cmake --preset iwyu
|
||||
cmake --build --preset iwyu
|
||||
```
|
||||
- There's also a make target that automatically fixes the suggestions from
|
||||
IWYU:
|
||||
```
|
||||
make iwyu
|
||||
```
|
||||
|
||||
See [#549][549] for more details.
|
||||
|
||||
Documenting
|
||||
-----------
|
||||
|
||||
Many parts of the `:help` documentation are autogenerated from C or Lua docstrings using the `./scripts/gen_vimdoc.py` script.
|
||||
You can filter the regeneration based on the target (api, lua, or lsp), or the file you changed, that need a doc refresh using `./scripts/gen_vimdoc.py -t <target>`.
|
||||
|
||||
## Lua docstrings
|
||||
|
||||
Lua documentation uses a subset of [EmmyLua] annotations. A rough outline of a function documentation is
|
||||
|
||||
```lua
|
||||
--- {Brief}
|
||||
---
|
||||
--- {Long explanation}
|
||||
---
|
||||
---@param arg1 type {description}
|
||||
---@param arg2 type {description}
|
||||
{...}
|
||||
---
|
||||
---@return type {description}
|
||||
```
|
||||
|
||||
If possible, always add type information (`table`, `string`, `number`, ...). Multiple valid types are separated by a bar (`string|table`). Indicate optional parameters via `type|nil`.
|
||||
|
||||
If a function in your Lua module should not be documented (e.g. internal function or local function), you should set the doc comment to:
|
||||
|
||||
```
|
||||
---@private
|
||||
```
|
||||
|
||||
Mark functions that are deprecated as
|
||||
```
|
||||
---@deprecated
|
||||
```
|
||||
|
||||
Reviewing
|
||||
---------
|
||||
@ -305,46 +252,39 @@ 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.
|
||||
Using [GitHub CLI][gh], you can create a new branch with the contents of a pull
|
||||
Using [`hub`][hub], you can create a new branch with the contents of a pull
|
||||
request, e.g. [#1820][1820]:
|
||||
|
||||
gh pr checkout https://github.com/neovim/neovim/pull/1820
|
||||
hub checkout https://github.com/neovim/neovim/pull/1820
|
||||
|
||||
Use [`git log -p master..FETCH_HEAD`][git-history-filtering] to list all
|
||||
commits in the feature branch which aren't in the `master` branch; `-p`
|
||||
shows each commit's diff. To show the whole surrounding function of a change
|
||||
as context, use the `-W` argument as well.
|
||||
|
||||
[549]: https://github.com/neovim/neovim/issues/549
|
||||
[1820]: https://github.com/neovim/neovim/pull/1820
|
||||
[3174]: https://github.com/neovim/neovim/issues/3174
|
||||
[ASan]: http://clang.llvm.org/docs/AddressSanitizer.html
|
||||
[Cirrus CI]: https://cirrus-ci.com/github/neovim/neovim
|
||||
[Clang report]: https://neovim.io/doc/reports/clang/
|
||||
[GitHub Actions]: https://github.com/neovim/neovim/actions
|
||||
[clangd]: https://clangd.llvm.org
|
||||
[Merge a Vim patch]: https://github.com/neovim/neovim/wiki/Merging-patches-from-upstream-Vim
|
||||
[complexity:low]: https://github.com/neovim/neovim/issues?q=is%3Aopen+is%3Aissue+label%3Acomplexity%3Alow
|
||||
[conventional_commits]: https://www.conventionalcommits.org
|
||||
[EmmyLua]: https://github.com/sumneko/lua-language-server/wiki/Annotations
|
||||
[gcc-warnings]: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
|
||||
[gh]: https://cli.github.com/
|
||||
[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-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
|
||||
[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
|
||||
[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
|
||||
[pr-draft]: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request
|
||||
[pr-ready]: https://docs.github.com/en/github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-stage-of-a-pull-request
|
||||
[review-checklist]: https://github.com/neovim/neovim/wiki/Code-review-checklist
|
||||
[run-tests]: https://github.com/neovim/neovim/blob/master/test/README.md#running-tests
|
||||
[1820]: https://github.com/neovim/neovim/pull/1820
|
||||
[hub]: https://hub.github.com/
|
||||
[conventional_commits]: https://www.conventionalcommits.org
|
||||
[style-guide]: https://neovim.io/doc/user/dev_style.html#dev-style
|
||||
[uncrustify]: http://uncrustify.sourceforge.net/
|
||||
[wiki-contribute-help]: https://github.com/neovim/neovim/wiki/contribute-%3Ahelp
|
||||
[ASan]: http://clang.llvm.org/docs/AddressSanitizer.html
|
||||
[run-tests]: https://github.com/neovim/neovim/blob/master/test/README.md#running-tests
|
||||
[wiki-faq]: https://github.com/neovim/neovim/wiki/FAQ
|
||||
[review-checklist]: https://github.com/neovim/neovim/wiki/Code-review-checklist
|
||||
[3174]: https://github.com/neovim/neovim/issues/3174
|
||||
[sourcehut]: https://builds.sr.ht/~jmk
|
||||
[GitHub Actions]: https://github.com/neovim/neovim/actions
|
||||
[Merge a Vim patch]: https://github.com/neovim/neovim/wiki/Merging-patches-from-upstream-Vim
|
||||
[Clang report]: https://neovim.io/doc/reports/clang/
|
||||
[complexity:low]: https://github.com/neovim/neovim/issues?q=is%3Aopen+is%3Aissue+label%3Acomplexity%3Alow
|
||||
[master error list]: https://raw.githubusercontent.com/neovim/doc/gh-pages/reports/clint/errors.json
|
||||
[wiki-contribute-help]: https://github.com/neovim/neovim/wiki/contribute-%3Ahelp
|
||||
[pr-draft]: https://docs.github.com/en/github/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
|
||||
[uncrustify]: https://formulae.brew.sh/formula/uncrustify
|
||||
|
@ -8,7 +8,7 @@ Neovim's license follows:
|
||||
====
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
https://www.apache.org/licenses/
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
@ -196,11 +196,10 @@ The externally maintained libraries used by Neovim are:
|
||||
- libtermkey: MIT license
|
||||
- libuv. Copyright Joyent, Inc. and other Node contributors. Node.js license.
|
||||
- libvterm: MIT license
|
||||
- lua-cjson: MIT license
|
||||
- lua-compat: MIT license
|
||||
- tree-sitter: MIT license
|
||||
- unibilium: LGPL v3
|
||||
- xdiff: LGPL v2
|
||||
- xdiff: LGPL license
|
||||
- lua-cjson: MIT license
|
||||
|
||||
====
|
||||
|
118
MAINTAIN.md
118
MAINTAIN.md
@ -12,23 +12,23 @@ General guidelines
|
||||
* Use automation to solve problems
|
||||
* Never break the API... but sometimes break the UI
|
||||
|
||||
Issue triage
|
||||
------------
|
||||
Ticket triage
|
||||
-------------
|
||||
|
||||
In practice we haven't found a way to forecast more precisely than "next" and
|
||||
"after next". So there are usually one or two (at most) planned milestones:
|
||||
|
||||
* Next bugfix-release (1.0.x)
|
||||
* Next feature-release (1.x.0)
|
||||
- Next bugfix-release (1.0.x)
|
||||
- Next feature-release (1.x.0)
|
||||
|
||||
The forecasting problem might be solved with an explicit priority system (like
|
||||
Bram's todo.txt). Meanwhile the Neovim priority system is defined by:
|
||||
|
||||
* PRs nearing completion.
|
||||
* Issue labels. E.g. the `+plan` label increases the ticket's priority merely
|
||||
- PRs nearing completion.
|
||||
- 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
|
||||
without a plan.
|
||||
* Comment activity or new information.
|
||||
- Comment activity or new information.
|
||||
|
||||
Anything that isn't in the next milestone, and doesn't have a finished PR—is
|
||||
just not something you care very much about, by construction. Post-release you
|
||||
@ -50,89 +50,43 @@ has a major bug:
|
||||
1. Fix the bug on `master`.
|
||||
2. Cherry-pick the fix to `release-x.y`.
|
||||
3. Cut a release from `release-x.y`.
|
||||
* 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)
|
||||
will update the release assets and force-push to the `stable` tag.
|
||||
- Run `./scripts/release.sh`
|
||||
- Update (force-push) the remote `stable` tag.
|
||||
- The [nightly job](https://github.com/neovim/bot-ci/blob/master/ci/nightly.sh)
|
||||
will update the release assets based on the `stable` tag.
|
||||
|
||||
### Release automation
|
||||
|
||||
Neovim automation includes a [backport bot](https://github.com/zeebe-io/backport-action).
|
||||
Trigger the action by labeling a PR with `backport release-X.Y`. See `.github/workflows/backport.yml`.
|
||||
The neovim repository includes a backport [github action](https://github.com/zeebe-io/backport-action).
|
||||
In order to trigger the action, a PR must be labeled with a label matching the
|
||||
form `backport release-0.X`. If the label is applied before the PR is merged,
|
||||
the backport will be filed automatically against the target branch. Otherwise,
|
||||
comment `\backport` on the merged PR *after* the label has been applied to trigger
|
||||
a backport. Note, the PR must have a description in the issue body, or the backport
|
||||
will fail.
|
||||
|
||||
Third-party dependencies
|
||||
------------------------
|
||||
|
||||
These "bundled" dependencies can be updated by bumping their versions in `cmake.deps/CMakeLists.txt`.
|
||||
Some can be auto-bumped by `scripts/bump_deps.lua`.
|
||||
|
||||
* [LuaJIT](https://github.com/LuaJIT/LuaJIT)
|
||||
* [Lua](https://www.lua.org/download.html)
|
||||
* [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/)
|
||||
* [libiconv](https://ftp.gnu.org/pub/gnu/libiconv)
|
||||
* [libtermkey](https://github.com/neovim/libtermkey)
|
||||
* [libuv](https://github.com/libuv/libuv)
|
||||
* [libvterm](http://www.leonerd.org.uk/code/libvterm/)
|
||||
* [lua-compat](https://github.com/keplerproject/lua-compat-5.3)
|
||||
* [msys2](https://github.com/msys2/MINGW-packages) (for mingw Windows build)
|
||||
* Changes to mingw can [break our mingw build](https://github.com/msys2/MINGW-packages/issues/9946).
|
||||
* [tree-sitter](https://github.com/tree-sitter/tree-sitter)
|
||||
* [unibilium](https://github.com/neovim/unibilium)
|
||||
|
||||
### Vendored dependencies
|
||||
|
||||
These dependencies are "vendored" (inlined), we must update the sources manually:
|
||||
|
||||
* `src/mpack/`: [libmpack](https://github.com/libmpack/libmpack)
|
||||
* send improvements upstream!
|
||||
* `src/xdiff/`: [xdiff](https://github.com/git/git/tree/master/xdiff)
|
||||
* `src/cjson/`: [lua-cjson](https://github.com/openresty/lua-cjson)
|
||||
* `src/nvim/lib/`: [Klib](https://github.com/attractivechaos/klib)
|
||||
* `runtime/lua/vim/inspect.lua`: [inspect.lua](https://github.com/kikito/inspect.lua)
|
||||
* `src/nvim/tui/terminfo_defs.h`: terminfo definitions
|
||||
* Run `scripts/update_terminfo.sh` to update these definitions.
|
||||
* `src/bit.c`: only for PUC lua: port of `require'bit'` from luajit https://bitop.luajit.org/
|
||||
* [treesitter parsers](https://github.com/neovim/neovim/blob/fcc24e43e0b5f9d801a01ff2b8f78ce8c16dd551/cmake.deps/CMakeLists.txt#L197-L210)
|
||||
|
||||
### Forks
|
||||
|
||||
We may maintain forks, if we are waiting on upstream changes: https://github.com/neovim/neovim/wiki/Deps
|
||||
|
||||
CI
|
||||
--------------
|
||||
|
||||
### General
|
||||
These "bundled" dependencies can be updated by bumping their versions in `third-party/CMakeLists.txt`:
|
||||
- [Lua](https://www.lua.org/download.html)
|
||||
- [LuaJIT](https://github.com/LuaJIT/LuaJIT)
|
||||
- [Luv](https://github.com/luvit/luv)
|
||||
- [libtermkey](https://github.com/neovim/libtermkey)
|
||||
- [libuv](https://github.com/libuv/libuv)
|
||||
- [libvterm](http://www.leonerd.org.uk/code/libvterm/)
|
||||
- [lua-compat](https://github.com/keplerproject/lua-compat-5.3)
|
||||
- [tree-sitter](https://github.com/tree-sitter/tree-sitter)
|
||||
|
||||
As our CI is primarily dependent on GitHub Actions at the moment, then so will
|
||||
our CI strategy be. The following guidelines have worked well for us so far:
|
||||
These dependencies are "vendored" (inlined), we need to update the sources manually:
|
||||
- [libmpack](https://github.com/libmpack/libmpack)
|
||||
- [xdiff](https://github.com/git/git/tree/master/xdiff)
|
||||
- [lua-cjson](https://github.com/openresty/lua-cjson)
|
||||
- [Klib](https://github.com/attractivechaos/klib)
|
||||
|
||||
* Never use a macOS runner if an Ubuntu or a Windows runner can be used
|
||||
instead. This is because macOS runners have a [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.yml`.
|
||||
|
||||
* For our testing jobs, which are in `test.yml` and `build.yml`, prefer to use
|
||||
the latest stable (i.e. non-beta) 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 automatic
|
||||
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.
|
||||
We also maintain some forks, particularly for Windows, if we are waiting on upstream changes:
|
||||
https://github.com/neovim/neovim/wiki/Deps
|
||||
|
||||
See also
|
||||
--------
|
||||
|
||||
* https://github.com/neovim/neovim/issues/862
|
||||
* https://github.com/git/git/blob/master/Documentation/howto/maintain-git.txt
|
||||
- https://github.com/neovim/neovim/issues/862
|
||||
- https://github.com/git/git/blob/master/Documentation/howto/maintain-git.txt
|
||||
|
103
Makefile
103
Makefile
@ -47,12 +47,19 @@ endif
|
||||
|
||||
ifeq (,$(BUILD_TOOL))
|
||||
ifeq (Ninja,$(CMAKE_GENERATOR))
|
||||
BUILD_TOOL = ninja
|
||||
ifneq ($(shell $(CMAKE_PRG) --help 2>/dev/null | grep Ninja),)
|
||||
BUILD_TOOL = ninja
|
||||
else
|
||||
# User's version of CMake doesn't support Ninja
|
||||
BUILD_TOOL = $(MAKE)
|
||||
CMAKE_GENERATOR := Unix Makefiles
|
||||
endif
|
||||
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),)
|
||||
@ -65,7 +72,8 @@ ifeq ($(CMAKE_GENERATOR),Ninja)
|
||||
endif
|
||||
|
||||
DEPS_CMAKE_FLAGS ?=
|
||||
USE_BUNDLED ?=
|
||||
# Back-compat: USE_BUNDLED_DEPS was the old name.
|
||||
USE_BUNDLED ?= $(USE_BUNDLED_DEPS)
|
||||
|
||||
ifneq (,$(USE_BUNDLED))
|
||||
BUNDLED_CMAKE_FLAG := -DUSE_BUNDLED=$(USE_BUNDLED)
|
||||
@ -94,7 +102,7 @@ build/.ran-cmake: | deps
|
||||
cd build && $(CMAKE_PRG) -G '$(CMAKE_GENERATOR)' $(CMAKE_FLAGS) $(CMAKE_EXTRA_FLAGS) $(MAKEFILE_DIR)
|
||||
touch $@
|
||||
|
||||
deps: | build/.ran-deps-cmake
|
||||
deps: | build/.ran-third-party-cmake
|
||||
ifeq ($(call filter-true,$(USE_BUNDLED)),)
|
||||
+$(BUILD_TOOL) -C $(DEPS_BUILD_DIR)
|
||||
endif
|
||||
@ -102,49 +110,80 @@ endif
|
||||
ifeq ($(call filter-true,$(USE_BUNDLED)),)
|
||||
$(DEPS_BUILD_DIR):
|
||||
mkdir -p "$@"
|
||||
build/.ran-deps-cmake:: $(DEPS_BUILD_DIR)
|
||||
build/.ran-third-party-cmake:: $(DEPS_BUILD_DIR)
|
||||
cd $(DEPS_BUILD_DIR) && \
|
||||
$(CMAKE_PRG) -G '$(CMAKE_GENERATOR)' $(BUNDLED_CMAKE_FLAG) $(BUNDLED_LUA_CMAKE_FLAG) \
|
||||
$(DEPS_CMAKE_FLAGS) $(MAKEFILE_DIR)/cmake.deps
|
||||
$(DEPS_CMAKE_FLAGS) $(MAKEFILE_DIR)/third-party
|
||||
endif
|
||||
build/.ran-deps-cmake::
|
||||
build/.ran-third-party-cmake::
|
||||
mkdir -p build
|
||||
touch $@
|
||||
|
||||
# TODO: cmake 3.2+ add_custom_target() has a USES_TERMINAL flag.
|
||||
oldtest: | nvim build/runtime/doc/tags
|
||||
+$(SINGLE_MAKE) -C test/old/testdir clean
|
||||
+$(SINGLE_MAKE) -C src/nvim/testdir clean
|
||||
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
|
||||
@# 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
|
||||
# Build oldtest by specifying the relative .vim filename.
|
||||
.PHONY: phony_force
|
||||
test/old/testdir/%.vim: phony_force
|
||||
+$(SINGLE_MAKE) -C test/old/testdir NVIM_PRG=$(NVIM_PRG) SCRIPTS= $(MAKEOVERRIDES) $(patsubst test/old/testdir/%.vim,%,$@)
|
||||
src/nvim/testdir/%.vim: phony_force
|
||||
+$(SINGLE_MAKE) -C src/nvim/testdir NVIM_PRG=$(NVIM_PRG) SCRIPTS= $(MAKEOVERRIDES) $(patsubst src/nvim/testdir/%.vim,%,$@)
|
||||
|
||||
build/runtime/doc/tags helptags: | nvim
|
||||
+$(BUILD_TOOL) -C build runtime/doc/tags
|
||||
|
||||
# Builds help HTML _and_ checks for invalid help tags.
|
||||
helphtml: | nvim build/runtime/doc/tags
|
||||
+$(BUILD_TOOL) -C build doc_html
|
||||
|
||||
functionaltest: | nvim
|
||||
+$(BUILD_TOOL) -C build functionaltest
|
||||
|
||||
functionaltest-lua: | nvim
|
||||
$(BUILD_TOOL) -C build $@
|
||||
+$(BUILD_TOOL) -C build functionaltest-lua
|
||||
|
||||
FORMAT=formatc formatlua format
|
||||
LINT=lintlua lintsh lintc clang-tidy lintcommit lint
|
||||
TEST=functionaltest unittest
|
||||
generated-sources benchmark uninstall $(FORMAT) $(LINT) $(TEST): | build/.ran-cmake
|
||||
$(CMAKE_PRG) --build build --target $@
|
||||
lualint: | build/.ran-cmake deps
|
||||
$(BUILD_TOOL) -C build lualint
|
||||
|
||||
test: $(TEST)
|
||||
shlint:
|
||||
@shellcheck --version | head -n 2
|
||||
shellcheck scripts/vim-patch.sh
|
||||
|
||||
iwyu: build/.ran-cmake
|
||||
cmake --preset iwyu
|
||||
cmake --build --preset iwyu > build/iwyu.log
|
||||
iwyu-fix-includes --only_re="src/nvim" --ignore_re="src/nvim/(auto|map.h|eval/encode.c)" --safe_headers < build/iwyu.log
|
||||
cmake -B build -U ENABLE_IWYU
|
||||
_opt_shlint:
|
||||
@command -v shellcheck && { $(MAKE) shlint; exit $$?; } \
|
||||
|| echo "SKIP: shlint (shellcheck not found)"
|
||||
|
||||
pylint:
|
||||
flake8 contrib/ scripts/ src/ test/
|
||||
|
||||
# Run pylint only if flake8 is installed.
|
||||
_opt_pylint:
|
||||
@command -v flake8 && { $(MAKE) pylint; exit $$?; } \
|
||||
|| echo "SKIP: pylint (flake8 not found)"
|
||||
|
||||
commitlint:
|
||||
$(NVIM_PRG) --clean -es +"lua require('scripts.lintcommit').main({trace=false})"
|
||||
|
||||
_opt_commitlint:
|
||||
@test -x build/bin/nvim && { $(MAKE) commitlint; exit $$?; } \
|
||||
|| echo "SKIP: commitlint (build/bin/nvim not found)"
|
||||
|
||||
unittest: | nvim
|
||||
+$(BUILD_TOOL) -C build unittest
|
||||
|
||||
benchmark: | nvim
|
||||
+$(BUILD_TOOL) -C build benchmark
|
||||
|
||||
test: functionaltest unittest
|
||||
|
||||
clean:
|
||||
+test -d build && $(BUILD_TOOL) -C build clean || true
|
||||
$(MAKE) -C test/old/testdir clean
|
||||
$(MAKE) -C src/nvim/testdir clean
|
||||
$(MAKE) -C runtime/doc clean
|
||||
$(MAKE) -C runtime/indent clean
|
||||
|
||||
distclean:
|
||||
@ -154,6 +193,18 @@ distclean:
|
||||
install: checkprefix nvim
|
||||
+$(BUILD_TOOL) -C build install
|
||||
|
||||
clint: build/.ran-cmake
|
||||
+$(BUILD_TOOL) -C build clint
|
||||
|
||||
clint-full: build/.ran-cmake
|
||||
+$(BUILD_TOOL) -C build clint-full
|
||||
|
||||
check-single-includes: build/.ran-cmake
|
||||
+$(BUILD_TOOL) -C build check-single-includes
|
||||
|
||||
generated-sources: build/.ran-cmake
|
||||
+$(BUILD_TOOL) -C build generated-sources
|
||||
|
||||
appimage:
|
||||
bash scripts/genappimage.sh
|
||||
|
||||
@ -163,6 +214,8 @@ appimage:
|
||||
appimage-%:
|
||||
bash scripts/genappimage.sh $*
|
||||
|
||||
lint: check-single-includes clint lualint _opt_pylint _opt_shlint _opt_commitlint
|
||||
|
||||
# Generic pattern rules, allowing for `make build/bin/nvim` etc.
|
||||
# Does not work with "Unix Makefiles".
|
||||
ifeq ($(CMAKE_GENERATOR),Ninja)
|
||||
@ -173,4 +226,4 @@ $(DEPS_BUILD_DIR)/%: phony_force
|
||||
$(BUILD_TOOL) -C $(DEPS_BUILD_DIR) $(patsubst $(DEPS_BUILD_DIR)/%,%,$@)
|
||||
endif
|
||||
|
||||
.PHONY: test clean distclean nvim libnvim cmake deps install appimage checkprefix benchmark uninstall $(FORMAT) $(LINT) $(TEST)
|
||||
.PHONY: test lualint pylint shlint functionaltest unittest lint clint clean distclean nvim libnvim cmake deps install appimage checkprefix commitlint
|
||||
|
42
README.md
42
README.md
@ -1,18 +1,21 @@
|
||||
<h1 align="center">
|
||||
<img src="https://raw.githubusercontent.com/neovim/neovim.github.io/master/logos/neovim-logo-300x87.png" alt="Neovim">
|
||||
[](https://neovim.io)
|
||||
|
||||
<a href="https://neovim.io/doc/">Documentation</a> |
|
||||
<a href="https://app.element.io/#/room/#neovim:matrix.org">Chat</a>
|
||||
</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://codecov.io/gh/neovim/neovim)
|
||||
[](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://buildd.debian.org/neovim)
|
||||
[](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)
|
||||
- Split the work between multiple developers
|
||||
@ -27,7 +30,7 @@ Features
|
||||
|
||||
- Modern [GUIs](https://github.com/neovim/neovim/wiki/Related-projects#gui)
|
||||
- [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
|
||||
- Embedded, scriptable [terminal emulator](https://neovim.io/doc/user/nvim_terminal_emulator.html)
|
||||
- Asynchronous [job control](https://github.com/neovim/neovim/pull/2247)
|
||||
@ -35,7 +38,7 @@ Features
|
||||
- [XDG base directories](https://github.com/neovim/neovim/pull/3470) support
|
||||
- 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
|
||||
--------------------
|
||||
@ -48,7 +51,7 @@ Pre-built packages for Windows, macOS, and Linux are found on the
|
||||
Install from source
|
||||
-------------------
|
||||
|
||||
See the [Building Neovim](https://github.com/neovim/neovim/wiki/Building-Neovim) wiki page 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.
|
||||
After installing the dependencies, run the following command.
|
||||
@ -58,7 +61,7 @@ After installing the dependencies, run the following command.
|
||||
|
||||
To install to a non-default location:
|
||||
|
||||
make CMAKE_BUILD_TYPE=RelWithDebInfo CMAKE_INSTALL_PREFIX=/full/path/
|
||||
make CMAKE_INSTALL_PREFIX=/full/path/
|
||||
make install
|
||||
|
||||
CMake hints for inspecting the build:
|
||||
@ -75,10 +78,9 @@ See [`:help nvim-from-vim`](https://neovim.io/doc/user/nvim.html#nvim-from-vim)
|
||||
Project layout
|
||||
--------------
|
||||
|
||||
├─ cmake/ CMake utils
|
||||
├─ cmake.config/ CMake defines
|
||||
├─ cmake.deps/ subproject to fetch and build dependencies (optional)
|
||||
├─ runtime/ plugins and docs
|
||||
├─ ci/ build automation
|
||||
├─ cmake/ build scripts
|
||||
├─ runtime/ user plugins/docs
|
||||
├─ src/nvim/ application source code (see src/nvim/README.md)
|
||||
│ ├─ api/ API subsystem
|
||||
│ ├─ eval/ VimL subsystem
|
||||
@ -89,6 +91,7 @@ Project layout
|
||||
│ ├─ msgpack_rpc/ RPC subsystem
|
||||
│ ├─ os/ low-level platform code
|
||||
│ └─ tui/ built-in UI
|
||||
├─ third-party/ CMake subproject to build dependencies
|
||||
└─ test/ tests (see test/README.md)
|
||||
|
||||
License
|
||||
@ -102,22 +105,21 @@ 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
|
||||
kcc section of the vim docs or visit the ICCF web site, available at these URLs:
|
||||
|
||||
https://iccf-holland.org/
|
||||
https://www.vim.org/iccf/
|
||||
https://www.iccf.nl/
|
||||
http://iccf-holland.org/
|
||||
http://www.vim.org/iccf/
|
||||
http://www.iccf.nl/
|
||||
|
||||
You can also sponsor the development of Vim. Vim sponsors can vote for
|
||||
features. The money goes to Uganda anyway.
|
||||
|
||||
[license-commit]: https://github.com/neovim/neovim/commit/b17d9691a24099c9210289f16afb1a498a89d803
|
||||
[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/
|
||||
[advanced UIs]: https://github.com/neovim/neovim/wiki/Related-projects#gui
|
||||
[Managed packages]: https://github.com/neovim/neovim/wiki/Installing-Neovim#install-from-package
|
||||
[Debian]: https://packages.debian.org/testing/neovim
|
||||
[Ubuntu]: https://packages.ubuntu.com/search?keywords=neovim
|
||||
[Fedora]: https://packages.fedoraproject.org/pkgs/neovim/neovim/
|
||||
[Ubuntu]: http://packages.ubuntu.com/search?keywords=neovim
|
||||
[Fedora]: https://apps.fedoraproject.org/packages/neovim
|
||||
[Arch Linux]: https://www.archlinux.org/packages/?q=neovim
|
||||
[Void Linux]: https://voidlinux.org/packages/?arch=x86_64&q=neovim
|
||||
[Gentoo]: https://packages.gentoo.org/packages/app-editors/neovim
|
||||
|
27
ci/before_cache.sh
Executable file
27
ci/before_cache.sh
Executable file
@ -0,0 +1,27 @@
|
||||
#!/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"
|
||||
|
||||
echo "before_cache.sh: cache size"
|
||||
du -chd 1 "${HOME}/.cache" | sort -rh | head -20
|
||||
|
||||
echo "before_cache.sh: ccache stats"
|
||||
ccache -s 2>/dev/null || true
|
||||
# Do not keep ccache stats (uploaded to cache otherwise; reset initially anyway).
|
||||
find "${HOME}/.ccache" -name stats -delete
|
||||
|
||||
# Update the third-party dependency cache only if the build was successful.
|
||||
if ended_successfully; 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
|
46
ci/before_install.sh
Executable file
46
ci/before_install.sh
Executable file
@ -0,0 +1,46 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
echo 'Python info:'
|
||||
(
|
||||
set -x
|
||||
python3 --version
|
||||
python2 --version
|
||||
python --version
|
||||
pip3 --version
|
||||
pip2 --version
|
||||
pip --version
|
||||
|
||||
pyenv --version
|
||||
pyenv versions
|
||||
) 2>&1 | sed 's/^/ /' || true
|
||||
|
||||
# Use pyenv, but not for OSX on Travis, where it only has the "system" version.
|
||||
if [[ "${TRAVIS_OS_NAME}" != osx ]] && command -v pyenv; then
|
||||
echo 'Setting Python versions via pyenv'
|
||||
|
||||
# Prefer Python 2 over 3 (more conservative).
|
||||
pyenv global 2.7:3.8
|
||||
|
||||
echo 'Updated Python info:'
|
||||
(
|
||||
set -x
|
||||
python3 --version
|
||||
python2 --version
|
||||
python --version
|
||||
|
||||
python3 -m pip --version
|
||||
python2 -m pip --version
|
||||
) 2>&1 | sed 's/^/ /'
|
||||
fi
|
||||
|
||||
echo "Install node (LTS)"
|
||||
|
||||
if [[ "${TRAVIS_OS_NAME}" == osx ]] || [ ! -f ~/.nvm/nvm.sh ]; then
|
||||
curl -o ~/.nvm/nvm.sh https://raw.githubusercontent.com/creationix/nvm/master/nvm.sh
|
||||
fi
|
||||
|
||||
source ~/.nvm/nvm.sh
|
||||
nvm install 10
|
46
ci/before_script.sh
Executable file
46
ci/before_script.sh
Executable file
@ -0,0 +1,46 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
CI_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
source "${CI_DIR}/common/build.sh"
|
||||
|
||||
# Enable ipv6 on Travis. ref: a39c8b7ce30d
|
||||
if test -n "${TRAVIS_OS_NAME}" && ! test "${TRAVIS_OS_NAME}" = osx ; then
|
||||
echo "before_script.sh: enable ipv6"
|
||||
sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=0
|
||||
fi
|
||||
|
||||
# Test some of the configuration variables.
|
||||
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
|
||||
|
||||
echo "before_script.sh: ccache stats (will be cleared)"
|
||||
ccache -s
|
||||
# Reset ccache stats for real results in before_cache.
|
||||
ccache --zero-stats
|
||||
|
||||
if [[ "${TRAVIS_OS_NAME}" == osx ]]; then
|
||||
# Adds user to a dummy group.
|
||||
# That allows to test changing the group of the file by `os_fchown`.
|
||||
sudo dscl . -create /Groups/chown_test
|
||||
sudo dscl . -append /Groups/chown_test GroupMembership "${USER}"
|
||||
fi
|
||||
|
||||
# Compile dependencies.
|
||||
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}"
|
182
ci/build.ps1
Normal file
182
ci/build.ps1
Normal file
@ -0,0 +1,182 @@
|
||||
param([switch]$NoTests)
|
||||
Set-StrictMode -Version Latest
|
||||
$ErrorActionPreference = 'Stop'
|
||||
$ProgressPreference = 'SilentlyContinue'
|
||||
|
||||
$env:CONFIGURATION -match '^(?<compiler>\w+)_(?<bits>32|64)(?:-(?<option>\w+))?$'
|
||||
$compiler = $Matches.compiler
|
||||
$compileOption = if ($Matches -contains 'option') {$Matches.option} else {''}
|
||||
$bits = $Matches.bits
|
||||
$cmakeBuildType = $(if ($env:CMAKE_BUILD_TYPE -ne $null) {$env:CMAKE_BUILD_TYPE} else {'RelWithDebInfo'});
|
||||
$buildDir = [System.IO.Path]::GetFullPath("$(pwd)")
|
||||
$depsCmakeVars = @{
|
||||
CMAKE_BUILD_TYPE = $cmakeBuildType;
|
||||
}
|
||||
$nvimCmakeVars = @{
|
||||
CMAKE_BUILD_TYPE = $cmakeBuildType;
|
||||
BUSTED_OUTPUT_TYPE = 'nvim';
|
||||
DEPS_PREFIX=$(if ($env:DEPS_PREFIX -ne $null) {$env:DEPS_PREFIX} else {".deps/usr"});
|
||||
}
|
||||
if ($env:DEPS_BUILD_DIR -eq $null) {
|
||||
$env:DEPS_BUILD_DIR = ".deps";
|
||||
}
|
||||
$uploadToCodeCov = $false
|
||||
|
||||
function exitIfFailed() {
|
||||
if ($LastExitCode -ne 0) {
|
||||
exit $LastExitCode
|
||||
}
|
||||
}
|
||||
|
||||
if (-not $NoTests) {
|
||||
node --version
|
||||
npm.cmd --version
|
||||
}
|
||||
|
||||
if (-Not (Test-Path -PathType container $env:DEPS_BUILD_DIR)) {
|
||||
write-host "cache dir not found: $($env:DEPS_BUILD_DIR)"
|
||||
mkdir $env:DEPS_BUILD_DIR
|
||||
} else {
|
||||
write-host "cache dir $($env:DEPS_BUILD_DIR) size: $(Get-ChildItem $env:DEPS_BUILD_DIR -recurse | Measure-Object -property length -sum | Select -expand sum)"
|
||||
}
|
||||
|
||||
if ($compiler -eq 'MINGW') {
|
||||
if ($bits -eq 32) {
|
||||
$arch = 'i686'
|
||||
}
|
||||
elseif ($bits -eq 64) {
|
||||
$arch = 'x86_64'
|
||||
}
|
||||
if ($compileOption -eq 'gcov') {
|
||||
$nvimCmakeVars['USE_GCOV'] = 'ON'
|
||||
$uploadToCodecov = $true
|
||||
$env:GCOV = "C:\msys64\mingw$bits\bin\gcov"
|
||||
|
||||
# Setup/build Lua coverage.
|
||||
$env:USE_LUACOV = 1
|
||||
$env:BUSTED_ARGS = "--coverage"
|
||||
}
|
||||
# These are native MinGW builds, but they use the toolchain inside
|
||||
# MSYS2, this allows using all the dependencies and tools available
|
||||
# in MSYS2, but we cannot build inside the MSYS2 shell.
|
||||
$cmakeGenerator = 'Ninja'
|
||||
$cmakeGeneratorArgs = '-v'
|
||||
$mingwPackages = @('ninja', 'cmake', 'diffutils').ForEach({
|
||||
"mingw-w64-$arch-$_"
|
||||
})
|
||||
|
||||
# Add MinGW to the PATH
|
||||
$env:PATH = "C:\msys64\mingw$bits\bin;$env:PATH"
|
||||
|
||||
# Avoid pacman "warning" which causes non-zero return code. https://github.com/open62541/open62541/issues/2068
|
||||
& C:\msys64\usr\bin\mkdir -p /var/cache/pacman/pkg
|
||||
|
||||
# Build third-party dependencies
|
||||
C:\msys64\usr\bin\bash -lc "pacman --verbose --noconfirm -Syu" ; exitIfFailed
|
||||
C:\msys64\usr\bin\bash -lc "pacman --verbose --noconfirm --needed -S $mingwPackages" ; exitIfFailed
|
||||
}
|
||||
elseif ($compiler -eq 'MSVC') {
|
||||
$cmakeGeneratorArgs = '/verbosity:normal'
|
||||
if ($bits -eq 32) {
|
||||
$cmakeGenerator = 'Visual Studio 15 2017'
|
||||
}
|
||||
elseif ($bits -eq 64) {
|
||||
$cmakeGenerator = 'Visual Studio 15 2017 Win64'
|
||||
}
|
||||
}
|
||||
|
||||
if (-not $NoTests) {
|
||||
# Setup python (use AppVeyor system python)
|
||||
|
||||
# Disambiguate python3, if needed
|
||||
if (-not (Test-Path -Path C:\hostedtoolcache\windows\Python\3.5.4\x64\python3.exe) ) {
|
||||
move C:\hostedtoolcache\windows\Python\3.5.4\x64\python.exe C:\hostedtoolcache\windows\Python\3.5.4\x64\python3.exe
|
||||
}
|
||||
$env:PATH = "C:\hostedtoolcache\windows\Python\2.7.18\x64;C:\hostedtoolcache\windows\Python\3.5.4\x64;$env:PATH"
|
||||
|
||||
python -m pip install pynvim ; exitIfFailed
|
||||
python3 -m pip install pynvim ; exitIfFailed
|
||||
# Sanity check
|
||||
python -c "import pynvim; print(str(pynvim))" ; exitIfFailed
|
||||
python3 -c "import pynvim; print(str(pynvim))" ; exitIfFailed
|
||||
|
||||
gem.cmd install --pre neovim
|
||||
Get-Command -CommandType Application neovim-ruby-host.bat
|
||||
|
||||
npm.cmd install -g neovim
|
||||
Get-Command -CommandType Application neovim-node-host.cmd
|
||||
npm.cmd link neovim
|
||||
}
|
||||
|
||||
if ($compiler -eq 'MSVC') {
|
||||
# Required for LuaRocks (https://github.com/luarocks/luarocks/issues/1039#issuecomment-507296940).
|
||||
$env:VCINSTALLDIR = "C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/"
|
||||
}
|
||||
|
||||
function convertToCmakeArgs($vars) {
|
||||
return $vars.GetEnumerator() | foreach { "-D$($_.Key)=$($_.Value)" }
|
||||
}
|
||||
|
||||
cd $env:DEPS_BUILD_DIR
|
||||
cmake -G $cmakeGenerator $(convertToCmakeArgs($depsCmakeVars)) "$buildDir/third-party/" ; exitIfFailed
|
||||
cmake --build . --config $cmakeBuildType -- $cmakeGeneratorArgs ; exitIfFailed
|
||||
cd $buildDir
|
||||
|
||||
# Build Neovim
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -G $cmakeGenerator $(convertToCmakeArgs($nvimCmakeVars)) .. ; exitIfFailed
|
||||
cmake --build . --config $cmakeBuildType -- $cmakeGeneratorArgs ; exitIfFailed
|
||||
.\bin\nvim --version ; exitIfFailed
|
||||
|
||||
# Ensure that the "win32" feature is set.
|
||||
.\bin\nvim -u NONE --headless -c 'exe !has(\"win32\").\"cq\"' ; exitIfFailed
|
||||
|
||||
if ($env:USE_LUACOV -eq 1) {
|
||||
& $env:DEPS_PREFIX\luarocks\luarocks.bat install cluacov
|
||||
}
|
||||
|
||||
if (-not $NoTests) {
|
||||
# Functional tests
|
||||
# The $LastExitCode from MSBuild can't be trusted
|
||||
$failed = $false
|
||||
|
||||
# Run only this test file:
|
||||
# $env:TEST_FILE = "test\functional\foo.lua"
|
||||
cmake --build . --config $cmakeBuildType --target functionaltest -- $cmakeGeneratorArgs 2>&1 |
|
||||
foreach { $failed = $failed -or
|
||||
$_ -match 'functional tests failed with error'; $_ }
|
||||
|
||||
if ($uploadToCodecov) {
|
||||
if ($env:USE_LUACOV -eq 1) {
|
||||
& $env:DEPS_PREFIX\bin\luacov.bat
|
||||
}
|
||||
bash -l /c/projects/neovim/ci/common/submit_coverage.sh functionaltest
|
||||
}
|
||||
if ($failed) {
|
||||
exit $LastExitCode
|
||||
}
|
||||
|
||||
# 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\mingw$bits\bin\mingw32-make.exe" -C $(Convert-Path ..\src\nvim\testdir) VERBOSE=1 ; exitIfFailed
|
||||
$env:PATH = $OldPath
|
||||
|
||||
if ($uploadToCodecov) {
|
||||
bash -l /c/projects/neovim/ci/common/submit_coverage.sh oldtest
|
||||
}
|
||||
}
|
||||
|
||||
# Ensure choco's cpack is not in PATH otherwise, it conflicts with CMake's
|
||||
if (Test-Path -Path $env:ChocolateyInstall\bin\cpack.exe) {
|
||||
Remove-Item -Path $env:ChocolateyInstall\bin\cpack.exe -Force
|
||||
}
|
||||
|
||||
# Build artifacts
|
||||
cpack -G ZIP -C RelWithDebInfo
|
||||
if ($env:APPVEYOR_REPO_TAG_NAME -ne $null) {
|
||||
cpack -G NSIS -C RelWithDebInfo
|
||||
}
|
88
ci/common/build.sh
Normal file
88
ci/common/build.sh
Normal file
@ -0,0 +1,88 @@
|
||||
_stat() {
|
||||
if test "${CI_OS_NAME}" = osx ; then
|
||||
stat -f %Sm "${@}"
|
||||
else
|
||||
stat -c %y "${@}"
|
||||
fi
|
||||
}
|
||||
|
||||
top_make() {
|
||||
printf '%78s\n' | tr ' ' '='
|
||||
# Travis has 1.5 virtual cores according to:
|
||||
# http://docs.travis-ci.com/user/speeding-up-the-build/#Paralellizing-your-build-on-one-VM
|
||||
ninja "$@"
|
||||
}
|
||||
|
||||
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 "${CACHE_ENABLE}" = "false" ; then
|
||||
export CCACHE_RECACHE=1
|
||||
elif test -f "${CACHE_MARKER}" ; then
|
||||
echo "Using third-party dependencies from cache (last update: $(_stat "${CACHE_MARKER}"))."
|
||||
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}/third-party/"
|
||||
|
||||
if ! top_make; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd "${CI_BUILD_DIR}"
|
||||
}
|
||||
|
||||
prepare_build() {
|
||||
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}"
|
||||
}
|
||||
|
||||
build_nvim() {
|
||||
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 -ex
|
||||
|
||||
# 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"
|
||||
|
||||
python3 -m pip install --quiet --user gcovr
|
||||
fi
|
||||
|
||||
(
|
||||
cd build
|
||||
python3 -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
|
210
ci/common/suite.sh
Normal file
210
ci/common/suite.sh
Normal file
@ -0,0 +1,210 @@
|
||||
# HACK: get newline for use in strings given that "\n" and $'' do not work.
|
||||
NL="$(printf '\nE')"
|
||||
NL="${NL%E}"
|
||||
|
||||
FAIL_SUMMARY=""
|
||||
|
||||
# Test success marker. If END_MARKER file exists, we know that all tests
|
||||
# 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"
|
||||
|
||||
ANSI_CLEAR="\033[0K"
|
||||
|
||||
if test "$TRAVIS" = "true"; then
|
||||
ci_fold() {
|
||||
local action="$1"
|
||||
local name="$2"
|
||||
name="$(echo -n "$name" | tr '\n\0' '--' | sed 's/[^A-Za-z0-9]\{1,\}/-/g')"
|
||||
name="$(echo -n "$name" | sed 's/-$//')"
|
||||
echo -en "travis_fold:${action}:${name}\r${ANSI_CLEAR}"
|
||||
}
|
||||
elif test "$GITHUB_ACTIONS" = "true"; then
|
||||
ci_fold() {
|
||||
local action="$1"
|
||||
local name="$2"
|
||||
name="$(echo -n "$name" | tr '\n\0' '--' | sed 's/[^A-Za-z0-9]\{1,\}/-/g')"
|
||||
name="$(echo -n "$name" | sed 's/-$//')"
|
||||
case "$action" in
|
||||
start)
|
||||
echo "::group::${name}"
|
||||
;;
|
||||
end)
|
||||
echo "::endgroup::"
|
||||
;;
|
||||
*)
|
||||
:;;
|
||||
esac
|
||||
}
|
||||
else
|
||||
ci_fold() {
|
||||
return 0
|
||||
}
|
||||
fi
|
||||
|
||||
enter_suite() {
|
||||
set +x
|
||||
FAILED=0
|
||||
rm -f "${END_MARKER}"
|
||||
local suite_name="$1"
|
||||
export NVIM_TEST_CURRENT_SUITE="${NVIM_TEST_CURRENT_SUITE}/$suite_name"
|
||||
ci_fold start "${NVIM_TEST_CURRENT_SUITE}"
|
||||
set -x
|
||||
}
|
||||
|
||||
exit_suite() {
|
||||
set +x
|
||||
if test $FAILED -ne 0 ; then
|
||||
echo "Suite ${NVIM_TEST_CURRENT_SUITE} failed, summary:"
|
||||
echo "${FAIL_SUMMARY}"
|
||||
else
|
||||
ci_fold end "${NVIM_TEST_CURRENT_SUITE}"
|
||||
fi
|
||||
export NVIM_TEST_CURRENT_SUITE="${NVIM_TEST_CURRENT_SUITE%/*}"
|
||||
if test "$1" != "--continue" ; then
|
||||
exit $FAILED
|
||||
else
|
||||
local saved_failed=$FAILED
|
||||
FAILED=0
|
||||
return $saved_failed
|
||||
fi
|
||||
}
|
||||
|
||||
fail() {
|
||||
local test_name="$1"
|
||||
local fail_char="$2"
|
||||
local message="$3"
|
||||
|
||||
: ${fail_char:=F}
|
||||
: ${message:=Test $test_name failed}
|
||||
|
||||
local full_msg="$fail_char $NVIM_TEST_CURRENT_SUITE|$test_name :: $message"
|
||||
FAIL_SUMMARY="${FAIL_SUMMARY}${NL}${full_msg}"
|
||||
echo "${full_msg}" >> "${FAIL_SUMMARY_FILE}"
|
||||
echo "Failed: $full_msg"
|
||||
FAILED=1
|
||||
}
|
||||
|
||||
run_test() {
|
||||
local cmd="$1"
|
||||
test $# -gt 0 && shift
|
||||
local test_name="$1"
|
||||
: ${test_name:=$cmd}
|
||||
test $# -gt 0 && shift
|
||||
if ! eval "$cmd" ; then
|
||||
fail "${test_name}" "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
run_test_wd() {
|
||||
local hang_ok=
|
||||
if test "$1" = "--allow-hang" ; then
|
||||
hang_ok=1
|
||||
shift
|
||||
fi
|
||||
|
||||
local timeout="$1"
|
||||
test $# -gt 0 && shift
|
||||
|
||||
local cmd="$1"
|
||||
test $# -gt 0 && shift
|
||||
|
||||
local restart_cmd="$1"
|
||||
: ${restart_cmd:=true}
|
||||
test $# -gt 0 && shift
|
||||
|
||||
local test_name="$1"
|
||||
: ${test_name:=$cmd}
|
||||
test $# -gt 0 && shift
|
||||
|
||||
local output_file="$(mktemp)"
|
||||
local status_file="$(mktemp)"
|
||||
local sid_file="$(mktemp)"
|
||||
|
||||
local restarts=5
|
||||
local prev_tmpsize=-1
|
||||
while test $restarts -gt 0 ; do
|
||||
: > "$status_file"
|
||||
: > "$sid_file"
|
||||
setsid \
|
||||
env \
|
||||
output_file="$output_file" \
|
||||
status_file="$status_file" \
|
||||
sid_file="$sid_file" \
|
||||
cmd="$cmd" \
|
||||
CI_DIR="$CI_DIR" \
|
||||
sh -c '
|
||||
. "${CI_DIR}/common/test.sh"
|
||||
ps -o sid= > "$sid_file"
|
||||
(
|
||||
ret=0
|
||||
if ! eval "$cmd" 2>&1 ; then
|
||||
ret=1
|
||||
fi
|
||||
echo "$ret" > "$status_file"
|
||||
) | tee -a "$output_file"
|
||||
'
|
||||
while test "$(stat -c "%s" "$status_file")" -eq 0 ; do
|
||||
prev_tmpsize=$tmpsize
|
||||
sleep $timeout
|
||||
tmpsize="$(stat -c "%s" "$output_file")"
|
||||
if test $tempsize -eq $prev_temsize ; then
|
||||
# no output, assuming either hang or exit
|
||||
break
|
||||
fi
|
||||
done
|
||||
restarts=$(( restarts - 1 ))
|
||||
if test "$(stat -c "%s" "$status_file")" -eq 0 ; then
|
||||
# Status file not updated, assuming hang
|
||||
|
||||
# SID not known, this should not ever happen
|
||||
if test "$(stat -c "%s" "$sid_file")" -eq 0 ; then
|
||||
fail "$test_name" E "Shell did not run"
|
||||
break
|
||||
fi
|
||||
|
||||
# Kill all processes which belong to one session: should get rid of test
|
||||
# processes as well as sh itself.
|
||||
pkill -KILL -s$(cat "$sid_file")
|
||||
|
||||
if test $restarts -eq 0 ; then
|
||||
if test -z "$hang_ok" ; then
|
||||
fail "$test_name" E "Test hang up"
|
||||
fi
|
||||
else
|
||||
echo "Test ${test_name} hang up, restarting"
|
||||
eval "$restart_cmd"
|
||||
fi
|
||||
else
|
||||
local new_failed="$(cat "$status_file")"
|
||||
if test "$new_failed" != "0" ; then
|
||||
fail "$test_name" F "Test failed in run_test_wd"
|
||||
fi
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
rm -f "$output_file"
|
||||
rm -f "$status_file"
|
||||
rm -f "$sid_file"
|
||||
}
|
||||
|
||||
ended_successfully() {
|
||||
if test -f "${FAIL_SUMMARY_FILE}" ; then
|
||||
echo 'Test failed, complete summary:'
|
||||
cat "${FAIL_SUMMARY_FILE}"
|
||||
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
|
||||
}
|
189
ci/common/test.sh
Normal file
189
ci/common/test.sh
Normal file
@ -0,0 +1,189 @@
|
||||
. "${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' E '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' E '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
|
||||
}
|
||||
|
||||
run_unittests() {(
|
||||
enter_suite unittests
|
||||
ulimit -c unlimited || true
|
||||
if ! build_make unittest ; then
|
||||
fail 'unittests' F 'Unit tests failed'
|
||||
fi
|
||||
submit_coverage unittest
|
||||
check_core_dumps "$(command -v luajit)"
|
||||
exit_suite
|
||||
)}
|
||||
|
||||
run_functionaltests() {(
|
||||
enter_suite functionaltests
|
||||
ulimit -c unlimited || true
|
||||
if ! build_make ${FUNCTIONALTEST}; then
|
||||
fail 'functionaltests' F 'Functional tests failed'
|
||||
fi
|
||||
submit_coverage functionaltest
|
||||
check_sanitizer "${LOG_DIR}"
|
||||
valgrind_check "${LOG_DIR}"
|
||||
check_core_dumps
|
||||
exit_suite
|
||||
)}
|
||||
|
||||
run_oldtests() {(
|
||||
enter_suite oldtests
|
||||
ulimit -c unlimited || true
|
||||
if ! make oldtest; then
|
||||
reset
|
||||
fail 'oldtests' F 'Legacy tests failed'
|
||||
fi
|
||||
submit_coverage oldtest
|
||||
check_sanitizer "${LOG_DIR}"
|
||||
valgrind_check "${LOG_DIR}"
|
||||
check_core_dumps
|
||||
exit_suite
|
||||
)}
|
||||
|
||||
check_runtime_files() {(
|
||||
set +x
|
||||
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" E \
|
||||
"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" F "$(printf "$message" "$file")"
|
||||
fi
|
||||
done
|
||||
)}
|
||||
|
||||
install_nvim() {(
|
||||
enter_suite 'install_nvim'
|
||||
if ! build_make install ; then
|
||||
fail 'install' E 'make install failed'
|
||||
exit_suite
|
||||
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' F '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' F "It appears that $genvimsynf does not contain $gpat."
|
||||
fi
|
||||
|
||||
exit_suite
|
||||
)}
|
||||
|
||||
csi_clean() {
|
||||
find "${BUILD_DIR}/bin" -name 'test-includes-*' -delete
|
||||
find "${BUILD_DIR}" -name '*test-include*.o' -delete
|
||||
}
|
33
ci/install.sh
Executable file
33
ci/install.sh
Executable file
@ -0,0 +1,33 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
if [[ "${CI_TARGET}" == lint ]]; then
|
||||
python3 -m pip -q install --user --upgrade flake8
|
||||
exit
|
||||
fi
|
||||
|
||||
if [[ "${TRAVIS_OS_NAME}" == osx ]]; then
|
||||
export PATH="/usr/local/opt/ccache/libexec:$PATH"
|
||||
fi
|
||||
|
||||
# Use default CC to avoid compilation problems when installing Python modules.
|
||||
echo "Install neovim module for Python 3."
|
||||
CC=cc python3 -m pip -q install --user --upgrade pynvim
|
||||
if python2 -m pip -c True 2>&1; then
|
||||
echo "Install neovim module for Python 2."
|
||||
CC=cc python2 -m pip -q install --user --upgrade pynvim
|
||||
fi
|
||||
|
||||
echo "Install neovim RubyGem."
|
||||
gem install --no-document --bindir "$HOME/.local/bin" --user-install --pre neovim
|
||||
|
||||
echo "Install neovim npm package"
|
||||
source ~/.nvm/nvm.sh
|
||||
nvm use 10
|
||||
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'
|
36
ci/run_lint.sh
Executable file
36
ci/run_lint.sh
Executable file
@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
CI_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
|
||||
source "${CI_DIR}/common/build.sh"
|
||||
source "${CI_DIR}/common/suite.sh"
|
||||
|
||||
enter_suite 'clint'
|
||||
run_test 'make clint-full' clint
|
||||
exit_suite --continue
|
||||
|
||||
enter_suite 'lualint'
|
||||
run_test 'make lualint' lualint
|
||||
exit_suite --continue
|
||||
|
||||
enter_suite 'pylint'
|
||||
run_test 'make pylint' pylint
|
||||
exit_suite --continue
|
||||
|
||||
enter_suite 'shlint'
|
||||
run_test 'make shlint' shlint
|
||||
exit_suite --continue
|
||||
|
||||
enter_suite single-includes
|
||||
CLICOLOR_FORCE=1 run_test_wd \
|
||||
--allow-hang \
|
||||
10s \
|
||||
'make check-single-includes' \
|
||||
'csi_clean' \
|
||||
single-includes
|
||||
exit_suite --continue
|
||||
|
||||
end_tests
|
40
ci/run_tests.sh
Executable file
40
ci/run_tests.sh
Executable file
@ -0,0 +1,40 @@
|
||||
#!/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"
|
||||
|
||||
enter_suite build
|
||||
|
||||
check_core_dumps --delete quiet
|
||||
|
||||
prepare_build
|
||||
build_nvim
|
||||
|
||||
exit_suite --continue
|
||||
|
||||
source ~/.nvm/nvm.sh
|
||||
nvm use 10
|
||||
|
||||
|
||||
enter_suite tests
|
||||
|
||||
if test "$CLANG_SANITIZER" != "TSAN" ; then
|
||||
# Additional threads are only created when the builtin UI starts, which
|
||||
# doesn't happen in the unit/functional tests
|
||||
if test "${FUNCTIONALTEST}" != "functionaltest-lua"; then
|
||||
run_test run_unittests
|
||||
fi
|
||||
run_test run_functionaltests
|
||||
fi
|
||||
run_test run_oldtests
|
||||
|
||||
run_test install_nvim
|
||||
|
||||
exit_suite --continue
|
||||
|
||||
end_tests
|
19
ci/script.sh
Executable file
19
ci/script.sh
Executable file
@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
# This will pass the environment variables down to a bash process which runs
|
||||
# as $USER, while retaining the environment variables defined and belonging
|
||||
# to secondary groups given above in usermod.
|
||||
if [[ "${TRAVIS_OS_NAME}" == osx ]]; then
|
||||
sudo -E su "${USER}" -c "ci/run_${CI_TARGET}.sh"
|
||||
else
|
||||
ci/run_${CI_TARGET}.sh
|
||||
fi
|
||||
|
||||
if [[ -s "${GCOV_ERROR_FILE}" ]]; then
|
||||
echo '=== Unexpected gcov errors: ==='
|
||||
cat "${GCOV_ERROR_FILE}"
|
||||
exit 1
|
||||
fi
|
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_realease_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_realease_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.
@ -1,226 +0,0 @@
|
||||
# This was initially taken from the IWYU repository:
|
||||
# github.com/include-what-you-use/include-what-you-use/blob/164b8fe7597805ae55f029ecf6580dc46a74c7ed/gcc.libc.imp
|
||||
# It has useful mappings that are normally enabled by default, but there are
|
||||
# other default mappings that conflict with our builds. The best solution seems
|
||||
# to be to disable all defaults, import the defaults from the IWYU
|
||||
# repo and modify the rules that conflict with our build.
|
||||
#
|
||||
# TODO(dundargoc): Check if there is a way to disable specific builtin maps as
|
||||
# to avoid this file entirely.
|
||||
|
||||
# Mappings for GNU libc
|
||||
# ( cd /usr/include && grep '^ *# *include' {sys/,net/,}* | perl -nle 'm/^([^:]+).*<([^>]+)>/ && print qq@ { include: [ "<$2>", private, "<$1>", public ] },@' | grep bits/ | sort )
|
||||
# When I saw more than one mapping for these, I typically picked
|
||||
# what I thought was the "best" one.
|
||||
[
|
||||
{ include: [ "<bits/a.out.h>", private, "<a.out.h>", public ] },
|
||||
{ include: [ "<bits/auxv.h>", private, "<sys/auxv.h>", public ] },
|
||||
{ include: [ "<bits/byteswap.h>", private, "<byteswap.h>", public ] },
|
||||
{ include: [ "<bits/cmathcalls.h>", private, "<complex.h>", public ] },
|
||||
{ include: [ "<bits/confname.h>", private, "<unistd.h>", private ] },
|
||||
{ include: [ "<bits/dirent.h>", private, "<dirent.h>", public ] },
|
||||
{ include: [ "<bits/dlfcn.h>", private, "<dlfcn.h>", public ] },
|
||||
{ include: [ "<bits/elfclass.h>", private, "<link.h>", public ] },
|
||||
{ include: [ "<bits/endian.h>", private, "<endian.h>", public ] },
|
||||
{ include: [ "<bits/environments.h>", private, "<unistd.h>", private ] },
|
||||
{ include: [ "<bits/epoll.h>", private, "<sys/epoll.h>", public ] },
|
||||
{ include: [ "<bits/errno.h>", private, "<errno.h>", public ] },
|
||||
{ include: [ "<bits/error.h>", private, "<error.h>", public ] },
|
||||
{ include: [ "<bits/eventfd.h>", private, "<sys/eventfd.h>", public ] },
|
||||
{ include: [ "<bits/fcntl.h>", private, "<fcntl.h>", public ] },
|
||||
{ include: [ "<bits/fcntl2.h>", private, "<fcntl.h>", public ] },
|
||||
{ include: [ "<bits/fenv.h>", private, "<fenv.h>", public ] },
|
||||
{ include: [ "<bits/fenvinline.h>", private, "<fenv.h>", public ] },
|
||||
{ include: [ "<bits/huge_val.h>", private, "<math.h>", public ] },
|
||||
{ include: [ "<bits/huge_valf.h>", private, "<math.h>", public ] },
|
||||
{ include: [ "<bits/huge_vall.h>", private, "<math.h>", public ] },
|
||||
{ include: [ "<bits/hwcap.h>", private, "<sys/auxv.h>", public ] },
|
||||
{ include: [ "<bits/inf.h>", private, "<math.h>", public ] },
|
||||
{ include: [ "<bits/inotify.h>", private, "<sys/inotify.h>", public ] },
|
||||
{ include: [ "<bits/ioctl-types.h>", private, "<sys/ioctl.h>", public ] },
|
||||
{ include: [ "<bits/ioctls.h>", private, "<sys/ioctl.h>", public ] },
|
||||
{ include: [ "<bits/ipc.h>", private, "<sys/ipc.h>", public ] },
|
||||
{ include: [ "<bits/ipctypes.h>", private, "<sys/ipc.h>", public ] },
|
||||
{ include: [ "<bits/libio-ldbl.h>", private, "<libio.h>", public ] },
|
||||
{ include: [ "<bits/link.h>", private, "<link.h>", public ] },
|
||||
{ include: [ "<bits/locale.h>", private, "<locale.h>", public ] },
|
||||
{ include: [ "<bits/math-finite.h>", private, "<math.h>", public ] },
|
||||
{ include: [ "<bits/mathcalls.h>", private, "<math.h>", public ] },
|
||||
{ include: [ "<bits/mathdef.h>", private, "<math.h>", public ] },
|
||||
{ include: [ "<bits/mathinline.h>", private, "<math.h>", public ] },
|
||||
{ include: [ "<bits/mman.h>", private, "<sys/mman.h>", public ] },
|
||||
{ include: [ "<bits/mman-shared.h>", private, "<sys/mman.h>", public ] },
|
||||
{ include: [ "<bits/monetary-ldbl.h>", private, "<monetary.h>", public ] },
|
||||
{ include: [ "<bits/mqueue.h>", private, "<mqueue.h>", public ] },
|
||||
{ include: [ "<bits/mqueue2.h>", private, "<mqueue.h>", public ] },
|
||||
{ include: [ "<bits/msq.h>", private, "<sys/msg.h>", public ] },
|
||||
{ include: [ "<bits/nan.h>", private, "<math.h>", public ] },
|
||||
{ include: [ "<bits/netdb.h>", private, "<netdb.h>", private ] },
|
||||
{ include: [ "<bits/param.h>", private, "<sys/param.h>", public ] },
|
||||
{ include: [ "<bits/poll.h>", private, "<sys/poll.h>", private ] },
|
||||
{ include: [ "<bits/poll2.h>", private, "<sys/poll.h>", private ] },
|
||||
{ include: [ "<bits/posix1_lim.h>", private, "<limits.h>", public ] },
|
||||
{ include: [ "<bits/posix2_lim.h>", private, "<limits.h>", public ] },
|
||||
{ include: [ "<bits/posix_opt.h>", private, "<unistd.h>", private ] },
|
||||
{ include: [ "<bits/printf-ldbl.h>", private, "<printf.h>", public ] },
|
||||
{ include: [ "<bits/pthreadtypes.h>", private, "<pthread.h>", private ] },
|
||||
{ include: [ "<bits/resource.h>", private, "<sys/resource.h>", public ] },
|
||||
{ include: [ "<bits/sched.h>", private, "<sched.h>", public ] },
|
||||
{ include: [ "<bits/select.h>", private, "<sys/select.h>", public ] },
|
||||
{ include: [ "<bits/select2.h>", private, "<sys/select.h>", public ] },
|
||||
{ include: [ "<bits/sem.h>", private, "<sys/sem.h>", public ] },
|
||||
{ include: [ "<bits/semaphore.h>", private, "<semaphore.h>", public ] },
|
||||
{ include: [ "<bits/setjmp.h>", private, "<setjmp.h>", public ] },
|
||||
{ include: [ "<bits/setjmp2.h>", private, "<setjmp.h>", public ] },
|
||||
{ include: [ "<bits/shm.h>", private, "<sys/shm.h>", public ] },
|
||||
{ include: [ "<bits/sigaction.h>", private, "<signal.h>", public ] },
|
||||
{ include: [ "<bits/sigcontext.h>", private, "<signal.h>", public ] },
|
||||
{ include: [ "<bits/siginfo.h>", private, "<signal.h>", public ] },
|
||||
{ include: [ "<bits/signum.h>", private, "<signal.h>", public ] },
|
||||
{ include: [ "<bits/sigset.h>", private, "<signal.h>", public ] },
|
||||
{ include: [ "<bits/sigstack.h>", private, "<signal.h>", public ] },
|
||||
{ include: [ "<bits/sigthread.h>", private, "<signal.h>", public ] },
|
||||
{ include: [ "<bits/sockaddr.h>", private, "<sys/un.h>", public ] },
|
||||
{ include: [ "<bits/socket.h>", private, "<sys/socket.h>", private ] },
|
||||
{ include: [ "<bits/socket2.h>", private, "<sys/socket.h>", private ] },
|
||||
{ include: [ "<bits/socket_type.h>", private, "<sys/socket.h>", private ] },
|
||||
{ include: [ "<bits/stab.def>", private, "<stab.h>", public ] },
|
||||
{ include: [ "<bits/stat.h>", private, "<sys/stat.h>", public ] },
|
||||
{ include: [ "<bits/statfs.h>", private, "<sys/statfs.h>", public ] },
|
||||
{ include: [ "<bits/statvfs.h>", private, "<sys/statvfs.h>", public ] },
|
||||
{ include: [ "<bits/stdio-ldbl.h>", private, "<stdio.h>", public ] },
|
||||
{ include: [ "<bits/stdio-lock.h>", private, "<libio.h>", public ] },
|
||||
{ include: [ "<bits/stdio.h>", private, "<stdio.h>", public ] },
|
||||
{ include: [ "<bits/stdio2.h>", private, "<stdio.h>", public ] },
|
||||
{ include: [ "<bits/stdio_lim.h>", private, "<stdio.h>", public ] },
|
||||
{ include: [ "<bits/stdlib-bsearch.h>", private, "<stdlib.h>", public ] },
|
||||
{ include: [ "<bits/stdlib-float.h>", private, "<stdlib.h>", public ] },
|
||||
{ include: [ "<bits/stdlib-ldbl.h>", private, "<stdlib.h>", public ] },
|
||||
{ include: [ "<bits/stdlib.h>", private, "<stdlib.h>", public ] },
|
||||
{ include: [ "<bits/string.h>", private, "<string.h>", public ] },
|
||||
{ include: [ "<bits/string2.h>", private, "<string.h>", public ] },
|
||||
{ include: [ "<bits/string3.h>", private, "<string.h>", public ] },
|
||||
{ include: [ "<bits/stropts.h>", private, "<stropts.h>", public ] },
|
||||
{ include: [ "<bits/struct_stat.h>", private, "<sys/stat.h>", public ] },
|
||||
{ include: [ "<bits/struct_stat.h>", private, "<ftw.h>", public ] },
|
||||
{ include: [ "<bits/sys_errlist.h>", private, "<stdio.h>", public ] },
|
||||
{ include: [ "<bits/syscall.h>", private, "<sys/syscall.h>", public ] },
|
||||
{ include: [ "<bits/sysctl.h>", private, "<sys/sysctl.h>", public ] },
|
||||
{ include: [ "<bits/syslog-ldbl.h>", private, "<sys/syslog.h>", private ] },
|
||||
{ include: [ "<bits/syslog-path.h>", private, "<sys/syslog.h>", private ] },
|
||||
{ include: [ "<bits/syslog.h>", private, "<sys/syslog.h>", private ] },
|
||||
{ include: [ "<bits/termios.h>", private, "<termios.h>", private ] },
|
||||
{ include: [ "<bits/termios-c_lflag.h>", private, "<termios.h>", private ] },
|
||||
{ include: [ "<bits/termios-struct.h>", private, "<termios.h>", private ] },
|
||||
{ include: [ "<bits/termios-tcflow.h>", private, "<termios.h>", private ] },
|
||||
{ include: [ "<bits/time.h>", private, "<time.h>", public ] },
|
||||
{ include: [ "<bits/time.h>", private, "<sys/time.h>", public ] },
|
||||
{ include: [ "<bits/timerfd.h>", private, "<sys/timerfd.h>", public ] },
|
||||
{ include: [ "<bits/timex.h>", private, "<sys/timex.h>", public ] },
|
||||
{ include: [ "<bits/types.h>", private, "<sys/types.h>", public ] },
|
||||
{ include: [ "<bits/types/siginfo_t.h>", private, "<signal.h>", public ] },
|
||||
{ include: [ "<bits/types/siginfo_t.h>", private, "<sys/wait.h>", public ] },
|
||||
{ include: [ "<bits/uio.h>", private, "<sys/uio.h>", public ] },
|
||||
{ include: [ "<bits/unistd.h>", private, "<unistd.h>", private ] },
|
||||
{ include: [ "<bits/ustat.h>", private, "<sys/ustat.h>", private ] },
|
||||
{ include: [ "<bits/utmp.h>", private, "<utmp.h>", public ] },
|
||||
{ include: [ "<bits/utmpx.h>", private, "<utmpx.h>", public ] },
|
||||
{ include: [ "<bits/utsname.h>", private, "<sys/utsname.h>", public ] },
|
||||
{ include: [ "<bits/waitflags.h>", private, "<sys/wait.h>", public ] },
|
||||
{ include: [ "<bits/waitstatus.h>", private, "<sys/wait.h>", public ] },
|
||||
{ include: [ "<bits/wchar-ldbl.h>", private, "<wchar.h>", public ] },
|
||||
{ include: [ "<bits/wchar.h>", private, "<wchar.h>", public ] },
|
||||
{ include: [ "<bits/wchar2.h>", private, "<wchar.h>", public ] },
|
||||
{ include: [ "<bits/wordsize.h>", private, "<limits.h>", public ] },
|
||||
{ include: [ "<bits/xopen_lim.h>", private, "<limits.h>", public ] },
|
||||
{ include: [ "<bits/xtitypes.h>", private, "<stropts.h>", public ] },
|
||||
# Sometimes libc tells you what mapping to do via an '#error':
|
||||
# # error "Never use <bits/dlfcn.h> directly; include <dlfcn.h> instead."
|
||||
# or
|
||||
# # error "Never include <bits/socket_type.h> directly; use <sys/socket.h> instead."
|
||||
# ( cd /usr/include && grep -R '^ *# *error "Never use\|include' * | perl -nle 'm/<([^>]+).*directly.*<([^>]+)/ && print qq@ { include: [ "<$1>", private, "<$2>", public ] },@' | sort )
|
||||
{ include: [ "<bits/a.out.h>", private, "<a.out.h>", public ] },
|
||||
{ include: [ "<bits/byteswap-16.h>", private, "<byteswap.h>", public ] },
|
||||
{ include: [ "<bits/byteswap.h>", private, "<byteswap.h>", public ] },
|
||||
{ include: [ "<bits/cmathcalls.h>", private, "<complex.h>", public ] },
|
||||
{ include: [ "<bits/confname.h>", private, "<unistd.h>", private ] },
|
||||
{ include: [ "<bits/dirent.h>", private, "<dirent.h>", public ] },
|
||||
{ include: [ "<bits/dlfcn.h>", private, "<dlfcn.h>", public ] },
|
||||
{ include: [ "<bits/elfclass.h>", private, "<link.h>", public ] },
|
||||
{ include: [ "<bits/endian.h>", private, "<endian.h>", public ] },
|
||||
{ include: [ "<bits/epoll.h>", private, "<sys/epoll.h>", public ] },
|
||||
{ include: [ "<bits/eventfd.h>", private, "<sys/eventfd.h>", public ] },
|
||||
{ include: [ "<bits/fcntl-linux.h>", private, "<fcntl.h>", public ] },
|
||||
{ include: [ "<bits/fcntl.h>", private, "<fcntl.h>", public ] },
|
||||
{ include: [ "<bits/fenv.h>", private, "<fenv.h>", public ] },
|
||||
{ include: [ "<bits/huge_val.h>", private, "<math.h>", public ] },
|
||||
{ include: [ "<bits/huge_valf.h>", private, "<math.h>", public ] },
|
||||
{ include: [ "<bits/huge_vall.h>", private, "<math.h>", public ] },
|
||||
{ include: [ "<bits/in.h>", private, "<netinet/in.h>", private ] },
|
||||
{ include: [ "<bits/inf.h>", private, "<math.h>", public ] },
|
||||
{ include: [ "<bits/inotify.h>", private, "<sys/inotify.h>", public ] },
|
||||
{ include: [ "<bits/ioctl-types.h>", private, "<sys/ioctl.h>", public ] },
|
||||
{ include: [ "<bits/ioctls.h>", private, "<sys/ioctl.h>", public ] },
|
||||
{ include: [ "<bits/ipc.h>", private, "<sys/ipc.h>", public ] },
|
||||
{ include: [ "<bits/ipctypes.h>", private, "<sys/ipc.h>", public ] },
|
||||
{ include: [ "<bits/locale.h>", private, "<locale.h>", public ] },
|
||||
{ include: [ "<bits/math-finite.h>", private, "<math.h>", public ] },
|
||||
{ include: [ "<bits/mathdef.h>", private, "<math.h>", public ] },
|
||||
{ include: [ "<bits/mathinline.h>", private, "<math.h>", public ] },
|
||||
{ include: [ "<bits/mman-linux.h>", private, "<sys/mman.h>", public ] },
|
||||
{ include: [ "<bits/mman.h>", private, "<sys/mman.h>", public ] },
|
||||
{ include: [ "<bits/mqueue.h>", private, "<mqueue.h>", public ] },
|
||||
{ include: [ "<bits/msq.h>", private, "<sys/msg.h>", public ] },
|
||||
{ include: [ "<bits/nan.h>", private, "<math.h>", public ] },
|
||||
{ include: [ "<bits/param.h>", private, "<sys/param.h>", public ] },
|
||||
{ include: [ "<bits/poll.h>", private, "<sys/poll.h>", private ] },
|
||||
{ include: [ "<bits/predefs.h>", private, "<features.h>", public ] },
|
||||
{ include: [ "<bits/resource.h>", private, "<sys/resource.h>", public ] },
|
||||
{ include: [ "<bits/select.h>", private, "<sys/select.h>", public ] },
|
||||
{ include: [ "<bits/semaphore.h>", private, "<semaphore.h>", public ] },
|
||||
{ include: [ "<bits/sigcontext.h>", private, "<signal.h>", public ] },
|
||||
{ include: [ "<bits/signalfd.h>", private, "<sys/signalfd.h>", public ] },
|
||||
{ include: [ "<bits/stdlib-float.h>", private, "<stdlib.h>", public ] },
|
||||
{ include: [ "<bits/string.h>", private, "<string.h>", public ] },
|
||||
{ include: [ "<bits/string2.h>", private, "<string.h>", public ] },
|
||||
{ include: [ "<bits/string3.h>", private, "<string.h>", public ] },
|
||||
{ include: [ "<bits/timerfd.h>", private, "<sys/timerfd.h>", public ] },
|
||||
{ include: [ "<bits/typesizes.h>", private, "<sys/types.h>", public ] },
|
||||
# Top-level #includes that just forward to another file:
|
||||
# $ for i in /usr/include/*; do [ -f $i ] } && [ `wc -l < $i` = 1 ] } && echo $i; done
|
||||
# (poll.h, syscall.h, syslog.h, ustat.h, wait.h).
|
||||
# For each file, I looked at the list of canonical header files --
|
||||
# http://www.opengroup.org/onlinepubs/9699919799/idx/head.html --
|
||||
# to decide which of the two files is canonical. If neither is
|
||||
# on the POSIX.1 1998 list, I just choose the top-level one.
|
||||
{ include: [ "<sys/poll.h>", private, "<poll.h>", public ] },
|
||||
{ include: [ "<sys/syslog.h>", private, "<syslog.h>", public ] },
|
||||
{ include: [ "<sys/ustat.h>", private, "<ustat.h>", public ] },
|
||||
{ include: [ "<wait.h>", private, "<sys/wait.h>", public ] },
|
||||
# These are all files in bits/ that delegate to asm/ and linux/ to
|
||||
# do all (or lots) of the work. Note these are private->private.
|
||||
# $ for i in /usr/include/bits/*; do for dir in asm linux; do grep -H -e $dir/`basename $i` $i; done; done
|
||||
{ include: [ "<linux/errno.h>", private, "<bits/errno.h>", private ] },
|
||||
{ include: [ "<asm/ioctls.h>", private, "<bits/ioctls.h>", private ] },
|
||||
{ include: [ "<asm/socket.h>", private, "<bits/socket.h>", private ] },
|
||||
{ include: [ "<linux/socket.h>", private, "<bits/socket.h>", private ] },
|
||||
# Some asm files have 32- and 64-bit variants:
|
||||
# $ ls /usr/include/asm/*_{32,64}.h
|
||||
{ include: [ "<asm/posix_types_32.h>", private, "<asm/posix_types.h>", public ] },
|
||||
{ include: [ "<asm/posix_types_64.h>", private, "<asm/posix_types.h>", public ] },
|
||||
{ include: [ "<asm/unistd_32.h>", private, "<asm/unistd.h>", private ] },
|
||||
{ include: [ "<asm/unistd_64.h>", private, "<asm/unistd.h>", private ] },
|
||||
# I don't know what grep would have found these. I found them
|
||||
# via user report.
|
||||
{ include: [ "<asm/errno.h>", private, "<errno.h>", public ] },
|
||||
{ include: [ "<asm/errno-base.h>", private, "<errno.h>", public ] },
|
||||
{ include: [ "<asm/ptrace-abi.h>", private, "<asm/ptrace.h>", public ] },
|
||||
{ include: [ "<asm/unistd.h>", private, "<sys/syscall.h>", public ] },
|
||||
{ include: [ "<linux/limits.h>", private, "<limits.h>", public ] }, # PATH_MAX
|
||||
{ include: [ "<linux/prctl.h>", private, "<sys/prctl.h>", public ] },
|
||||
{ include: [ "<sys/ucontext.h>", private, "<ucontext.h>", public ] },
|
||||
# Exports guaranteed by the C standard
|
||||
{ include: [ "<stdint.h>", public, "<inttypes.h>", public ] },
|
||||
]
|
||||
|
||||
# vim: set ft=toml:
|
@ -1,305 +0,0 @@
|
||||
# This was initially taken from the IWYU repository:
|
||||
# github.com/include-what-you-use/include-what-you-use/blob/164b8fe7597805ae55f029ecf6580dc46a74c7ed/gcc.symbols.imp
|
||||
# It has useful mappings that are normally enabled by default, but there are
|
||||
# other default mappings that conflict with our builds. The best solution seems
|
||||
# to be to disable all defaults, import the defaults from the IWYU repo and
|
||||
# modify the rules that conflict with our build.
|
||||
#
|
||||
# TODO(dundargoc): Check if there is a way to disable specific builtin maps as
|
||||
# to avoid this file entirely.
|
||||
|
||||
# For library symbols that can be defined in more than one header
|
||||
# file, maps from symbol-name to legitimate header files.
|
||||
# This list was generated via
|
||||
# grep -R '__.*_defined' /usr/include | perl -nle 'm,/usr/include/([^:]*):#\s*\S+ __(.*)_defined, and print qq@ { symbol: [ "$2", public, "<$1>", public ] },@' | sort -u
|
||||
# I ignored all entries that only appeared once on the list (eg uint32_t).
|
||||
# I then added in NULL, which according to [diff.null] C.2.2.3, can
|
||||
# be defined in <clocale>, <cstddef>, <cstdio>, <cstdlib>,
|
||||
# <cstring>, <ctime>, or <cwchar>. We also allow their C
|
||||
# equivalents.
|
||||
# In each case, I ordered them so <sys/types.h> was first, if it was
|
||||
# an option for this type. That's the preferred #include all else
|
||||
# equal. The same goes for <stdint.h>. The visibility on the
|
||||
# symbol-name is ignored; by convention we always set it to private.
|
||||
[
|
||||
{ symbol: [ "aiocb", private, "<aio.h>", public ] },
|
||||
{ symbol: [ "blkcnt_t", private, "<sys/types.h>", public ] },
|
||||
{ symbol: [ "blkcnt_t", private, "<sys/stat.h>", public ] },
|
||||
{ symbol: [ "blksize_t", private, "<sys/types.h>", public ] },
|
||||
{ symbol: [ "blksize_t", private, "<sys/stat.h>", public ] },
|
||||
{ symbol: [ "cc_t", private, "<termios.h>", private ] },
|
||||
{ symbol: [ "clock_t", private, "<sys/types.h>", public ] },
|
||||
{ symbol: [ "clock_t", private, "<sys/time.h>", public ] },
|
||||
{ symbol: [ "clock_t", private, "<time.h>", public ] },
|
||||
{ symbol: [ "clockid_t", private, "<sys/types.h>", public ] },
|
||||
{ symbol: [ "clockid_t", private, "<time.h>", public ] },
|
||||
{ symbol: [ "daddr_t", private, "<sys/types.h>", public ] },
|
||||
{ symbol: [ "daddr_t", private, "<rpc/types.h>", public ] },
|
||||
{ symbol: [ "dev_t", private, "<sys/types.h>", public ] },
|
||||
{ symbol: [ "dev_t", private, "<sys/stat.h>", public ] },
|
||||
{ symbol: [ "div_t", private, "<stdlib.h>", public ] },
|
||||
{ symbol: [ "double_t", private, "<math.h>", public ] },
|
||||
{ symbol: [ "error_t", private, "<errno.h>", public ] },
|
||||
{ symbol: [ "error_t", private, "<argp.h>", public ] },
|
||||
{ symbol: [ "error_t", private, "<argz.h>", public ] },
|
||||
{ symbol: [ "fd_set", private, "<sys/select.h>", public ] },
|
||||
{ symbol: [ "fd_set", private, "<sys/time.h>", public ] },
|
||||
{ symbol: [ "fenv_t", private, "<fenv.h>", public ] },
|
||||
{ symbol: [ "fexcept_t", private, "<fenv.h>", public ] },
|
||||
{ symbol: [ "FILE", private, "<stdio.h>", public ] },
|
||||
{ symbol: [ "FILE", private, "<wchar.h>", public ] },
|
||||
{ symbol: [ "float_t", private, "<math.h>", public ] },
|
||||
{ symbol: [ "fsblkcnt_t", private, "<sys/types.h>", public ] },
|
||||
{ symbol: [ "fsblkcnt_t", private, "<sys/statvfs.h>", public ] },
|
||||
{ symbol: [ "fsfilcnt_t", private, "<sys/types.h>", public ] },
|
||||
{ symbol: [ "fsfilcnt_t", private, "<sys/statvfs.h>", public ] },
|
||||
{ symbol: [ "getopt", private, "<unistd.h>", private ] },
|
||||
{ symbol: [ "gid_t", private, "<sys/types.h>", public ] },
|
||||
{ symbol: [ "gid_t", private, "<grp.h>", public ] },
|
||||
{ symbol: [ "gid_t", private, "<pwd.h>", public ] },
|
||||
{ symbol: [ "gid_t", private, "<signal.h>", public ] },
|
||||
{ symbol: [ "gid_t", private, "<stropts.h>", public ] },
|
||||
{ symbol: [ "gid_t", private, "<sys/ipc.h>", public ] },
|
||||
{ symbol: [ "gid_t", private, "<sys/stat.h>", public ] },
|
||||
{ symbol: [ "gid_t", private, "<unistd.h>", private ] },
|
||||
{ symbol: [ "htonl", private, "<arpa/inet.h>", private ] },
|
||||
{ symbol: [ "htons", private, "<arpa/inet.h>", private ] },
|
||||
{ symbol: [ "id_t", private, "<sys/types.h>", public ] },
|
||||
{ symbol: [ "id_t", private, "<sys/resource.h>", public ] },
|
||||
{ symbol: [ "imaxdiv_t", private, "<inttypes.h>", public ] },
|
||||
{ symbol: [ "intmax_t", private, "<stdint.h>", public ] },
|
||||
{ symbol: [ "uintmax_t", private, "<stdint.h>", public ] },
|
||||
{ symbol: [ "ino64_t", private, "<sys/types.h>", public ] },
|
||||
{ symbol: [ "ino64_t", private, "<dirent.h>", public ] },
|
||||
{ symbol: [ "ino_t", private, "<sys/types.h>", public ] },
|
||||
{ symbol: [ "ino_t", private, "<dirent.h>", public ] },
|
||||
{ symbol: [ "ino_t", private, "<sys/stat.h>", public ] },
|
||||
{ symbol: [ "int8_t", private, "<stdint.h>", public ] },
|
||||
{ symbol: [ "int16_t", private, "<stdint.h>", public ] },
|
||||
{ symbol: [ "int32_t", private, "<stdint.h>", public ] },
|
||||
{ symbol: [ "int64_t", private, "<stdint.h>", public ] },
|
||||
{ symbol: [ "uint8_t", private, "<stdint.h>", public ] },
|
||||
{ symbol: [ "uint16_t", private, "<stdint.h>", public ] },
|
||||
{ symbol: [ "uint32_t", private, "<stdint.h>", public ] },
|
||||
{ symbol: [ "uint64_t", private, "<stdint.h>", public ] },
|
||||
{ symbol: [ "intptr_t", private, "<stdint.h>", public ] },
|
||||
{ symbol: [ "uintptr_t", private, "<stdint.h>", public ] },
|
||||
{ symbol: [ "iovec", private, "<sys/uio.h>", public ] },
|
||||
{ symbol: [ "iovec", private, "<sys/socket.h>", private ] },
|
||||
{ symbol: [ "itimerspec", private, "<time.h>", public ] },
|
||||
{ symbol: [ "itimerspec", private, "<sys/timerfd.h>", public ] },
|
||||
{ symbol: [ "key_t", private, "<sys/types.h>", public ] },
|
||||
{ symbol: [ "key_t", private, "<sys/ipc.h>", public ] },
|
||||
{ symbol: [ "lconv", private, "<locale.h>", public ] },
|
||||
{ symbol: [ "ldiv_t", private, "<stdlib.h>", public ] },
|
||||
{ symbol: [ "lldiv_t", private, "<stdlib.h>", public ] },
|
||||
{ symbol: [ "max_align_t", private, "<stddef.h>", public ] },
|
||||
{ symbol: [ "mode_t", private, "<sys/types.h>", public ] },
|
||||
{ symbol: [ "mode_t", private, "<fcntl.h>", public ] },
|
||||
{ symbol: [ "mode_t", private, "<ndbm.h>", public ] },
|
||||
{ symbol: [ "mode_t", private, "<spawn.h>", public ] },
|
||||
{ symbol: [ "mode_t", private, "<sys/ipc.h>", public ] },
|
||||
{ symbol: [ "mode_t", private, "<sys/mman.h>", public ] },
|
||||
{ symbol: [ "mode_t", private, "<sys/stat.h>", public ] },
|
||||
{ symbol: [ "nlink_t", private, "<sys/types.h>", public ] },
|
||||
{ symbol: [ "nlink_t", private, "<sys/stat.h>", public ] },
|
||||
{ symbol: [ "ntohl", private, "<arpa/inet.h>", private ] },
|
||||
{ symbol: [ "ntohs", private, "<arpa/inet.h>", private ] },
|
||||
{ symbol: [ "off64_t", private, "<sys/types.h>", public ] },
|
||||
{ symbol: [ "off64_t", private, "<unistd.h>", private ] },
|
||||
{ symbol: [ "off_t", private, "<sys/types.h>", public ] },
|
||||
{ symbol: [ "off_t", private, "<aio.h>", public ] },
|
||||
{ symbol: [ "off_t", private, "<fcntl.h>", public ] },
|
||||
{ symbol: [ "off_t", private, "<stdio.h>", public ] },
|
||||
{ symbol: [ "off_t", private, "<sys/mman.h>", public ] },
|
||||
{ symbol: [ "off_t", private, "<sys/stat.h>", public ] },
|
||||
{ symbol: [ "off_t", private, "<unistd.h>", private ] },
|
||||
{ symbol: [ "optarg", private, "<unistd.h>", private ] },
|
||||
{ symbol: [ "opterr", private, "<unistd.h>", private ] },
|
||||
{ symbol: [ "optind", private, "<unistd.h>", private ] },
|
||||
{ symbol: [ "optopt", private, "<unistd.h>", private ] },
|
||||
{ symbol: [ "pid_t", private, "<sys/types.h>", public ] },
|
||||
{ symbol: [ "pid_t", private, "<fcntl.h>", public ] },
|
||||
{ symbol: [ "pid_t", private, "<sched.h>", public ] },
|
||||
{ symbol: [ "pid_t", private, "<signal.h>", public ] },
|
||||
{ symbol: [ "pid_t", private, "<spawn.h>", public ] },
|
||||
{ symbol: [ "pid_t", private, "<sys/msg.h>", public ] },
|
||||
{ symbol: [ "pid_t", private, "<sys/sem.h>", public ] },
|
||||
{ symbol: [ "pid_t", private, "<sys/shm.h>", public ] },
|
||||
{ symbol: [ "pid_t", private, "<sys/wait.h>", public ] },
|
||||
{ symbol: [ "pid_t", private, "<termios.h>", private ] },
|
||||
{ symbol: [ "pid_t", private, "<time.h>", public ] },
|
||||
{ symbol: [ "pid_t", private, "<unistd.h>", private ] },
|
||||
{ symbol: [ "pid_t", private, "<utmpx.h>", public ] },
|
||||
{ symbol: [ "ptrdiff_t", private, "<stddef.h>", public ] },
|
||||
{ symbol: [ "regex_t", private, "<regex.h>", public ] },
|
||||
{ symbol: [ "regmatch_t", private, "<regex.h>", public ] },
|
||||
{ symbol: [ "regoff_t", private, "<regex.h>", public ] },
|
||||
{ symbol: [ "sigevent", private, "<signal.h>", public ] },
|
||||
{ symbol: [ "sigevent", private, "<aio.h>", public ] },
|
||||
{ symbol: [ "sigevent", private, "<mqueue.h>", public ] },
|
||||
{ symbol: [ "sigevent", private, "<time.h>", public ] },
|
||||
{ symbol: [ "siginfo_t", private, "<signal.h>", public ] },
|
||||
{ symbol: [ "siginfo_t", private, "<sys/wait.h>", public ] },
|
||||
{ symbol: [ "sigset_t", private, "<signal.h>", public ] },
|
||||
{ symbol: [ "sigset_t", private, "<spawn.h>", public ] },
|
||||
{ symbol: [ "sigset_t", private, "<sys/select.h>", public ] },
|
||||
{ symbol: [ "sigval", private, "<signal.h>", public ] },
|
||||
{ symbol: [ "sockaddr", private, "<sys/socket.h>", private ] },
|
||||
{ symbol: [ "socklen_t", private, "<sys/socket.h>", private ] },
|
||||
{ symbol: [ "socklen_t", private, "<netdb.h>", private ] },
|
||||
{ symbol: [ "ssize_t", private, "<sys/types.h>", public ] },
|
||||
{ symbol: [ "ssize_t", private, "<aio.h>", public ] },
|
||||
{ symbol: [ "ssize_t", private, "<monetary.h>", public ] },
|
||||
{ symbol: [ "ssize_t", private, "<mqueue.h>", public ] },
|
||||
{ symbol: [ "ssize_t", private, "<stdio.h>", public ] },
|
||||
{ symbol: [ "ssize_t", private, "<sys/msg.h>", public ] },
|
||||
{ symbol: [ "ssize_t", private, "<sys/socket.h>", private ] },
|
||||
{ symbol: [ "ssize_t", private, "<sys/uio.h>", public ] },
|
||||
{ symbol: [ "ssize_t", private, "<unistd.h>", private ] },
|
||||
{ symbol: [ "stat", private, "<sys/stat.h>", public ] },
|
||||
{ symbol: [ "stat", private, "<ftw.h>", public ] },
|
||||
{ symbol: [ "suseconds_t", private, "<sys/types.h>", public ] },
|
||||
{ symbol: [ "suseconds_t", private, "<sys/select.h>", public ] },
|
||||
{ symbol: [ "suseconds_t", private, "<sys/time.h>", public ] },
|
||||
{ symbol: [ "time_t", private, "<time.h>", public ] },
|
||||
{ symbol: [ "time_t", private, "<sched.h>", public ] },
|
||||
{ symbol: [ "time_t", private, "<sys/msg.h>", public ] },
|
||||
{ symbol: [ "time_t", private, "<sys/select.h>", public ] },
|
||||
{ symbol: [ "time_t", private, "<sys/sem.h>", public ] },
|
||||
{ symbol: [ "time_t", private, "<sys/shm.h>", public ] },
|
||||
{ symbol: [ "time_t", private, "<sys/stat.h>", public ] },
|
||||
{ symbol: [ "time_t", private, "<sys/time.h>", public ] },
|
||||
{ symbol: [ "time_t", private, "<sys/types.h>", public ] },
|
||||
{ symbol: [ "time_t", private, "<utime.h>", public ] },
|
||||
{ symbol: [ "timer_t", private, "<sys/types.h>", public ] },
|
||||
{ symbol: [ "timer_t", private, "<time.h>", public ] },
|
||||
{ symbol: [ "timespec", private, "<time.h>", public ] },
|
||||
{ symbol: [ "timespec", private, "<aio.h>", public ] },
|
||||
{ symbol: [ "timespec", private, "<mqueue.h>", public ] },
|
||||
{ symbol: [ "timespec", private, "<sched.h>", public ] },
|
||||
{ symbol: [ "timespec", private, "<signal.h>", public ] },
|
||||
{ symbol: [ "timespec", private, "<sys/select.h>", public ] },
|
||||
{ symbol: [ "timespec", private, "<sys/stat.h>", public ] },
|
||||
{ symbol: [ "timeval", private, "<sys/time.h>", public ] },
|
||||
{ symbol: [ "timeval", private, "<sys/resource.h>", public ] },
|
||||
{ symbol: [ "timeval", private, "<sys/select.h>", public ] },
|
||||
{ symbol: [ "timeval", private, "<utmpx.h>", public ] },
|
||||
{ symbol: [ "tm", private, "<time.h>", public ] },
|
||||
{ symbol: [ "u_char", private, "<sys/types.h>", public ] },
|
||||
{ symbol: [ "u_char", private, "<rpc/types.h>", public ] },
|
||||
{ symbol: [ "uid_t", private, "<sys/types.h>", public ] },
|
||||
{ symbol: [ "uid_t", private, "<pwd.h>", public ] },
|
||||
{ symbol: [ "uid_t", private, "<signal.h>", public ] },
|
||||
{ symbol: [ "uid_t", private, "<stropts.h>", public ] },
|
||||
{ symbol: [ "uid_t", private, "<sys/ipc.h>", public ] },
|
||||
{ symbol: [ "uid_t", private, "<sys/stat.h>", public ] },
|
||||
{ symbol: [ "uid_t", private, "<unistd.h>", private ] },
|
||||
{ symbol: [ "useconds_t", private, "<sys/types.h>", public ] },
|
||||
{ symbol: [ "useconds_t", private, "<unistd.h>", private ] },
|
||||
{ symbol: [ "wchar_t", private, "<stddef.h>", public ] },
|
||||
{ symbol: [ "wchar_t", private, "<stdlib.h>", public ] },
|
||||
{ symbol: [ "size_t", private, "<stddef.h>", public ] },
|
||||
{ symbol: [ "size_t", private, "<aio.h>", public ] },
|
||||
{ symbol: [ "size_t", private, "<glob.h>", public ] },
|
||||
{ symbol: [ "size_t", private, "<grp.h>", public ] },
|
||||
{ symbol: [ "size_t", private, "<iconv.h>", public ] },
|
||||
{ symbol: [ "size_t", private, "<monetary.h>", public ] },
|
||||
{ symbol: [ "size_t", private, "<mqueue.h>", public ] },
|
||||
{ symbol: [ "size_t", private, "<ndbm.h>", public ] },
|
||||
{ symbol: [ "size_t", private, "<pwd.h>", public ] },
|
||||
{ symbol: [ "size_t", private, "<regex.h>", public ] },
|
||||
{ symbol: [ "size_t", private, "<search.h>", public ] },
|
||||
{ symbol: [ "size_t", private, "<signal.h>", public ] },
|
||||
{ symbol: [ "size_t", private, "<stdio.h>", public ] },
|
||||
{ symbol: [ "size_t", private, "<stdlib.h>", public ] },
|
||||
{ symbol: [ "size_t", private, "<string.h>", public ] },
|
||||
{ symbol: [ "size_t", private, "<strings.h>", public ] },
|
||||
{ symbol: [ "size_t", private, "<sys/mman.h>", public ] },
|
||||
{ symbol: [ "size_t", private, "<sys/msg.h>", public ] },
|
||||
{ symbol: [ "size_t", private, "<sys/sem.h>", public ] },
|
||||
{ symbol: [ "size_t", private, "<sys/shm.h>", public ] },
|
||||
{ symbol: [ "size_t", private, "<sys/socket.h>", private ] },
|
||||
{ symbol: [ "size_t", private, "<sys/types.h>", public ] },
|
||||
{ symbol: [ "size_t", private, "<sys/uio.h>", public ] },
|
||||
{ symbol: [ "size_t", private, "<time.h>", public ] },
|
||||
{ symbol: [ "size_t", private, "<uchar.h>", public ] },
|
||||
{ symbol: [ "size_t", private, "<unistd.h>", private ] },
|
||||
{ symbol: [ "size_t", private, "<wchar.h>", public ] },
|
||||
{ symbol: [ "size_t", private, "<wordexp.h>", public ] },
|
||||
# Macros that can be defined in more than one file, don't have the
|
||||
# same __foo_defined guard that other types do, so the grep above
|
||||
# doesn't discover them. Until I figure out a better way, I just
|
||||
# add them in by hand as I discover them.
|
||||
{ symbol: [ "EOF", private, "<stdio.h>", public ] },
|
||||
{ symbol: [ "EOF", private, "<libio.h>", public ] },
|
||||
{ symbol: [ "FILE", private, "<stdio.h>", public ] },
|
||||
{ symbol: [ "MAP_POPULATE", private, "<sys/mman.h>", public ] },
|
||||
{ symbol: [ "MAP_POPULATE", private, "<linux/mman.h>", public ] },
|
||||
{ symbol: [ "MAP_STACK", private, "<sys/mman.h>", public ] },
|
||||
{ symbol: [ "MAP_STACK", private, "<linux/mman.h>", public ] },
|
||||
{ symbol: [ "MAXHOSTNAMELEN", private, "<sys/param.h>", public ] },
|
||||
{ symbol: [ "MAXHOSTNAMELEN", private, "<protocols/timed.h>", public ] },
|
||||
{ symbol: [ "SIGABRT", private, "<signal.h>", public ] },
|
||||
{ symbol: [ "SIGCHLD", private, "<signal.h>", public ] },
|
||||
{ symbol: [ "SIGCHLD", private, "<linux/signal.h>", public ] },
|
||||
{ symbol: [ "va_list", private, "<stdarg.h>", public ] },
|
||||
{ symbol: [ "va_list", private, "<stdio.h>", public ] },
|
||||
{ symbol: [ "va_list", private, "<wchar.h>", public ] },
|
||||
# These are symbols that could be defined in either stdlib.h or
|
||||
# malloc.h, but we always want the stdlib location.
|
||||
{ symbol: [ "malloc", private, "<stdlib.h>", public ] },
|
||||
{ symbol: [ "calloc", private, "<stdlib.h>", public ] },
|
||||
{ symbol: [ "realloc", private, "<stdlib.h>", public ] },
|
||||
{ symbol: [ "free", private, "<stdlib.h>", public ] },
|
||||
# Entries for NULL
|
||||
{ symbol: [ "NULL", private, "<stddef.h>", public ] }, # 'canonical' location for NULL
|
||||
{ symbol: [ "NULL", private, "<clocale>", public ] },
|
||||
{ symbol: [ "NULL", private, "<cstddef>", public ] },
|
||||
{ symbol: [ "NULL", private, "<cstdio>", public ] },
|
||||
{ symbol: [ "NULL", private, "<cstdlib>", public ] },
|
||||
{ symbol: [ "NULL", private, "<cstring>", public ] },
|
||||
{ symbol: [ "NULL", private, "<ctime>", public ] },
|
||||
{ symbol: [ "NULL", private, "<cwchar>", public ] },
|
||||
{ symbol: [ "NULL", private, "<locale.h>", public ] },
|
||||
{ symbol: [ "NULL", private, "<stdio.h>", public ] },
|
||||
{ symbol: [ "NULL", private, "<stdlib.h>", public ] },
|
||||
{ symbol: [ "NULL", private, "<string.h>", public ] },
|
||||
{ symbol: [ "NULL", private, "<time.h>", public ] },
|
||||
{ symbol: [ "NULL", private, "<unistd.h>", private ] },
|
||||
{ symbol: [ "NULL", private, "<wchar.h>", public ] },
|
||||
|
||||
# Kludge time: almost all STL types take an allocator, but they
|
||||
# almost always use the default value. Usually we detect that
|
||||
# and don't try to do IWYU, but sometimes it passes through.
|
||||
# For instance, when adding two strings, we end up calling
|
||||
# template<_CharT,_Traits,_Alloc> ... operator+(
|
||||
# basic_string<_CharT,_Traits,_Alloc>, ...)
|
||||
# These look like normal template args to us, so we see they're
|
||||
# used and declare an iwyu dependency, even though we don't need
|
||||
# to #include the traits or alloc type ourselves. The surest way
|
||||
# to deal with this is to just say that everyone provides
|
||||
# std::allocator. We can add more here at need.
|
||||
{ symbol: [ "std::allocator", private, "<memory>", public ] },
|
||||
{ symbol: [ "std::allocator", private, "<string>", public ] },
|
||||
{ symbol: [ "std::allocator", private, "<vector>", public ] },
|
||||
{ symbol: [ "std::allocator", private, "<map>", public ] },
|
||||
{ symbol: [ "std::allocator", private, "<set>", public ] },
|
||||
# A similar kludge for std::char_traits. basic_string,
|
||||
# basic_ostream and basic_istream have this as a default template
|
||||
# argument, and sometimes it bleeds through when clang desugars the
|
||||
# string/ostream/istream type.
|
||||
{ symbol: [ "std::char_traits", private, "<string>", public ] },
|
||||
{ symbol: [ "std::char_traits", private, "<ostream>", public ] },
|
||||
{ symbol: [ "std::char_traits", private, "<istream>", public ] },
|
||||
|
||||
{ symbol: [ "std::size_t", private, "<cstddef>", public ] },
|
||||
{ symbol: [ "std::size_t", private, "<cstdio>", public ] },
|
||||
{ symbol: [ "std::size_t", private, "<cstdlib>", public ] },
|
||||
{ symbol: [ "std::size_t", private, "<cstring>", public ] },
|
||||
{ symbol: [ "std::size_t", private, "<ctime>", public ] },
|
||||
{ symbol: [ "std::size_t", private, "<cuchar>", public ] },
|
||||
{ symbol: [ "std::size_t", private, "<cwchar>", public ] }
|
||||
]
|
||||
|
||||
# vim: set ft=toml:
|
@ -1,238 +0,0 @@
|
||||
[
|
||||
# Generated to normal headers: header.h.generated.h -> nvim/header.h
|
||||
{ include: [ '"api/autocmd.h.generated.h"', private, '"nvim/api/autocmd.h"', public ] },
|
||||
{ include: [ '"api/buffer.h.generated.h"', private, '"nvim/api/buffer.h"', public ] },
|
||||
{ include: [ '"api/command.h.generated.h"', private, '"nvim/api/command.h"', public ] },
|
||||
{ include: [ '"api/deprecated.h.generated.h"', private, '"nvim/api/deprecated.h"', public ] },
|
||||
{ include: [ '"api/extmark.h.generated.h"', private, '"nvim/api/extmark.h"', public ] },
|
||||
{ include: [ '"api/options.h.generated.h"', private, '"nvim/api/options.h"', public ] },
|
||||
{ include: [ '"api/private/converter.h.generated.h"', private, '"nvim/api/private/converter.h"', public ] },
|
||||
{ include: [ '"api/private/dispatch.h.generated.h"', private, '"nvim/api/private/dispatch.h"', public ] },
|
||||
{ include: [ '"api/private/helpers.h.generated.h"', private, '"nvim/api/private/helpers.h"', public ] },
|
||||
{ include: [ '"api/tabpage.h.generated.h"', private, '"nvim/api/tabpage.h"', public ] },
|
||||
{ include: [ '"api/ui.h.generated.h"', private, '"nvim/api/ui.h"', public ] },
|
||||
{ include: [ '"api/vim.h.generated.h"', private, '"nvim/api/vim.h"', public ] },
|
||||
{ include: [ '"api/vimscript.h.generated.h"', private, '"nvim/api/vimscript.h"', public ] },
|
||||
{ include: [ '"api/win_config.h.generated.h"', private, '"nvim/api/win_config.h"', public ] },
|
||||
{ include: [ '"api/window.h.generated.h"', private, '"nvim/api/window.h"', public ] },
|
||||
{ include: [ '"arabic.h.generated.h"', private, '"nvim/arabic.h"', public ] },
|
||||
{ include: [ '"arglist.h.generated.h"', private, '"nvim/arglist.h"', public ] },
|
||||
{ include: [ '"autocmd.h.generated.h"', private, '"nvim/autocmd.h"', public ] },
|
||||
{ include: [ '"buffer.h.generated.h"', private, '"nvim/buffer.h"', public ] },
|
||||
{ include: [ '"buffer_updates.h.generated.h"', private, '"nvim/buffer_updates.h"', public ] },
|
||||
{ include: [ '"change.h.generated.h"', private, '"nvim/change.h"', public ] },
|
||||
{ include: [ '"channel.h.generated.h"', private, '"nvim/channel.h"', public ] },
|
||||
{ include: [ '"charset.h.generated.h"', private, '"nvim/charset.h"', public ] },
|
||||
{ include: [ '"cmdexpand.h.generated.h"', private, '"nvim/cmdexpand.h"', public ] },
|
||||
{ include: [ '"cmdhist.h.generated.h"', private, '"nvim/cmdhist.h"', public ] },
|
||||
{ include: [ '"context.h.generated.h"', private, '"nvim/context.h"', public ] },
|
||||
{ include: [ '"cursor.h.generated.h"', private, '"nvim/cursor.h"', public ] },
|
||||
{ include: [ '"cursor_shape.h.generated.h"', private, '"nvim/cursor_shape.h"', public ] },
|
||||
{ include: [ '"debugger.h.generated.h"', private, '"nvim/debugger.h"', public ] },
|
||||
{ include: [ '"decoration.h.generated.h"', private, '"nvim/decoration.h"', public ] },
|
||||
{ include: [ '"decoration_provider.h.generated.h"', private, '"nvim/decoration_provider.h"', public ] },
|
||||
{ include: [ '"diff.h.generated.h"', private, '"nvim/diff.h"', public ] },
|
||||
{ include: [ '"digraph.h.generated.h"', private, '"nvim/digraph.h"', public ] },
|
||||
{ include: [ '"drawline.h.generated.h"', private, '"nvim/drawline.h"', public ] },
|
||||
{ include: [ '"drawscreen.h.generated.h"', private, '"nvim/drawscreen.h"', public ] },
|
||||
{ include: [ '"edit.h.generated.h"', private, '"nvim/edit.h"', public ] },
|
||||
{ include: [ '"eval.h.generated.h"', private, '"nvim/eval.h"', public ] },
|
||||
{ include: [ '"eval/buffer.h.generated.h"', private, '"nvim/eval/buffer.h"', public ] },
|
||||
{ include: [ '"eval/decode.h.generated.h"', private, '"nvim/eval/decode.h"', public ] },
|
||||
{ include: [ '"eval/encode.h.generated.h"', private, '"nvim/eval/encode.h"', public ] },
|
||||
{ include: [ '"eval/executor.h.generated.h"', private, '"nvim/eval/executor.h"', public ] },
|
||||
{ include: [ '"eval/funcs.h.generated.h"', private, '"nvim/eval/funcs.h"', public ] },
|
||||
{ include: [ '"eval/typval.h.generated.h"', private, '"nvim/eval/typval.h"', public ] },
|
||||
{ include: [ '"eval/userfunc.h.generated.h"', private, '"nvim/eval/userfunc.h"', public ] },
|
||||
{ include: [ '"eval/vars.h.generated.h"', private, '"nvim/eval/vars.h"', public ] },
|
||||
{ include: [ '"eval/window.h.generated.h"', private, '"nvim/eval/window.h"', public ] },
|
||||
{ include: [ '"event/libuv_process.h.generated.h"', private, '"nvim/event/libuv_process.h"', public ] },
|
||||
{ include: [ '"event/loop.h.generated.h"', private, '"nvim/event/loop.h"', public ] },
|
||||
{ include: [ '"event/multiqueue.h.generated.h"', private, '"nvim/event/multiqueue.h"', public ] },
|
||||
{ include: [ '"event/process.h.generated.h"', private, '"nvim/event/process.h"', public ] },
|
||||
{ include: [ '"event/rstream.h.generated.h"', private, '"nvim/event/rstream.h"', public ] },
|
||||
{ include: [ '"event/signal.h.generated.h"', private, '"nvim/event/signal.h"', public ] },
|
||||
{ include: [ '"event/socket.h.generated.h"', private, '"nvim/event/socket.h"', public ] },
|
||||
{ include: [ '"event/stream.h.generated.h"', private, '"nvim/event/stream.h"', public ] },
|
||||
{ include: [ '"event/time.h.generated.h"', private, '"nvim/event/time.h"', public ] },
|
||||
{ include: [ '"event/wstream.h.generated.h"', private, '"nvim/event/wstream.h"', public ] },
|
||||
{ include: [ '"ex_cmds.h.generated.h"', private, '"nvim/ex_cmds.h"', public ] },
|
||||
{ include: [ '"ex_cmds2.h.generated.h"', private, '"nvim/ex_cmds2.h"', public ] },
|
||||
{ include: [ '"ex_docmd.h.generated.h"', private, '"nvim/ex_docmd.h"', public ] },
|
||||
{ include: [ '"ex_eval.h.generated.h"', private, '"nvim/ex_eval.h"', public ] },
|
||||
{ include: [ '"ex_getln.h.generated.h"', private, '"nvim/ex_getln.h"', public ] },
|
||||
{ include: [ '"ex_session.h.generated.h"', private, '"nvim/ex_session.h"', public ] },
|
||||
{ include: [ '"extmark.h.generated.h"', private, '"nvim/extmark.h"', public ] },
|
||||
{ include: [ '"file_search.h.generated.h"', private, '"nvim/file_search.h"', public ] },
|
||||
{ include: [ '"fileio.h.generated.h"', private, '"nvim/fileio.h"', public ] },
|
||||
{ include: [ '"fold.h.generated.h"', private, '"nvim/fold.h"', public ] },
|
||||
{ include: [ '"garray.h.generated.h"', private, '"nvim/garray.h"', public ] },
|
||||
{ include: [ '"getchar.h.generated.h"', private, '"nvim/getchar.h"', public ] },
|
||||
{ include: [ '"grid.h.generated.h"', private, '"nvim/grid.h"', public ] },
|
||||
{ include: [ '"hashtab.h.generated.h"', private, '"nvim/hashtab.h"', public ] },
|
||||
{ include: [ '"help.h.generated.h"', private, '"nvim/help.h"', public ] },
|
||||
{ include: [ '"highlight.h.generated.h"', private, '"nvim/highlight.h"', public ] },
|
||||
{ include: [ '"highlight_group.h.generated.h"', private, '"nvim/highlight_group.h"', public ] },
|
||||
{ include: [ '"if_cscope.h.generated.h"', private, '"nvim/if_cscope.h"', public ] },
|
||||
{ include: [ '"indent.h.generated.h"', private, '"nvim/indent.h"', public ] },
|
||||
{ include: [ '"indent_c.h.generated.h"', private, '"nvim/indent_c.h"', public ] },
|
||||
{ include: [ '"input.h.generated.h"', private, '"nvim/input.h"', public ] },
|
||||
{ include: [ '"insexpand.h.generated.h"', private, '"nvim/insexpand.h"', public ] },
|
||||
{ include: [ '"keycodes.h.generated.h"', private, '"nvim/keycodes.h"', public ] },
|
||||
{ include: [ '"linematch.h.generated.h"', private, '"nvim/linematch.h"', public ] },
|
||||
{ include: [ '"locale.h.generated.h"', private, '"nvim/locale.h"', public ] },
|
||||
{ include: [ '"log.h.generated.h"', private, '"nvim/log.h"', public ] },
|
||||
{ include: [ '"lua/converter.h.generated.h"', private, '"nvim/lua/converter.h"', public ] },
|
||||
{ include: [ '"lua/executor.h.generated.h"', private, '"nvim/lua/executor.h"', public ] },
|
||||
{ include: [ '"lua/spell.h.generated.h"', private, '"nvim/lua/spell.h"', public ] },
|
||||
{ include: [ '"lua/stdlib.h.generated.h"', private, '"nvim/lua/stdlib.h"', public ] },
|
||||
{ include: [ '"lua/treesitter.h.generated.h"', private, '"nvim/lua/treesitter.h"', public ] },
|
||||
{ include: [ '"lua/xdiff.h.generated.h"', private, '"nvim/lua/xdiff.h"', public ] },
|
||||
{ include: [ '"main.h.generated.h"', private, '"nvim/main.h"', public ] },
|
||||
{ include: [ '"mapping.h.generated.h"', private, '"nvim/mapping.h"', public ] },
|
||||
{ include: [ '"mark.h.generated.h"', private, '"nvim/mark.h"', public ] },
|
||||
{ include: [ '"marktree.h.generated.h"', private, '"nvim/marktree.h"', public ] },
|
||||
{ include: [ '"match.h.generated.h"', private, '"nvim/match.h"', public ] },
|
||||
{ include: [ '"math.h.generated.h"', private, '"nvim/math.h"', public ] },
|
||||
{ include: [ '"mbyte.h.generated.h"', private, '"nvim/mbyte.h"', public ] },
|
||||
{ include: [ '"memfile.h.generated.h"', private, '"nvim/memfile.h"', public ] },
|
||||
{ include: [ '"memline.h.generated.h"', private, '"nvim/memline.h"', public ] },
|
||||
{ include: [ '"memory.h.generated.h"', private, '"nvim/memory.h"', public ] },
|
||||
{ include: [ '"menu.h.generated.h"', private, '"nvim/menu.h"', public ] },
|
||||
{ include: [ '"message.h.generated.h"', private, '"nvim/message.h"', public ] },
|
||||
{ include: [ '"mouse.h.generated.h"', private, '"nvim/mouse.h"', public ] },
|
||||
{ include: [ '"move.h.generated.h"', private, '"nvim/move.h"', public ] },
|
||||
{ include: [ '"msgpack_rpc/channel.h.generated.h"', private, '"nvim/msgpack_rpc/channel.h"', public ] },
|
||||
{ include: [ '"msgpack_rpc/helpers.h.generated.h"', private, '"nvim/msgpack_rpc/helpers.h"', public ] },
|
||||
{ include: [ '"msgpack_rpc/server.h.generated.h"', private, '"nvim/msgpack_rpc/server.h"', public ] },
|
||||
{ include: [ '"msgpack_rpc/unpacker.h.generated.h"', private, '"nvim/msgpack_rpc/unpacker.h"', public ] },
|
||||
{ include: [ '"normal.h.generated.h"', private, '"nvim/normal.h"', public ] },
|
||||
{ include: [ '"ops.h.generated.h"', private, '"nvim/ops.h"', public ] },
|
||||
{ include: [ '"option.h.generated.h"', private, '"nvim/option.h"', public ] },
|
||||
{ include: [ '"optionstr.h.generated.h"', private, '"nvim/optionstr.h"', public ] },
|
||||
{ include: [ '"os/dl.h.generated.h"', private, '"nvim/os/dl.h"', public ] },
|
||||
{ include: [ '"os/fileio.h.generated.h"', private, '"nvim/os/fileio.h"', public ] },
|
||||
{ include: [ '"os/fs.h.generated.h"', private, '"nvim/os/fs.h"', public ] },
|
||||
{ include: [ '"os/input.h.generated.h"', private, '"nvim/os/input.h"', public ] },
|
||||
{ include: [ '"os/lang.h.generated.h"', private, '"nvim/os/lang.h"', public ] },
|
||||
{ include: [ '"os/process.h.generated.h"', private, '"nvim/os/process.h"', public ] },
|
||||
{ include: [ '"os/pty_process_unix.h.generated.h"', private, '"nvim/os/pty_process_unix.h"', private ] },
|
||||
{ include: [ '"os/shell.h.generated.h"', private, '"nvim/os/shell.h"', public ] },
|
||||
{ include: [ '"os/signal.h.generated.h"', private, '"nvim/os/signal.h"', public ] },
|
||||
{ include: [ '"os/time.h.generated.h"', private, '"nvim/os/time.h"', public ] },
|
||||
{ include: [ '"path.h.generated.h"', private, '"nvim/path.h"', public ] },
|
||||
{ include: [ '"plines.h.generated.h"', private, '"nvim/plines.h"', public ] },
|
||||
{ include: [ '"popupmenu.h.generated.h"', private, '"nvim/popupmenu.h"', public ] },
|
||||
{ include: [ '"profile.h.generated.h"', private, '"nvim/profile.h"', public ] },
|
||||
{ include: [ '"quickfix.h.generated.h"', private, '"nvim/quickfix.h"', public ] },
|
||||
{ include: [ '"rbuffer.h.generated.h"', private, '"nvim/rbuffer.h"', public ] },
|
||||
{ include: [ '"regexp.h.generated.h"', private, '"nvim/regexp.h"', public ] },
|
||||
{ include: [ '"runtime.h.generated.h"', private, '"nvim/runtime.h"', public ] },
|
||||
{ include: [ '"screen.h.generated.h"', private, '"nvim/screen.h"', public ] },
|
||||
{ include: [ '"search.h.generated.h"', private, '"nvim/search.h"', public ] },
|
||||
{ include: [ '"sha256.h.generated.h"', private, '"nvim/sha256.h"', public ] },
|
||||
{ include: [ '"shada.h.generated.h"', private, '"nvim/shada.h"', public ] },
|
||||
{ include: [ '"sign.h.generated.h"', private, '"nvim/sign.h"', public ] },
|
||||
{ include: [ '"spell.h.generated.h"', private, '"nvim/spell.h"', public ] },
|
||||
{ include: [ '"spellfile.h.generated.h"', private, '"nvim/spellfile.h"', public ] },
|
||||
{ include: [ '"spellsuggest.h.generated.h"', private, '"nvim/spellsuggest.h"', public ] },
|
||||
{ include: [ '"state.h.generated.h"', private, '"nvim/state.h"', public ] },
|
||||
{ include: [ '"statusline.h.generated.h"', private, '"nvim/statusline.h"', public ] },
|
||||
{ include: [ '"strings.h.generated.h"', private, '"nvim/strings.h"', public ] },
|
||||
{ include: [ '"syntax.h.generated.h"', private, '"nvim/syntax.h"', public ] },
|
||||
{ include: [ '"tag.h.generated.h"', private, '"nvim/tag.h"', public ] },
|
||||
{ include: [ '"terminal.h.generated.h"', private, '"nvim/terminal.h"', public ] },
|
||||
{ include: [ '"testing.h.generated.h"', private, '"nvim/testing.h"', public ] },
|
||||
{ include: [ '"textformat.h.generated.h"', private, '"nvim/textformat.h"', public ] },
|
||||
{ include: [ '"textobject.h.generated.h"', private, '"nvim/textobject.h"', public ] },
|
||||
{ include: [ '"tui/input.h.generated.h"', private, '"nvim/tui/input.h"', public ] },
|
||||
{ include: [ '"tui/terminfo.h.generated.h"', private, '"nvim/tui/terminfo.h"', public ] },
|
||||
{ include: [ '"tui/tui.h.generated.h"', private, '"nvim/tui/tui.h"', public ] },
|
||||
{ include: [ '"ugrid.h.generated.h"', private, '"nvim/ugrid.h"', public ] },
|
||||
{ include: [ '"ui.h.generated.h"', private, '"nvim/ui.h"', public ] },
|
||||
{ include: [ '"ui_bridge.h.generated.h"', private, '"nvim/ui_bridge.h"', public ] },
|
||||
{ include: [ '"ui_client.h.generated.h"', private, '"nvim/ui_client.h"', public ] },
|
||||
{ include: [ '"ui_compositor.h.generated.h"', private, '"nvim/ui_compositor.h"', public ] },
|
||||
{ include: [ '"undo.h.generated.h"', private, '"nvim/undo.h"', public ] },
|
||||
{ include: [ '"usercmd.h.generated.h"', private, '"nvim/usercmd.h"', public ] },
|
||||
{ include: [ '"version.h.generated.h"', private, '"nvim/version.h"', public ] },
|
||||
{ include: [ '"viml/parser/expressions.h.generated.h"', private, '"nvim/viml/parser/expressions.h"', public ] },
|
||||
{ include: [ '"viml/parser/parser.h.generated.h"', private, '"nvim/viml/parser/parser.h"', public ] },
|
||||
{ include: [ '"window.h.generated.h"', private, '"nvim/window.h"', public ] },
|
||||
|
||||
# Generated to normal headers with a different name: header.h.generated.h -> nvim/some_other_header.h
|
||||
{ include: [ '"api/private/dispatch_wrappers.h.generated.h"', private, '"nvim/api/private/dispatch.h"', public ] },
|
||||
{ include: [ '"auevents_enum.generated.h"', private, '"nvim/autocmd.h"', public ] },
|
||||
{ include: [ '"ex_cmds_enum.generated.h"', private, '"nvim/ex_cmds_defs.h"', public ] },
|
||||
{ include: [ '"keysets.h.generated.h"', private, '"nvim/api/private/helpers.h"', public ] },
|
||||
{ include: [ '"keysets_defs.generated.h"', private, '"nvim/api/private/defs.h"', public ] },
|
||||
{ include: [ '"nvim/os/pty_process_unix.h"', private, '"nvim/os/pty_process.h"', public ] },
|
||||
{ include: [ '"nvim/os/pty_process_win.h"', private, '"nvim/os/pty_process.h"', public ] },
|
||||
{ include: [ '"nvim/os/unix_defs.h"', private, '"nvim/os/os_defs.h"', public ] },
|
||||
{ include: [ '"nvim/os/win_defs.h"', private, '"nvim/os/os_defs.h"', public ] },
|
||||
{ include: [ '"os/env.h.generated.h"', private, '"nvim/os/os.h"', public ] },
|
||||
{ include: [ '"os/fs.h.generated.h"', private, '"nvim/os/os.h"', public ] },
|
||||
{ include: [ '"os/mem.h.generated.h"', private, '"nvim/os/os.h"', public ] },
|
||||
{ include: [ '"os/stdpaths.h.generated.h"', private, '"nvim/os/os.h"', public ] },
|
||||
{ include: [ '"os/users.h.generated.h"', private, '"nvim/os/os.h"', public ] },
|
||||
{ include: [ '"regexp_bt.h.generated.h"', private, '"nvim/regexp.h"', public ] },
|
||||
{ include: [ '"ui_events_call.h.generated.h"', private, '"nvim/ui.h"', public ] },
|
||||
{ include: [ '"ui_events_client.h.generated.h"', private, '"nvim/ui_client.h"', public ] },
|
||||
{ include: [ '"ui_events_remote.generated.h"', private, '"nvim/api/ui.h"', public ] },
|
||||
{ include: [ '"ui_events_remote.h.generated.h"', private, '"nvim/api/ui.h"', public ] },
|
||||
|
||||
# Def to normal headers: nvim/header_defs.h -> nvim/header.h
|
||||
#
|
||||
# This is a public to public mapping, meaning that while IWYU can use the
|
||||
# headers on the left, it will use the headers on the right if possible. This
|
||||
# isn't explicitly mentioned in the IWYU docs, this is just my interpretation
|
||||
# of its behavior.
|
||||
{ include: [ '"nvim/buffer_defs.h"', public, '"nvim/buffer.h"', public ] },
|
||||
{ include: [ '"nvim/ex_cmds_defs.h"', public, '"nvim/ex_cmds.h"', public ] },
|
||||
{ include: [ '"nvim/ex_eval_defs.h"', public, '"nvim/ex_eval.h"', public ] },
|
||||
{ include: [ '"nvim/extmark_defs.h"', public, '"nvim/extmark.h"', public ] },
|
||||
{ include: [ '"nvim/grid_defs.h"', public, '"nvim/grid.h"', public ] },
|
||||
{ include: [ '"nvim/highlight_defs.h"', public, '"nvim/highlight.h"', public ] },
|
||||
{ include: [ '"nvim/map_defs.h"', public, '"nvim/map.h"', public ] },
|
||||
{ include: [ '"nvim/mark_defs.h"', public, '"nvim/mark.h"', public ] },
|
||||
{ include: [ '"nvim/mbyte_defs.h"', public, '"nvim/mbyte.h"', public ] },
|
||||
{ include: [ '"nvim/memfile_defs.h"', public, '"nvim/memfile.h"', public ] },
|
||||
{ include: [ '"nvim/memline_defs.h"', public, '"nvim/memline.h"', public ] },
|
||||
{ include: [ '"nvim/menu_defs.h"', public, '"nvim/menu.h"', public ] },
|
||||
{ include: [ '"nvim/msgpack/channel_defs.h"', public, '"nvim/msgpack/channel.h"', public ] },
|
||||
{ include: [ '"nvim/option_defs.h"', public, '"nvim/option.h"', public ] },
|
||||
{ include: [ '"nvim/os/fs_defs.h"', public, '"nvim/os/fs.h"', public ] },
|
||||
{ include: [ '"nvim/os/os_defs.h"', public, '"nvim/os/os.h"', public ] },
|
||||
{ include: [ '"nvim/regexp_defs.h"', public, '"nvim/regexp.h"', public ] },
|
||||
{ include: [ '"nvim/sign_defs.h"', public, '"nvim/sign.h"', public ] },
|
||||
{ include: [ '"nvim/spell_defs.h"', public, '"nvim/spell.h"', public ] },
|
||||
{ include: [ '"nvim/statusline_defs.h"', public, '"nvim/statusline.h"', public ] },
|
||||
{ include: [ '"nvim/syntax_defs.h"', public, '"nvim/syntax.h"', public ] },
|
||||
{ include: [ '"nvim/tui/input_defs.h"', public, '"nvim/tui/input.h"', public ] },
|
||||
{ include: [ '"nvim/undo_defs.h"', public, '"nvim/undo.h"', public ] },
|
||||
|
||||
# Third party headers
|
||||
{ include: [ "<bits/types/wint_t.h>", private, "<wchar.h>", public ] },
|
||||
{ include: [ '<arpa/inet.h>', private, '<uv/unix.h>', private ] },
|
||||
{ include: [ '<bits/termios-c_cc.h>', private, '<termios.h>', private ] },
|
||||
{ include: [ '<bits/termios-c_cflag.h>', private, '<termios.h>', private ] },
|
||||
{ include: [ '<bits/termios-c_iflag.h>', private, '<termios.h>', private ] },
|
||||
{ include: [ '<bits/termios-c_oflag.h>', private, '<termios.h>', private ] },
|
||||
{ include: [ '<libintl.h>', private, '"nvim/gettext.h"', public ] },
|
||||
{ include: [ '<netdb.h>', private, '<uv/unix.h>', private ] },
|
||||
{ include: [ '<netinet/in.h>', private, '<uv/unix.h>', private ] },
|
||||
{ include: [ '<pthread.h>', private, '"nvim/os/unix_defs.h"', private ] },
|
||||
{ include: [ '<sys/socket.h>', private, '<uv/unix.h>', private ] },
|
||||
{ include: [ '<termios.h>', private, '"nvim/os/unix_defs.h"', private ] },
|
||||
{ include: [ '<unistd.h>', private, '"nvim/os/unix_defs.h"', private ] },
|
||||
{ include: [ '<uv/unix.h>', private, '<uv.h>', public ] },
|
||||
|
||||
# Symbols
|
||||
{ symbol: [ "MAX", private, '"nvim/macros.h"', public ] },
|
||||
{ symbol: [ "MIN", private, '"nvim/macros.h"', public ] },
|
||||
{ symbol: [ "SEEK_END", private, '<stdio.h>', public ] },
|
||||
{ symbol: [ "SEEK_SET", private, '<stdio.h>', public ] },
|
||||
{ symbol: [ "time_fd", private, '"nvim/globals.h"', public ] },
|
||||
]
|
||||
|
||||
# vim: set ft=toml:
|
@ -1,281 +0,0 @@
|
||||
# This is not meant to be included by the top-level.
|
||||
cmake_minimum_required (VERSION 3.10)
|
||||
project(NVIM_DEPS C)
|
||||
|
||||
if(POLICY CMP0135)
|
||||
cmake_policy(SET CMP0135 NEW)
|
||||
endif()
|
||||
|
||||
# Point CMake at any custom modules we may ship
|
||||
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" "${PROJECT_SOURCE_DIR}/../cmake")
|
||||
|
||||
include(CheckCCompilerFlag)
|
||||
include(Util)
|
||||
|
||||
set(DEPS_CMAKE_ARGS
|
||||
-D CMAKE_C_COMPILER=${CMAKE_C_COMPILER}
|
||||
-D CMAKE_C_STANDARD=99
|
||||
-D CMAKE_GENERATOR=${CMAKE_GENERATOR}
|
||||
-D CMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM}
|
||||
-D CMAKE_POSITION_INDEPENDENT_CODE=ON)
|
||||
|
||||
set(DEPS_CMAKE_CACHE_ARGS -DCMAKE_OSX_ARCHITECTURES:STRING=${CMAKE_OSX_ARCHITECTURES})
|
||||
|
||||
set_default_buildtype()
|
||||
|
||||
get_property(isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
||||
if(NOT isMultiConfig)
|
||||
list(APPEND DEPS_CMAKE_ARGS -D CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE})
|
||||
endif()
|
||||
|
||||
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()
|
||||
|
||||
set(DEPS_INSTALL_DIR "${CMAKE_BINARY_DIR}/usr")
|
||||
set(DEPS_BIN_DIR "${DEPS_INSTALL_DIR}/bin")
|
||||
set(DEPS_LIB_DIR "${DEPS_INSTALL_DIR}/lib")
|
||||
set(DEPS_BUILD_DIR "${CMAKE_BINARY_DIR}/build")
|
||||
set(DEPS_DOWNLOAD_DIR "${DEPS_BUILD_DIR}/downloads")
|
||||
|
||||
list(APPEND DEPS_CMAKE_ARGS -D CMAKE_INSTALL_PREFIX=${DEPS_INSTALL_DIR})
|
||||
|
||||
option(USE_BUNDLED "Use bundled dependencies." ON)
|
||||
|
||||
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, don't
|
||||
# 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)
|
||||
option(USE_BUNDLED_GETTEXT "Use the bundled version of gettext." ON)
|
||||
option(USE_BUNDLED_LIBICONV "Use the bundled version of libiconv." ON)
|
||||
else()
|
||||
option(USE_BUNDLED_GETTEXT "Use the bundled version of gettext." OFF)
|
||||
option(USE_BUNDLED_LIBICONV "Use the bundled version of libiconv." OFF)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
option(USE_BUNDLED_NVIMQT "Bundle neovim-qt" ON)
|
||||
endif()
|
||||
|
||||
option(USE_EXISTING_SRC_DIR "Skip download of deps sources in case of existing source directory." OFF)
|
||||
|
||||
find_package(Git)
|
||||
if(NOT Git_FOUND)
|
||||
message(FATAL_ERROR "Git is required to apply patches.")
|
||||
endif()
|
||||
|
||||
if(UNIX)
|
||||
find_program(MAKE_PRG NAMES gmake make)
|
||||
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()
|
||||
|
||||
# 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()
|
||||
|
||||
set(DEPS_C_COMPILER "${CMAKE_C_COMPILER}")
|
||||
|
||||
if(CMAKE_OSX_SYSROOT)
|
||||
set(DEPS_C_COMPILER "${DEPS_C_COMPILER} -isysroot${CMAKE_OSX_SYSROOT}")
|
||||
endif()
|
||||
|
||||
if(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}")
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
# 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.
|
||||
if(APPLE)
|
||||
if(NOT CMAKE_OSX_DEPLOYMENT_TARGET)
|
||||
execute_process(COMMAND sw_vers -productVersion
|
||||
OUTPUT_VARIABLE MACOS_VERSION
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET "${MACOS_VERSION}")
|
||||
endif()
|
||||
message(STATUS "Using deployment target ${CMAKE_OSX_DEPLOYMENT_TARGET}")
|
||||
endif()
|
||||
|
||||
include(ExternalProject)
|
||||
set_directory_properties(PROPERTIES EP_PREFIX "${DEPS_BUILD_DIR}")
|
||||
|
||||
set(LIBUV_URL https://github.com/libuv/libuv/archive/v1.46.0.tar.gz)
|
||||
set(LIBUV_SHA256 7aa66be3413ae10605e1f5c9ae934504ffe317ef68ea16fdaa83e23905c681bd)
|
||||
|
||||
set(MSGPACK_URL https://github.com/msgpack/msgpack-c/releases/download/c-6.0.0/msgpack-c-6.0.0.tar.gz)
|
||||
set(MSGPACK_SHA256 3654f5e2c652dc52e0a993e270bb57d5702b262703f03771c152bba51602aeba)
|
||||
|
||||
# https://github.com/LuaJIT/LuaJIT/tree/v2.1
|
||||
set(LUAJIT_URL https://github.com/LuaJIT/LuaJIT/archive/03c31124cc3b521ef54fe398e10fa55660a5057d.tar.gz)
|
||||
set(LUAJIT_SHA256 61dcc7ae3f543ae3cc30e66db060e31e2a77e4be34ee65e370c953d112b4d60c)
|
||||
|
||||
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.9.2.tar.gz)
|
||||
set(LUAROCKS_SHA256 a0b36cd68586cd79966d0106bb2e5a4f5523327867995fd66bee4237062b3e3b)
|
||||
|
||||
set(UNIBILIUM_URL https://github.com/neovim/unibilium/archive/d72c3598e7ac5d1ebf86ee268b8b4ed95c0fa628.tar.gz)
|
||||
set(UNIBILIUM_SHA256 9c4747c862ab5e3076dcf8fa8f0ea7a6b50f20ec5905618b9536655596797487)
|
||||
|
||||
set(LIBTERMKEY_URL https://github.com/neovim/deps/raw/aa004f1b2b6470a92363cba8e1cc1874141dacc4/opt/libtermkey-0.22.tar.gz)
|
||||
set(LIBTERMKEY_SHA256 6945bd3c4aaa83da83d80a045c5563da4edd7d0374c62c0d35aec09eb3014600)
|
||||
|
||||
set(LIBVTERM_URL https://github.com/neovim/deps/raw/12c9dcf1d823ac4acbccf494c93c4774a87db11d/opt/libvterm-0.3.3.tar.gz)
|
||||
set(LIBVTERM_SHA256 09156f43dd2128bd347cbeebe50d9a571d32c64e0cf18d211197946aff7226e0)
|
||||
|
||||
set(LUV_URL https://github.com/luvit/luv/archive/1.45.0-0.tar.gz)
|
||||
set(LUV_SHA256 97e89940f9eeaa8dfb34f1c19f80dd373299c42719d15228ec790f415d4e4965)
|
||||
|
||||
set(LUA_COMPAT53_URL https://github.com/keplerproject/lua-compat-5.3/archive/v0.9.tar.gz)
|
||||
set(LUA_COMPAT53_SHA256 ad05540d2d96a48725bb79a1def35cf6652a4e2ec26376e2617c8ce2baa6f416)
|
||||
|
||||
# Windows only: cat.exe diff.exe tee.exe xxd.exe
|
||||
set(CAT_URL https://github.com/neovim/deps/raw/21c5e8bdda33521a6ed497b315e03265a2785cbc/opt/cat.exe)
|
||||
set(CAT_SHA256 93b8d307bb15af3968920bdea3beb869a49d166f9164853c58a4e6ffdcae61c6)
|
||||
set(DIFF_URL https://github.com/neovim/deps/raw/21c5e8bdda33521a6ed497b315e03265a2785cbc/opt/diff.exe)
|
||||
set(DIFF_SHA256 4ceceebc8150422c6d8d9a06c2e9686d5a5d90f1033f60ad92ab81fe810e2a28)
|
||||
set(TEE_URL https://github.com/neovim/deps/raw/21c5e8bdda33521a6ed497b315e03265a2785cbc/opt/tee.exe)
|
||||
set(TEE_SHA256 950eea4e17fa3a7e89fa2c55374037b5797b3f1a54fea1304634884ab42ec14d)
|
||||
set(XXD_URL https://github.com/neovim/deps/raw/21c5e8bdda33521a6ed497b315e03265a2785cbc/opt/xxd.exe)
|
||||
set(XXD_SHA256 7a581e3882d28161cc52850f9a11d634b3eaf2c029276f093c1ed4c90e45a10c)
|
||||
|
||||
set(WINGUI_URL https://github.com/equalsraf/neovim-qt/releases/download/v0.2.17/neovim-qt.zip)
|
||||
set(WINGUI_SHA256 502e386eef677c2c2e0c11d8cbb27f3e12b4d96818369417e8da4129c4580c25)
|
||||
|
||||
set(WIN32YANK_X86_64_URL https://github.com/equalsraf/win32yank/releases/download/v0.1.1/win32yank-x64.zip)
|
||||
set(WIN32YANK_X86_64_SHA256 247c9a05b94387a884b49d3db13f806b1677dfc38020f955f719be6902260cd6)
|
||||
|
||||
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.5.tar.gz)
|
||||
set(TREESITTER_C_SHA256 694a5408246ee45d535df9df025febecdb50bee764df64a94346b9805a5f349b )
|
||||
set(TREESITTER_LUA_URL https://github.com/MunifTanjim/tree-sitter-lua/archive/v0.0.18.tar.gz)
|
||||
set(TREESITTER_LUA_SHA256 659beef871a7fa1d9a02c23f5ebf55019aa3adce6d7f5441947781e128845256)
|
||||
set(TREESITTER_VIM_URL https://github.com/neovim/tree-sitter-vim/archive/v0.3.0.tar.gz)
|
||||
set(TREESITTER_VIM_SHA256 403acec3efb7cdb18ff3d68640fc823502a4ffcdfbb71cec3f98aa786c21cbe2)
|
||||
set(TREESITTER_VIMDOC_URL https://github.com/neovim/tree-sitter-vimdoc/archive/v2.0.0.tar.gz)
|
||||
set(TREESITTER_VIMDOC_SHA256 1ff8f4afd3a9599dd4c3ce87c155660b078c1229704d1a254433e33794b8f274)
|
||||
set(TREESITTER_QUERY_URL https://github.com/nvim-treesitter/tree-sitter-query/archive/v0.1.0.tar.gz)
|
||||
set(TREESITTER_QUERY_SHA256 e2b806f80e8bf1c4f4e5a96248393fe6622fc1fc6189d6896d269658f67f914c)
|
||||
set(TREESITTER_URL https://github.com/tree-sitter/tree-sitter/archive/v0.20.8.tar.gz)
|
||||
set(TREESITTER_SHA256 6181ede0b7470bfca37e293e7d5dc1d16469b9485d13f13a605baec4a8b1f791)
|
||||
|
||||
if(USE_EXISTING_SRC_DIR)
|
||||
get_cmake_property(VARS VARIABLES)
|
||||
foreach (VAR ${VARS})
|
||||
if(VAR MATCHES "^.*URL$")
|
||||
unset(${VAR})
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
if(USE_BUNDLED_UNIBILIUM)
|
||||
include(BuildUnibilium)
|
||||
endif()
|
||||
|
||||
if(USE_BUNDLED_LIBTERMKEY)
|
||||
include(BuildLibtermkey)
|
||||
if(USE_BUNDLED_UNIBILIUM)
|
||||
add_dependencies(libtermkey unibilium)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(USE_BUNDLED_LIBVTERM)
|
||||
include(BuildLibvterm)
|
||||
endif()
|
||||
|
||||
if(USE_BUNDLED_LIBUV)
|
||||
include(BuildLibuv)
|
||||
endif()
|
||||
|
||||
if(USE_BUNDLED_MSGPACK)
|
||||
include(BuildMsgpack)
|
||||
endif()
|
||||
|
||||
if(USE_BUNDLED_LUAJIT)
|
||||
include(BuildLuajit)
|
||||
endif()
|
||||
|
||||
if(USE_BUNDLED_LUA)
|
||||
include(BuildLua)
|
||||
endif()
|
||||
|
||||
if(USE_BUNDLED_LUAROCKS)
|
||||
include(BuildLuarocks)
|
||||
endif()
|
||||
|
||||
if(USE_BUNDLED_LUV)
|
||||
include(BuildLuv)
|
||||
endif()
|
||||
|
||||
if(USE_BUNDLED_GETTEXT)
|
||||
include(BuildGettext)
|
||||
endif()
|
||||
|
||||
if(USE_BUNDLED_LIBICONV)
|
||||
include(BuildLibiconv)
|
||||
endif()
|
||||
|
||||
if(USE_BUNDLED_TS_PARSERS)
|
||||
include(BuildTreesitterParsers)
|
||||
endif()
|
||||
|
||||
if(USE_BUNDLED_TS)
|
||||
include(BuildTreesitter)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
include(GetBinaryDeps)
|
||||
|
||||
GetExecutable(TARGET cat)
|
||||
GetExecutable(TARGET diff)
|
||||
GetExecutable(TARGET tee)
|
||||
GetExecutable(TARGET xxd)
|
||||
|
||||
if(USE_BUNDLED_NVIMQT)
|
||||
GetBinaryDep(TARGET wingui
|
||||
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory bin ${DEPS_BIN_DIR}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory share ${DEPS_INSTALL_DIR}/share)
|
||||
endif()
|
||||
|
||||
GetBinaryDep(TARGET win32yank_X86_64
|
||||
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy win32yank.exe ${DEPS_BIN_DIR})
|
||||
endif()
|
@ -1,20 +0,0 @@
|
||||
if(MSVC)
|
||||
ExternalProject_Add(gettext
|
||||
URL ${GETTEXT_URL}
|
||||
URL_HASH SHA256=${GETTEXT_SHA256}
|
||||
DOWNLOAD_NO_PROGRESS TRUE
|
||||
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/gettext
|
||||
PATCH_COMMAND ${CMAKE_COMMAND} -E copy
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cmake/GettextCMakeLists.txt
|
||||
${DEPS_BUILD_DIR}/src/gettext/CMakeLists.txt
|
||||
CMAKE_ARGS ${DEPS_CMAKE_ARGS}
|
||||
-D LIBICONV_INCLUDE_DIRS=${DEPS_INSTALL_DIR}/include
|
||||
-D LIBICONV_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}
|
||||
CMAKE_CACHE_ARGS ${DEPS_CMAKE_CACHE_ARGS})
|
||||
else()
|
||||
message(FATAL_ERROR "Trying to build gettext in an unsupported system ${CMAKE_SYSTEM_NAME}/${CMAKE_C_COMPILER_ID}")
|
||||
endif()
|
||||
|
||||
if(USE_BUNDLED_LIBICONV)
|
||||
add_dependencies(gettext libiconv)
|
||||
endif()
|
@ -1,14 +0,0 @@
|
||||
if(MSVC)
|
||||
ExternalProject_Add(libiconv
|
||||
URL ${LIBICONV_URL}
|
||||
URL_HASH SHA256=${LIBICONV_SHA256}
|
||||
DOWNLOAD_NO_PROGRESS TRUE
|
||||
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/libiconv
|
||||
PATCH_COMMAND ${CMAKE_COMMAND} -E copy
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cmake/LibiconvCMakeLists.txt
|
||||
${DEPS_BUILD_DIR}/src/libiconv/CMakeLists.txt
|
||||
CMAKE_ARGS ${DEPS_CMAKE_ARGS}
|
||||
CMAKE_CACHE_ARGS ${DEPS_CMAKE_CACHE_ARGS})
|
||||
else()
|
||||
message(FATAL_ERROR "Trying to build libiconv in an unsupported system ${CMAKE_SYSTEM_NAME}/${CMAKE_C_COMPILER_ID}")
|
||||
endif()
|
@ -1,13 +0,0 @@
|
||||
ExternalProject_Add(libtermkey
|
||||
URL ${LIBTERMKEY_URL}
|
||||
URL_HASH SHA256=${LIBTERMKEY_SHA256}
|
||||
DOWNLOAD_NO_PROGRESS TRUE
|
||||
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/libtermkey
|
||||
PATCH_COMMAND ${CMAKE_COMMAND} -E copy
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cmake/LibtermkeyCMakeLists.txt
|
||||
${DEPS_BUILD_DIR}/src/libtermkey/CMakeLists.txt
|
||||
CMAKE_ARGS ${DEPS_CMAKE_ARGS}
|
||||
-D CMAKE_SHARED_LIBRARY_LINK_C_FLAGS="" # Hack to avoid -rdynamic in Mingw
|
||||
-D UNIBILIUM_INCLUDE_DIRS=${DEPS_INSTALL_DIR}/include
|
||||
-D UNIBILIUM_LIBRARIES=${DEPS_LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}unibilium${CMAKE_STATIC_LIBRARY_SUFFIX}
|
||||
CMAKE_CACHE_ARGS ${DEPS_CMAKE_CACHE_ARGS})
|
@ -1,10 +0,0 @@
|
||||
ExternalProject_Add(libuv
|
||||
URL ${LIBUV_URL}
|
||||
URL_HASH SHA256=${LIBUV_SHA256}
|
||||
DOWNLOAD_NO_PROGRESS TRUE
|
||||
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/libuv
|
||||
CMAKE_ARGS ${DEPS_CMAKE_ARGS}
|
||||
-D CMAKE_INSTALL_LIBDIR=lib
|
||||
-D BUILD_TESTING=OFF
|
||||
-D LIBUV_BUILD_SHARED=OFF
|
||||
CMAKE_CACHE_ARGS ${DEPS_CMAKE_CACHE_ARGS})
|
@ -1,10 +0,0 @@
|
||||
ExternalProject_Add(libvterm
|
||||
URL ${LIBVTERM_URL}
|
||||
URL_HASH SHA256=${LIBVTERM_SHA256}
|
||||
DOWNLOAD_NO_PROGRESS TRUE
|
||||
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/libvterm
|
||||
PATCH_COMMAND ${CMAKE_COMMAND} -E copy
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cmake/LibvtermCMakeLists.txt
|
||||
${DEPS_BUILD_DIR}/src/libvterm/CMakeLists.txt
|
||||
CMAKE_ARGS ${DEPS_CMAKE_ARGS}
|
||||
CMAKE_CACHE_ARGS ${DEPS_CMAKE_CACHE_ARGS})
|
@ -1,62 +0,0 @@
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
set(LUA_TARGET linux)
|
||||
elseif(APPLE)
|
||||
set(LUA_TARGET macosx)
|
||||
elseif(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
|
||||
set(LUA_TARGET freebsd)
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES "BSD")
|
||||
set(CMAKE_LUA_TARGET bsd)
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES "^MINGW")
|
||||
set(CMAKE_LUA_TARGET mingw)
|
||||
else()
|
||||
if(UNIX)
|
||||
set(LUA_TARGET posix)
|
||||
else()
|
||||
set(LUA_TARGET generic)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(LUA_CFLAGS "-O0 -g3 -fPIC")
|
||||
set(LUA_LDFLAGS "")
|
||||
|
||||
if(ENABLE_ASAN_UBSAN)
|
||||
set(LUA_CFLAGS "${LUA_CFLAGS} -fsanitize=address")
|
||||
set(LUA_CFLAGS "${LUA_CFLAGS} -fno-omit-frame-pointer")
|
||||
set(LUA_CFLAGS "${LUA_CFLAGS} -fno-optimize-sibling-calls")
|
||||
|
||||
set(LUA_LDFLAGS "${LUA_LDFLAGS} -fsanitize=address")
|
||||
endif()
|
||||
|
||||
set(LUA_CONFIGURE_COMMAND
|
||||
sed -e "/^CC/s@gcc@${CMAKE_C_COMPILER}@"
|
||||
-e "/^CFLAGS/s@-O2@${LUA_CFLAGS}@"
|
||||
-e "/^MYLDFLAGS/s@$@${LUA_LDFLAGS}@"
|
||||
-e "s@-lreadline@@g"
|
||||
-e "s@-lhistory@@g"
|
||||
-e "s@-lncurses@@g"
|
||||
-i ${DEPS_BUILD_DIR}/src/lua/src/Makefile &&
|
||||
sed -e "/#define LUA_USE_READLINE/d"
|
||||
-e "s@\\(#define LUA_ROOT[ ]*\"\\)/usr/local@\\1${DEPS_INSTALL_DIR}@"
|
||||
-i ${DEPS_BUILD_DIR}/src/lua/src/luaconf.h)
|
||||
set(LUA_INSTALL_TOP_ARG "INSTALL_TOP=${DEPS_INSTALL_DIR}")
|
||||
|
||||
message(STATUS "Lua target is ${LUA_TARGET}")
|
||||
|
||||
ExternalProject_Add(lua
|
||||
URL ${LUA_URL}
|
||||
URL_HASH SHA256=${LUA_SHA256}
|
||||
DOWNLOAD_NO_PROGRESS TRUE
|
||||
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/lua
|
||||
CONFIGURE_COMMAND "${LUA_CONFIGURE_COMMAND}"
|
||||
BUILD_IN_SOURCE 1
|
||||
BUILD_COMMAND ${MAKE_PRG} ${LUA_INSTALL_TOP_ARG} ${LUA_TARGET}
|
||||
INSTALL_COMMAND ${MAKE_PRG} ${LUA_INSTALL_TOP_ARG} install)
|
||||
|
||||
set(BUSTED ${DEPS_BIN_DIR}/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 ALL
|
||||
DEPENDS ${DEPS_BIN_DIR}/busted-lua)
|
@ -1,146 +0,0 @@
|
||||
# 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)
|
||||
cmake_parse_arguments(_luajit
|
||||
""
|
||||
"TARGET"
|
||||
"CONFIGURE_COMMAND;BUILD_COMMAND;INSTALL_COMMAND;DEPENDS"
|
||||
${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()
|
||||
|
||||
ExternalProject_Add(${_luajit_TARGET}
|
||||
URL ${LUAJIT_URL}
|
||||
URL_HASH SHA256=${LUAJIT_SHA256}
|
||||
DOWNLOAD_NO_PROGRESS TRUE
|
||||
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/luajit
|
||||
CONFIGURE_COMMAND "${_luajit_CONFIGURE_COMMAND}"
|
||||
BUILD_IN_SOURCE 1
|
||||
BUILD_COMMAND "${_luajit_BUILD_COMMAND}"
|
||||
INSTALL_COMMAND "${_luajit_INSTALL_COMMAND}"
|
||||
DEPENDS "${_luajit_DEPENDS}")
|
||||
endfunction()
|
||||
|
||||
check_c_compiler_flag(-fno-stack-check HAS_NO_STACK_CHECK)
|
||||
if(APPLE AND HAS_NO_STACK_CHECK)
|
||||
set(NO_STACK_CHECK "CFLAGS+=-fno-stack-check")
|
||||
else()
|
||||
set(NO_STACK_CHECK "")
|
||||
endif()
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
|
||||
set(AMD64_ABI "LDFLAGS=-lpthread -lc++abi")
|
||||
else()
|
||||
set(AMD64_ABI "")
|
||||
endif()
|
||||
set(BUILDCMD_UNIX ${MAKE_PRG} -j CFLAGS=-fPIC
|
||||
CFLAGS+=-DLUA_USE_APICHECK
|
||||
CFLAGS+=-funwind-tables
|
||||
${NO_STACK_CHECK}
|
||||
${AMD64_ABI}
|
||||
CCDEBUG+=-g
|
||||
Q=)
|
||||
|
||||
# Setting MACOSX_DEPLOYMENT_TARGET is mandatory for LuaJIT; use version set by
|
||||
# cmake.deps/CMakeLists.txt (either environment variable or current system version).
|
||||
if(APPLE)
|
||||
set(DEPLOYMENT_TARGET "MACOSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}")
|
||||
endif()
|
||||
|
||||
if((UNIX AND NOT APPLE) OR (APPLE AND NOT CMAKE_OSX_ARCHITECTURES))
|
||||
BuildLuaJit(INSTALL_COMMAND ${BUILDCMD_UNIX}
|
||||
CC=${DEPS_C_COMPILER} PREFIX=${DEPS_INSTALL_DIR}
|
||||
${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)
|
||||
|
||||
if(CMAKE_GENERATOR MATCHES "Ninja")
|
||||
set(LUAJIT_MAKE_PRG ${MAKE_PRG})
|
||||
else()
|
||||
set(LUAJIT_MAKE_PRG ${CMAKE_MAKE_PROGRAM})
|
||||
endif()
|
||||
BuildLuaJit(BUILD_COMMAND ${LUAJIT_MAKE_PRG} CC=${DEPS_C_COMPILER}
|
||||
PREFIX=${DEPS_INSTALL_DIR}
|
||||
CFLAGS+=-DLUA_USE_APICHECK
|
||||
CFLAGS+=-funwind-tables
|
||||
CCDEBUG+=-g
|
||||
BUILDMODE=static
|
||||
# Build a DLL too
|
||||
COMMAND ${LUAJIT_MAKE_PRG} CC=${DEPS_C_COMPILER} BUILDMODE=dynamic
|
||||
|
||||
INSTALL_COMMAND ${CMAKE_COMMAND} -E make_directory ${DEPS_BIN_DIR}
|
||||
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/lua51.dll ${DEPS_BIN_DIR}
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${DEPS_LIB_DIR}
|
||||
# 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/libluajit.a ${DEPS_LIB_DIR}
|
||||
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} -E copy_directory ${DEPS_BUILD_DIR}/src/luajit/src/jit ${DEPS_INSTALL_DIR}/share/luajit-2.1/jit
|
||||
)
|
||||
elseif(MSVC)
|
||||
|
||||
BuildLuaJit(
|
||||
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}
|
||||
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/lua51.dll ${DEPS_BIN_DIR}
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${DEPS_LIB_DIR}
|
||||
# Luarocks searches for lua51.lib
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${DEPS_BUILD_DIR}/src/luajit/src/lua51.lib ${DEPS_LIB_DIR}/lua51.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 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} -E copy_directory ${DEPS_BUILD_DIR}/src/luajit/src/jit ${DEPS_INSTALL_DIR}/share/luajit-2.1/jit
|
||||
)
|
||||
else()
|
||||
message(FATAL_ERROR "Trying to build luajit in an unsupported system ${CMAKE_SYSTEM_NAME}/${CMAKE_C_COMPILER_ID}")
|
||||
endif()
|
||||
|
||||
if (NOT MSVC)
|
||||
add_custom_target(clean_shared_libraries_luajit ALL
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
-D REMOVE_FILE_GLOB=${DEPS_LIB_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}*${CMAKE_SHARED_LIBRARY_SUFFIX}*
|
||||
-P ${PROJECT_SOURCE_DIR}/cmake/RemoveFiles.cmake)
|
||||
add_dependencies(clean_shared_libraries_luajit luajit)
|
||||
endif()
|
@ -1,160 +0,0 @@
|
||||
# Luarocks recipe. Luarocks is only required when building Neovim.
|
||||
# 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 ${DEPS_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=${DEPS_C_COMPILER} LD=${DEPS_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=${DEPS_INSTALL_DIR}
|
||||
--with-lua-include=${DEPS_INSTALL_DIR}/include/luajit-2.1
|
||||
--with-lua-interpreter=luajit)
|
||||
elseif(USE_BUNDLED_LUA)
|
||||
list(APPEND LUAROCKS_OPTS
|
||||
--with-lua=${DEPS_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=${DEPS_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
|
||||
URL ${LUAROCKS_URL}
|
||||
URL_HASH SHA256=${LUAROCKS_SHA256}
|
||||
DOWNLOAD_NO_PROGRESS TRUE
|
||||
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/luarocks
|
||||
BUILD_IN_SOURCE 1
|
||||
CONFIGURE_COMMAND "${LUAROCKS_CONFIGURE_COMMAND}"
|
||||
BUILD_COMMAND ""
|
||||
INSTALL_COMMAND "${LUAROCKS_INSTALL_COMMAND}")
|
||||
|
||||
if(USE_BUNDLED_LUAJIT)
|
||||
add_dependencies(luarocks luajit)
|
||||
elseif(USE_BUNDLED_LUA)
|
||||
add_dependencies(luarocks lua)
|
||||
endif()
|
||||
set(ROCKS_DIR ${DEPS_LIB_DIR}/luarocks/rocks-${LUA_VERSION})
|
||||
|
||||
if(MSVC)
|
||||
# Workaround for luarocks failing to find the md5sum.exe it is shipped with.
|
||||
list(APPEND LUAROCKS_BUILDARGS MD5SUM=md5sum)
|
||||
set(PATH PATH=${DEPS_INSTALL_DIR}/luarocks/tools;$ENV{PATH})
|
||||
endif()
|
||||
|
||||
# mpack
|
||||
add_custom_command(OUTPUT ${ROCKS_DIR}/mpack
|
||||
COMMAND ${CMAKE_COMMAND} -E env "${PATH}" ${LUAROCKS_BINARY} build mpack 1.0.10-0 ${LUAROCKS_BUILDARGS}
|
||||
DEPENDS luarocks)
|
||||
add_custom_target(mpack ALL DEPENDS ${ROCKS_DIR}/mpack)
|
||||
|
||||
# lpeg
|
||||
add_custom_command(OUTPUT ${ROCKS_DIR}/lpeg
|
||||
COMMAND ${CMAKE_COMMAND} -E env "${PATH}" ${LUAROCKS_BINARY} build lpeg 1.0.2-1 ${LUAROCKS_BUILDARGS}
|
||||
DEPENDS mpack)
|
||||
add_custom_target(lpeg ALL DEPENDS ${ROCKS_DIR}/lpeg)
|
||||
|
||||
if((NOT USE_BUNDLED_LUAJIT) AND USE_BUNDLED_LUA)
|
||||
# luabitop
|
||||
add_custom_command(OUTPUT ${ROCKS_DIR}/luabitop
|
||||
COMMAND ${CMAKE_COMMAND} -E env "${PATH}" ${LUAROCKS_BINARY} build luabitop 1.0.2-3 ${LUAROCKS_BUILDARGS}
|
||||
DEPENDS lpeg)
|
||||
add_custom_target(luabitop ALL DEPENDS ${ROCKS_DIR}/luabitop)
|
||||
endif()
|
||||
|
||||
if(USE_BUNDLED_BUSTED)
|
||||
if((NOT USE_BUNDLED_LUAJIT) AND USE_BUNDLED_LUA)
|
||||
set(BUSTED_DEPENDS luabitop)
|
||||
else()
|
||||
set(BUSTED_DEPENDS lpeg)
|
||||
endif()
|
||||
|
||||
# busted
|
||||
if(WIN32)
|
||||
set(BUSTED_EXE "${DEPS_BIN_DIR}/busted.bat")
|
||||
set(LUACHECK_EXE "${DEPS_BIN_DIR}/luacheck.bat")
|
||||
else()
|
||||
set(BUSTED_EXE "${DEPS_BIN_DIR}/busted")
|
||||
set(LUACHECK_EXE "${DEPS_BIN_DIR}/luacheck")
|
||||
endif()
|
||||
add_custom_command(OUTPUT ${BUSTED_EXE}
|
||||
COMMAND ${CMAKE_COMMAND} -E env "${PATH}" ${LUAROCKS_BINARY} build busted 2.1.1 ${LUAROCKS_BUILDARGS}
|
||||
DEPENDS ${BUSTED_DEPENDS})
|
||||
add_custom_target(busted ALL DEPENDS ${BUSTED_EXE})
|
||||
|
||||
# luacheck
|
||||
add_custom_command(OUTPUT ${LUACHECK_EXE}
|
||||
COMMAND ${CMAKE_COMMAND} -E env "${PATH}" ${LUAROCKS_BINARY} build luacheck 1.1.0-1 ${LUAROCKS_BUILDARGS}
|
||||
DEPENDS busted)
|
||||
add_custom_target(luacheck ALL DEPENDS ${LUACHECK_EXE})
|
||||
|
||||
if (USE_BUNDLED_LUA OR NOT USE_BUNDLED_LUAJIT)
|
||||
# coxpcall
|
||||
add_custom_command(OUTPUT ${ROCKS_DIR}/coxpcall
|
||||
COMMAND ${CMAKE_COMMAND} -E env "${PATH}" ${LUAROCKS_BINARY} build coxpcall 1.17.0-1 ${LUAROCKS_BUILDARGS}
|
||||
DEPENDS luarocks)
|
||||
add_custom_target(coxpcall ALL DEPENDS ${ROCKS_DIR}/coxpcall)
|
||||
endif()
|
||||
endif()
|
@ -1,62 +0,0 @@
|
||||
set(LUV_INCLUDE_FLAGS
|
||||
"-I${DEPS_INSTALL_DIR}/include -I${DEPS_INSTALL_DIR}/include/luajit-2.1")
|
||||
|
||||
set(LUV_CMAKE_ARGS
|
||||
-D LUA_BUILD_TYPE=System
|
||||
-D LUA_COMPAT53_DIR=${DEPS_BUILD_DIR}/src/lua-compat-5.3
|
||||
-D WITH_SHARED_LIBUV=ON
|
||||
-D BUILD_SHARED_LIBS=OFF
|
||||
-D BUILD_STATIC_LIBS=ON
|
||||
-D BUILD_MODULE=OFF)
|
||||
|
||||
if(USE_BUNDLED_LUAJIT)
|
||||
list(APPEND LUV_CMAKE_ARGS -D WITH_LUA_ENGINE=LuaJit)
|
||||
elseif(USE_BUNDLED_LUA)
|
||||
list(APPEND LUV_CMAKE_ARGS -D WITH_LUA_ENGINE=Lua)
|
||||
else()
|
||||
find_package(Luajit)
|
||||
if(LUAJIT_FOUND)
|
||||
list(APPEND LUV_CMAKE_ARGS -D WITH_LUA_ENGINE=LuaJit)
|
||||
else()
|
||||
list(APPEND LUV_CMAKE_ARGS -D WITH_LUA_ENGINE=Lua)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(USE_BUNDLED_LIBUV)
|
||||
list(APPEND LUV_CMAKE_ARGS -D CMAKE_PREFIX_PATH=${DEPS_INSTALL_DIR})
|
||||
endif()
|
||||
|
||||
list(APPEND LUV_CMAKE_ARGS
|
||||
"-DCMAKE_C_FLAGS:STRING=${LUV_INCLUDE_FLAGS}")
|
||||
if(CMAKE_GENERATOR MATCHES "Unix Makefiles" AND
|
||||
(CMAKE_SYSTEM_NAME MATCHES ".*BSD" OR CMAKE_SYSTEM_NAME MATCHES "DragonFly"))
|
||||
list(APPEND LUV_CMAKE_ARGS -D CMAKE_MAKE_PROGRAM=gmake)
|
||||
endif()
|
||||
|
||||
ExternalProject_Add(lua-compat-5.3
|
||||
URL ${LUA_COMPAT53_URL}
|
||||
URL_HASH SHA256=${LUA_COMPAT53_SHA256}
|
||||
DOWNLOAD_NO_PROGRESS TRUE
|
||||
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/lua-compat-5.3
|
||||
CONFIGURE_COMMAND ""
|
||||
BUILD_COMMAND ""
|
||||
INSTALL_COMMAND "")
|
||||
|
||||
ExternalProject_Add(luv-static
|
||||
DEPENDS lua-compat-5.3
|
||||
URL ${LUV_URL}
|
||||
URL_HASH SHA256=${LUV_SHA256}
|
||||
DOWNLOAD_NO_PROGRESS TRUE
|
||||
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/luv
|
||||
SOURCE_DIR ${DEPS_BUILD_DIR}/src/luv
|
||||
CMAKE_ARGS ${DEPS_CMAKE_ARGS} ${LUV_CMAKE_ARGS}
|
||||
CMAKE_CACHE_ARGS ${DEPS_CMAKE_CACHE_ARGS})
|
||||
|
||||
if(USE_BUNDLED_LUAJIT)
|
||||
add_dependencies(luv-static luajit)
|
||||
elseif(USE_BUNDLED_LUA)
|
||||
add_dependencies(luv-static lua)
|
||||
endif()
|
||||
if(USE_BUNDLED_LIBUV)
|
||||
add_dependencies(luv-static libuv)
|
||||
endif()
|
@ -1,17 +0,0 @@
|
||||
ExternalProject_Add(msgpack
|
||||
URL ${MSGPACK_URL}
|
||||
URL_HASH SHA256=${MSGPACK_SHA256}
|
||||
DOWNLOAD_NO_PROGRESS TRUE
|
||||
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/msgpack
|
||||
CMAKE_ARGS ${DEPS_CMAKE_ARGS}
|
||||
-D MSGPACK_BUILD_TESTS=OFF
|
||||
-D MSGPACK_BUILD_EXAMPLES=OFF
|
||||
CMAKE_CACHE_ARGS ${DEPS_CMAKE_CACHE_ARGS})
|
||||
|
||||
if (NOT MSVC)
|
||||
add_custom_target(clean_shared_libraries_msgpack ALL
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
-D REMOVE_FILE_GLOB=${DEPS_LIB_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}*${CMAKE_SHARED_LIBRARY_SUFFIX}*
|
||||
-P ${PROJECT_SOURCE_DIR}/cmake/RemoveFiles.cmake)
|
||||
add_dependencies(clean_shared_libraries_msgpack msgpack)
|
||||
endif()
|
@ -1,11 +0,0 @@
|
||||
ExternalProject_Add(treesitter
|
||||
URL ${TREESITTER_URL}
|
||||
URL_HASH SHA256=${TREESITTER_SHA256}
|
||||
DOWNLOAD_NO_PROGRESS TRUE
|
||||
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/treesitter
|
||||
INSTALL_DIR ${DEPS_INSTALL_DIR}
|
||||
PATCH_COMMAND ${CMAKE_COMMAND} -E copy
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cmake/TreesitterCMakeLists.txt
|
||||
${DEPS_BUILD_DIR}/src/treesitter/CMakeLists.txt
|
||||
CMAKE_ARGS ${DEPS_CMAKE_ARGS}
|
||||
CMAKE_CACHE_ARGS ${DEPS_CMAKE_CACHE_ARGS})
|
@ -1,39 +0,0 @@
|
||||
# Helper function to download treesitter parsers
|
||||
#
|
||||
# Single value arguments:
|
||||
# LANG - Parser language
|
||||
# CMAKE_FILE - Cmake file to build the parser with. Defaults to
|
||||
# TreesitterParserCMakeLists.txt.
|
||||
function(BuildTSParser)
|
||||
cmake_parse_arguments(TS
|
||||
""
|
||||
"LANG;CMAKE_FILE"
|
||||
""
|
||||
${ARGN})
|
||||
|
||||
if(NOT TS_CMAKE_FILE)
|
||||
set(TS_CMAKE_FILE TreesitterParserCMakeLists.txt)
|
||||
endif()
|
||||
|
||||
set(NAME treesitter-${TS_LANG})
|
||||
string(TOUPPER "TREESITTER_${TS_LANG}_URL" URL_VARNAME)
|
||||
set(URL ${${URL_VARNAME}})
|
||||
string(TOUPPER "TREESITTER_${TS_LANG}_SHA256" HASH_VARNAME)
|
||||
set(HASH ${${HASH_VARNAME}})
|
||||
|
||||
ExternalProject_Add(${NAME}
|
||||
URL ${URL}
|
||||
URL_HASH SHA256=${HASH}
|
||||
DOWNLOAD_NO_PROGRESS TRUE
|
||||
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/${NAME}
|
||||
PATCH_COMMAND ${CMAKE_COMMAND} -E copy
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cmake/${TS_CMAKE_FILE}
|
||||
${DEPS_BUILD_DIR}/src/${NAME}/CMakeLists.txt
|
||||
CMAKE_ARGS ${DEPS_CMAKE_ARGS}
|
||||
-D PARSERLANG=${TS_LANG}
|
||||
CMAKE_CACHE_ARGS ${DEPS_CMAKE_CACHE_ARGS})
|
||||
endfunction()
|
||||
|
||||
foreach(lang c lua vim vimdoc query)
|
||||
BuildTSParser(LANG ${lang})
|
||||
endforeach()
|
@ -1,7 +0,0 @@
|
||||
ExternalProject_Add(unibilium
|
||||
URL ${UNIBILIUM_URL}
|
||||
URL_HASH SHA256=${UNIBILIUM_SHA256}
|
||||
DOWNLOAD_NO_PROGRESS TRUE
|
||||
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/unibilium
|
||||
CMAKE_ARGS ${DEPS_CMAKE_ARGS}
|
||||
CMAKE_CACHE_ARGS ${DEPS_CMAKE_CACHE_ARGS})
|
@ -1,53 +0,0 @@
|
||||
# This is similar to the build recipes, but instead downloads a third party
|
||||
# binary and installs it under the DEPS_PREFIX.
|
||||
# The INSTALL_COMMAND is executed in the folder where downloaded files are
|
||||
# extracted and the ${DEPS_INSTALL_DIR} holds the path to the third-party
|
||||
# install root.
|
||||
function(GetBinaryDep)
|
||||
cmake_parse_arguments(_gettool
|
||||
"BUILD_IN_SOURCE"
|
||||
"TARGET"
|
||||
"INSTALL_COMMAND"
|
||||
${ARGN})
|
||||
|
||||
string(TOUPPER "${_gettool_TARGET}_URL" URL_VARNAME)
|
||||
string(TOUPPER "${_gettool_TARGET}_SHA256" HASH_VARNAME)
|
||||
set(URL ${${URL_VARNAME}})
|
||||
set(HASH ${${HASH_VARNAME}})
|
||||
|
||||
ExternalProject_Add(${_gettool_TARGET}
|
||||
URL ${URL}
|
||||
URL_HASH SHA256=${HASH}
|
||||
DOWNLOAD_NO_PROGRESS TRUE
|
||||
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}
|
||||
CONFIGURE_COMMAND ""
|
||||
BUILD_IN_SOURCE 1
|
||||
BUILD_COMMAND ""
|
||||
INSTALL_COMMAND ${CMAKE_COMMAND} -E make_directory ${DEPS_BIN_DIR}
|
||||
COMMAND "${_gettool_INSTALL_COMMAND}")
|
||||
endfunction()
|
||||
|
||||
# Download executable and move it to DEPS_BIN_DIR
|
||||
function(GetExecutable)
|
||||
cmake_parse_arguments(ARG
|
||||
""
|
||||
"TARGET"
|
||||
""
|
||||
${ARGN})
|
||||
|
||||
string(TOUPPER "${ARG_TARGET}_URL" URL_VARNAME)
|
||||
string(TOUPPER "${ARG_TARGET}_SHA256" HASH_VARNAME)
|
||||
set(URL ${${URL_VARNAME}})
|
||||
set(HASH ${${HASH_VARNAME}})
|
||||
|
||||
ExternalProject_Add(${ARG_TARGET}
|
||||
URL ${URL}
|
||||
URL_HASH SHA256=${HASH}
|
||||
DOWNLOAD_NO_PROGRESS TRUE
|
||||
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}
|
||||
DOWNLOAD_NO_EXTRACT TRUE
|
||||
CONFIGURE_COMMAND ""
|
||||
BUILD_COMMAND ""
|
||||
INSTALL_COMMAND ${CMAKE_COMMAND} -E make_directory ${DEPS_BIN_DIR}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy <DOWNLOADED_FILE> ${DEPS_BIN_DIR})
|
||||
endfunction()
|
@ -1,30 +0,0 @@
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
project(libvterm C)
|
||||
|
||||
include(GNUInstallDirs)
|
||||
|
||||
if(MSVC)
|
||||
add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE)
|
||||
endif()
|
||||
|
||||
include_directories(${CMAKE_SOURCE_DIR}/include)
|
||||
include_directories(${CMAKE_BINARY_DIR})
|
||||
|
||||
file(GLOB VTERM_SOURCES ${CMAKE_SOURCE_DIR}/src/*.c)
|
||||
add_library(vterm ${VTERM_SOURCES})
|
||||
install(TARGETS vterm ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
|
||||
install(FILES include/vterm.h include/vterm_keycodes.h
|
||||
DESTINATION include)
|
||||
|
||||
if(NOT WIN32)
|
||||
file(GLOB BIN_SOURCES ${CMAKE_SOURCE_DIR}/bin/*.c)
|
||||
foreach(EXE_C ${BIN_SOURCES})
|
||||
get_filename_component(target_name ${EXE_C} NAME_WE)
|
||||
add_executable(${target_name} ${EXE_C})
|
||||
target_link_libraries(${target_name} vterm)
|
||||
install(TARGETS ${target_name} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
# vim: set ft=cmake:
|
@ -1,16 +0,0 @@
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
project(treesitter C)
|
||||
|
||||
add_library(tree-sitter lib/src/lib.c)
|
||||
target_include_directories(tree-sitter
|
||||
PRIVATE lib/src lib/include)
|
||||
|
||||
install(FILES
|
||||
lib/include/tree_sitter/api.h
|
||||
lib/include/tree_sitter/parser.h
|
||||
DESTINATION include/tree_sitter)
|
||||
|
||||
include(GNUInstallDirs)
|
||||
install(TARGETS tree-sitter DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
|
||||
# vim: set ft=cmake:
|
@ -1,70 +0,0 @@
|
||||
set(CPACK_PACKAGE_NAME "Neovim")
|
||||
set(CPACK_PACKAGE_VENDOR "neovim.io")
|
||||
set(CPACK_PACKAGE_FILE_NAME "nvim")
|
||||
set(CPACK_PACKAGE_DIRECTORY ${PROJECT_BINARY_DIR})
|
||||
|
||||
# From the GitHub About section
|
||||
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Vim-fork focused on extensibility and usability.")
|
||||
|
||||
set(CPACK_PACKAGE_INSTALL_DIRECTORY ${CPACK_PACKAGE_NAME})
|
||||
|
||||
# Pull the versions defined with the top level CMakeLists.txt
|
||||
set(CPACK_PACKAGE_VERSION_MAJOR ${NVIM_VERSION_MAJOR})
|
||||
set(CPACK_PACKAGE_VERSION_MINOR ${NVIM_VERSION_MINOR})
|
||||
set(CPACK_PACKAGE_VERSION_PATCH ${NVIM_VERSION_PATCH})
|
||||
|
||||
# CPACK_VERBATIM_VARIABLES ensures that the variables prefixed with *CPACK_*
|
||||
# are correctly passed to the cpack program.
|
||||
# This should always be set to true.
|
||||
set(CPACK_VERBATIM_VARIABLES TRUE)
|
||||
|
||||
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE.txt")
|
||||
set(CPACK_RESOURCE_FILE_README ${PROJECT_SOURCE_DIR}/README.md)
|
||||
|
||||
|
||||
if(WIN32)
|
||||
set(CPACK_PACKAGE_FILE_NAME "nvim-win64")
|
||||
set(CPACK_GENERATOR ZIP WIX)
|
||||
|
||||
# WIX
|
||||
# CPACK_WIX_UPGRADE_GUID should be set, but should never change.
|
||||
# CPACK_WIX_PRODUCT_GUID should not be set (leave as default to auto-generate).
|
||||
|
||||
# The following guid is just a randomly generated guid that's been pasted here.
|
||||
# It has no special meaning other than to supply it to WIX.
|
||||
set(CPACK_WIX_UPGRADE_GUID "207A1A70-7B0C-418A-A153-CA6883E38F4D")
|
||||
set(CPACK_WIX_PRODUCT_ICON ${PROJECT_SOURCE_DIR}/runtime/neovim.ico)
|
||||
|
||||
# Create start menu and desktop shortcuts
|
||||
set(CPACK_WIX_PROGRAM_MENU_FOLDER "${CPACK_PACKAGE_NAME}")
|
||||
set(CPACK_PACKAGE_EXECUTABLES "nvim" "Neovim" "nvim-qt" "Neovim Qt")
|
||||
set(CPACK_CREATE_DESKTOP_LINKS "nvim-qt")
|
||||
|
||||
# We use a wix patch to add further options to the installer. At present, it just adds neovim to the path
|
||||
# on installation and defines per-user installation, however, it can be extended.
|
||||
# See: https://cmake.org/cmake/help/v3.7/module/CPackWIX.html#variable:CPACK_WIX_PATCH_FILE
|
||||
list(APPEND CPACK_WIX_EXTENSIONS WixUtilExtension)
|
||||
list(APPEND CPACK_WIX_PATCH_FILE ${CMAKE_CURRENT_LIST_DIR}/WixPatch.xml)
|
||||
elseif(APPLE)
|
||||
set(CPACK_PACKAGE_FILE_NAME "nvim-macos")
|
||||
set(CPACK_GENERATOR TGZ)
|
||||
set(CPACK_PACKAGE_ICON ${CMAKE_CURRENT_LIST_DIR}/neovim.icns)
|
||||
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
set(CPACK_PACKAGE_FILE_NAME "nvim-linux64")
|
||||
set(CPACK_GENERATOR TGZ DEB)
|
||||
set(CPACK_DEBIAN_PACKAGE_NAME "Neovim") # required
|
||||
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Neovim.io") # required
|
||||
|
||||
# Automatically compute required shared lib dependencies.
|
||||
# Unfortunately, you "just need to know" that this has a hidden
|
||||
# dependency on dpkg-shlibdeps whilst using a debian based host.
|
||||
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS TRUE)
|
||||
else()
|
||||
set(CPACK_GENERATOR TGZ)
|
||||
endif()
|
||||
|
||||
# CPack variables are loaded in on the call to include(CPack). If you set
|
||||
# variables *after* the inclusion, they don't get updated within the CPack
|
||||
# config. Note that some CPack commands should still be run after it, such
|
||||
# as cpack_add_component().
|
||||
include(CPack)
|
@ -1,14 +0,0 @@
|
||||
<CPackWiXPatch>
|
||||
<!-- Fragment ID is from: <your build dir>/_CPack_Packages/win64/WIX/files.wxs -->
|
||||
<CPackWiXFragment Id="CM_CP_bin.nvim.exe">
|
||||
<Environment
|
||||
Id='UpdatePath'
|
||||
Name='PATH'
|
||||
Action='set'
|
||||
Permanent='no'
|
||||
System='no'
|
||||
Part='last'
|
||||
Value='[INSTALL_ROOT]bin'
|
||||
/>
|
||||
</CPackWiXFragment>
|
||||
</CPackWiXPatch>
|
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 6.6 KiB |
@ -1,147 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:sketch="http://www.bohemiancoding.com/sketch/ns"
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="256"
|
||||
height="256"
|
||||
viewBox="0 0 256 256"
|
||||
version="1.1"
|
||||
id="svg4612"
|
||||
sodipodi:docname="neovim.svg"
|
||||
inkscape:version="0.92.4 5da689c313, 2019-01-14">
|
||||
<metadata
|
||||
id="metadata4616">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title>neovim-mark@2x</dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="2560"
|
||||
inkscape:window-height="1333"
|
||||
id="namedview4614"
|
||||
showgrid="false"
|
||||
inkscape:zoom="2.1945358"
|
||||
inkscape:cx="132.84232"
|
||||
inkscape:cy="196.34741"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="34"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="svg4612" />
|
||||
<title
|
||||
id="title4587">neovim-mark@2x</title>
|
||||
<description>Created with Sketch (http://www.bohemiancoding.com/sketch)</description>
|
||||
<defs
|
||||
id="defs4604">
|
||||
<linearGradient
|
||||
x1="167.95833"
|
||||
y1="-0.46142399"
|
||||
x2="167.95833"
|
||||
y2="335.45523"
|
||||
id="linearGradient-1"
|
||||
gradientTransform="scale(0.46142398,2.1672042)"
|
||||
gradientUnits="userSpaceOnUse">
|
||||
<stop
|
||||
stop-color="#16B0ED"
|
||||
stop-opacity="0.800235524"
|
||||
offset="0%"
|
||||
id="stop4589" />
|
||||
<stop
|
||||
stop-color="#0F59B2"
|
||||
stop-opacity="0.83700023"
|
||||
offset="100%"
|
||||
id="stop4591" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
x1="1118.3427"
|
||||
y1="-0.46586797"
|
||||
x2="1118.3427"
|
||||
y2="338.68604"
|
||||
id="linearGradient-2"
|
||||
gradientTransform="scale(0.46586797,2.1465309)"
|
||||
gradientUnits="userSpaceOnUse">
|
||||
<stop
|
||||
stop-color="#7DB643"
|
||||
offset="0%"
|
||||
id="stop4594" />
|
||||
<stop
|
||||
stop-color="#367533"
|
||||
offset="100%"
|
||||
id="stop4596" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
x1="356.33795"
|
||||
y1="0"
|
||||
x2="356.33795"
|
||||
y2="612.90131"
|
||||
id="linearGradient-3"
|
||||
gradientTransform="scale(0.84189739,1.1877932)"
|
||||
gradientUnits="userSpaceOnUse">
|
||||
<stop
|
||||
stop-color="#88C649"
|
||||
stop-opacity="0.8"
|
||||
offset="0%"
|
||||
id="stop4599" />
|
||||
<stop
|
||||
stop-color="#439240"
|
||||
stop-opacity="0.84"
|
||||
offset="100%"
|
||||
id="stop4601" />
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<g
|
||||
id="Page-1"
|
||||
sketch:type="MSPage"
|
||||
style="fill:none;fill-rule:evenodd;stroke:none;stroke-width:1"
|
||||
transform="matrix(0.34367476,0,0,0.34367476,25.312651,1.7737533)">
|
||||
<g
|
||||
id="mark-copy"
|
||||
sketch:type="MSLayerGroup"
|
||||
transform="translate(2,3)">
|
||||
<path
|
||||
d="M 0,155.5704 155,-1 V 727 L 0,572.23792 Z"
|
||||
id="Left---green"
|
||||
sketch:type="MSShapeGroup"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:url(#linearGradient-1)" />
|
||||
<path
|
||||
d="M 443.0604,156.9824 600,-1 596.81879,727 442,572.21994 Z"
|
||||
id="Right---blue"
|
||||
sketch:type="MSShapeGroup"
|
||||
transform="matrix(-1,0,0,1,1042,0)"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:url(#linearGradient-2)" />
|
||||
<path
|
||||
d="M 154.98629,0 558,615.1897 445.2246,728 42,114.17202 Z"
|
||||
id="Cross---blue"
|
||||
sketch:type="MSShapeGroup"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:url(#linearGradient-3)" />
|
||||
<path
|
||||
d="M 155,283.83232 154.78675,308 31,124.71061 42.461949,113 Z"
|
||||
id="Shadow"
|
||||
sketch:type="MSShapeGroup"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#000000;fill-opacity:0.12999998" />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 4.3 KiB |
@ -1,13 +0,0 @@
|
||||
if(UNCRUSTIFY_PRG)
|
||||
execute_process(COMMAND uncrustify --version
|
||||
OUTPUT_VARIABLE user_version
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
string(REGEX REPLACE "[A-Za-z_#-]" "" user_version ${user_version})
|
||||
|
||||
file(STRINGS ${CONFIG_FILE} required_version LIMIT_COUNT 1)
|
||||
string(REGEX REPLACE "[A-Za-z_# -]" "" required_version ${required_version})
|
||||
|
||||
if(NOT user_version STREQUAL required_version)
|
||||
message(FATAL_ERROR "Wrong uncrustify version! Required version is ${required_version} but found ${user_version}")
|
||||
endif()
|
||||
endif()
|
18
cmake/Download.cmake
Normal file
18
cmake/Download.cmake
Normal file
@ -0,0 +1,18 @@
|
||||
file(
|
||||
DOWNLOAD "${URL}" "${FILE}"
|
||||
STATUS status
|
||||
LOG log
|
||||
)
|
||||
|
||||
list(GET status 0 status_code)
|
||||
list(GET status 1 status_string)
|
||||
|
||||
if(NOT status_code EQUAL 0)
|
||||
if(NOT ALLOW_FAILURE)
|
||||
message(FATAL_ERROR "error: downloading '${URL}' failed
|
||||
status_code: ${status_code}
|
||||
status_string: ${status_string}
|
||||
log: ${log}
|
||||
")
|
||||
endif()
|
||||
endif()
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user