summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Richardson <bruce.richardson@intel.com>2019-11-28 00:00:55 +0100
committerThomas Monjalon <thomas@monjalon.net>2019-11-28 22:31:53 +0100
commitaa75995509302edcc8241781504749ed0664b24f (patch)
treea98372608142524cdd03afc8b03153232d7916d2
parentb09afc2ad82647ab4f0edc121e9632cc1906c5bb (diff)
downloaddpdk-next-eventdev-aa75995509302edcc8241781504749ed0664b24f.zip
dpdk-next-eventdev-aa75995509302edcc8241781504749ed0664b24f.tar.gz
dpdk-next-eventdev-aa75995509302edcc8241781504749ed0664b24f.tar.xz
devtools: control location of test builds
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_BUILD_TEST_DIR environment variable to control where the build outputs are put. For example, doing: export DPDK_BUILD_TEST_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> Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Acked-by: David Marchand <david.marchand@redhat.com>
-rwxr-xr-xdevtools/test-build.sh17
-rwxr-xr-xdevtools/test-meson-builds.sh9
-rw-r--r--doc/guides/contributing/patches.rst7
3 files changed, 24 insertions, 9 deletions
diff --git a/devtools/test-build.sh b/devtools/test-build.sh
index 2bedbdb..be565a1 100755
--- a/devtools/test-build.sh
+++ b/devtools/test-build.sh
@@ -7,6 +7,7 @@ default_path=$PATH
# Load config options:
# - ARMV8_CRYPTO_LIB_PATH
# - DPDK_BUILD_TEST_CONFIGS (defconfig1+option1+option2 defconfig2)
+# - DPDK_BUILD_TEST_DIR
# - DPDK_DEP_ARCHIVE
# - DPDK_DEP_BPF (y/[n])
# - DPDK_DEP_CFLAGS
@@ -63,6 +64,7 @@ print_help () {
[ -z $MAKE ] && echo "Cannot find make or gmake" && exit 1
J=$DPDK_MAKE_JOBS
+builds_dir=${DPDK_BUILD_TEST_DIR:-.}
short=false
unset verbose
maxerr=-Wfatal-errors
@@ -234,21 +236,24 @@ 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"
+ echo "================== Build $conf"
${MAKE} -j$J EXTRA_CFLAGS="$maxerr $DPDK_DEP_CFLAGS" \
EXTRA_LDFLAGS="$DPDK_DEP_LDFLAGS" $verbose O=$dir
! $short || break
- echo "================== Build examples for $dir"
- export RTE_SDK=$(pwd)
- export RTE_TARGET=$dir
+ export RTE_TARGET=$target
+ rm -rf $dir/install
+ ${MAKE} install O=$dir DESTDIR=$dir/install prefix=
+ echo "================== Build examples for $conf"
+ export RTE_SDK=$(readlink -f $dir)/install/share/dpdk
+ ln -sTf $(pwd)/lib $RTE_SDK/lib # workaround for vm_power_manager
${MAKE} -j$J -sC examples \
EXTRA_LDFLAGS="$DPDK_DEP_LDFLAGS" $verbose \
O=$(readlink -f $dir)/examples
unset RTE_TARGET
- echo "################## $dir done."
+ echo "################## $conf done."
unset dir
done
diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh
index 50a3263..6885677 100755
--- a/devtools/test-meson-builds.sh
+++ b/devtools/test-meson-builds.sh
@@ -12,8 +12,11 @@ PIPEFAIL=""
set -o | grep -q pipefail && set -o pipefail && PIPEFAIL=1
srcdir=$(dirname $(readlink -f $0))/..
+. $srcdir/devtools/load-devel-config
+
MESON=${MESON:-meson}
use_shared="--default-library=shared"
+builds_dir=${DPDK_BUILD_TEST_DIR:-.}
if command -v gmake >/dev/null 2>&1 ; then
MAKE=gmake
@@ -56,7 +59,7 @@ load_env () # <target compiler>
build () # <directory> <target compiler> <meson options>
{
- builddir=$1
+ builddir=$builds_dir/$1
shift
targetcc=$1
shift
@@ -131,8 +134,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 2359328..0686450 100644
--- a/doc/guides/contributing/patches.rst
+++ b/doc/guides/contributing/patches.rst
@@ -480,6 +480,7 @@ Examples of configs are::
The builds can be modified via the following environmental variables:
* ``DPDK_BUILD_TEST_CONFIGS`` (target1+option1+option2 target2)
+* ``DPDK_BUILD_TEST_DIR``
* ``DPDK_DEP_CFLAGS``
* ``DPDK_DEP_LDFLAGS``
* ``DPDK_DEP_PCAP`` (y/[n])
@@ -504,6 +505,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_BUILD_TEST_DIR`` can be set to that desired location.
+For example, setting ``DPDK_BUILD_TEST_DIR=__builds`` will put all builds
+in a single subfolder called "__builds" created in the current directory.
+Setting ``DPDK_BUILD_TEST_DIR`` to an absolute directory path e.g. ``/tmp`` is also supported.
Sending Patches