-
Notifications
You must be signed in to change notification settings - Fork 7
/
deep-rebuild
executable file
·90 lines (72 loc) · 2.39 KB
/
deep-rebuild
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
#!/usr/bin/env bash
set -eu
export SILVER_HOME=$(pwd)
JVM_ARGS="-Xss20M -Xmx6G -jar ../jars/silver.compiler.composed.Default.jar"
export ANT_OPTS=-Xss10M
# just run this script, no parameters or options.
# One new option: --newcore, for when the core FFI stuff has to change in tandem with the runtime
# Only I should ever have to use this, as once it's done ONCE, fetch-jars will eliminate anyone else's need to do it.
trap 'echo -e "\a"' EXIT
mkdir -p build
cd build
if [ -d ../generated/bin/common ]; then
# oh man, let's make sure stale runtimes aren't causing us serious problems here
rm -rf ../generated/bin/common
fi
# Modifications may have been made to how the translation is done
echo "One full cycle ..."
echo ""
echo " > Silver Build"
echo " Silver Build"
echo " Runtime Build"
echo " Silver Build"
echo ""
time java $JVM_ARGS --relative-jar --clean silver:compiler:composed:Default
ant
mv silver.compiler.composed.Default.jar ../jars/
# Modifications may need to be made to how core translates, to accomodate translation/runtime changes
if [ $# -gt 0 ] && [ "$1" == "--newcore" ]; then
echo -e "\a"
echo " Updates to core should be made NOW, to accomodate a new runtime... "
read
fi
# Should backup old jars here
echo ""
echo " Silver Build"
echo " > Silver Build"
echo " Runtime Build"
echo " Silver Build"
echo ""
echo "Start ..."
# Also building silver:xml:ast here since the runtime depends on that
time java $JVM_ARGS --relative-jar --clean silver:compiler:composed:Default silver:xml:ast
# Modifications may have been made to the runtime
echo "No ant yet! Let's go build the runtime! ..."
echo ""
echo " Silver Build"
echo " Silver Build"
echo " > Runtime Build"
echo " Silver Build"
echo ""
cd ../runtime/java
ant
mv SilverRuntime.jar ../../jars/
cd ../../build
echo "Now finish ..."
ant
mv silver.compiler.composed.Default.jar ../jars/
# Finally, we should have a fully working binary on all the new code. Run it again to reach a fixed point:
echo "One more full cycle ..."
echo ""
echo " Silver Build"
echo " Silver Build"
echo " Runtime Build"
echo " > Silver Build"
echo ""
time java -ea $JVM_ARGS --relative-jar --clean silver:compiler:composed:Default
ant
mv silver.compiler.composed.Default.jar ../jars/
# If the last build failed, should restore backup jars
echo "Cleaning out stale runtime class files..."
rm -rf ../generated/bin/common
echo "deep-rebuild success"