@@ -112,6 +112,24 @@ set_targets() {
115+# XXX cabal issue "cabal v2-exec which" cannot find benchmark/test executables
118+# $2: package name with version
119+# $3: component ("" (lib), t (test), b (benchmark), x (executable))
120+# $4: command to find
121+cabal_which_builddir() {
122+ local path=$(echo $1/build/*/ghc-${GHC_VERSION}/${2}/$3/$4/build/$4/$4)
123+ test -f "$path" && echo $path
126+# $1: package name with version
128+# $3: command to find
130+ cabal_which_builddir $BUILD_DIR $1 $2 $3
115# We run the benchmarks in isolation in a separate process so that different
133# We run the benchmarks in isolation in a separate process so that different
116# benchmarks do not interfere with other. To enable that we need to pass the
134# benchmarks do not interfere with other. To enable that we need to pass the
117# benchmark exe path to gauge as an argument. Unfortunately it cannot find its
135# benchmark exe path to gauge as an argument. Unfortunately it cannot find its
@@ -119,7 +137,7 @@ set_targets() {
120# The path is dependent on the architecture and cabal version.
138# The path is dependent on the architecture and cabal version.
122−# $1: package name
140+# $1: package name with version
123# $2: component
141# $2: component
124# $3: target
142# $3: target
125cabal_target_prog () {
143cabal_target_prog () {
@@ -169,24 +187,6 @@ set_derived_vars () {
169 GHC_VERSION=$($CABAL_WITH_COMPILER --numeric-version)
187 GHC_VERSION=$($CABAL_WITH_COMPILER --numeric-version)
172−# XXX cabal issue "cabal v2-exec which" cannot find benchmark/test executables
176−# $3: component ("" (lib), t (test), b (benchmark), x (executable))
177−# $4: command to find
178−cabal_which_builddir() {
179− local path=$(echo $1/build/*/ghc-${GHC_VERSION}/${2}-0.0.0/$3/$4/build/$4/$4)
180− test -f "$path" && echo $path
185−# $3: command to find
187− cabal_which_builddir $BUILD_DIR $1 $2 $3
190# $1: build program
190# $1: build program
191# $2: package name
191# $2: package name
192# $3: component prefix
192# $3: component prefix
@@ -204,47 +204,3 @@ run_build () {
205 run_verbose $build_prog $COMPONENTS || die "build failed"
205 run_verbose $build_prog $COMPONENTS || die "build failed"
210− echo $BUILD_DIR/build/$SYSTEM/ghc-${GHC_VERSION}/$PACKAGE_FULL_NAME/hpc/vanilla/tix/$1/$1.tix
216−# $4: args generator func
218− local package_name=$1
220− local target_name=$3
224− target_prog=$(cabal_target_prog $package_name $component $target_name) || \
225− die "Cannot find executable for target $target_name"
227− echo "Running executable $target_name ..."
229− # Needed by bench-exec-one.sh
230− export BENCH_EXEC_PATH=$target_prog
231− mkdir -p $(dirname $(get_tix_file $target_name))
232− export HPCTIXFILE=$(get_tix_file $target_name)
234− run_verbose $target_prog $($extra_args $target_name $target_prog) \
235− || die "Target exe failed"
237− # hpc-coveralls fails if there is an empty dir and no .tix file generated
238− rmdir $(dirname $(get_tix_file $target_name)) 2>/dev/null || true
244−# $4: args generator func
248− run_target $1 $2 $i $4