-
Notifications
You must be signed in to change notification settings - Fork 51
/
Copy pathbuild.sh
103 lines (88 loc) · 3.42 KB
/
build.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#!/bin/bash
###################### COPYRIGHT/COPYLEFT ######################
# (C) 2020 Michael Soegtrop
# Released to the public under the
# Creative Commons CC0 1.0 Universal License
# See https://creativecommons.org/publicdomain/zero/1.0/legalcode.txt
###################### BUILD ALL PACKAGES USING OPAM ######################
# This is set by the windows batch file and conflicts with the use of variables e.g. in VST
unset ARCH
function dump_opam_logs {
if [ "${COQ_PLATFORM_DUMP_LOGS:-n}" == "y" ]
then
for log in $(opam config var root)/log/*
do
echo "==============================================================================="
echo $log
echo "==============================================================================="
cat -n $log
done
fi
return 1
}
opam config set jobs $COQ_PLATFORM_JOBS
# coq-fiat-crypto requires this - it sets the maximum stack size to 64MB
# Note that on MacOS the absolute maximum is ulimit -S -s 65520
# One can rise it as root on MacOS, but only for a root shell, not for the current shell
ulimit -S -s 65520
if ! $COQ_PLATFORM_TIME opam pin -n ocamlfind 1.9.5~relocatable; then dump_opam_logs; fi
if [[ "$OSTYPE" == cygwin ]]
then
if ! $COQ_PLATFORM_TIME opam pin -n opam-client 2.1.0; then dump_opam_logs; fi # opam-clinet 2.2.0 doesn't want to compile on Windows
fi
if [[ "$OSTYPE" != cygwin ]]
then
if ! $COQ_PLATFORM_TIME opam pin -n z3 4.11.2; then dump_opam_logs; fi # Installing z3 later will cause Tactician to be recompiled
if ! $COQ_PLATFORM_TIME opam install z3; then dump_opam_logs; fi
fi
if ! $COQ_PLATFORM_TIME opam pin -n dune 3.15.3; then dump_opam_logs; fi
if ! $COQ_PLATFORM_TIME opam pin -n coq-tactician-dummy 8.17.dev; then dump_opam_logs; fi
if ! $COQ_PLATFORM_TIME opam pin -n coq-tactician 8.18.dev; then dump_opam_logs; fi
if ! $COQ_PLATFORM_TIME opam pin -n coq-core 8.18.0; then dump_opam_logs; fi
if ! $COQ_PLATFORM_TIME opam install dune coq-core coq-tactician-dummy coq-tactician ocamlfind; then dump_opam_logs; fi
opam switch
opam switch set ${COQ_PLATFORM_SWITCH_NAME}
opam switch
eval $(opam env --set-switch --switch ${COQ_PLATFORM_SWITCH_NAME})
opam switch
opam exec -- tactician inject
case "$COQ_PLATFORM_PARALLEL" in
[pP])
echo "===== INSTALL OPAM PACKAGES (PARALLEL) ====="
if ! $COQ_PLATFORM_TIME opam install ${PACKAGES//PIN.}; then dump_opam_logs; fi
for package in ${PACKAGES}
do
case $package in
PIN.*)
echo PINNING $package
package_name="$(echo "$package" | cut -d '.' -f 2)"
package_version="$(echo "$package" | cut -d '.' -f 3-)"
if ! $COQ_PLATFORM_TIME opam pin ${package_name} ${package_version}; then dump_opam_logs; fi
;;
esac
done
;;
[sS])
echo "===== INSTALL OPAM PACKAGES (SEQUENTIAL) ====="
for package in ${PACKAGES}
do
echo PROCESSING $package
case $package in
PIN.*)
echo PROCESSING 1 $package
package_name="$(echo "$package" | cut -d '.' -f 2)"
package_version="$(echo "$package" | cut -d '.' -f 3-)"
if ! $COQ_PLATFORM_TIME opam pin ${package_name} ${package_version}; then dump_opam_logs; fi
;;
*)
echo PROCESSING 2 $package
if ! $COQ_PLATFORM_TIME opam install ${package}; then dump_opam_logs; fi
;;
esac
done
;;
*)
echo "Illegal value for COQ_PLATFORM_PARALLEL - aborting"
false
;;
esac