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

Message ID 20221206122341.3046688-2-ferruh.yigit@amd.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series [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/iol-aarch64-unit-testing success Testing PASS
ci/github-robot: build success github build: passed
ci/iol-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS

Commit Message

Ferruh Yigit Dec. 6, 2022, 12:23 p.m. UTC
  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 close for reference
using 'DPDK_ABI_REF_SRC' environment variable.

It is possible to put these variables to 'devel.config' config file, or
provide via command line, like:
`
 DPDK_ABI_REF_SRC=~/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>
---
 devtools/test-meson-builds.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
  

Comments

Akhil Goyal Dec. 8, 2022, 6:14 p.m. UTC | #1
> 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 close for reference
> using 'DPDK_ABI_REF_SRC' environment variable.
> 
> It is possible to put these variables to 'devel.config' config file, or
> provide via command line, like:
> `
>  DPDK_ABI_REF_SRC=~/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>

Worked for me, but I still needed to clone the dpdk-stable repo manually.
I was hoping, test-meson-build.sh would do that by itself.
Had it been a tag in same repo, it would have been straight forward as before.
I would still suggest to add a tag v22.11.1 in main branch and all can use that instead of v22.11.
The fix that we are talking about is a mandatory one for each one to use for ABI checks,
dpdk-stable patches are not mandatory for the users.

-Akhil
  
Thomas Monjalon Dec. 8, 2022, 7:43 p.m. UTC | #2
08/12/2022 19:14, Akhil Goyal:
> > 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 close for reference
> > using 'DPDK_ABI_REF_SRC' environment variable.
> > 
> > It is possible to put these variables to 'devel.config' config file, or
> > provide via command line, like:
> > `
> >  DPDK_ABI_REF_SRC=~/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>
> 
> Worked for me, but I still needed to clone the dpdk-stable repo manually.
> I was hoping, test-meson-build.sh would do that by itself.
> Had it been a tag in same repo, it would have been straight forward as before.
> I would still suggest to add a tag v22.11.1 in main branch and all can use that instead of v22.11.

First, v22.11.1 exists already in dpdk-stable.
Second, vXX.YY.z tags are supposed to be only in dpdk-stable.

> The fix that we are talking about is a mandatory one for each one to use for ABI checks,
> dpdk-stable patches are not mandatory for the users.

You could have dpdk-stable as a remote in your main DPDK directory.
If you don't want to do that, you could refer to the commit SHA1 of the fix I think.
  
Akhil Goyal Dec. 9, 2022, 4:16 a.m. UTC | #3
> 08/12/2022 19:14, Akhil Goyal:
> > > 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 close for reference
> > > using 'DPDK_ABI_REF_SRC' environment variable.
> > >
> > > It is possible to put these variables to 'devel.config' config file, or
> > > provide via command line, like:
> > > `
> > >  DPDK_ABI_REF_SRC=~/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>
> >
> > Worked for me, but I still needed to clone the dpdk-stable repo manually.
> > I was hoping, test-meson-build.sh would do that by itself.
> > Had it been a tag in same repo, it would have been straight forward as before.
> > I would still suggest to add a tag v22.11.1 in main branch and all can use that
> instead of v22.11.
> 
> First, v22.11.1 exists already in dpdk-stable.
> Second, vXX.YY.z tags are supposed to be only in dpdk-stable.

May be some other tag name we can think. v22.11.hotfix or something better.
I was just asking to give a name to commit, and NOT updating the VERSION file.

> 
> > The fix that we are talking about is a mandatory one for each one to use for
> ABI checks,
> > dpdk-stable patches are not mandatory for the users.
> 
> You could have dpdk-stable as a remote in your main DPDK directory.
> If you don't want to do that, you could refer to the commit SHA1 of the fix I
> think.
> 
Adding remote did not solve the issue as the commits are different(version commit).
I cloned stable repo separately and it worked for me.
Since you refer to use commit SHA, why not give it a name, remembering SHA is not easy.

-Akhil
  
David Marchand Dec. 9, 2022, 8:22 a.m. UTC | #4
On Tue, Dec 6, 2022 at 1:24 PM Ferruh Yigit <ferruh.yigit@amd.com> wrote:
>
> 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 close for reference
> using 'DPDK_ABI_REF_SRC' environment variable.
>
> It is possible to put these variables to 'devel.config' config file, or
> provide via command line, like:
> `
>  DPDK_ABI_REF_SRC=~/dpdk-stable/   \

DPDK_ABI_REF_SRC could be passed as a remote repository.
This should remove the need for any "git remote" configuration.

$ DPDK_ABI_REF_SRC=https://dpdk.org/git/dpdk-stable
DPDK_ABI_REF_VERSION=v22.11.1 ./devtools/test-meson-builds.sh


diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh
index 406bf4e184..48f4e52df3 100755
--- a/devtools/test-meson-builds.sh
+++ b/devtools/test-meson-builds.sh
@@ -18,8 +18,8 @@ srcdir=$(dirname $(readlink -f $0))/..
 #
 # - DPDK_MESON_OPTIONS
 #
-# - DPDK_ABI_REF_SRC
 # - DPDK_ABI_REF_DIR
+# - DPDK_ABI_REF_SRC
 # - DPDK_ABI_REF_VERSION
 #
 # - DPDK_BUILD_TEST_EXAMPLES
@@ -186,10 +186,14 @@ build () # <directory> <target cc | cross file>
<ABI check> [meson options]
        if [ -n "$DPDK_ABI_REF_VERSION" -a "$abicheck" = ABI ] ; then
                abirefdir=${DPDK_ABI_REF_DIR:-reference}/$DPDK_ABI_REF_VERSION
                if [ ! -d $abirefdir/$targetdir ]; then
-                       abirefsrc=${DPDK_ABI_REF_SRC:-$srcdir}
                        # 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 \
                                        $abirefsrc $abirefdir/src


>  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.
  
Ferruh Yigit Dec. 9, 2022, 8:44 a.m. UTC | #5
On 12/9/2022 8:22 AM, David Marchand wrote:
> On Tue, Dec 6, 2022 at 1:24 PM Ferruh Yigit <ferruh.yigit@amd.com> wrote:
>>
>> 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 close for reference
>> using 'DPDK_ABI_REF_SRC' environment variable.
>>
>> It is possible to put these variables to 'devel.config' config file, or
>> provide via command line, like:
>> `
>>  DPDK_ABI_REF_SRC=~/dpdk-stable/   \
> 
> DPDK_ABI_REF_SRC could be passed as a remote repository.
> This should remove the need for any "git remote" configuration.
> 
> $ DPDK_ABI_REF_SRC=https://dpdk.org/git/dpdk-stable
> DPDK_ABI_REF_VERSION=v22.11.1 ./devtools/test-meson-builds.sh
> 

+1 to 'DPDK_ABI_REF_SRC' accept either folder or remote git repo.

Can you send a v2 with your sign off added, or do you want me send a v2?

> 
> diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh
> index 406bf4e184..48f4e52df3 100755
> --- a/devtools/test-meson-builds.sh
> +++ b/devtools/test-meson-builds.sh
> @@ -18,8 +18,8 @@ srcdir=$(dirname $(readlink -f $0))/..
>  #
>  # - DPDK_MESON_OPTIONS
>  #
> -# - DPDK_ABI_REF_SRC
>  # - DPDK_ABI_REF_DIR
> +# - DPDK_ABI_REF_SRC
>  # - DPDK_ABI_REF_VERSION
>  #
>  # - DPDK_BUILD_TEST_EXAMPLES
> @@ -186,10 +186,14 @@ build () # <directory> <target cc | cross file>
> <ABI check> [meson options]
>         if [ -n "$DPDK_ABI_REF_VERSION" -a "$abicheck" = ABI ] ; then
>                 abirefdir=${DPDK_ABI_REF_DIR:-reference}/$DPDK_ABI_REF_VERSION
>                 if [ ! -d $abirefdir/$targetdir ]; then
> -                       abirefsrc=${DPDK_ABI_REF_SRC:-$srcdir}
>                         # 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 \
>                                         $abirefsrc $abirefdir/src
> 
> 
>>  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.
> 
> 
>
  

Patch

diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh
index bbe90e2bde2e..8a0ed92fcf0a 100755
--- a/devtools/test-meson-builds.sh
+++ b/devtools/test-meson-builds.sh
@@ -18,6 +18,7 @@  srcdir=$(dirname $(readlink -f $0))/..
 #
 # - DPDK_MESON_OPTIONS
 #
+# - DPDK_ABI_REF_SRC
 # - DPDK_ABI_REF_DIR
 # - DPDK_ABI_REF_VERSION
 #
@@ -185,12 +186,13 @@  build () # <directory> <target cc | cross file> <ABI check> [meson options]
 	if [ -n "$DPDK_ABI_REF_VERSION" -a "$abicheck" = ABI ] ; then
 		abirefdir=${DPDK_ABI_REF_DIR:-reference}/$DPDK_ABI_REF_VERSION
 		if [ ! -d $abirefdir/$targetdir ]; then
+			abirefsrc=${DPDK_ABI_REF_SRC:-$srcdir}
 			# clone current sources
 			if [ ! -d $abirefdir/src ]; then
 				git clone --local --no-hardlinks \
 					--single-branch \
 					-b $DPDK_ABI_REF_VERSION \
-					$srcdir $abirefdir/src
+					$abirefsrc $abirefdir/src
 			fi
 
 			rm -rf $abirefdir/build