[1/5] ci: test build with minimum configuration

Message ID 20211110164814.5231-2-david.marchand@redhat.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series Extend optional libraries list |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/iol-testing warning apply patch failure

Commit Message

David Marchand Nov. 10, 2021, 4:48 p.m. UTC
  Disabling optional libraries was not tested.
Add a new target in test-meson-builds.sh and GHA.

The Bluefield target is removed from test-meson-builds.sh to save space
and compilation time in exchange of the new target.

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 .ci/linux-build.sh            | 3 +++
 .github/workflows/build.yml   | 5 +++++
 devtools/test-meson-builds.sh | 4 +++-
 3 files changed, 11 insertions(+), 1 deletion(-)
  

Comments

Thomas Monjalon Nov. 16, 2021, 5:06 p.m. UTC | #1
10/11/2021 17:48, David Marchand:
> Disabling optional libraries was not tested.
> Add a new target in test-meson-builds.sh and GHA.
> 
> The Bluefield target is removed from test-meson-builds.sh to save space
> and compilation time in exchange of the new target.

OK to remove build-arm64-bluefield.
We should also remove build-arm64-host-clang which has no benefit.
And instead of adding a new target, can we reuse an existing one,
like build-clang-static or build-arm64-dpaa?
  
David Marchand Nov. 16, 2021, 8:39 p.m. UTC | #2
On Tue, Nov 16, 2021 at 6:06 PM Thomas Monjalon <thomas@monjalon.net> wrote:
>
> 10/11/2021 17:48, David Marchand:
> > Disabling optional libraries was not tested.
> > Add a new target in test-meson-builds.sh and GHA.
> >
> > The Bluefield target is removed from test-meson-builds.sh to save space
> > and compilation time in exchange of the new target.
>
> OK to remove build-arm64-bluefield.
> We should also remove build-arm64-host-clang which has no benefit.

To be fair, I originally had no such change and added this following
an offline discussion you and I had :-).
But this is going farther than what this patch is about: testing
disabling components through existing options.


> And instead of adding a new target, can we reuse an existing one,
> like build-clang-static or build-arm64-dpaa?

Reusing means we lose some coverage of the existing target.
I prefer adding a dedicated target.

So I think I'll go back to my original idea and drop the bluefield change.
To make this new target less space/cpu consuming (which impacts us,
maintainers, when merging patches), I can make it a really
minimalistic configuration: I would disable all drivers (but the
net/null one used in test-null.sh).


I don't mind looking into other target usefulness in
test-meson-builds.sh, but as a followup series.
  
Thomas Monjalon Nov. 16, 2021, 9:47 p.m. UTC | #3
16/11/2021 21:39, David Marchand:
> On Tue, Nov 16, 2021 at 6:06 PM Thomas Monjalon <thomas@monjalon.net> wrote:
> >
> > 10/11/2021 17:48, David Marchand:
> > > Disabling optional libraries was not tested.
> > > Add a new target in test-meson-builds.sh and GHA.
> > >
> > > The Bluefield target is removed from test-meson-builds.sh to save space
> > > and compilation time in exchange of the new target.
> >
> > OK to remove build-arm64-bluefield.
> > We should also remove build-arm64-host-clang which has no benefit.
> 
> To be fair, I originally had no such change and added this following
> an offline discussion you and I had :-).
> But this is going farther than what this patch is about: testing
> disabling components through existing options.
> 
> 
> > And instead of adding a new target, can we reuse an existing one,
> > like build-clang-static or build-arm64-dpaa?
> 
> Reusing means we lose some coverage of the existing target.
> I prefer adding a dedicated target.
> 
> So I think I'll go back to my original idea and drop the bluefield change.
> To make this new target less space/cpu consuming (which impacts us,
> maintainers, when merging patches), I can make it a really
> minimalistic configuration: I would disable all drivers (but the
> net/null one used in test-null.sh).
> 
> 
> I don't mind looking into other target usefulness in
> test-meson-builds.sh, but as a followup series.

I fully agree with this plan.
  

Patch

diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh
index ef0bd099be..e7ed648099 100755
--- a/.ci/linux-build.sh
+++ b/.ci/linux-build.sh
@@ -87,6 +87,9 @@  OPTS="$OPTS -Dplatform=generic"
 OPTS="$OPTS --default-library=$DEF_LIB"
 OPTS="$OPTS --buildtype=debugoptimized"
 OPTS="$OPTS -Dcheck_includes=true"
+if [ "$NO_OPTIONAL_LIBS" = "true" ]; then
+    OPTS="$OPTS -Ddisable_libs=*"
+fi
 meson build --werror $OPTS
 ninja -C build
 
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 4151cafee7..346cc75c20 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -21,6 +21,7 @@  jobs:
       CC: ccache ${{ matrix.config.compiler }}
       DEF_LIB: ${{ matrix.config.library }}
       LIBABIGAIL_VERSION: libabigail-1.8
+      NO_OPTIONAL_LIBS: ${{ matrix.config.no_optional_libs != '' }}
       PPC64LE: ${{ matrix.config.cross == 'ppc64le' }}
       REF_GIT_TAG: none
       RUN_TESTS: ${{ contains(matrix.config.checks, 'tests') }}
@@ -32,6 +33,10 @@  jobs:
           - os: ubuntu-18.04
             compiler: gcc
             library: static
+          - os: ubuntu-18.04
+            compiler: gcc
+            library: shared
+            no_optional_libs: no-optional-libs
           - os: ubuntu-18.04
             compiler: gcc
             library: shared
diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh
index 9ec8e2bc7e..36ecf63ec6 100755
--- a/devtools/test-meson-builds.sh
+++ b/devtools/test-meson-builds.sh
@@ -220,6 +220,8 @@  for c in gcc clang ; do
 	done
 done
 
+build build-x86-no-optional-libs cc skipABI $use_shared -Ddisable_libs=*
+
 # test compilation with minimal x86 instruction set
 # Set the install path for libraries to "lib" explicitly to prevent problems
 # with pkg-config prefixes if installed in "lib/x86_64-linux-gnu" later.
@@ -258,7 +260,7 @@  export CC="clang"
 build build-arm64-host-clang $f ABI $use_shared
 unset CC
 # some gcc/arm configurations
-for f in $srcdir/config/arm/arm64_[bdo]*gcc ; do
+for f in $srcdir/config/arm/arm64_[do]*gcc ; do
 	export CC="$CCACHE gcc"
 	targetdir=build-$(basename $f | tr '_' '-' | cut -d'-' -f-2)
 	build $targetdir $f skipABI $use_shared