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:
parent
b5a5f68fff
commit
358a4ac6d4
1 changed files with 35 additions and 4 deletions
39
third_party/nix/default.nix
vendored
39
third_party/nix/default.nix
vendored
|
@ -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"
|
||||
];
|
||||
};
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue