Skip to contentSkip to conversation

relative path support for ABI compatibility check

PATCH Superseded Feifei Wang 3 participants 11 messages Jun 1, 2021 – Oct 15, 2021 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

cover relative path support for ABI compatibility check

Add relative path support for ABI compatibility check and do some code simplification work.

Phil Yang (2):
devtools: add relative path support for ABI compatibility check
devtools: use absolute path for the build directory

 devtools/test-meson-builds.sh | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/2 devtools: add relative path support for ABI compatibility check

From: Phil Yang <[email protected]>

Because dpdk guide does not limit the relative path for ABI compatibility check, users maybe set 'DPDK_ABI_REF_DIR' as a relative path:

~/dpdk/devtools$ DPDK_ABI_REF_VERSION=v19.11 DPDK_ABI_REF_DIR=build-gcc-shared ./test-meson-builds.sh

And if the DESTDIR is not an absolute path, ninja complains:
+ install_target build-gcc-shared/v19.11/build build-gcc-shared/v19.11/build-gcc-shared
+ rm -rf build-gcc-shared/v19.11/build-gcc-shared
+ echo 'DESTDIR=build-gcc-shared/v19.11/build-gcc-shared ninja -C build-gcc-shared/v19.11/build install'
+ DESTDIR=build-gcc-shared/v19.11/build-gcc-shared
+ ninja -C build-gcc-shared/v19.11/build install
...
ValueError: dst_dir must be absolute, got build-gcc-shared/v19.11/build-gcc-shared/usr/local/share/dpdk/ examples/bbdev_app
...
Error: install directory 'build-gcc-shared/v19.11/build-gcc-shared' does not exist.

To fix this, add relative path support using 'readlink -f'.

---
 devtools/test-meson-builds.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
devtools/test-meson-builds.sh +2 -1
index daf817ac3e..43b906598d 100755
@@ -168,7 +168,8 @@ build () # <directory> <target cc | cross file> <ABI check> [meson options]
 	config $srcdir $builds_dir/$targetdir $cross --werror $*
 	compile $builds_dir/$targetdir
 	if [ -n "$DPDK_ABI_REF_VERSION" -a "$abicheck" = ABI ] ; then
-		abirefdir=${DPDK_ABI_REF_DIR:-reference}/$DPDK_ABI_REF_VERSION
+		abirefdir=$(readlink -f \
+			${DPDK_ABI_REF_DIR:-reference}/$DPDK_ABI_REF_VERSION)
 		if [ ! -d $abirefdir/$targetdir ]; then
 			# clone current sources
 			if [ ! -d $abirefdir/src ]; then
Signature · 1 line
2.25.1
#2 lore raw

[dpdk-dev] 回复: [PATCH v1 1/2] devtools: add relative path support for ABI compatibility check

Hi, Bruce

Would you please help review this patch series?
Thanks.

Best Regards
Feifei

Quoted 64 lines

-----邮件原件-----
发件人: Feifei Wang <[email protected]>
发送时间: 2021年6月1日 9:57
收件人: Bruce Richardson <[email protected]>
抄送: [email protected]; nd <[email protected]>; Phil Yang <[email protected]>; Feifei Wang <[email protected]>; Juraj Linkeš <[email protected]>; Ruifeng Wang <[email protected]> 主题: [PATCH v1 1/2] devtools: add relative path support for ABI compatibility check

From: Phil Yang <[email protected]>

Because dpdk guide does not limit the relative path for ABI compatibility check, users maybe set 'DPDK_ABI_REF_DIR' as a relative
path:

~/dpdk/devtools$ DPDK_ABI_REF_VERSION=v19.11 DPDK_ABI_REF_DIR=build-gcc-shared ./test-meson-builds.sh

And if the DESTDIR is not an absolute path, ninja complains:
+ install_target build-gcc-shared/v19.11/build
+ build-gcc-shared/v19.11/build-gcc-shared
+ rm -rf build-gcc-shared/v19.11/build-gcc-shared
+ echo 'DESTDIR=build-gcc-shared/v19.11/build-gcc-shared ninja -C build-gcc- shared/v19.11/build install'
+ DESTDIR=build-gcc-shared/v19.11/build-gcc-shared
+ ninja -C build-gcc-shared/v19.11/build install
...
ValueError: dst_dir must be absolute, got build-gcc-shared/v19.11/build-gcc- shared/usr/local/share/dpdk/
examples/bbdev_app
...
Error: install directory 'build-gcc-shared/v19.11/build-gcc-shared' does not exist.

