cvise: explicitly point to clang-format

Without the cnage `cvise` fails to normalize sources with
`clang-format` and produces less than ideal intermediate sources to
lines-based pass. That affects reduction speed among other things.

Before the change `cvise` complained as:

    $ cvise --command 'grep foo a.c' a.c
    00:00:00 INFO Using temporary interestingness test: /tmp/tmp4a_4wut0.sh
    00:00:00 ERROR cannot find external program clang-format
    00:00:00 ERROR Prereqs not found for pass IndentPass::regular

After the change `clang-format` is found:

    $ result/bin/cvise --command 'grep foo a.c' a.c
    00:00:00 INFO Using temporary interestingness test: /tmp/tmpudipespb.sh
    00:00:00 INFO ===< 1539388 >===

While at it used `--replace-fail`.
This commit is contained in:
Sergei Trofimovich
2024-09-21 21:19:44 +01:00
parent 3c8525a3b7
commit e233ccb7a0
+10 -3
View File
@@ -1,6 +1,7 @@
{ lib
, buildPythonApplication
, fetchFromGitHub
, clang-tools
, cmake
, colordiff
, flex
@@ -34,11 +35,11 @@ buildPythonApplication rec {
# Avoid blanket -Werror to evade build failures on less
# tested compilers.
substituteInPlace CMakeLists.txt \
--replace " -Werror " " "
--replace-fail " -Werror " " "
substituteInPlace cvise/utils/testing.py \
--replace "'colordiff --version'" "'${colordiff}/bin/colordiff --version'" \
--replace "'colordiff'" "'${colordiff}/bin/colordiff'"
--replace-fail "'colordiff --version'" "'${colordiff}/bin/colordiff --version'" \
--replace-fail "'colordiff'" "'${colordiff}/bin/colordiff'"
'';
nativeBuildInputs = [
@@ -65,6 +66,12 @@ buildPythonApplication rec {
unifdef
];
cmakeFlags = [
# By default `cvise` looks it up in `llvm` bin directory. But
# `nixpkgs` moves it into a separate derivation.
"-DCLANG_FORMAT_PATH=${clang-tools}/bin/clang-format"
];
disabledTests = [
# Needs gcc, fails when run noninteractively (without tty).
"test_simple_reduction"