From 5cc72dbec4b80094f6ba41c7f14af2abf996919f Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Wed, 15 Sep 2021 19:18:05 +0100 Subject: [PATCH] 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. --- pkgs/development/tools/misc/cvise/default.nix | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pkgs/development/tools/misc/cvise/default.nix b/pkgs/development/tools/misc/cvise/default.nix index e24c133e8b90..80d2a73cc425 100644 --- a/pkgs/development/tools/misc/cvise/default.nix +++ b/pkgs/development/tools/misc/cvise/default.nix @@ -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 '';