To fix this, add relative path support using 'readlink -f'.

---
 devtools/test-meson-builds.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
devtools/test-meson-builds.sh +0 -0
index daf817ac3e..43b906598d 100755
@@ -168,7 +168,8 @@ build () # <directory> <target cc | cross file> <ABI

check> [meson options]

devtools/test-meson-builds.sh +0 -1
 	config $srcdir $builds_dir/$targetdir $cross --werror $*
 	compile $builds_dir/$targetdir
 	if [ -n "$DPDK_ABI_REF_VERSION" -a "$abicheck" = ABI ] ; then
-		abirefdir=${DPDK_ABI_REF_DIR:-

reference}/$DPDK_ABI_REF_VERSION

devtools/test-meson-builds.sh +2 -0
+		abirefdir=$(readlink -f \
+			${DPDK_ABI_REF_DIR:-

reference}/$DPDK_ABI_REF_VERSION)

devtools/test-meson-builds.sh +0 -1
 		if [ ! -d $abirefdir/$targetdir ]; then
 			# clone current sources
 			if [ ! -d $abirefdir/src ]; then
--

2.25.1

Acked-by on v1 1/2
#3 lore raw

Re: [dpdk-dev] [PATCH v1 1/2] devtools: add relative path support for ABI compatibility check

In reply to Feifei Wang
Quoted 36 lines · Feifei Wang

From: Phil Yang <[email protected]>

Because dpdk guide does not limit the relative path for ABI compatibility check, users maybe set 'DPDK_ABI_REF_DIR' as a relative path:

~/dpdk/devtools$ DPDK_ABI_REF_VERSION=v19.11 DPDK_ABI_REF_DIR=build-gcc-shared ./test-meson-builds.sh

And if the DESTDIR is not an absolute path, ninja complains:
+ install_target build-gcc-shared/v19.11/build build-gcc-shared/v19.11/build-gcc-shared
+ rm -rf build-gcc-shared/v19.11/build-gcc-shared
+ echo 'DESTDIR=build-gcc-shared/v19.11/build-gcc-shared ninja -C build-gcc-shared/v19.11/build install'
+ DESTDIR=build-gcc-shared/v19.11/build-gcc-shared
+ ninja -C build-gcc-shared/v19.11/build install
...
ValueError: dst_dir must be absolute, got build-gcc-shared/v19.11/build-gcc-shared/usr/local/share/dpdk/ examples/bbdev_app
...
Error: install directory 'build-gcc-shared/v19.11/build-gcc-shared' does not exist.

To fix this, add relative path support using 'readlink -f'.

---
 devtools/test-meson-builds.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
devtools/test-meson-builds.sh +0 -0
index daf817ac3e..43b906598d 100755

devtools/test-meson-builds.sh build () # <directory> <target cc | cross file> <ABI check> [meson options] · line 175

Quoted 9 lines
devtools/test-meson-builds.sh +2 -1
@@ -168,7 +168,8 @@ build () # <directory> <target cc | cross file> <ABI check> [meson options]
 	config $srcdir $builds_dir/$targetdir $cross --werror $*
 	compile $builds_dir/$targetdir
 	if [ -n "$DPDK_ABI_REF_VERSION" -a "$abicheck" = ABI ] ; then
-		abirefdir=${DPDK_ABI_REF_DIR:-reference}/$DPDK_ABI_REF_VERSION
+		abirefdir=$(readlink -f \
+			${DPDK_ABI_REF_DIR:-reference}/$DPDK_ABI_REF_VERSION)
 		if [ ! -d $abirefdir/$targetdir ]; then
 			# clone current sources
 			if [ ! -d $abirefdir/src ]; then

This looks a simple enough change.

#4 lore raw

PATCH 2/2 devtools: use absolute path for the build directory

In reply to Feifei Wang

From: Phil Yang <[email protected]>

To make the code easier to maintain, use the absolute path for the default build_dir to avoid repeatedly calling of readlink.

---
 devtools/test-meson-builds.sh | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
devtools/test-meson-builds.sh +7 -7
index 43b906598d..d6b0e7e059 100755
@@ -16,7 +16,7 @@ srcdir=$(dirname $(readlink -f $0))/..
 
 MESON=${MESON:-meson}
 use_shared="--default-library=shared"
-builds_dir=${DPDK_BUILD_TEST_DIR:-.}
+builds_dir=$(readlink -f ${DPDK_BUILD_TEST_DIR:-.})
 
 if command -v gmake >/dev/null 2>&1 ; then
 	MAKE=gmake
