Add a hack to find "chart" executable
We can always use the chart executable built by any compiler version.
Sometimes the chart executable is not buildable by newer compiler
versions, in that case we can build it using another compiler and use
that.
commita7ba0701ec31ab8de0290dd1893dc0713a75f0f4
authorHarendra Kumar <harendra@composewell.com>
dateThu 18 Feb 2021, 19:34 (6 years ago)
parentf68d334
bin/bench.sh+13−1
@@ -70,7 +70,19 @@ cabal_which_report() {
7070 local path=$(cabal_which streamly-benchmarks x $1)
7171 if test -z "$path"
7272 then
73− cabal_which_builddir dist-newstyle streamly-benchmarks x $1
73+ echo "Cannot find $1 executable, trying in dist-newstyle" 1>&2
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
7486 else
7587 echo $path
7688 fi
default.nix+7
@@ -3,6 +3,13 @@
33# To build the chart executable for running bench.sh use:
44# nix-shell --argstr c2nix "--flag dev" --run "cabal build chart --flag dev"
55#
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+#
613# To use ghc-8.6.5
714# nix-shell --argstr compiler "ghc865"
815