QEMU: include test runs for most cross compilation targets
authorPauli <pauli@openssl.org>
Fri, 23 Jul 2021 01:48:32 +0000 (11:48 +1000)
committerPauli <pauli@openssl.org>
Wed, 28 Jul 2021 00:30:45 +0000 (10:30 +1000)
For the cross compiles where the tests couldn't be run, most are capable
of being run when statically linked.  For these, a shared with FIPS build
but not test run is also included to maximise compilation coverage.
The builds take a couple of minutes so the impact of these extra jobs
isn't great.

The test failures for test_includes, test_store and test_x509_store
across several platforms are related the the OPENSSL_DIR_read() call.
This gets a "Value too large for defined data type" error calling the
standard library's readdir() wrapper.  That is, the failure is during
the translation from the x86-64 structure to the 32 bit structure.
I've tried tweaking the include defines to use larger fields but couldn't
figure out how to make it work.  The most prudent fix is to ignore these
tests for these platforms.

Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/16144)

.github/workflows/cross-compiles.yml

index 6b4505c5db2aaa8956ededb9dfd719ac55716e09..3aa916ab4600041780ace3cb8c430e6034d4e53f 100644 (file)
@@ -14,6 +14,8 @@ jobs:
         #   libs: the Debian package for the necessary link/runtime libraries.
         #   target: the OpenSSL configuration target to use, this is passed
         #           directly to the config command line.
+        #   fips:   set to "no" to disable building FIPS, leave unset to
+        #           build the FIPS provider.
         #   tests: omit this to run all the tests using QEMU, set it to "none"
         #          to never run the tests, otherwise it's value is passed to
         #          the "make test" command to allow selectiving disabling of
@@ -40,23 +42,26 @@ jobs:
           }, {
             arch: hppa-linux-gnu,
             libs: libc6-dev-hppa-cross,
-            target: linux-generic32,
-            tests: none #-test_includes -test_store -test_x509_store
+            target: -static linux-generic32,
+            fips: no,
+            tests: -test_includes -test_store -test_x509_store
           }, {
             arch: m68k-linux-gnu,
             libs: libc6-dev-m68k-cross,
-            target: linux-latomic no-asm,
-            tests: none #-test_includes -test_store -test_x509_store -test_includes
+            target: -static no-asm linux-latomic,
+            fips: no,
+            tests: -test_includes -test_store -test_x509_store -test_params_conversion
           }, {
             arch: mips-linux-gnu,
             libs: libc6-dev-mips-cross,
-            target: linux-mips32,
-            tests: none
+            target: -static linux-mips32,
+            fips: no,
+            tests: -test_includes -test_store -test_x509_store
           }, {
             arch: mips64-linux-gnuabi64,
             libs: libc6-dev-mips64-cross,
-            target: linux64-mips64,
-            tests: none
+            target: -static linux64-mips64,
+            fips: no
           }, {
             arch: mipsel-linux-gnu,
             libs: libc6-dev-mipsel-cross,
@@ -79,7 +84,35 @@ jobs:
             libs: libc6-dev-sh4-cross,
             target: linux-latomic,
             tests: -test_includes -test_store -test_x509_store -test_async
+          },
+
+          # These build with shared libraries but they crash when run
+          # They mirror static builds above in order to cover more of the
+          # code base.
+          {
+            arch: hppa-linux-gnu,
+            libs: libc6-dev-hppa-cross,
+            target: linux-generic32,
+            tests: none
           }, {
+            arch: m68k-linux-gnu,
+            libs: libc6-dev-m68k-cross,
+            target: no-asm linux-latomic,
+            tests: none
+          }, {
+            arch: mips-linux-gnu,
+            libs: libc6-dev-mips-cross,
+            target: linux-mips32,
+            tests: none
+          }, {
+            arch: mips64-linux-gnuabi64,
+            libs: libc6-dev-mips64-cross,
+            target: linux64-mips64,
+            tests: none
+          },
+
+          # This build doesn't execute either with or without shared libraries.
+          {
             arch: sparc64-linux-gnu,
             libs: libc6-dev-sparc64-cross,
             target: linux64-sparcv9,
@@ -96,11 +129,18 @@ jobs:
             ${{ matrix.platform.libs }}
     - uses: actions/checkout@v2
 
-    - name: config
+    - name: config with FIPS
+      if: matrix.platform.fips != 'no'
       run: |
         ./config --banner=Configured --strict-warnings enable-fips \
                  --cross-compile-prefix=${{ matrix.platform.arch }}- \
                  ${{ matrix.platform.target }}
+    - name: config without FIPS
+      if: matrix.platform.fips == 'no'
+      run: |
+        ./config --banner=Configured --strict-warnings \
+                 --cross-compile-prefix=${{ matrix.platform.arch }}- \
+                 ${{ matrix.platform.target }}
     - name: config dump
       run: ./configdata.pm --dump