@@ -193,16 +193,16 @@ build () # <directory> <target cc | cross file> <ABI check> [meson options]
 		fi
 
 		install_target $builds_dir/$targetdir \
-			$(readlink -f $builds_dir/$targetdir/install)
+			$builds_dir/$targetdir/install
 		echo "Checking ABI compatibility of $targetdir" >&$verbose
 		echo $srcdir/devtools/gen-abi.sh \
-			$(readlink -f $builds_dir/$targetdir/install) >&$veryverbose
+			$builds_dir/$targetdir/install >&$veryverbose
 		$srcdir/devtools/gen-abi.sh \
-			$(readlink -f $builds_dir/$targetdir/install) >&$veryverbose
+			$builds_dir/$targetdir/install >&$veryverbose
 		echo $srcdir/devtools/check-abi.sh $abirefdir/$targetdir \
-			$(readlink -f $builds_dir/$targetdir/install) >&$veryverbose
+			$builds_dir/$targetdir/install >&$veryverbose
 		$srcdir/devtools/check-abi.sh $abirefdir/$targetdir \
-			$(readlink -f $builds_dir/$targetdir/install) >&$verbose
+			$builds_dir/$targetdir/install >&$verbose
 	fi
 }
 
@@ -275,7 +275,7 @@ done
 # Test installation of the x86-generic target, to be used for checking
 # the sample apps build using the pkg-config file for cflags and libs
 load_env cc
-build_path=$(readlink -f $builds_dir/build-x86-generic)
+build_path=$builds_dir/build-x86-generic
 export DESTDIR=$build_path/install
 install_target $build_path $DESTDIR
 pc_file=$(find $DESTDIR -name libdpdk.pc)
Signature · 1 line
2.25.1
#5 lore raw

[dpdk-dev] 回复: [PATCH v1 2/2] devtools: use absolute path for the build directory

Hi, Bruce

Sorry to disturb you again. Would you please help review the second patch of this series? Thanks very much.

Best Regards
Feifei

Quoted 73 lines

-----邮件原件-----
发件人: Feifei Wang <[email protected]>
发送时间: Tuesday, June 1, 2021 9:57 AM
收件人: Bruce Richardson <[email protected]>
抄送: [email protected]; nd <[email protected]>; Phil Yang <[email protected]>; Juraj Linkeš <[email protected]>; Feifei Wang <[email protected]>; Ruifeng Wang <[email protected]> 主题: [PATCH v1 2/2] devtools: use absolute path for the build directory

From: Phil Yang <[email protected]>

To make the code easier to maintain, use the absolute path for the default build_dir to avoid repeatedly calling of readlink.

---
 devtools/test-meson-builds.sh | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
devtools/test-meson-builds.sh +1 -1
index 43b906598d..d6b0e7e059 100755
@@ -16,7 +16,7 @@ srcdir=$(dirname $(readlink -f $0))/..
 
 MESON=${MESON:-meson}
 use_shared="--default-library=shared"
-builds_dir=${DPDK_BUILD_TEST_DIR:-.}
+builds_dir=$(readlink -f ${DPDK_BUILD_TEST_DIR:-.})
 
 if command -v gmake >/dev/null 2>&1 ; then
 	MAKE=gmake
@@ -193,16 +193,16 @@ build () # <directory> <target cc | cross file> <ABI

check> [meson options]

devtools/test-meson-builds.sh +1 -2
 		fi
 
 		install_target $builds_dir/$targetdir \
-			$(readlink -f $builds_dir/$targetdir/install)
+			$builds_dir/$targetdir/install
 		echo "Checking ABI compatibility of $targetdir" >&$verbose
 		echo $srcdir/devtools/gen-abi.sh \
-			$(readlink -f

$builds_dir/$targetdir/install) >&$veryverbose

devtools/test-meson-builds.sh +1 -1
+			$builds_dir/$targetdir/install >&$veryverbose
 		$srcdir/devtools/gen-abi.sh \
-			$(readlink -f

$builds_dir/$targetdir/install) >&$veryverbose

devtools/test-meson-builds.sh +1 -1
+			$builds_dir/$targetdir/install >&$veryverbose
 		echo $srcdir/devtools/check-abi.sh $abirefdir/$targetdir \
-			$(readlink -f

$builds_dir/$targetdir/install) >&$veryverbose

