aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Coudron <mcoudron@hotmail.com>2021-07-10 17:48:59 +0200
committerMatthieu Coudron <mcoudron@hotmail.com>2021-07-10 17:52:15 +0200
commitde909bf48b5b845602204d84597af38a93a6ebd1 (patch)
tree440bc8c9be9626208b4cb62bfbd7e26d7c4436f5
parente43dbfdd05d09e28ee0468f1cd1808f859807606 (diff)
downloadrneovim-de909bf48b5b845602204d84597af38a93a6ebd1.tar.gz
rneovim-de909bf48b5b845602204d84597af38a93a6ebd1.tar.bz2
rneovim-de909bf48b5b845602204d84597af38a93a6ebd1.zip
chore(flake): update inputs
Updated inputs so no need to add tree-sitter ourselves anymore. Added checks: - for pylint/shlint - distinguish the devolpment shell from the ASAN build (closure for ASAN version is smaller). While in the devShell, functionaltests would fail because bin/nvim could not load outputs/out/share/nvim/syntax/syntax.vim So we touch the file.
-rw-r--r--contrib/flake.lock12
-rw-r--r--contrib/flake.nix80
2 files changed, 52 insertions, 40 deletions
diff --git a/contrib/flake.lock b/contrib/flake.lock
index 521b7629d9..b9e074db52 100644
--- a/contrib/flake.lock
+++ b/contrib/flake.lock
@@ -2,11 +2,11 @@
"nodes": {
"flake-utils": {
"locked": {
- "lastModified": 1610051610,
- "narHash": "sha256-U9rPz/usA1/Aohhk7Cmc2gBrEEKRzcW4nwPWMPwja4Y=",
+ "lastModified": 1623875721,
+ "narHash": "sha256-A8BU7bjS5GirpAUv4QA+QnJ4CceLHkcXdRp4xITDB0s=",
"owner": "numtide",
"repo": "flake-utils",
- "rev": "3982c9903e93927c2164caa727cd3f6a0e6d14cc",
+ "rev": "f7e004a55b120c02ecb6219596820fcd32ca8772",
"type": "github"
},
"original": {
@@ -17,11 +17,11 @@
},
"nixpkgs": {
"locked": {
- "lastModified": 1613226215,
- "narHash": "sha256-3rA5cGIrBHD6yeKhNhsF7/t461ww25oJY8KyBb0IhjU=",
+ "lastModified": 1625697353,
+ "narHash": "sha256-/v85RkZ0Z+lxipkG2sjYNRINktc8VySbLQmPbirY0hQ=",
"owner": "nixos",
"repo": "nixpkgs",
- "rev": "ff96a0fa5635770390b184ae74debea75c3fd534",
+ "rev": "87807e64a5ef5206b745a40af118c7be8db73681",
"type": "github"
},
"original": {
diff --git a/contrib/flake.nix b/contrib/flake.nix
index e75ff0356b..c601377cd0 100644
--- a/contrib/flake.nix
+++ b/contrib/flake.nix
@@ -16,14 +16,6 @@
neovim = pkgs.neovim-unwrapped.overrideAttrs (oa: {
version = "master";
src = ../.;
-
- buildInputs = oa.buildInputs ++ ([
- pkgs.tree-sitter
- ]);
-
- cmakeFlags = oa.cmakeFlags ++ [
- "-DUSE_BUNDLED=OFF"
- ];
});
# a development binary to help debug issues
@@ -42,16 +34,10 @@
disallowedReferences = [];
}));
- # for neovim developers, builds a slow binary
- # huge closure size but aims at covering all scripts
- # brings development tools as well
+ # for neovim developers, beware of the slow binary
neovim-developer =
let
lib = nixpkgs.lib;
- pythonEnv = pkgs.python3.withPackages(ps: [
- ps.msgpack
- ps.flake8 # for 'make pylint'
- ]);
luacheck = pkgs.luaPackages.luacheck;
in
(neovim-debug.override ({ doCheck = pkgs.stdenv.isLinux; })).overrideAttrs (oa: {
@@ -59,29 +45,11 @@
"-DLUACHECK_PRG=${luacheck}/bin/luacheck"
"-DMIN_LOG_LEVEL=0"
"-DENABLE_LTO=OFF"
- "-DUSE_BUNDLED=OFF"
] ++ pkgs.lib.optionals pkgs.stdenv.isLinux [
# https://github.com/google/sanitizers/wiki/AddressSanitizerFlags
# https://clang.llvm.org/docs/AddressSanitizer.html#symbolizing-the-reports
"-DCLANG_ASAN_UBSAN=ON"
];
-
- nativeBuildInputs = oa.nativeBuildInputs ++ (with pkgs; [
- pythonEnv
- include-what-you-use # for scripts/check-includes.py
- jq # jq for scripts/vim-patch.sh -r
- shellcheck # for `make shlint`
- doxygen # for script/gen_vimdoc.py
- clang-tools # for clangd to find the correct headers
- ]);
-
- shellHook = oa.shellHook + ''
- export NVIM_PYTHON_LOG_LEVEL=DEBUG
- export NVIM_LOG_FILE=/tmp/nvim.log
-
- export ASAN_OPTIONS="log_path=./test.log:abort_on_error=1"
- export UBSAN_OPTIONS=print_stacktrace=1
- '';
});
};
} //
@@ -91,6 +59,11 @@
overlays = [ self.overlay ];
inherit system;
};
+
+ pythonEnv = pkgs.python3.withPackages(ps: [
+ ps.msgpack
+ ps.flake8 # for 'make pylint'
+ ]);
in
rec {
@@ -98,6 +71,18 @@
inherit neovim neovim-debug neovim-developer;
};
+ checks = {
+ pylint = pkgs.runCommandNoCC "pylint" {
+ nativeBuildInputs = [ pythonEnv ];
+ preferLocalBuild = true;
+ } "make -C ${./..} pylint > $out";
+
+ shlint = pkgs.runCommandNoCC "shlint" {
+ nativeBuildInputs = [ pkgs.shellcheck ];
+ preferLocalBuild = true;
+ } "make -C ${./..} shlint > $out";
+ };
+
defaultPackage = pkgs.neovim;
apps = {
@@ -107,6 +92,33 @@
defaultApp = apps.nvim;
- devShell = pkgs.neovim-developer;
+ devShell = let
+ in
+ pkgs.neovim-developer.overrideAttrs(oa: {
+
+ buildInputs = with pkgs; oa.buildInputs ++ [
+ cmake
+ pythonEnv
+ include-what-you-use # for scripts/check-includes.py
+ jq # jq for scripts/vim-patch.sh -r
+ shellcheck # for `make shlint`
+ doxygen # for script/gen_vimdoc.py
+ clang-tools # for clangd to find the correct headers
+ ];
+
+ shellHook = ''
+ export NVIM_PYTHON_LOG_LEVEL=DEBUG
+ export NVIM_LOG_FILE=/tmp/nvim.log
+
+ # ASAN_OPTIONS=detect_leaks=1
+ export ASAN_OPTIONS="log_path=./test.log:abort_on_error=1"
+ export UBSAN_OPTIONS=print_stacktrace=1
+ mkdir -p build/runtime/parser
+ # nvim looks into CMAKE_INSTALL_DIR. Hack to avoid errors
+ # when running the functionaltests
+ mkdir -p outputs/out/share/nvim/syntax
+ touch outputs/out/share/nvim/syntax/syntax.vim
+ '';
+ });
});
}