feat(3p/tvix): run formatting check in parallel to rest

Change-Id: Ia5b3a5e76672143df361fec375903e3582694112
Reviewed-on: https://cl.tvl.fyi/c/depot/+/4632
Tested-by: BuildkiteCI
Reviewed-by: grfn <grfn@gws.fyi>
Reviewed-by: zseri <zseri.devel@ytrizja.de>
Autosubmit: zseri <zseri.devel@ytrizja.de>
This commit is contained in:
zseri 2021-12-26 06:10:40 +01:00
parent b5a5f68fff
commit 358a4ac6d4

View file

@ -125,10 +125,6 @@ in lib.fix (self: pkgs.fullLlvm11Stdenv.mkDerivation {
export NIX_DATA_DIR=$out/share
export NIX_TEST_VAR=foo # this is required by a language test
make test
# Ensure formatting is coherent, but do this after the rest of the
# tests run so that developers get all the useful feedback
fd . $src -e hh -e cc | xargs clang-format --dry-run --Werror
'';
preBuild = ''
@ -201,6 +197,41 @@ in lib.fix (self: pkgs.fullLlvm11Stdenv.mkDerivation {
export NIX_TEST_VAR=foo
'';
});
# Ensure formatting is coherent,
# but do this in parallel to the main build because:
# - (in favor of building this after tvix)
# tests run so that developers get all the useful feedback
# - (in favor of building this before tvix)
# if the formatting is broken, and this build was submitted to CI
# it would be a good idea to get this feedback rather sooner than later
# - we don't want builds to differ between local and CI runs
checkfmt = pkgs.fullLlvm11Stdenv.mkDerivation {
name = "tvix-checkfmt";
inherit src;
nativeBuildInputs = with pkgs; [ clang-tools_11 fd ];
SANDBOX_SHELL = "${pkgs.busybox}/bin/busybox";
buildPhase = ''
set -e
runHook preBuild
fd . $src -e hh -e cc | xargs clang-format --dry-run --Werror
runHook postBuild
'';
installPhase = ''
runHook preInstall
touch $out
runHook postInstall
'';
};
test-vm = import ./test-vm.nix args;
};
meta = {
targets = [
"checkfmt"
];
};
})