devtools/test-meson-builds.sh +1 -1
+			$builds_dir/$targetdir/install >&$veryverbose
 		$srcdir/devtools/check-abi.sh $abirefdir/$targetdir \
-			$(readlink -f

$builds_dir/$targetdir/install) >&$verbose

devtools/test-meson-builds.sh +1 -0
+			$builds_dir/$targetdir/install >&$verbose
 	fi
 }
@@ -275,7 +275,7 @@ done
 # Test installation of the x86-generic target, to be used for checking  # the

sample apps build using the pkg-config file for cflags and libs load_env cc - build_path=$(readlink -f $builds_dir/build-x86-generic) +build_path=$builds_dir/build-x86-generic
export DESTDIR=$build_path/install
install_target $build_path $DESTDIR
pc_file=$(find $DESTDIR -name libdpdk.pc)
--
2.25.1

#6 lore raw

Re: [dpdk-dev] [PATCH v1 2/2] devtools: use absolute path for the build directory

In reply to Feifei Wang

01/06/2021 03:56, Feifei Wang:

Quoted 4 lines

From: Phil Yang <[email protected]>

To make the code easier to maintain, use the absolute path for the default build_dir to avoid repeatedly calling of readlink.

[...]

devtools/test-meson-builds.sh srcdir=$(dirname $(readlink -f $0))/.. · line 19

Quoted 4 lines
devtools/test-meson-builds.sh +1 -1
-builds_dir=${DPDK_BUILD_TEST_DIR:-.}
+builds_dir=$(readlink -f ${DPDK_BUILD_TEST_DIR:-.})

It means that all uses of builds_dir will get the absolute path. It may have consequences on meson configuration,
and will make outputs and logs longer.

I'm not sure this change is desirable.

#7 lore raw

[dpdk-dev] 回复: [PATCH v1 2/2] devtools: use absolute path for the build directory

Hi, Thomas

Thanks for your reviewing.

I agree with your comment.
As your concern, this patch is simple but may have some negative effects. Thus I will drop it from series in the next version.

Best Regards
Feifei

Quoted 28 lines

-----邮件原件-----
发件人: Thomas Monjalon <[email protected]>
发送时间: Friday, August 6, 2021 11:43 PM
收件人: Phil Yang <[email protected]>; Feifei Wang <[email protected]>
抄送: Bruce Richardson <[email protected]>; [email protected]; nd <[email protected]>; Juraj Linkeš <[email protected]>; Ruifeng Wang <[email protected]>; [email protected]
主题: Re: [dpdk-dev] [PATCH v1 2/2] devtools: use absolute path for the build directory

01/06/2021 03:56, Feifei Wang:

Quoted 4 lines

From: Phil Yang <[email protected]>

To make the code easier to maintain, use the absolute path for the default build_dir to avoid repeatedly calling of readlink.

[...]

devtools/test-meson-builds.sh srcdir=$(dirname $(readlink -f $0))/.. · line 19

Quoted 4 lines
devtools/test-meson-builds.sh +1 -1
-builds_dir=${DPDK_BUILD_TEST_DIR:-.}
+builds_dir=$(readlink -f ${DPDK_BUILD_TEST_DIR:-.})

It means that all uses of builds_dir will get the absolute path. It may have consequences on meson configuration, and will make outputs and logs longer.

I'm not sure this change is desirable.

#8 lore raw

v2 cover relative path support for ABI compatibility check

In reply to Feifei Wang

Add relative path support for ABI compatibility check.

v2:
1. delete the code simplification patch due to negative effects (Thomas)

Phil Yang (1):
devtools: add relative path support for ABI compatibility check

 devtools/test-meson-builds.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Signature · 1 line
2.25.1
#9 lore raw

PATCH v2 1/1 devtools: add relative path support for ABI compatibility check

From: Phil Yang <[email protected]>

Because dpdk guide does not limit the relative path for ABI compatibility check, users maybe set 'DPDK_ABI_REF_DIR' as a relative path:

~/dpdk/devtools$ DPDK_ABI_REF_VERSION=v19.11 DPDK_ABI_REF_DIR=build-gcc-shared ./test-meson-builds.sh

