ci: add 32-bit travis builds

Message ID 20191119151543.54309-1-bruce.richardson@intel.com (mailing list archive)
State Accepted, archived
Delegated to: David Marchand
Headers
Series ci: add 32-bit travis builds |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-compilation success Compile Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/travis-robot success Travis build: passed
ci/Intel-compilation fail apply issues

Commit Message

Bruce Richardson Nov. 19, 2019, 3:15 p.m. UTC
  Add a travis job to build for 32-bit on 64-bit systems to catch additional
build errors, for example, incorrect use of printf specifiers with uint64_t
types.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 .ci/linux-build.sh |  5 +++++
 .travis.yml        | 10 ++++++++++
 2 files changed, 15 insertions(+)
  

Comments

Aaron Conole Nov. 19, 2019, 4:06 p.m. UTC | #1
Bruce Richardson <bruce.richardson@intel.com> writes:

> Add a travis job to build for 32-bit on 64-bit systems to catch additional
> build errors, for example, incorrect use of printf specifiers with uint64_t
> types.
>
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---

Nice!

Acked-by: Aaron Conole <aconole@redhat.com>
  
David Marchand Nov. 19, 2019, 9:38 p.m. UTC | #2
On Tue, Nov 19, 2019 at 5:06 PM Aaron Conole <aconole@redhat.com> wrote:
>
> Bruce Richardson <bruce.richardson@intel.com> writes:
>
> > Add a travis job to build for 32-bit on 64-bit systems to catch additional
> > build errors, for example, incorrect use of printf specifiers with uint64_t
> > types.
> >
> > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> Acked-by: Aaron Conole <aconole@redhat.com>

Applied, thanks.



--
David Marchand
  

Patch

diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh
index 6075c440c..c570ba24e 100755
--- a/.ci/linux-build.sh
+++ b/.ci/linux-build.sh
@@ -23,6 +23,11 @@  if [ "$BUILD_DOCS" = "1" ]; then
     OPTS="$OPTS -Denable_docs=true"
 fi
 
+if [ "$BUILD_32BIT" = "1" ]; then
+    OPTS="$OPTS -Dc_args=-m32 -Dc_link_args=-m32"
+    export PKG_CONFIG_LIBDIR="/usr/lib32/pkgconfig"
+fi
+
 OPTS="$OPTS --default-library=$DEF_LIB"
 meson build --werror -Dexamples=all $OPTS
 ninja -C build
diff --git a/.travis.yml b/.travis.yml
index 3d6ef2959..7b9fc6898 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -23,6 +23,10 @@  extra_packages: &extra_packages
   - *required_packages
   - [libbsd-dev, libpcap-dev, libcrypto++-dev, libjansson4]
 
+build_32b_packages: &build_32b_packages
+  - *required_packages
+  - [gcc-multilib]
+
 doc_packages: &doc_packages
   - [doxygen, graphviz, python3-sphinx]
 
@@ -37,6 +41,12 @@  env:
 
 matrix:
   include:
+  - env: DEF_LIB="static" BUILD_32BIT=1
+    compiler: gcc
+    addons:
+      apt:
+        packages:
+          - *build_32b_packages
   - env: DEF_LIB="static" OPTS="-Denable_kmods=false" AARCH64=1
     compiler: gcc
     addons: