cvise: use /bin.bash from nix store
Noticed failures as an incorrect handling of `--command` param:
$ cvise --command="gcc -c bug.c |& fgrep 'during RTL pass: expand'" bug.c
C-Vise cannot run because the interestingness test does not return
zero.
This happens because temporary shell script has "#!/bin/bash" shebang.
The change replaces it to path from nix store.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
{ lib, buildPythonApplication, fetchFromGitHub, cmake, flex
|
||||
{ lib, buildPythonApplication, fetchFromGitHub, bash, cmake, flex
|
||||
, libclang, llvm, unifdef
|
||||
, pebble, psutil, pytestCheckHook, pytest-flake8
|
||||
}:
|
||||
@@ -20,10 +20,16 @@ buildPythonApplication rec {
|
||||
];
|
||||
|
||||
nativeBuildInputs = [ cmake flex llvm.dev ];
|
||||
buildInputs = [ libclang llvm llvm.dev unifdef ];
|
||||
buildInputs = [ bash libclang llvm llvm.dev unifdef ];
|
||||
propagatedBuildInputs = [ pebble psutil ];
|
||||
checkInputs = [ pytestCheckHook pytest-flake8 unifdef ];
|
||||
|
||||
# 'cvise --command=...' generates a script with hardcoded shebang.
|
||||
postPatch = ''
|
||||
substituteInPlace cvise.py \
|
||||
--replace "#!/bin/bash" "#!${bash}/bin/bash"
|
||||
'';
|
||||
|
||||
preCheck = ''
|
||||
patchShebangs cvise.py
|
||||
'';
|
||||
|
||||
Reference in New Issue
Block a user