And if the DESTDIR is not an absolute path, ninja complains:
+ install_target build-gcc-shared/v19.11/build build-gcc-shared/v19.11/build-gcc-shared
+ rm -rf build-gcc-shared/v19.11/build-gcc-shared
+ echo 'DESTDIR=build-gcc-shared/v19.11/build-gcc-shared ninja -C build-gcc-shared/v19.11/build install'
+ DESTDIR=build-gcc-shared/v19.11/build-gcc-shared
+ ninja -C build-gcc-shared/v19.11/build install
...
ValueError: dst_dir must be absolute, got build-gcc-shared/v19.11/build-gcc-shared/usr/local/share/dpdk/ examples/bbdev_app
...
Error: install directory 'build-gcc-shared/v19.11/build-gcc-shared' does not exist.

To fix this, add relative path support using 'readlink -f'.

---
 devtools/test-meson-builds.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
devtools/test-meson-builds.sh +2 -1
index 9ec8e2bc7e..8ddde95276 100755
@@ -168,7 +168,8 @@ build () # <directory> <target cc | cross file> <ABI check> [meson options]
 	config $srcdir $builds_dir/$targetdir $cross --werror $*
 	compile $builds_dir/$targetdir
 	if [ -n "$DPDK_ABI_REF_VERSION" -a "$abicheck" = ABI ] ; then
-		abirefdir=${DPDK_ABI_REF_DIR:-reference}/$DPDK_ABI_REF_VERSION
+		abirefdir=$(readlink -f \
+			${DPDK_ABI_REF_DIR:-reference}/$DPDK_ABI_REF_VERSION)
 		if [ ! -d $abirefdir/$targetdir ]; then
 			# clone current sources
 			if [ ! -d $abirefdir/src ]; then
Signature · 1 line
2.25.1
#10 lore raw

[dpdk-dev] 回复: [PATCH v2 1/1] devtools: add relative path support for ABI compatibility check

Hi,

Sorry to disturb you. Have more comments for this patch or if it can be applied? Thanks very much.

Best Regards
Feifei

Quoted 65 lines

-----邮件原件-----
发件人: Feifei Wang <[email protected]>
发送时间: Wednesday, August 11, 2021 2:17 PM
收件人: Bruce Richardson <[email protected]>
抄送: [email protected]; nd <[email protected]>; Phil Yang <[email protected]>; Feifei Wang <[email protected]>; Juraj Linkeš <[email protected]>; Ruifeng Wang <[email protected]> 主题: [PATCH v2 1/1] devtools: add relative path support for ABI compatibility check

From: Phil Yang <[email protected]>

Because dpdk guide does not limit the relative path for ABI compatibility check, users maybe set 'DPDK_ABI_REF_DIR' as a relative
path:

~/dpdk/devtools$ DPDK_ABI_REF_VERSION=v19.11 DPDK_ABI_REF_DIR=build-gcc-shared ./test-meson-builds.sh

And if the DESTDIR is not an absolute path, ninja complains:
+ install_target build-gcc-shared/v19.11/build
+ build-gcc-shared/v19.11/build-gcc-shared
+ rm -rf build-gcc-shared/v19.11/build-gcc-shared
+ echo 'DESTDIR=build-gcc-shared/v19.11/build-gcc-shared ninja -C build-gcc- shared/v19.11/build install'
+ DESTDIR=build-gcc-shared/v19.11/build-gcc-shared
+ ninja -C build-gcc-shared/v19.11/build install
...
ValueError: dst_dir must be absolute, got build-gcc-shared/v19.11/build-gcc- shared/usr/local/share/dpdk/
examples/bbdev_app
...
Error: install directory 'build-gcc-shared/v19.11/build-gcc-shared' does not exist.

To fix this, add relative path support using 'readlink -f'.

---
 devtools/test-meson-builds.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
devtools/test-meson-builds.sh +0 -0
index 9ec8e2bc7e..8ddde95276 100755
@@ -168,7 +168,8 @@ build () # <directory> <target cc | cross file> <ABI

check> [meson options]

devtools/test-meson-builds.sh +0 -1
 	config $srcdir $builds_dir/$targetdir $cross --werror $*
 	compile $builds_dir/$targetdir
 	if [ -n "$DPDK_ABI_REF_VERSION" -a "$abicheck" = ABI ] ; then
-		abirefdir=${DPDK_ABI_REF_DIR:-

reference}/$DPDK_ABI_REF_VERSION

devtools/test-meson-builds.sh +2 -0
+		abirefdir=$(readlink -f \
+			${DPDK_ABI_REF_DIR:-

reference}/$DPDK_ABI_REF_VERSION)

devtools/test-meson-builds.sh +0 -1
 		if [ ! -d $abirefdir/$targetdir ]; then
 			# clone current sources
 			if [ ! -d $abirefdir/src ]; then
--

2.25.1