-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathreport-sizes
More file actions
executable file
·49 lines (43 loc) · 1.46 KB
/
report-sizes
File metadata and controls
executable file
·49 lines (43 loc) · 1.46 KB
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
#!/usr/bin/env bash
if [[ -n "$(git status --porcelain)" ]]; then
echo 'The working tree is not clean' >&2
exit 1
fi
ret="$(git rev-parse --abbrev-ref HEAD)"
[[ $ret != 'HEAD' ]] || ret="$(git rev-parse HEAD)"
base="$(git merge-base installation-tests $ret)"
echo "Report sizes${2:+ of }$2${1:+ for }$1 from $(git rev-parse --short $base)..$(git rev-parse --short $ret)"
git clean -dfX &> /dev/null
git checkout -q "$base"
printf 'configuring tree...'
./configure $1 &> /dev/null
echo -ne '\r\e[2K'
for sha in $(git log --format='%h' --reverse $(git merge-base installation-tests $ret)..$ret); do
git checkout -q "$sha"
if git show --format='' --name-only | grep -q '\.in$'; then
printf "$sha: re-running ./config.status\r"
./config.status &> /dev/null
echo -ne '\e[2K'
fi
if grep -q '^tmpheader\.exe:.*libcamlrun' stdlib/Makefile; then
if [[ ! -f boot/ocamlrun ]]; then
git clean -dfX &> /dev/null
./configure $1 &> /dev/null
fi
printf "$sha: compiling...\r"
if ! make -j coldstart &> /dev/null ; then
make -j coldstart
echo "$sha: build failure!"
else
echo -ne '\e[2K'
fi
fi
rm -f stdlib/tmpheader.exe stdlib/tmpheader.o stdlib/tmpheader.obj
if ! make -C stdlib tmpheader.exe &> /dev/null; then
make -C stdlib tmpheader.exe
echo "$sha: header compilation error!"
else
echo "$sha: $(stat -c '%s' stdlib/tmpheader.exe) $(git log --format=%s "$sha" -1)"
fi
done
git checkout "$ret"