diff options
Diffstat (limited to 'Tools/BuildSlaveSupport/gtk')
-rw-r--r-- | Tools/BuildSlaveSupport/gtk/README | 52 | ||||
-rwxr-xr-x | Tools/BuildSlaveSupport/gtk/buildbot/log/run | 38 | ||||
-rwxr-xr-x | Tools/BuildSlaveSupport/gtk/buildbot/run | 77 | ||||
-rwxr-xr-x | Tools/BuildSlaveSupport/gtk/crashmon/crashmon | 73 | ||||
-rwxr-xr-x | Tools/BuildSlaveSupport/gtk/crashmon/log/run | 38 | ||||
-rwxr-xr-x | Tools/BuildSlaveSupport/gtk/crashmon/run | 74 | ||||
-rw-r--r-- | Tools/BuildSlaveSupport/gtk/daemontools-buildbot.conf | 87 | ||||
-rwxr-xr-x | Tools/BuildSlaveSupport/gtk/pulseaudio/run | 24 | ||||
-rwxr-xr-x | Tools/BuildSlaveSupport/gtk/xvfb/log/run | 37 | ||||
-rwxr-xr-x | Tools/BuildSlaveSupport/gtk/xvfb/run | 41 |
10 files changed, 541 insertions, 0 deletions
diff --git a/Tools/BuildSlaveSupport/gtk/README b/Tools/BuildSlaveSupport/gtk/README new file mode 100644 index 0000000..9e58ae2 --- /dev/null +++ b/Tools/BuildSlaveSupport/gtk/README @@ -0,0 +1,52 @@ +============================================== + Running a GTK+ build slave under daemontools +============================================== + +This directory contains several scripts which can be used to run a WebKitGTK+ +build slave under daemontools [1]. This is convenient because daemontools +will automatically restart services when they die, and that means less human +intervention is needed. + + +Dependencies +============ + +In order to use the provided service control files, you will need the +following: + +* The GNU Bash shell (the scripts contain some bash-isms) + +* The daemontools package (or one of its drop-in replacements, like runit + or freedt; but only daemontools has been tested so far). + +* The crash dump monitor also uses "inotifywait" (part of inotify-tools [2]) + +In short, in a Debian-based system you can ensure you have the needed bits +with the following command: + + apt-get install inotify-tools daemontools-run + + +Setup +===== + +1. Follow the instructions at http://trac.webkit.org/wiki/BuildBot + +2. Install the dependencies outlined above. + +3. Copy "daemontools-buildbot.conf" to "/etc/daemontools-buildbot.conf" + +4. Edit the configuration file to suit your needs, the comments should + be self-explanatory. + +5. Drop the "buildbot", "pulseaudio" and "xvfb" directories (plus + "crashmon", if desired) to the service control directory of + daemontools; for Debian-based setups that would be "/etc/service" + + +References +========== + +[1] http://cr.yp.to/daemontools.html +[2] http://wiki.github.com/rvoicilas/inotify-tools/ + diff --git a/Tools/BuildSlaveSupport/gtk/buildbot/log/run b/Tools/BuildSlaveSupport/gtk/buildbot/log/run new file mode 100755 index 0000000..cc2c87e --- /dev/null +++ b/Tools/BuildSlaveSupport/gtk/buildbot/log/run @@ -0,0 +1,38 @@ +#! /bin/bash +# +# Copyright (C) 2010 Igalia S.L. All rights reserved. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Library General Public +# License as published by the Free Software Foundation; either +# version 2 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public License +# along with this library; see the file COPYING.LIB. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. + +: ${BUILDBOT_CONFIG:=/etc/daemontools-buildbot.conf} + +# Read configuration file +[ -r "${BUILDBOT_CONFIG}" ] && . "${BUILDBOT_CONFIG}" + +: ${buildbot_user:=${HOME}} +: ${buildbot_log_path:=/var/log/buildbot} + +# Expand all "env_*" environment variables +for varname in ${!env_*} ; do + eval "export ${varname#env_}=\${${varname}}" +done + +mkdir -p "${buildbot_log_path}" +chown "${buildbot_user}" "${buildbot_log_path}" + +exec /usr/bin/setuidgid "${buildbot_user}" \ + /usr/bin/multilog t "${buildbot_log_path}" + diff --git a/Tools/BuildSlaveSupport/gtk/buildbot/run b/Tools/BuildSlaveSupport/gtk/buildbot/run new file mode 100755 index 0000000..b26fe58 --- /dev/null +++ b/Tools/BuildSlaveSupport/gtk/buildbot/run @@ -0,0 +1,77 @@ +#! /bin/bash +# +# Copyright (C) 2010 Igalia S.L. All rights reserved. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Library General Public +# License as published by the Free Software Foundation; either +# version 2 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public License +# along with this library; see the file COPYING.LIB. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. + +exec 2>&1 + +: ${BUILDBOT_CONFIG:=/etc/daemontools-buildbot.conf} + +# Read configuration file +[ -r "${BUILDBOT_CONFIG}" ] && . "${BUILDBOT_CONFIG}" + +# Expand all "env_*" environment variables +for varname in ${!env_*} ; do + eval "export ${varname#env_}=\${${varname}}" +done + + +if ! [ "${buildbot_path}" ] ; then + echo "No \${buildbot_path} defined! (will sleep for 5 minutes)" + sleep 300 + exit 111 +fi + + +if ! [ "${WEBKIT_TESTFONTS}" ] ; then + echo "No \${WEBKIT_TESTFONTS} environment variable! (will sleep for 5 minutes)" + sleep 300 + exit 111 +fi + + +if [ "${coredump_output:=''}" ] ; then + # Ensure that the output directory exists. + if [[ ! -d ${crashmon_output} ]] ; then + mkdir -p "${crashmon_output}" + fi + + ulimit -c "${crashmon_max_size:=unlimited}" +fi + + +if [ "${ccache_path}" ] ; then + export PATH="${ccache_path}:${PATH}" +fi + +: ${buildbot_user:=${USER}} + +cd "${buildbot_path}" +exec /usr/bin/env - \ + TERM=dumb \ + TZ=PST8PDT \ + PATH="${PATH}" \ + SHELL=/bin/bash \ + LANG=en_US.UTF-8 \ + USER="${buildbot_user}" \ + LOGNAME="${buildbot_user}" \ + HOME="/home/${buildbot_user}" \ + DISPLAY="${xvfb_display:-':10'}" \ + MAIL="/var/mail/${buildbot_user}" \ + /usr/bin/setuidgid "${buildbot_user}" \ + /usr/bin/twistd -noy buildbot.tac + diff --git a/Tools/BuildSlaveSupport/gtk/crashmon/crashmon b/Tools/BuildSlaveSupport/gtk/crashmon/crashmon new file mode 100755 index 0000000..41705a2 --- /dev/null +++ b/Tools/BuildSlaveSupport/gtk/crashmon/crashmon @@ -0,0 +1,73 @@ +#! /bin/bash +# +# Copyright (C) 2010 Carlos Lopez <clopez@igalia.com>, Igalia S.L. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Library General Public +# License as published by the Free Software Foundation; either +# version 2 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public License +# along with this library; see the file COPYING.LIB. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. + +set -e + +[ "${coredir}" ] || { + echo "Env var '\${coredir}' not defined!" >&2 + exit 111 +} +[ "${programpath}" ] || { + echo "Env var '\${programpath}' not defined" >&2 + exit 111 +} +[ "${arch}" ] || { + echo "Env var '\${arch}' not defined" >&2 + exit 111 +} +[ "${mailto}" ] || { + echo "Env var '\${mailto}' not defined" >&2 + exit 111 +} + + +inotifywait -q -m --format '%f' --exclude '.trace.html$' -e close_write "${coredir}" | \ +while read -r coredump +do + if grep -qE '^core-when_[[:digit:]]{10\,12}-_-who_[[:print:]]+-_-why_' <<< "${coredump}" + then + # Get revision number from Subversion sources + rev=$(cd "${crashmon_src_path}" && svn info | sed -e '/^Revision:/s/Revision: //p' -e d) + + # Get the who from the coredump name + programfile=$(echo "${coredump}" \ + | awk -F'-_-who_' '{ print $2 }'\ + | awk -F'-_-why_' '{ print $1 }') + + # Sometimes programfile gets cut when it is a long name: + # Search using wildcards + fullprogrampath=$(find "${programpath}" -executable -name "${programfile}"\* | head -n1) + + ( printf "<html><head><title>StackTrace for ${programfile} from svn" + printf " rev ${rev}</title></head>\n<body>Core dump file: " + printf "<a href=\"cores/${coredump}\">${coredump}</a><br/>\n" + printf "<pre>Executable crashed: ${fullprogrampath}</pre>\n" + printf "<br/><hr><b>Stack Trace:</b><hr><br/>\n<pre>" + + gdb -ex "thread apply all bt" --batch "${fullprogrampath}" "${coredump}" 2>&1 \ + | sed -e 's/\&/\&/g;s/</\</g;s/>/\>/g;s/\"/\"/g' -e "s/'/\&\#039;/g" + + printf "</pre></body></html>\n" + ) > "/var/www/svn_${rev}.${coredump}.trace.html" + + # Make sure the web server can read it + chmod 644 "${coredump}" + fi +done + diff --git a/Tools/BuildSlaveSupport/gtk/crashmon/log/run b/Tools/BuildSlaveSupport/gtk/crashmon/log/run new file mode 100755 index 0000000..4dcd71f --- /dev/null +++ b/Tools/BuildSlaveSupport/gtk/crashmon/log/run @@ -0,0 +1,38 @@ +#! /bin/bash +# +# Copyright (C) 2010 Igalia S.L. All rights reserved. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Library General Public +# License as published by the Free Software Foundation; either +# version 2 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public License +# along with this library; see the file COPYING.LIB. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. + +: ${BUILDBOT_CONFIG:=/etc/daemontools-buildbot.conf} + +# Read configuration file +[ -r "${BUILDBOT_CONFIG}" ] && . "${BUILDBOT_CONFIG}" + +: ${buildbot_user:=${HOME}} +: ${crashmon_log_path:=/var/log/crashmon} + +# Expand all "env_*" environment variables +for varname in ${!env_*} ; do + eval "export ${varname#env_}=\${${varname}}" +done + +mkdir -p "${crashmon_log_path}" +chown "${buildbot_user}" "${crashmon_log_path}" + +exec /usr/bin/setuidgid "${buildbot_user}" \ + /usr/bin/multilog t "${crashmon_log_path}" + diff --git a/Tools/BuildSlaveSupport/gtk/crashmon/run b/Tools/BuildSlaveSupport/gtk/crashmon/run new file mode 100755 index 0000000..38be3fe --- /dev/null +++ b/Tools/BuildSlaveSupport/gtk/crashmon/run @@ -0,0 +1,74 @@ +#! /bin/bash +# +# Copyright (C) 2010 Igalia S.L. All rights reserved. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Library General Public +# License as published by the Free Software Foundation; either +# version 2 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public License +# along with this library; see the file COPYING.LIB. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. + +exec 2>&1 + +: ${BUILDBOT_CONFIG:=/etc/daemontools-buildbot.conf} + +# Read configuration file +[ -r "${BUILDBOT_CONFIG}" ] && . "${BUILDBOT_CONFIG}" + +: ${buildbot_user:=${USER:-${LOGNAME}}} +: ${crashmon_output:=''} + +# Expand all "env_*" environment variables +for varname in ${!env_*} ; do + eval "export ${varname#env_}=\${${varname}}" +done + + +if [ ! -d "${crashmon_output}" ] +then + if ! [ "${crashmon_output}" ] + then + echo "Dump directory '${crashmon_output}' does not exist (sleeping)" + fi + sleep $(( 60 * 60 * 4 )) + exit 111 +fi + + +if ! [ "${buildbot_bits}" ] +then + # Guess bits (32/64) from uname -m + machine=$(uname -m) + case ${machine} in + x86_64 | amd64 | ia64 | ppc64) + buildbot_bits="64" ;; + *) + buildbot_bits="32" ;; + esac +fi + +: ${crashmon_bin_path:="${buildbot_path}/gtk-linux-${buildbot_bits}-debug/build/WebKitBuild/Debug/Programs"} + + +cd "${crashmon_output}" +exec /usr/bin/env - \ + PATH="${PATH}" \ + SHELL="/bin/bash" \ + USER="${buildbot_user}" \ + arch="${buildbot_bits}" \ + LOGNAME="${buildbot_user}" \ + coredir="${crashmon_output}" \ + HOME="/home/${buildbot_user}" \ + mailto="${crashmon_mailto:-''}" \ + programpath="${crashmon_bin_path}" \ + /usr/bin/setuidgid "${buildbot_user}" "$(pwd)/crashmon" + diff --git a/Tools/BuildSlaveSupport/gtk/daemontools-buildbot.conf b/Tools/BuildSlaveSupport/gtk/daemontools-buildbot.conf new file mode 100644 index 0000000..59c1c0b --- /dev/null +++ b/Tools/BuildSlaveSupport/gtk/daemontools-buildbot.conf @@ -0,0 +1,87 @@ +# Copyright (C) 2010 Igalia S.L. All rights reserved. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Library General Public +# License as published by the Free Software Foundation; either +# version 2 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public License +# along with this library; see the file COPYING.LIB. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. + + +# Path to the Buildbot slave directory +# +buildbot_path="/home/slave/webkitgtk" + +# User account used to run Buildbot. +# +buildbot_user="slave" + +# Path to a directory where to log Buildbot output +# +buildbot_log_path="/var/log/buildbot" + + +# Display number under which Xvfb will run +# +xvfb_display=":10" + +# Graphical mode which Xvfb will report to applications +# +xvfb_mode="1024x768x24" + +# Path to a directory where to log Xvfb error output +# +xvfb_log_path="/var/log/xvfb" + + +# Output directory for core dumps. Set this to an empty string to +# disable recording them. +# +crashmon_output="/var/www/webkitgtk-coredumps" + +# Maximum size of core dumps. With the default "unlimited" setting +# it is recommended to have ~20GB for cores in 64-bit machines. +# For 32-bit bots, less space is needed. +# +crashmon_max_size="unlimited" + +# Path to a directory where to log crashmon output +# +crashmon_log_path="/var/log/crashmon" + +# A list of e-mail addresses where to send notifications of core dumps. +# Leave empty to disable mail notifications. +# +# WARNING: E-mail addresses will be flooded with messages! +# +crashmon_mailto="" + +# Base directory where to find sources and built binaries of which +# crash dumps are to be catched. Usually you will not need to change this. +# +crashmon_src_path="${buildbot_path}/gtk-linux-${buildbot_bits}-debug/build" +crashmon_bin_path="${crashmon_src_path}/WebKitBuild/Debug/Programs" + + +# If you want to use ccache, set a path to where synlinks with tool +# names pointing to ccache are installed. In Debian systems this +# would be /usr/lib/ccache. Set to empty to disable. +# +ccache_path="/usr/lib/ccache" + + +# Environment variables. Prefix them with "env_". +# +env_CFLAGS="-pipe" +env_CXXFLAGS="-pipe" +env_WebKitMakeArguments="-j3" +env_WEBKIT_TESTFONTS="/home/${buildbot_user}/testfonts" + diff --git a/Tools/BuildSlaveSupport/gtk/pulseaudio/run b/Tools/BuildSlaveSupport/gtk/pulseaudio/run new file mode 100755 index 0000000..37ba0de --- /dev/null +++ b/Tools/BuildSlaveSupport/gtk/pulseaudio/run @@ -0,0 +1,24 @@ +#! /bin/bash +# +# Copyright (C) 2010 Igalia S.L. All rights reserved. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Library General Public +# License as published by the Free Software Foundation; either +# version 2 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public License +# along with this library; see the file COPYING.LIB. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. + +exec 2>&1 +exec /usr/bin/pulseaudio --system \ + --disallow-exit --disallow-module-loading \ + --log-target=syslog + diff --git a/Tools/BuildSlaveSupport/gtk/xvfb/log/run b/Tools/BuildSlaveSupport/gtk/xvfb/log/run new file mode 100755 index 0000000..1c83922 --- /dev/null +++ b/Tools/BuildSlaveSupport/gtk/xvfb/log/run @@ -0,0 +1,37 @@ +#! /bin/bash +# +# Copyright (C) 2010 Igalia S.L. All rights reserved. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Library General Public +# License as published by the Free Software Foundation; either +# version 2 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public License +# along with this library; see the file COPYING.LIB. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. + +: ${BUILDBOT_CONFIG:=/etc/daemontools-buildbot.conf} + +# Read configuration file +[ -r "${BUILDBOT_CONFIG}" ] && . "${BUILDBOT_CONFIG}" + +: ${buildbot_user:=${HOME}} +: ${xvfb_log_path:=/var/log/xvfb} + +# Expand all "env_*" environment variables +for varname in ${!env_*} ; do + eval "export ${varname#env_}=\${${varname}}" +done + +mkdir -p "${xvfb_log_path}" +chown "${buildbot_user}" "${xvfb_log_path}" + +exec /usr/bin/setuidgid "${buildbot_user}" \ + /usr/bin/multilog t "${xvfb_log_path}" diff --git a/Tools/BuildSlaveSupport/gtk/xvfb/run b/Tools/BuildSlaveSupport/gtk/xvfb/run new file mode 100755 index 0000000..89cd301 --- /dev/null +++ b/Tools/BuildSlaveSupport/gtk/xvfb/run @@ -0,0 +1,41 @@ +#! /bin/bash +# +# Copyright (C) 2010 Igalia S.L. All rights reserved. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Library General Public +# License as published by the Free Software Foundation; either +# version 2 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public License +# along with this library; see the file COPYING.LIB. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. + +exec 2>&1 + +: ${BUILDBOT_CONFIG:=/etc/daemontools-buildbot.conf} + +# Read configuration file +[ -r "${BUILDBOT_CONFIG}" ] && . "${BUILDBOT_CONFIG}" + +: ${xvfb_display:=':10'} +: ${xvfb_mode:='1024x768x24'} + +# Expand all "env_*" environment variables +for varname in ${!env_*} ; do + eval "export ${varname#env_}=\${${varname}}" +done + +mkdir -p "xvfb${xvfb_display}" +exec /usr/bin/Xvfb "${xvfb_display}" \ + -fbdir "xvfb${xvfb_display}" \ + -screen 0 "${xvfb_mode}" \ + -nolisten inet6 \ + -nolisten inet + |