From patchwork Wed Oct 9 10:10:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 60768 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EFA861D419; Wed, 9 Oct 2019 12:10:39 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 3616B1D16A for ; Wed, 9 Oct 2019 12:10:38 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Oct 2019 03:10:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,273,1566889200"; d="scan'208";a="197970466" Received: from silpixa00399126.ir.intel.com (HELO silpixa00399126.ger.corp.intel.com) ([10.237.223.2]) by orsmga006.jf.intel.com with ESMTP; 09 Oct 2019 03:10:33 -0700 From: Bruce Richardson To: thomas@monjalon.net, david.marchand@redhat.com Cc: dev@dpdk.org, ferruh.yigit@intel.com, Bruce Richardson Date: Wed, 9 Oct 2019 11:10:26 +0100 Message-Id: <20191009101026.49019-1-bruce.richardson@intel.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH] devtools: control location of test builds X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" By default, both test-build.sh and test-meson-builds.sh scripts create the builds they generate in the current working directory, leading to a large number of build directories being present when testing patches. This patchset modifies both scripts to use a DPDK_TEST_BUILD_DIR environment variable to control where the build outputs are put. For example, doing: export DPDK_TEST_BUILD_DIR=__builds ./devtools/test-meson-builds.sh && ./devtools/test-build.sh \ x86_64-native-linux-clang+shared i686-native-linux-gcc gives a "__builds" directory with 14 meson and 2 make builds (with the meson build count depending on compiler availability) Signed-off-by: Bruce Richardson --- devtools/test-build.sh | 3 ++- devtools/test-meson-builds.sh | 7 ++++--- doc/guides/contributing/patches.rst | 6 ++++++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/devtools/test-build.sh b/devtools/test-build.sh index 2bedbdb98..b64c963d7 100755 --- a/devtools/test-build.sh +++ b/devtools/test-build.sh @@ -63,6 +63,7 @@ print_help () { [ -z $MAKE ] && echo "Cannot find make or gmake" && exit 1 J=$DPDK_MAKE_JOBS +builds_dir=${DPDK_TEST_BUILD_DIR:-.} short=false unset verbose maxerr=-Wfatal-errors @@ -234,7 +235,7 @@ for conf in $configs ; do . $(dirname $(readlink -f $0))/load-devel-config options=$(echo $conf | sed 's,[^~+]*,,') - dir=$conf + dir=$builds_dir/$conf config $dir $target $options echo "================== Build $dir" diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh index 08e83eb5c..f61709761 100755 --- a/devtools/test-meson-builds.sh +++ b/devtools/test-meson-builds.sh @@ -14,6 +14,7 @@ set -o | grep -q pipefail && set -o pipefail && PIPEFAIL=1 srcdir=$(dirname $(readlink -f $0))/.. MESON=${MESON:-meson} use_shared="--default-library=shared" +builds_dir=${DPDK_TEST_BUILD_DIR:-.} if command -v gmake >/dev/null 2>&1 ; then MAKE=gmake @@ -50,7 +51,7 @@ load_env () # build () # { - builddir=$1 + builddir=$builds_dir/$1 shift targetcc=$1 shift @@ -125,8 +126,8 @@ done # Test installation of the x86-default target, to be used for checking # the sample apps build using the pkg-config file for cflags and libs -build_path=build-x86-default -export DESTDIR=$(pwd)/$build_path/install-root +build_path=$(readlink -f $builds_dir/build-x86-default) +export DESTDIR=$build_path/install-root $ninja_cmd -C $build_path install load_env cc diff --git a/doc/guides/contributing/patches.rst b/doc/guides/contributing/patches.rst index 9e1013b70..b2d94fb28 100644 --- a/doc/guides/contributing/patches.rst +++ b/doc/guides/contributing/patches.rst @@ -495,6 +495,12 @@ Compilation of patches is to be tested with ``devtools/test-meson-builds.sh`` sc The script internally checks for dependencies, then builds for several combinations of compilation configuration. +By default, each build will be put in a subfolder of the current working directory. +However, if it is preferred to place the builds in a different location, +the environment variable ``DPDK_TEST_BUILD_DIR`` can be set to that desired location. +For example, setting ``DPDK_TEST_BUILD_DIR=__builds`` will put all builds +in a single subfolder called "__builds" created in the current directory. +Setting ``DPDK_TEST_BUILD_DIR`` to an absolute directory path e.g. ``/tmp`` is also supported. Sending Patches