Initial check-in
authorJoachim Breitner <mail@joachim-breitner.de>
Tue, 3 Jun 2014 12:26:08 +0000 (14:26 +0200)
committerJoachim Breitner <mail@joachim-breitner.de>
Tue, 3 Jun 2014 12:26:08 +0000 (14:26 +0200)
ci-validate.sh [new file with mode: 0755]
compare-ifaces.sh [new file with mode: 0755]
compare-testruns.sh [new file with mode: 0755]
new-ghc-checkout [new file with mode: 0755]

diff --git a/ci-validate.sh b/ci-validate.sh
new file mode 100755 (executable)
index 0000000..4221c73
--- /dev/null
@@ -0,0 +1,69 @@
+#!/bin/bash
+
+cd /5playpen/t-jobrei/ghc-validate
+
+function get_branch () 
+{
+       git branch --list validate/\*|head -n 1|cut -c3-
+}
+
+function run (){
+       printf "%q " "$@"
+       echo
+       "$@"
+}
+function run_quiet (){
+       printf "%q " "$@"
+       echo
+       "$@" > /dev/null 2>&1
+}
+function run_to (){
+       file="$1"
+       shift
+       printf "%q " "$@"
+       echo "-> $file"
+       "$@" > "$file" 2>&1
+}
+
+
+while true
+do
+while [ -z "$(get_branch)" ]; do sleep 1; done
+
+BRANCH="$(get_branch)"
+BRANCH_BASE="${BRANCH#validate/}"
+LOGFILE="../validate-$BRANCH_BASE-$(date --iso=minutes).log"
+
+echo "I am asked to validate $BRANCH_BASE"
+
+echo "Making sure we are on current master"
+run_quiet ./sync-all checkout master
+run_quiet ./sync-all pull
+echo "Switching to that branch"
+run_quiet ./sync-all checkout "$BRANCH"
+git branch | fgrep -q "* $BRANCH"
+echo "moving branch to validating/$BRANCH_BASE"
+run_quiet ./sync-all --ignore-failure branch -M "$BRANCH" "validating/$BRANCH_BASE"
+echo "Running validate"
+export CPUS=8
+if run_to "$LOGFILE" ./validate --no-dph 
+then
+       echo "validate successful"
+       echo "moving branch to validated/$BRANCH_BASE"
+       run_quiet ./sync-all --ignore-failure branch -M "validating/$BRANCH_BASE" "validated/$BRANCH_BASE"
+else
+       echo "validate broken"
+       echo "moving branch to broken/$BRANCH_BASE"
+       run_quiet ./sync-all --ignore-failure branch -M "validating/$BRANCH_BASE" "broken/$BRANCH_BASE"
+fi
+run_quiet make -C testsuite CLEANUP=1 CLEAN_ONLY=YES
+run_quiet make clean
+echo Resetting to master and updating 
+run_quiet ./sync-all checkout master
+run_quiet ./sync-all pull
+echo "Waiting for new branches to appear."
+
+
+sleep 10
+done
+
diff --git a/compare-ifaces.sh b/compare-ifaces.sh
new file mode 100755 (executable)
index 0000000..dc1777e
--- /dev/null
@@ -0,0 +1,33 @@
+#!/bin/bash
+
+tree1=$1
+tree2=$2
+mod=$3
+
+if [ -z "$1" -o -z "$2" -o -z "$3" ]
+then 
+  echo "Usage: $0 tree1 tree2 module-name"
+  exit 1
+fi
+
+file="$( echo $mod | tr . /)"
+
+path1="$( find $tree1 -path \*$file.hi | grep -v haskell2010 )"
+path2="$( find $tree2 -path \*$file.hi | grep -v haskell2010 )"
+if [ -z "$path1" ]
+then
+  echo "Could not find $file.hi in $tree1"
+  exit 1
+fi
+if [ -z "$path2" ]
+then
+  echo "Could not find $file.hi in $tree2"
+  exit 1
+fi
+
+
+diff -U 10000 \
+ <($tree1/inplace/bin/ghc-stage1 --show-iface $path1) \
+ <($tree2/inplace/bin/ghc-stage1 --show-iface $path2)
+
+
diff --git a/compare-testruns.sh b/compare-testruns.sh
new file mode 100755 (executable)
index 0000000..8d6d030
--- /dev/null
@@ -0,0 +1,39 @@
+#!/bin/bash
+
+tree1="$1"
+tree2="$2"
+benchname="$3"
+shift; shift; shift
+
+if [ -z "$tree1" -o -z "$tree2" -o -z "$benchname" ]
+then 
+  echo "Usage: $0 tree1 tree2 benchname"
+  exit 1
+fi
+
+path1="$( find $tree1 -path \*/$benchname -type d )"
+path2="$( find $tree2 -path \*/$benchname -type d )"
+
+if [ -z "$path1" ]
+then
+  echo "Could not find a directory $benchname in $tree1"
+  exit 1
+fi
+echo "Found $path1 in $tree1"
+if [ -z "$path2" ]
+then
+  echo "Could not find a directory $benchname in $path2"
+  exit 1
+fi
+echo "Found $path2 in $tree2"
+
+(cd $path1; make clean)
+(cd $path2; make clean)
+
+echo Diff follows...
+
+${DIFF:-diff -U 10000} \
+ <(cd $path1 && make NoFibRuns=1 2>&1) \
+ <(cd $path2 && make NoFibRuns=1 2>&1)
+
+
diff --git a/new-ghc-checkout b/new-ghc-checkout
new file mode 100755 (executable)
index 0000000..4da17e6
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+if [ -z "$1" ]
+then
+       echo "Usage: $0 name"
+       exit 1
+fi
+
+set -e
+cd /5playpen/t-jobrei/
+git clone ghc-master "$1"
+cd "$1"
+./sync-all --no-dph --testsuite get
+./sync-all -r git://git.haskell.org remote set-url origin
+./sync-all -r ssh://git@git.haskell.org remote set-url --push origin
+./sync-all checkout master
+./sync-all pull
+cp ../ghc-master/mk/build.mk mk/
+perl boot
+./configure
+make -j4 V=0
+echo "Done, you should now do a "
+echo "cd $(realpath .)"