DPDK patches and discussions
 help / color / Atom feed
* [dpdk-dev] [PATCH] devtools: control location of test builds
@ 2019-10-09 10:10 Bruce Richardson
  0 siblings, 0 replies; only message in thread
From: Bruce Richardson @ 2019-10-09 10:10 UTC (permalink / raw)
  To: thomas, david.marchand; +Cc: dev, ferruh.yigit, Bruce Richardson

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 <bruce.richardson@intel.com>
 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
 unset verbose
@@ -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))/..
 if command -v gmake >/dev/null 2>&1 ; then
@@ -50,7 +51,7 @@ load_env () # <target compiler>
 build () # <directory> <target compiler> <meson options>
-	builddir=$1
+	builddir=$builds_dir/$1
@@ -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
-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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-09 10:10 [dpdk-dev] [PATCH] devtools: control location of test builds Bruce Richardson

DPDK patches and discussions

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ http://inbox.dpdk.org/dev \
	public-inbox-index dev

Newsgroup available over NNTP:

AGPL code for this site: git clone https://public-inbox.org/ public-inbox