[v2,2/2] devtools: configure source repo to use as ABI reference

Message ID 20221209090222.441690-2-david.marchand@redhat.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series [v2,1/2] devtools: document test meson script config options |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/github-robot: build success github build: passed
ci/intel-Testing success Testing PASS
ci/iol-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS

Commit Message

David Marchand Dec. 9, 2022, 9:02 a.m. UTC
  From: Ferruh Yigit <ferruh.yigit@amd.com>

By default 'test-meson-builds.sh' script clones the repository which the
script is in, and selects a configured branch ('DPDK_ABI_REF_VERSION')
as a reference for ABI check.

This patch enables selecting different repository to clone for reference
using 'DPDK_ABI_REF_SRC' environment variable.
'DPDK_ABI_REF_SRC' may refer to a directory containing a cloned git
repository, or a remote git repository.

It is possible to put these variables to 'devel.config' config file, or
provide via command line, like:
`
 DPDK_ABI_REF_SRC=https://dpdk.org/git/dpdk-stable \
 DPDK_ABI_REF_VERSION=v22.11.1     \
 DPDK_ABI_REF_DIR=/tmp/dpdk-abiref \
 ./devtools/test-meson-builds.sh
`

When 'DPDK_ABI_REF_SRC' is not defined, script behaves as it did
previously.

Other alternative to using 'DPDK_ABI_REF_SRC' variable is adding that
other repo as a new 'remote' to the exiting git repository.

Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
Changes since v1:
- expanded DPDK_ABI_REF_SRC usage to "non-local" sources,

---
 devtools/test-meson-builds.sh | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
  

Comments

David Marchand Dec. 21, 2022, 3:02 p.m. UTC | #1
On Fri, Dec 9, 2022 at 10:02 AM David Marchand
<david.marchand@redhat.com> wrote:
>
> From: Ferruh Yigit <ferruh.yigit@amd.com>
>
> By default 'test-meson-builds.sh' script clones the repository which the
> script is in, and selects a configured branch ('DPDK_ABI_REF_VERSION')
> as a reference for ABI check.
>
> This patch enables selecting different repository to clone for reference
> using 'DPDK_ABI_REF_SRC' environment variable.
> 'DPDK_ABI_REF_SRC' may refer to a directory containing a cloned git
> repository, or a remote git repository.
>
> It is possible to put these variables to 'devel.config' config file, or
> provide via command line, like:
> `
>  DPDK_ABI_REF_SRC=https://dpdk.org/git/dpdk-stable \
>  DPDK_ABI_REF_VERSION=v22.11.1     \
>  DPDK_ABI_REF_DIR=/tmp/dpdk-abiref \
>  ./devtools/test-meson-builds.sh
> `
>
> When 'DPDK_ABI_REF_SRC' is not defined, script behaves as it did
> previously.
>
> Other alternative to using 'DPDK_ABI_REF_SRC' variable is adding that
> other repo as a new 'remote' to the exiting git repository.
>
> Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
> Acked-by: Akhil Goyal <gakhil@marvell.com>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
> Changes since v1:
> - expanded DPDK_ABI_REF_SRC usage to "non-local" sources,

Series applied, thanks.
  

Patch

diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh
index 02541c19aa..48f4e52df3 100755
--- a/devtools/test-meson-builds.sh
+++ b/devtools/test-meson-builds.sh
@@ -19,6 +19,7 @@  srcdir=$(dirname $(readlink -f $0))/..
 # - DPDK_MESON_OPTIONS
 #
 # - DPDK_ABI_REF_DIR
+# - DPDK_ABI_REF_SRC
 # - DPDK_ABI_REF_VERSION
 #
 # - DPDK_BUILD_TEST_EXAMPLES
@@ -187,10 +188,15 @@  build () # <directory> <target cc | cross file> <ABI check> [meson options]
 		if [ ! -d $abirefdir/$targetdir ]; then
 			# clone current sources
 			if [ ! -d $abirefdir/src ]; then
-				git clone --local --no-hardlinks \
+				abirefsrc=${DPDK_ABI_REF_SRC:-$srcdir}
+				abirefcloneopts=
+				if [ -d $abirefsrc ]; then
+					abirefcloneopts="--local --no-hardlinks"
+				fi
+				git clone $abirefcloneopts \
 					--single-branch \
 					-b $DPDK_ABI_REF_VERSION \
-					$srcdir $abirefdir/src
+					$abirefsrc $abirefdir/src
 			fi
 
 			rm -rf $abirefdir/build