From patchwork Wed Jun 12 09:21:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 1114387 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45P1dx0Hx3z9sDB for ; Wed, 12 Jun 2019 19:24:05 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 14A461821; Wed, 12 Jun 2019 09:23:34 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id BF4731803 for ; Wed, 12 Jun 2019 09:21:43 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id D481B76D for ; Wed, 12 Jun 2019 09:21:41 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6D55A3087958; Wed, 12 Jun 2019 09:21:38 +0000 (UTC) Received: from dmarchan.remote.csb (unknown [10.40.205.71]) by smtp.corp.redhat.com (Postfix) with ESMTP id B0ED6377B; Wed, 12 Jun 2019 09:21:33 +0000 (UTC) From: David Marchand To: dev@openvswitch.org Date: Wed, 12 Jun 2019 11:21:20 +0200 Message-Id: <1560331280-13588-2-git-send-email-david.marchand@redhat.com> In-Reply-To: <1560331280-13588-1-git-send-email-david.marchand@redhat.com> References: <1560331280-13588-1-git-send-email-david.marchand@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Wed, 12 Jun 2019 09:21:41 +0000 (UTC) X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: i.maximets@samsung.com Subject: [ovs-dev] [PATCH 2/2] travis: Make it possible to build against a dpdk branch. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org Rework the build script so that we can pass branches and tags. With this, DPDK_VER can be passed as: - a string starting with refs/ which is understood as a git reference. This triggers a git clone on DPDK_GIT (default value points to https://dpdk.org/git/dpdk) for a single branch pointing to this reference (to save some disk), - else, any other string which is understood as an official release. This triggers a tarball download on dpdk.org. Signed-off-by: David Marchand --- .travis/linux-build.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.travis/linux-build.sh b/.travis/linux-build.sh index cd8cfcf..ddba2db 100755 --- a/.travis/linux-build.sh +++ b/.travis/linux-build.sh @@ -63,10 +63,13 @@ function install_kernel() function install_dpdk() { - if [ -n "$DPDK_GIT" ]; then - git clone $DPDK_GIT dpdk-$1 - cd dpdk-$1 - git checkout tags/v$1 + if [ "${1##refs/*/}" != "${1}" ]; then + DPDK_GIT=${DPDK_GIT:-https://dpdk.org/git/dpdk} + ref="${1##refs/*/}" + git clone --single-branch $DPDK_GIT dpdk-git -b $ref + name=$(git --git-dir=dpdk-git/.git describe) + mv dpdk-git dpdk-$name + cd dpdk-$name else wget https://fast.dpdk.org/rel/dpdk-$1.tar.xz tar xvf dpdk-$1.tar.xz > /dev/null @@ -87,6 +90,7 @@ function install_dpdk() sed -i '/CONFIG_RTE_KNI_KMOD=y/s/=y/=n/' build/.config make -j4 CC=gcc EXTRA_CFLAGS='-fPIC' + EXTRA_OPTS="$EXTRA_OPTS --with-dpdk=$(pwd)/build" echo "Installed DPDK source in $(pwd)" cd .. } @@ -109,7 +113,6 @@ if [ "$DPDK" ] || [ "$DPDK_SHARED" ]; then # Disregard cast alignment errors until DPDK is fixed CFLAGS="$CFLAGS -Wno-cast-align" fi - EXTRA_OPTS="$EXTRA_OPTS --with-dpdk=$(pwd)/dpdk-$DPDK_VER/build" fi OPTS="$EXTRA_OPTS $*"