aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/asan.sh5
-rw-r--r--contrib/flake.lock30
-rw-r--r--contrib/flake.nix58
-rw-r--r--contrib/local.mk.example8
-rw-r--r--contrib/luarc.json28
5 files changed, 81 insertions, 48 deletions
diff --git a/contrib/asan.sh b/contrib/asan.sh
index 7e7dffa1af..6354d65514 100755
--- a/contrib/asan.sh
+++ b/contrib/asan.sh
@@ -13,10 +13,7 @@ export CC='clang'
# Change to detect_leaks=1 to detect memory leaks (slower).
export ASAN_OPTIONS="detect_leaks=0:log_path=$log_path/asan"
-# Show backtraces in the logs.
-export UBSAN_OPTIONS="print_stacktrace=1"
-
-make -C "$root_path" CMAKE_EXTRA_FLAGS="-DCLANG_ASAN_UBSAN=ON"
+make -C "$root_path" CMAKE_EXTRA_FLAGS="-DENABLE_ASAN_UBSAN=ON"
VIMRUNTIME="$root_path"/runtime "$root_path"/build/bin/nvim
# Need to manually reset terminal to avoid mangled output, nvim does not
diff --git a/contrib/flake.lock b/contrib/flake.lock
index c6dfb4642b..554dc22bdb 100644
--- a/contrib/flake.lock
+++ b/contrib/flake.lock
@@ -1,12 +1,15 @@
{
"nodes": {
"flake-utils": {
+ "inputs": {
+ "systems": "systems"
+ },
"locked": {
- "lastModified": 1667395993,
- "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
+ "lastModified": 1685518550,
+ "narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=",
"owner": "numtide",
"repo": "flake-utils",
- "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
+ "rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef",
"type": "github"
},
"original": {
@@ -17,11 +20,11 @@
},
"nixpkgs": {
"locked": {
- "lastModified": 1671983799,
- "narHash": "sha256-Z2Ro6hFPZHkBqkVXY5/aBUzxi5xizQGvuHQ9+T5B/ks=",
+ "lastModified": 1686226982,
+ "narHash": "sha256-nLuiPoeiVfqqzeq9rmXxpybh77VS37dsY/k8N2LoxVg=",
"owner": "nixos",
"repo": "nixpkgs",
- "rev": "fad51abd42ca17a60fc1d4cb9382e2d79ae31836",
+ "rev": "a64b73e07d4aa65cfcbda29ecf78eaf9e72e44bd",
"type": "github"
},
"original": {
@@ -36,6 +39,21 @@
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
+ },
+ "systems": {
+ "locked": {
+ "lastModified": 1681028828,
+ "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
+ "owner": "nix-systems",
+ "repo": "default",
+ "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nix-systems",
+ "repo": "default",
+ "type": "github"
+ }
}
},
"root": "root",
diff --git a/contrib/flake.nix b/contrib/flake.nix
index 0898c943d7..57e56d0fdb 100644
--- a/contrib/flake.nix
+++ b/contrib/flake.nix
@@ -7,15 +7,64 @@
};
outputs = { self, nixpkgs, flake-utils }:
+ let
+ inherit (builtins)
+ elemAt
+ foldl'
+ mapAttrs
+ match
+ readFile
+ ;
+ inherit (nixpkgs.lib)
+ const
+ flip
+ pipe
+ remove
+ splitString
+ toLower
+ ;
+ in
{
overlay = final: prev: {
- neovim = final.neovim-unwrapped.overrideAttrs (oa: rec {
+ neovim = (final.neovim-unwrapped.override {
+ treesitter-parsers = pipe ../cmake.deps/deps.txt [
+ readFile
+ (splitString "\n")
+ (map (match "TREESITTER_([A-Z_]+)_(URL|SHA256)[[:space:]]+([^[:space:]]+)[[:space:]]*"))
+ (remove null)
+ (flip foldl' { }
+ (acc: matches:
+ let
+ lang = toLower (elemAt matches 0);
+ type = toLower (elemAt matches 1);
+ value = elemAt matches 2;
+ in
+ acc // {
+ ${lang} = acc.${lang} or { } // {
+ ${type} = value;
+ };
+ }))
+ (mapAttrs (const final.fetchurl))
+ (self: self // {
+ markdown = final.stdenv.mkDerivation {
+ inherit (self.markdown) name;
+ src = self.markdown;
+ installPhase = ''
+ mv tree-sitter-markdown $out
+ '';
+ };
+ })
+ ];
+ }).overrideAttrs (oa: rec {
version = self.shortRev or "dirty";
src = ../.;
- preConfigure = ''
+ preConfigure = oa.preConfigure or "" + ''
sed -i cmake.config/versiondef.h.in -e 's/@NVIM_VERSION_PRERELEASE@/-dev-${version}/'
'';
+ nativeBuildInputs = oa.nativeBuildInputs ++ [
+ final.libiconv
+ ];
});
# a development binary to help debug issues
@@ -33,7 +82,6 @@
NIX_CFLAGS_COMPILE = " -ggdb -Og";
cmakeBuildType = "Debug";
- cmakeFlags = oa.cmakeFlags ++ [ "-DMIN_LOG_LEVEL=0" ];
disallowedReferences = [ ];
});
@@ -45,12 +93,11 @@
}).overrideAttrs (oa: {
cmakeFlags = oa.cmakeFlags ++ [
"-DLUACHECK_PRG=${luacheck}/bin/luacheck"
- "-DMIN_LOG_LEVEL=0"
"-DENABLE_LTO=OFF"
] ++ final.lib.optionals final.stdenv.isLinux [
# https://github.com/google/sanitizers/wiki/AddressSanitizerFlags
# https://clang.llvm.org/docs/AddressSanitizer.html#symbolizing-the-reports
- "-DCLANG_ASAN_UBSAN=ON"
+ "-DENABLE_ASAN_UBSAN=ON"
];
});
};
@@ -105,7 +152,6 @@
# ASAN_OPTIONS=detect_leaks=1
export ASAN_OPTIONS="log_path=./test.log:abort_on_error=1"
- export UBSAN_OPTIONS=print_stacktrace=1
# for treesitter functionaltests
mkdir -p runtime/parser
diff --git a/contrib/local.mk.example b/contrib/local.mk.example
index 20396e86ae..bda2c1b4dc 100644
--- a/contrib/local.mk.example
+++ b/contrib/local.mk.example
@@ -31,9 +31,10 @@
# often. You can disable it explicitly:
# CMAKE_EXTRA_FLAGS += -DENABLE_LTO=OFF
-# Log levels: 0 (DEBUG), 1 (INFO), 2 (WARNING), 3 (ERROR)
-# Default is 1 (INFO) unless CMAKE_BUILD_TYPE is Release or RelWithDebInfo.
-# CMAKE_EXTRA_FLAGS += -DMIN_LOG_LEVEL=1
+# Log levels: DEBUG, INFO, WARNING, ERROR
+# For Debug builds all log levels are used
+# For Release and RelWithDebInfo builds only WARNING and ERROR are used, unless:
+# CMAKE_EXTRA_FLAGS += -DLOG_DEBUG
# By default, nvim uses bundled versions of its required third-party
# dependencies.
@@ -45,7 +46,6 @@
# DEPS_CMAKE_FLAGS += -DUSE_BUNDLED_LIBUV=OFF
# DEPS_CMAKE_FLAGS += -DUSE_BUNDLED_LIBVTERM=OFF
# DEPS_CMAKE_FLAGS += -DUSE_BUNDLED_LUAJIT=OFF
-# DEPS_CMAKE_FLAGS += -DUSE_BUNDLED_LUAROCKS=OFF
# DEPS_CMAKE_FLAGS += -DUSE_BUNDLED_MSGPACK=OFF
# DEPS_CMAKE_FLAGS += -DUSE_BUNDLED_UNIBILIUM=OFF
# DEPS_CMAKE_FLAGS += -DUSE_BUNDLED_UTF8PROC=OFF
diff --git a/contrib/luarc.json b/contrib/luarc.json
deleted file mode 100644
index ebad0581b9..0000000000
--- a/contrib/luarc.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "runtime.version": "LuaJIT",
- "diagnostics": {
- "enable": true,
- "globals": [
- "vim",
- "describe",
- "pending",
- "it",
- "before_each",
- "after_each",
- "setup",
- "teardown",
- "finally",
- "lfs"
- ]
- },
- "workspace": {
- "library": [
- "runtime/lua",
- "${3rd}/lfs/library"
- ],
- "checkThirdParty": false,
- "maxPreload": 2000,
- "preloadFileSize": 1000
- },
- "telemetry.enable": false
-}