Merge pull request #15047 from teto/flake-tests

flake update
This commit is contained in:
Matthieu Coudron 2021-07-10 18:37:07 +02:00 committed by GitHub
commit 3de7017d9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 57 additions and 41 deletions

View File

@ -2,11 +2,11 @@
"nodes": { "nodes": {
"flake-utils": { "flake-utils": {
"locked": { "locked": {
"lastModified": 1610051610, "lastModified": 1623875721,
"narHash": "sha256-U9rPz/usA1/Aohhk7Cmc2gBrEEKRzcW4nwPWMPwja4Y=", "narHash": "sha256-A8BU7bjS5GirpAUv4QA+QnJ4CceLHkcXdRp4xITDB0s=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "3982c9903e93927c2164caa727cd3f6a0e6d14cc", "rev": "f7e004a55b120c02ecb6219596820fcd32ca8772",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -17,11 +17,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1613226215, "lastModified": 1625697353,
"narHash": "sha256-3rA5cGIrBHD6yeKhNhsF7/t461ww25oJY8KyBb0IhjU=", "narHash": "sha256-/v85RkZ0Z+lxipkG2sjYNRINktc8VySbLQmPbirY0hQ=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "ff96a0fa5635770390b184ae74debea75c3fd534", "rev": "87807e64a5ef5206b745a40af118c7be8db73681",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@ -16,14 +16,6 @@
neovim = pkgs.neovim-unwrapped.overrideAttrs (oa: { neovim = pkgs.neovim-unwrapped.overrideAttrs (oa: {
version = "master"; version = "master";
src = ../.; src = ../.;
buildInputs = oa.buildInputs ++ ([
pkgs.tree-sitter
]);
cmakeFlags = oa.cmakeFlags ++ [
"-DUSE_BUNDLED=OFF"
];
}); });
# a development binary to help debug issues # a development binary to help debug issues
@ -42,16 +34,10 @@
disallowedReferences = []; disallowedReferences = [];
})); }));
# for neovim developers, builds a slow binary # for neovim developers, beware of the slow binary
# huge closure size but aims at covering all scripts
# brings development tools as well
neovim-developer = neovim-developer =
let let
lib = nixpkgs.lib; lib = nixpkgs.lib;
pythonEnv = pkgs.python3.withPackages(ps: [
ps.msgpack
ps.flake8 # for 'make pylint'
]);
luacheck = pkgs.luaPackages.luacheck; luacheck = pkgs.luaPackages.luacheck;
in in
(neovim-debug.override ({ doCheck = pkgs.stdenv.isLinux; })).overrideAttrs (oa: { (neovim-debug.override ({ doCheck = pkgs.stdenv.isLinux; })).overrideAttrs (oa: {
@ -59,29 +45,11 @@
"-DLUACHECK_PRG=${luacheck}/bin/luacheck" "-DLUACHECK_PRG=${luacheck}/bin/luacheck"
"-DMIN_LOG_LEVEL=0" "-DMIN_LOG_LEVEL=0"
"-DENABLE_LTO=OFF" "-DENABLE_LTO=OFF"
"-DUSE_BUNDLED=OFF"
] ++ pkgs.lib.optionals pkgs.stdenv.isLinux [ ] ++ pkgs.lib.optionals pkgs.stdenv.isLinux [
# https://github.com/google/sanitizers/wiki/AddressSanitizerFlags # https://github.com/google/sanitizers/wiki/AddressSanitizerFlags
# https://clang.llvm.org/docs/AddressSanitizer.html#symbolizing-the-reports # https://clang.llvm.org/docs/AddressSanitizer.html#symbolizing-the-reports
"-DCLANG_ASAN_UBSAN=ON" "-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 ]; overlays = [ self.overlay ];
inherit system; inherit system;
}; };
pythonEnv = pkgs.python3.withPackages(ps: [
ps.msgpack
ps.flake8 # for 'make pylint'
]);
in in
rec { rec {
@ -98,6 +71,18 @@
inherit neovim neovim-debug neovim-developer; 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; defaultPackage = pkgs.neovim;
apps = { apps = {
@ -107,6 +92,33 @@
defaultApp = apps.nvim; 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
'';
});
}); });
} }

View File

@ -950,6 +950,8 @@ def main(config, args):
os.remove(mpack_file) os.remove(mpack_file)
output_dir = out_dir.format(target=target) output_dir = out_dir.format(target=target)
log.info("Generating documentation for %s in folder %s",
target, output_dir)
debug = args.log_level >= logging.DEBUG debug = args.log_level >= logging.DEBUG
p = subprocess.Popen( p = subprocess.Popen(
['doxygen', '-'], ['doxygen', '-'],
@ -1105,7 +1107,8 @@ def filter_source(filename):
def parse_args(): def parse_args():
targets = ', '.join(CONFIG.keys()) targets = ', '.join(CONFIG.keys())
ap = argparse.ArgumentParser() ap = argparse.ArgumentParser(
description="Generate helpdoc from source code")
ap.add_argument( ap.add_argument(
"--log-level", "-l", choices=LOG_LEVELS.keys(), "--log-level", "-l", choices=LOG_LEVELS.keys(),
default=logging.getLevelName(logging.ERROR), help="Set log verbosity" default=logging.getLevelName(logging.ERROR), help="Set log verbosity"
@ -1159,6 +1162,7 @@ if __name__ == "__main__":
print("Setting log level to %s" % args.log_level) print("Setting log level to %s" % args.log_level)
args.log_level = LOG_LEVELS[args.log_level] args.log_level = LOG_LEVELS[args.log_level]
log.setLevel(args.log_level) log.setLevel(args.log_level)
log.addHandler(logging.StreamHandler())
if len(args.source_filter) > 0: if len(args.source_filter) > 0:
filter_source(args.source_filter[0]) filter_source(args.source_filter[0])