on master help sign in
Add a hack to find "chart" executable
a7ba070Harendra Kumar
bin/bench.sh+13−1
@@ -70,7 +70,19 @@ cabal_which_report() {
70 local path=$(cabal_which streamly-benchmarks x $1)
70 local path=$(cabal_which streamly-benchmarks x $1)
71 if test -z "$path"
71 if test -z "$path"
72 then
72 then
73+ echo "Cannot find $1 executable, trying in dist-newstyle" 1>&2
73− cabal_which_builddir dist-newstyle streamly-benchmarks x $1
74+ local path1=$(cabal_which_builddir dist-newstyle streamly-benchmarks x $1)
75+ if test -z "$path1"
76+ then
77+ local path2="./bin/$1"
78+ echo "Cannot find $1 executable, trying $path2" 1>&2
79+ if test -e "$path2"
80+ then
81+ echo $path2
82+ fi
83+ else
84+ echo $path1
85+ fi
74 else
86 else
75 echo $path
87 echo $path
76 fi
88 fi
default.nix+7
@@ -3,6 +3,13 @@
3# To build the chart executable for running bench.sh use:
3# To build the chart executable for running bench.sh use:
4# nix-shell --argstr c2nix "--flag dev" --run "cabal build chart --flag dev"
4# nix-shell --argstr c2nix "--flag dev" --run "cabal build chart --flag dev"
5#
5#
6+# You can permanently copy the "chart" executable to "./bin" to pick
7+# it up irrespective of the compiler/build. Its path is printed by the
8+# above build command. You can also print its path using the following
9+# command and then use "cp <path> ./bin" to copy it to "./bin", the bench.sh
10+# script will pick it up from there:
11+# nix-shell --argstr c2nix "--flag dev" --run "cabal exec --flag dev -- which chart"
12+#
6# To use ghc-8.6.5
13# To use ghc-8.6.5
7# nix-shell --argstr compiler "ghc865"
14# nix-shell --argstr compiler "ghc865"
8
15