summaryrefslogtreecommitdiffstats
path: root/loop-rebuild
blob: 6e2d0888fa4ef58a5d1055d9ae7db7d12c570e24 (plain)
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
#!/bin/sh

R=:rendezvous
if ! test -p "$R"
then
	rm -f "$R"
	mkfifo "$R" || exit
fi

export CC=clang

while cat "$R"
do
	time nice -20 Meta/Dothem -j32 --meson CC="clang -O2" USE_ASCIIDOCTOR=
	uptime; date
	Meta/V
done

exit

ssleep () {
	seconds=$1
	now=$(date "+%s")
	sleep $(( ((now + seconds + seconds / 4) / seconds) * seconds - now))
}

stamp () {
	Meta/V 2>/dev/null | sha1sum
}

export CC=clang

P=previous
O=observed
while :
do
	while O=$(stamp) && test "$P" = "$O"
	do
		ssleep 300
	done
	ssleep 30

	time nice -20 Meta/Dothem -j32 --meson CC="clang -O2" USE_ASCIIDOCTOR=

	uptime; date
	P=$(stamp)
	Meta/V
done