From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 20C03A0560; Mon, 17 Oct 2022 16:07:54 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B48954021D; Mon, 17 Oct 2022 16:07:53 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id C598A40143 for ; Mon, 17 Oct 2022 16:07:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666015671; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7KJaKf6tUk6PV+zsM7YUO7QNJkBJMuvxTx9hV+Yjuqk=; b=PHlAXvcsC3MLhTl95ULBBiGOoXWBzsIJw05/KfbfS8Snx/NYP24GzhC8oZDTyqqNQV/Rs8 1RhFke5QNGKf+C2VICbXJR6OxkTz3qX4aptf9Ny91WKWX1ZKK9uDWdwQl3igHS3YfUNZ3O 1C8DNVHbIXWsVKGliIGm9N7+QB6hHt4= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-652-21iZvyQeMJuEFeqYA7RXzw-1; Mon, 17 Oct 2022 10:07:48 -0400 X-MC-Unique: 21iZvyQeMJuEFeqYA7RXzw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8CD7F3C1107C; Mon, 17 Oct 2022 14:07:47 +0000 (UTC) Received: from localhost.localdomain (ovpn-192-244.brq.redhat.com [10.40.192.244]) by smtp.corp.redhat.com (Postfix) with ESMTP id BF5BF2027063; Mon, 17 Oct 2022 14:07:46 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: Aaron Conole , Michael Santana Subject: [PATCH] ci: combine static and shared linking build tests Date: Mon, 17 Oct 2022 16:07:31 +0200 Message-Id: <20221017140731.3467481-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Save some cpu time and disk by testing linking against static and shared library in single environments. The .ci/linux-build.sh is modified so it reconfigures an existing build directory: an empty DEF_LIB= means that static and shared builds are to be tested. ABI checks, documentation generation and unit tests are disabled for static builds as they would be redundant with the check against dynamically linked binaries, if any. Note: - --cross-file is an option that can be passed to meson only when creating a build environment, - for some other reason, --buildtype and other non -D options are only accepted when setting up a build directory with meson. When reconfiguring, only their -D$option forms are accepted, Signed-off-by: David Marchand --- .ci/linux-build.sh | 25 ++++++++++++++++++------- .github/workflows/build.yml | 28 ---------------------------- 2 files changed, 18 insertions(+), 35 deletions(-) diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh index 14148fef4a..baec65a914 100755 --- a/.ci/linux-build.sh +++ b/.ci/linux-build.sh @@ -1,5 +1,11 @@ #!/bin/sh -xe +if [ -z "${DEF_LIB:-}" ]; then + DEF_LIB=static ABI_CHECKS= BUILD_DOCS= RUN_TESTS= $0 + DEF_LIB=shared $0 + exit +fi + # Builds are run as root in containers, no need for sudo [ "$(id -u)" != '0' ] || alias sudo= @@ -78,10 +84,6 @@ if [ "$RISCV64" = "true" ]; then cross_file=config/riscv/riscv64_linux_gcc fi -if [ -n "$cross_file" ]; then - OPTS="$OPTS --cross-file $cross_file" -fi - if [ "$BUILD_DOCS" = "true" ]; then OPTS="$OPTS -Denable_docs=true" fi @@ -101,8 +103,8 @@ else fi OPTS="$OPTS -Dplatform=generic" -OPTS="$OPTS --default-library=$DEF_LIB" -OPTS="$OPTS --buildtype=debugoptimized" +OPTS="$OPTS -Ddefault_library=$DEF_LIB" +OPTS="$OPTS -Dbuildtype=debugoptimized" OPTS="$OPTS -Dcheck_includes=true" if [ "$MINI" = "true" ]; then OPTS="$OPTS -Denable_drivers=net/null" @@ -118,7 +120,16 @@ if [ "$ASAN" = "true" ]; then fi fi -meson build --werror $OPTS +OPTS="$OPTS -Dwerror=true" + +if [ -d build ]; then + meson configure build $OPTS +else + if [ -n "$cross_file" ]; then + OPTS="$OPTS --cross-file $cross_file" + fi + meson setup build $OPTS +fi ninja -C build if [ -z "$cross_file" ]; then diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b32758ff6f..82d83f4030 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -35,21 +35,12 @@ jobs: config: - os: ubuntu-20.04 compiler: gcc - library: static - - os: ubuntu-20.04 - compiler: gcc - library: shared mini: mini - os: ubuntu-20.04 compiler: gcc - library: shared checks: doc+tests - os: ubuntu-20.04 compiler: clang - library: static - - os: ubuntu-20.04 - compiler: clang - library: shared checks: asan+doc+tests - os: ubuntu-20.04 compiler: gcc @@ -61,23 +52,12 @@ jobs: cross: mingw - os: ubuntu-20.04 compiler: gcc - library: static - cross: aarch64 - - os: ubuntu-20.04 - compiler: gcc - library: shared cross: aarch64 - os: ubuntu-20.04 compiler: gcc - library: static cross: ppc64le - os: ubuntu-20.04 compiler: gcc - library: shared - cross: ppc64le - - os: ubuntu-20.04 - compiler: gcc - library: shared cross: riscv64 steps: @@ -218,16 +198,8 @@ jobs: config: - image: fedora:35 compiler: gcc - library: static - - image: fedora:35 - compiler: gcc - library: shared - - image: fedora:35 - compiler: clang - library: static - image: fedora:35 compiler: clang - library: shared steps: - name: Checkout sources -- 2.37.3