on master help sign in
Add support for --with-compiler
cdccb78Harendra Kumar
bin/bench.sh+4
@@ -17,6 +17,7 @@ print_help () {
17 echo " [--quick]"
17 echo " [--quick]"
18 echo " [--raw]"
18 echo " [--raw]"
19 echo " [--dev-build]"
19 echo " [--dev-build]"
20+ echo " [--with-compiler <compiler exe name>]"
20 echo " [--cabal-build-options <options>]"
21 echo " [--cabal-build-options <options>]"
21 echo " [--rtsopts <opts>]"
22 echo " [--rtsopts <opts>]"
22 echo " [--compare] [--base <commit>] [--candidate <commit>]"
23 echo " [--compare] [--base <commit>] [--candidate <commit>]"
@@ -297,6 +298,7 @@ do
297 --fields) shift; FIELDS=$1; shift ;;
298 --fields) shift; FIELDS=$1; shift ;;
298 --base) shift; BASE=$1; shift ;;
299 --base) shift; BASE=$1; shift ;;
299 --candidate) shift; CANDIDATE=$1; shift ;;
300 --candidate) shift; CANDIDATE=$1; shift ;;
301+ --with-compiler) shift; CABAL_WITH_COMPILER=$1; shift ;;
300 --cabal-build-flags) shift; CABAL_BUILD_OPTIONS+=$1; shift ;;
302 --cabal-build-flags) shift; CABAL_BUILD_OPTIONS+=$1; shift ;;
301 --cabal-build-options) shift; CABAL_BUILD_OPTIONS+=$1; shift ;;
303 --cabal-build-options) shift; CABAL_BUILD_OPTIONS+=$1; shift ;;
302 --rtsopts) shift; RTS_OPTIONS=$1; shift ;;
304 --rtsopts) shift; RTS_OPTIONS=$1; shift ;;
@@ -317,6 +319,8 @@ do
317done
319done
318GAUGE_ARGS=$*
320GAUGE_ARGS=$*
319
321
322+set_derived_vars
323+
320#-----------------------------------------------------------------------------
324#-----------------------------------------------------------------------------
321# Determine targets
325# Determine targets
322#-----------------------------------------------------------------------------
326#-----------------------------------------------------------------------------
bin/build-lib.sh+12−2
@@ -137,8 +137,6 @@ set_common_vars () {
137 TARGET_EXE_ARGS=
137 TARGET_EXE_ARGS=
138 RTS_OPTIONS=
138 RTS_OPTIONS=
139
139
140− GHC_VERSION=$(ghc --numeric-version)
141−
142 CABAL_BUILD_OPTIONS=""
140 CABAL_BUILD_OPTIONS=""
143 CABAL_EXECUTABLE=cabal
141 CABAL_EXECUTABLE=cabal
144
142
@@ -155,6 +153,18 @@ set_common_vars () {
155 fi
153 fi
156}
154}
157
155
156+# To be called after parsing CLI arguments
157+set_derived_vars () {
158+ if test -n "$CABAL_WITH_COMPILER"
159+ then
160+ CABAL_BUILD_OPTIONS+=" --with-compiler $CABAL_WITH_COMPILER"
161+ else
162+ CABAL_WITH_COMPILER=ghc
163+ fi
164+
165+ GHC_VERSION=$($CABAL_WITH_COMPILER --numeric-version)
166+}
167+
158# XXX cabal issue "cabal v2-exec which" cannot find benchmark/test executables
168# XXX cabal issue "cabal v2-exec which" cannot find benchmark/test executables
159
169
160# $1: builddir
170# $1: builddir
bin/test.sh+4
@@ -9,6 +9,7 @@ SCRIPT_DIR=$(dirname $0)
9print_help () {
9print_help () {
10 echo "Usage: $0 "
10 echo "Usage: $0 "
11 echo " [--targets <"target1 target2 ..." | help>]"
11 echo " [--targets <"target1 target2 ..." | help>]"
12+ echo " [--with-compiler <compiler exe name>]"
12 echo " [--cabal-build-options <option>]"
13 echo " [--cabal-build-options <option>]"
13 echo " [--dev-build]"
14 echo " [--dev-build]"
14 echo " [--coverage]"
15 echo " [--coverage]"
@@ -52,6 +53,7 @@ do
52 -h|--help|help) print_help ;;
53 -h|--help|help) print_help ;;
53 # options with arguments
54 # options with arguments
54 --targets) shift; TARGETS=$1; shift ;;
55 --targets) shift; TARGETS=$1; shift ;;
56+ --with-compiler) shift; CABAL_WITH_COMPILER=$1; shift ;;
55 --cabal-build-options) shift; CABAL_BUILD_OPTIONS=$1; shift ;;
57 --cabal-build-options) shift; CABAL_BUILD_OPTIONS=$1; shift ;;
56 --hpc-report-options) shift; HPC_REPORT_OPTIONS=$1; shift ;;
58 --hpc-report-options) shift; HPC_REPORT_OPTIONS=$1; shift ;;
57 --rtsopts) shift; RTS_OPTIONS=$1; shift ;;
59 --rtsopts) shift; RTS_OPTIONS=$1; shift ;;
@@ -69,6 +71,8 @@ do
69done
71done
70TARGET_EXE_ARGS=$*
72TARGET_EXE_ARGS=$*
71
73
74+set_derived_vars
75+
72#-----------------------------------------------------------------------------
76#-----------------------------------------------------------------------------
73# Determine targets
77# Determine targets
74#-----------------------------------------------------------------------------
78#-----------------------------------------------------------------------------