nixpkgs/pkgs/development/tools/misc/cvise/default.nix
Sergei Trofimovich 1cbf12663c cvise: disable blanket -Werror
`-Werror` flag usually causes build failures due to minor changes in
compiler versions. They might be useful for developers themselves but
are rarely useful for distributions.

For example right now `cvise` fails to compile on `gcc-13` due to
a `gcc` infelicity: https://gcc.gnu.org/PR107488

While this concrete instance is a compiler bug generally `-Werror` makes
users' lives harder. Specific `-Werror=<foo>` are better way to prevent
certain classes of bugs.

The change removes blanket `-Werror` with a `substituteInPlace` call.
2022-11-02 08:03:22 +00:00

86 lines
1.6 KiB
Nix

{ lib
, buildPythonApplication
, fetchFromGitHub
, bash
, cmake
, colordiff
, flex
, libclang
, llvm
, unifdef
, chardet
, pebble
, psutil
, pytestCheckHook
}:
buildPythonApplication rec {
pname = "cvise";
version = "2.6.0";
format = "other";
src = fetchFromGitHub {
owner = "marxin";
repo = "cvise";
rev = "refs/tags/v${version}";
sha256 = "sha256-yREdWrGiH8Bb2bIxvlg4okGbkIM5XqC039Fj0rrsJos=";
};
patches = [
# Refer to unifdef by absolute path.
./unifdef.patch
];
postPatch = ''
# Avoid blanket -Werror to evade build failures on less
# tested compilers.
substituteInPlace CMakeLists.txt \
--replace " -Werror " " "
# 'cvise --command=...' generates a script with hardcoded shebang.
substituteInPlace cvise.py \
--replace "#!/bin/bash" "#!${bash}/bin/bash"
substituteInPlace cvise/utils/testing.py \
--replace "'colordiff --version'" "'${colordiff}/bin/colordiff --version'" \
--replace "'colordiff'" "'${colordiff}/bin/colordiff'"
'';
nativeBuildInputs = [
cmake
flex
llvm.dev
];
buildInputs = [
libclang
llvm
llvm.dev
unifdef
];
propagatedBuildInputs = [
chardet
pebble
psutil
];
checkInputs = [
pytestCheckHook
unifdef
];
disabledTests = [
# Needs gcc, fails when run noninteractively (without tty).
"test_simple_reduction"
];
meta = with lib; {
homepage = "https://github.com/marxin/cvise";
description = "Super-parallel Python port of C-Reduce";
license = licenses.ncsa;
maintainers = with maintainers; [ orivej ];
platforms = platforms.linux;
};
}