path: root/ci
diff options
authorJohannes Schindelin <>2017-03-05 18:25:19 (GMT)
committerJunio C Hamano <>2017-03-06 19:19:09 (GMT)
commit88dedd5e72c082b741744c393567d7e5b4d03241 (patch)
tree6b671121377946491444e1ce2ab2e6b1103ed9d4 /ci
parent3b9e3c2cede15057af3ff8076c45ad5f33829436 (diff)
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 <> Signed-off-by: Lars Schneider <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'ci')
1 files changed, 30 insertions, 0 deletions
diff --git a/ci/ b/ci/
new file mode 100755
index 0000000..e30fb2c
--- /dev/null
+++ b/ci/
@@ -0,0 +1,30 @@
+# Build and test Git in a 32-bit environment
+# Usage:
+# [host-user-id]
+# Update packages to the latest available versions
+linux32 --32bit i386 sh -c '
+ apt update >/dev/null &&
+ apt install -y build-essential libcurl4-openssl-dev libssl-dev \
+ libexpat-dev gettext python >/dev/null
+' &&
+# If this script runs inside a docker container, then all commands are
+# usually executed as root. Consequently, the host user might not be
+# able to access the test output files.
+# If a host user id is given, then create a user "ci" with the host user
+# id to make everything accessible to the host user.
+HOST_UID=$1 &&
+test -z $HOST_UID || (CI_USER="ci" && useradd -u $HOST_UID $CI_USER) &&
+# Build and test
+linux32 --32bit i386 su -m -l $CI_USER -c '
+ cd /usr/src/git &&
+ make --jobs=2 &&
+ make --quiet test