Skip to content

Commit

Permalink
Add 32-bit builds to Travis CI
Browse files Browse the repository at this point in the history
  • Loading branch information
jmmv committed Jul 18, 2016
1 parent cdda60f commit 4c08392
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 13 deletions.
23 changes: 14 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,30 @@ before_install:
- ./admin/travis-install-deps.sh

env:
- DO=apidocs
- DO=style
- DO=distcheck AS_ROOT=no
- DO=distcheck AS_ROOT=yes UNPRIVILEGED_USER=no
- DO=distcheck AS_ROOT=yes UNPRIVILEGED_USER=yes
- ARCH=amd64 DO=apidocs
- ARCH=amd64 DO=style
- ARCH=amd64 DO=distcheck AS_ROOT=no
- ARCH=amd64 DO=distcheck AS_ROOT=yes UNPRIVILEGED_USER=no
- ARCH=amd64 DO=distcheck AS_ROOT=yes UNPRIVILEGED_USER=yes
- ARCH=i386 DO=distcheck AS_ROOT=no

matrix:
exclude:
# Treat clang as the main compiler. For gcc, just run the AS_ROOT=no
# env above to see if we can actually build, but do not really worry
# about the run-time aspects of the tests.
- compiler: gcc
env: DO=apidocs
env: ARCH=amd64 DO=apidocs
- compiler: gcc
env: DO=style
env: ARCH=amd64 DO=style
- compiler: gcc
env: DO=distcheck AS_ROOT=yes UNPRIVILEGED_USER=no
env: ARCH=amd64 DO=distcheck AS_ROOT=yes UNPRIVILEGED_USER=no
- compiler: gcc
env: DO=distcheck AS_ROOT=yes UNPRIVILEGED_USER=yes
env: ARCH=amd64 DO=distcheck AS_ROOT=yes UNPRIVILEGED_USER=yes
# For the i386 test, use gcc as that's the only prebuilt version of
# the tools we've got.
- compiler: clang
env: ARCH=i386 DO=distcheck AS_ROOT=no

script:
- ./admin/travis-build.sh
Expand Down
5 changes: 5 additions & 0 deletions admin/travis-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,13 @@ do_distcheck() {

sudo sysctl -w "kernel.core_pattern=core.%p"

local archflags=
[ "${ARCH?}" != i386 ] || archflags=-m32

local f=
f="${f} CFLAGS='${archflags}'"
f="${f} CPPFLAGS='-I/usr/local/include'"
f="${f} CXXFLAGS='${archflags}'"
f="${f} LDFLAGS='-L/usr/local/lib -Wl,-R/usr/local/lib'"
f="${f} PKG_CONFIG_PATH='/usr/local/lib/pkgconfig'"
if [ "${AS_ROOT:-no}" = yes ]; then
Expand Down
41 changes: 37 additions & 4 deletions admin/travis-install-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,25 @@

set -e -x

sudo apt-get update -qq
sudo apt-get install -y gdb liblua5.2-0 liblua5.2-dev \
libsqlite3-0 libsqlite3-dev pkg-config sqlite3
install_deps() {
sudo apt-get update -qq

local pkgsuffix=
local packages=
if [ "${ARCH?}" = i386 ]; then
pkgsuffix=:i386
packages="${packages} gcc-multilib"
packages="${packages} g++-multilib"
fi
packages="${packages} gdb"
packages="${packages} liblua5.2-0${pkgsuffix}"
packages="${packages} liblua5.2-dev${pkgsuffix}"
packages="${packages} libsqlite3-0${pkgsuffix}"
packages="${packages} libsqlite3-dev${pkgsuffix}"
packages="${packages} pkg-config${pkgsuffix}"
packages="${packages} sqlite3"
sudo apt-get install -y ${packages}
}

install_from_github() {
local name="${1}"; shift
Expand All @@ -44,12 +60,17 @@ install_from_github() {
"${baseurl}/releases/download/${distname}/${distname}.tar.gz"
tar -xzvf "${distname}.tar.gz"

local archflags=
[ "${ARCH?}" != i386 ] || archflags=-m32

cd "${distname}"
./configure \
--disable-developer \
--without-atf \
--without-doxygen \
CFLAGS="${archflags}" \
CPPFLAGS="-I/usr/local/include" \
CXXFLAGS="${archflags}" \
LDFLAGS="-L/usr/local/lib -Wl,-R/usr/local/lib" \
PKG_CONFIG_PATH="/usr/local/lib/pkgconfig"
make
Expand All @@ -60,7 +81,18 @@ install_from_github() {
}

install_from_bintray() {
local name="20160204-usr-local-kyua-ubuntu-12-04-amd64-${CC:-gcc}.tar.gz"
case "${ARCH?}" in
amd64)
name="20160204-usr-local-kyua-ubuntu-12-04-amd64-${CC?}.tar.gz"
;;
i386)
name="20160714-usr-local-kyua-ubuntu-12-04-i386-${CC?}.tar.gz"
;;
*)
echo "ERROR: Unknown ARCH value ${ARCH}" 1>&2
exit 1
;;
esac
wget "http://dl.bintray.com/jmmv/kyua/${name}" || return 1
sudo tar -xzvp -C / -f "${name}"
rm -f "${name}"
Expand Down Expand Up @@ -92,6 +124,7 @@ main() {
echo "DO must be defined" 1>&2
exit 1
fi
install_deps
for step in ${DO}; do
"do_${DO}" || exit 1
done
Expand Down

0 comments on commit 4c08392

Please sign in to comment.