From patchwork Mon Nov 28 14:25:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ales Musil X-Patchwork-Id: 1709767 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Z0+ycutV; dkim-atps=neutral Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NLSSJ1P3Cz23nB for ; Tue, 29 Nov 2022 01:25:52 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 52E5640356; Mon, 28 Nov 2022 14:25:50 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 52E5640356 Authentication-Results: smtp4.osuosl.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Z0+ycutV X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Tb9VuGMjWjDV; Mon, 28 Nov 2022 14:25:49 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp4.osuosl.org (Postfix) with ESMTPS id DFAE9401DC; Mon, 28 Nov 2022 14:25:47 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org DFAE9401DC Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 9ABC0C0033; Mon, 28 Nov 2022 14:25:47 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id BA6F9C002D for ; Mon, 28 Nov 2022 14:25:46 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 966D6400CF for ; Mon, 28 Nov 2022 14:25:46 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 966D6400CF Authentication-Results: smtp2.osuosl.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Z0+ycutV X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id p4xtXgunhXBL for ; Mon, 28 Nov 2022 14:25:46 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org D0A08400CC Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by smtp2.osuosl.org (Postfix) with ESMTPS id D0A08400CC for ; Mon, 28 Nov 2022 14:25:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1669645544; 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=cGQsHzGhYabV9pwfc/x6tgl8SFODB3dkjJSIyFegf20=; b=Z0+ycutVfU2E3HQ3n3guqQK/0MlYa2Q5iJ463O5nMyBR5gPBd5gsC33mrqH30dU+DDuRtQ kd5Z18hDpe4WG1zCywYjOxnHZI3p45Mi21YGI4p5J8SjNq9Ir6SN31Qsw6CTRnVgPhJqjQ UuJxGbm7ef/YtVhz1Nk8bTBn6246pjw= 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-38-mwFrUOoJOHu2fV44wMGw6g-1; Mon, 28 Nov 2022 09:25:43 -0500 X-MC-Unique: mwFrUOoJOHu2fV44wMGw6g-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D483829ABA14 for ; Mon, 28 Nov 2022 14:25:42 +0000 (UTC) Received: from amusil.redhat.com (ovpn-193-48.brq.redhat.com [10.40.193.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4CF80492B08; Mon, 28 Nov 2022 14:25:42 +0000 (UTC) From: Ales Musil To: dev@openvswitch.org Date: Mon, 28 Nov 2022 15:25:40 +0100 Message-Id: <20221128142541.300300-1-amusil@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH ovn 1/2] CI: Refactor the linux-build.sh X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" Update the build script, so it is easier to define opts/flags per compiler, but also per architecture. Signed-off-by: Ales Musil --- .ci/linux-build.sh | 48 +++++++++++++++++++++----------------- .github/workflows/test.yml | 8 +++---- 2 files changed, 31 insertions(+), 25 deletions(-) diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh index dc1ca5240..d7a49b6c0 100755 --- a/.ci/linux-build.sh +++ b/.ci/linux-build.sh @@ -3,9 +3,10 @@ set -o errexit set -x +ARCH=${ARCH:-"x86_64"} COMMON_CFLAGS="" OVN_CFLAGS="" -EXTRA_OPTS="--enable-Werror" +OPTS="$OPTS --enable-Werror" function configure_ovs() { @@ -23,28 +24,33 @@ function configure_ovn() { cat config.log; exit 1; } } -save_OPTS="${OPTS} $*" -OPTS="${EXTRA_OPTS} ${save_OPTS}" - -# If AddressSanitizer and UndefinedBehaviorSanitizer are requested, enable them, -# but only for OVN, not for OVS. However, disable some optimizations for -# OVS, to make sanitizer reports user friendly. -if [ "$SANITIZERS" ]; then - # Use the default options configured in tests/atlocal.in, in UBSAN_OPTIONS. - COMMON_CFLAGS="${COMMON_CFLAGS} -O1 -fno-omit-frame-pointer -fno-common -g" - OVN_CFLAGS="${OVN_CFLAGS} -fsanitize=address,undefined" -fi +function configure_gcc() +{ + if [ "$ARCH" = "x86_64" ]; then + # Enable sparse only for x86_64 architecture. + OPTS="$OPTS --enable-sparse" + elif [ "$ARCH" = "x86" ]; then + # Adding m32 flag directly to CC to avoid any possible issues + # with API/ABI difference on 'configure' and 'make' stages. + export CC="$CC -m32" + fi +} -if [ "$CC" = "clang" ]; then +function configure_clang() +{ + # If AddressSanitizer and UndefinedBehaviorSanitizer are requested, + # enable them, but only for OVN, not for OVS. However, disable some + # optimizations for OVS, to make sanitizer reports user friendly. + if [ "$SANITIZERS" ]; then + # Use the default options configured in tests/atlocal.in, + # in UBSAN_OPTIONS. + COMMON_CFLAGS="${COMMON_CFLAGS} -O1 -fno-omit-frame-pointer -fno-common -g" + OVN_CFLAGS="${OVN_CFLAGS} -fsanitize=address,undefined" + fi COMMON_CFLAGS="${COMMON_CFLAGS} -Wno-error=unused-command-line-argument" -elif [ "$M32" ]; then - # Not using sparse for 32bit builds on 64bit machine. - # Adding m32 flag directly to CC to avoid any possible issues with API/ABI - # difference on 'configure' and 'make' stages. - export CC="$CC -m32" -else - OPTS="$OPTS --enable-sparse" -fi +} + +configure_$CC if [ "$TESTSUITE" ]; then if [ "$TESTSUITE" = "system-test" ]; then diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cf98a30fa..0f8d9d193 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,9 +19,9 @@ jobs: libssl-dev llvm-dev libelf-dev libnuma-dev libpcap-dev \ selinux-policy-dev ncat python3-scapy isc-dhcp-server m32_dependecies: gcc-multilib + ARCH: ${{ matrix.cfg.arch }} CC: ${{ matrix.cfg.compiler }} LIBS: ${{ matrix.cfg.libs }} - M32: ${{ matrix.cfg.m32 }} OPTS: ${{ matrix.cfg.opts }} TESTSUITE: ${{ matrix.cfg.testsuite }} TEST_RANGE: ${{ matrix.cfg.test_range }} @@ -56,7 +56,7 @@ jobs: - { compiler: clang, testsuite: system-test, sanitizers: sanitizers, test_range: "-100" } - { compiler: clang, testsuite: system-test, sanitizers: sanitizers, test_range: "101-200" } - { compiler: clang, testsuite: system-test, sanitizers: sanitizers, test_range: "201-" } - - { compiler: gcc, m32: m32, opts: --disable-ssl} + - { arch: x86, compiler: gcc, opts: --disable-ssl } steps: - name: checkout @@ -90,11 +90,11 @@ jobs: run: sudo apt install -y ${{ env.dependencies }} - name: install libunbound libunwind - if: matrix.cfg.m32 == '' + if: matrix.cfg.arch != 'x86' run: sudo apt install -y libunbound-dev libunwind-dev - name: install 32-bit dependencies - if: matrix.cfg.m32 != '' + if: matrix.cfg.arch == 'x86' run: sudo apt install -y ${{ env.m32_dependecies }} - name: update PATH