Skip to content

Commit c5d84e8

Browse files
dscholarsxschneider
authored andcommitted
Travis: also test on 32-bit Linux
When Git v2.9.1 was released, it had a bug that showed only on Windows and on 32-bit systems: our assumption that `unsigned long` can hold 64-bit values turned out to be wrong. This could have been caught earlier if we had a Continuous Testing set up that includes a build and test run on 32-bit Linux. Let's do this (and take care of the Windows build later). This patch asks Travis CI to install a Docker image with 32-bit libraries and then goes on to build and test Git using this 32-bit setup. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
1 parent 3bc5322 commit c5d84e8

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

.travis.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,15 @@ env:
3939

4040
matrix:
4141
include:
42+
- env: Linux32
43+
os: linux
44+
sudo: required
45+
services:
46+
- docker
47+
before_install:
48+
- docker pull daald/ubuntu32:xenial
49+
before_script:
50+
script: ci/run-linux32-build.sh daald/ubuntu32:xenial
4251
- env: Documentation
4352
os: linux
4453
compiler: clang

ci/run-linux32-build.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/sh
2+
#
3+
# Build and test Git in a docker container running a 32-bit Ubuntu Linux
4+
#
5+
# Usage:
6+
# run-linux32-build.sh [container-image]
7+
#
8+
9+
CONTAINER="${1:-daald/ubuntu32:xenial}"
10+
11+
sudo docker run --interactive --volume "${PWD}:/usr/src/git" "$CONTAINER" \
12+
/bin/bash -c 'linux32 --32bit i386 sh -c "
13+
: update packages &&
14+
apt update >/dev/null &&
15+
apt install -y build-essential libcurl4-openssl-dev libssl-dev \
16+
libexpat-dev gettext python >/dev/null &&
17+
18+
: build and test &&
19+
cd /usr/src/git &&
20+
export DEFAULT_TEST_TARGET='$DEFAULT_TEST_TARGET' &&
21+
export GIT_PROVE_OPTS=\"'"$GIT_PROVE_OPTS"'\" &&
22+
export GIT_TEST_OPTS=\"'"$GIT_TEST_OPTS"'\" &&
23+
export GIT_TEST_CLONE_2GB='$GIT_TEST_CLONE_2GB' &&
24+
make --jobs=2 &&
25+
make --quiet test || (
26+
27+
: make test-results readable to non-root user on TravisCI &&
28+
test '$TRAVIS' &&
29+
find t/test-results/ -type f -exec chmod o+r {} \; &&
30+
false )
31+
"'

0 commit comments

Comments
 (0)