diff mbox series

build: fix experimental library versioning

Message ID 20200220195454.2363094-1-ferruh.yigit@intel.com (mailing list archive)
State Accepted, archived
Delegated to: David Marchand
Headers show
Series build: fix experimental library versioning | expand

Checks

Context Check Description
ci/travis-robot warning Travis build: failed
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-testing success Testing PASS
ci/checkpatch success coding style OK

Commit Message

Ferruh Yigit Feb. 20, 2020, 7:54 p.m. UTC
The problem occurred when workaround that makes soname two digits
applied. With this change for the ABI version "20.0.1" the experimental
library version become ".so.2001".
After workaround removed in ABI version 21.0, the experimental library
version will become ".so.210".
"2001" is bigger value than "201" although it is a previous version of
the library version, this can break the version comparisons.

To fix this, introducing a temporary sub level versioning for the
experimental libraries, so that minor version comparison will continue
to work.

After change experimental libraries will follow below versioning:

DPDK version  ABI version  soname       library name
------------  -----------  ------       ------------
DPDK 19.11     20.0        .so.0.200    .so.0.200
DPDK 20.02     20.0.1      .so.0.200.1  .so.0.200.1
DPDK 20.05     20.0.2      .so.0.200.2  .so.0.200.2
DPDK 20.11     21.0        .so.0.210    .so.0.210
DPDK 21.02     21.1        .so.0.211    .so.0.211

Note: After workaround removed in DPDK 20.11 and soname switch back to
single digit this patch won't work and needs to be updated.

Fixes: f26c2b39b271 ("build: fix soname info for 19.11 compatibility")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
Cc: Thomas Monjalon <thomas@monjalon.net>
Cc: ray.kinsella@intel.com
Cc: nhorman@tuxdriver.com
Cc: bruce.richardson@intel.com
Cc: bluca@debian.org
Cc: david.marchand@redhat.com
Cc: ktraynor@redhat.com
---
 config/meson.build | 4 ++--
 mk/rte.lib.mk      | 8 +++++---
 2 files changed, 7 insertions(+), 5 deletions(-)

Comments

Luca Boccassi Feb. 20, 2020, 10:14 p.m. UTC | #1
On Thu, 2020-02-20 at 19:54 +0000, Ferruh Yigit wrote:
> The problem occurred when workaround that makes soname two digits
> applied. With this change for the ABI version "20.0.1" the
> experimental
> library version become ".so.2001".
> After workaround removed in ABI version 21.0, the experimental
> library
> version will become ".so.210".
> "2001" is bigger value than "201" although it is a previous version
> of
> the library version, this can break the version comparisons.
> 
> To fix this, introducing a temporary sub level versioning for the
> experimental libraries, so that minor version comparison will
> continue
> to work.
> 
> After change experimental libraries will follow below versioning:
> 
> DPDK version  ABI version  soname       library name
> ------------  -----------  ------       ------------
> DPDK 19.11     20.0        .so.0.200    .so.0.200
> DPDK 20.02     20.0.1      .so.0.200.1  .so.0.200.1
> DPDK 20.05     20.0.2      .so.0.200.2  .so.0.200.2
> DPDK 20.11     21.0        .so.0.210    .so.0.210
> DPDK 21.02     21.1        .so.0.211    .so.0.211
> 
> Note: After workaround removed in DPDK 20.11 and soname switch back
> to
> single digit this patch won't work and needs to be updated.
> 
> Fixes: f26c2b39b271 ("build: fix soname info for 19.11
> compatibility")
> 
> Signed-off-by: Ferruh Yigit <
> ferruh.yigit@intel.com

Acked-by: Luca Boccassi <bluca@debian.org>

This solution looks like a good compromise to me. Thanks Ferruh.
Ray Kinsella Feb. 21, 2020, 12:36 p.m. UTC | #2
On 20/02/2020 19:54, Ferruh Yigit wrote:
> The problem occurred when workaround that makes soname two digits
> applied. With this change for the ABI version "20.0.1" the experimental
> library version become ".so.2001".
> After workaround removed in ABI version 21.0, the experimental library
> version will become ".so.210".
> "2001" is bigger value than "201" although it is a previous version of
> the library version, this can break the version comparisons.
> 
> To fix this, introducing a temporary sub level versioning for the
> experimental libraries, so that minor version comparison will continue
> to work.
> 
> After change experimental libraries will follow below versioning:
> 
> DPDK version  ABI version  soname       library name
> ------------  -----------  ------       ------------
> DPDK 19.11     20.0        .so.0.200    .so.0.200
> DPDK 20.02     20.0.1      .so.0.200.1  .so.0.200.1
> DPDK 20.05     20.0.2      .so.0.200.2  .so.0.200.2
> DPDK 20.11     21.0        .so.0.210    .so.0.210
> DPDK 21.02     21.1        .so.0.211    .so.0.211
> 
> Note: After workaround removed in DPDK 20.11 and soname switch back to
> single digit this patch won't work and needs to be updated.
> 
> Fixes: f26c2b39b271 ("build: fix soname info for 19.11 compatibility")
> 

Acked-by: Ray Kinsella <mdr@ashroe.eu>

> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> ---
> Cc: Thomas Monjalon <thomas@monjalon.net>
> Cc: ray.kinsella@intel.com
> Cc: nhorman@tuxdriver.com
> Cc: bruce.richardson@intel.com
> Cc: bluca@debian.org
> Cc: david.marchand@redhat.com
> Cc: ktraynor@redhat.com
> ---
>  config/meson.build | 4 ++--
>  mk/rte.lib.mk      | 8 +++++---
>  2 files changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/config/meson.build b/config/meson.build
> index 6c46767e3..d3d2370ce 100644
> --- a/config/meson.build
> +++ b/config/meson.build
> @@ -31,8 +31,8 @@ abi_version = run_command(find_program('cat', 'more'),
>  #      sonames => librte_stable.so.20.0, librte_experimental.so.0.200
>  abi_va = abi_version.split('.')
>  stable_so_version = abi_va.length() == 2 ? abi_va[0] : abi_va[0] + '.' + abi_va[1]
> -experimental_abi_version = '0.' + ''.join(abi_va)
> -experimental_so_version = '0.' + ''.join(stable_so_version.split('.'))
> +experimental_abi_version = '0.' + abi_va[0] + abi_va[1] + '.' + abi_va[2]
> +experimental_so_version = experimental_abi_version
>  
>  # extract all version information into the build configuration
>  dpdk_conf.set('RTE_VER_YEAR', pver.get(0).to_int())
> diff --git a/mk/rte.lib.mk b/mk/rte.lib.mk
> index b1a8372cc..682b590db 100644
> --- a/mk/rte.lib.mk
> +++ b/mk/rte.lib.mk
> @@ -15,8 +15,8 @@ LIBABIVER ?= $(shell cat $(RTE_SRCDIR)/ABI_VERSION)
>  SOVER := $(basename $(LIBABIVER))
>  ifeq ($(shell grep -s "^DPDK_" $(SRCDIR)/$(EXPORT_MAP)),)
>  # EXPERIMENTAL ABI is versioned as 0.major+minor, e.g. 0.201 for 20.1 ABI
> -LIBABIVER := 0.$(shell echo $(LIBABIVER) | tr -d '.')
> -SOVER := 0.$(shell echo $(SOVER) | tr -d '.')
> +LIBABIVER := 0.$(shell echo $(LIBABIVER) | awk 'BEGIN { FS="." }; { print $$1$$2"."$$3 }')
> +SOVER := $(LIBABIVER)
>  endif
>  
>  ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y)
> @@ -135,7 +135,9 @@ $(RTE_OUTPUT)/lib/$(LIB): $(LIB)
>  	$(Q)cp -f $(LIB) $(RTE_OUTPUT)/lib
>  ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y)
>  	$(Q)ln -s -f $< $(shell echo $@ | sed 's/\.so.*/.so/')
> -	$(Q)ln -s -f $< $(shell echo $@ | sed 's/\.so.*/.so.$(SOVER)/')
> +	$(Q)if [ $(SOVER) != $(LIBABIVER) ]; then \
> +		ln -s -f $< $(shell echo $@ | sed 's/\.so.*/.so.$(SOVER)/') ; \
> +	fi
>  endif
>  
>  #
>
David Marchand Feb. 21, 2020, 3:24 p.m. UTC | #3
On Thu, Feb 20, 2020 at 8:55 PM Ferruh Yigit <ferruh.yigit@intel.com> wrote:
>
> The problem occurred when workaround that makes soname two digits
> applied. With this change for the ABI version "20.0.1" the experimental
> library version become ".so.2001".
> After workaround removed in ABI version 21.0, the experimental library
> version will become ".so.210".
> "2001" is bigger value than "201" although it is a previous version of
> the library version, this can break the version comparisons.
>
> To fix this, introducing a temporary sub level versioning for the
> experimental libraries, so that minor version comparison will continue
> to work.
>
> After change experimental libraries will follow below versioning:
>
> DPDK version  ABI version  soname       library name
> ------------  -----------  ------       ------------
> DPDK 19.11     20.0        .so.0.200    .so.0.200
> DPDK 20.02     20.0.1      .so.0.200.1  .so.0.200.1
> DPDK 20.05     20.0.2      .so.0.200.2  .so.0.200.2
> DPDK 20.11     21.0        .so.0.210    .so.0.210
> DPDK 21.02     21.1        .so.0.211    .so.0.211
>
> Note: After workaround removed in DPDK 20.11 and soname switch back to
> single digit this patch won't work and needs to be updated.
>
> Fixes: f26c2b39b271 ("build: fix soname info for 19.11 compatibility")
>
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>

The soname change breaks existing applications like testpmd (linked to
various experimental libraries).
I have the full details if needed in a pastebin (v19.11, master, patch_applied).

$ LD_LIBRARY_PATH=$HOME/builds/x86_64-native-linux-gcc+shared+kmods/install/lib
$HOME/abi/v19.11/x86_64-native-linux-gcc+shared+kmods/bin/testpmd
/home/dmarchan/abi/v19.11/x86_64-native-linux-gcc+shared+kmods/bin/testpmd:
error while loading shared libraries: librte_flow_classify.so.0.200:
cannot open shared object file: No such file or directory


libabigail reports this change as an error, so if it is intended, we
need to bypass the check for those libraries.

Functions changes summary: 0 Removed, 0 Changed (2 filtered out), 0
Added functions
Variables changes summary: 0 Removed, 0 Changed, 0 Added variable
ELF SONAME changed
Functions changes summary: 0 Removed, 0 Changed (7 filtered out), 0
Added functions
Variables changes summary: 0 Removed, 0 Changed, 0 Added variable
SONAME changed from 'librte_flow_classify.so.0.200' to
'librte_flow_classify.so.0.200.1'
Error: ABI issue reported for 'abidiff --suppr
/home/dmarchan/dpdk/devtools/libabigail.abignore --no-added-syms
--headers-dir1 /home/dmarchan/abi/v19.11/x86_64-native-linux-gcc+shared+kmods/include
--headers-dir2 /home/dmarchan/builds/x86_64-native-linux-gcc+shared+kmods/install/include
/home/dmarchan/abi/v19.11/x86_64-native-linux-gcc+shared+kmods/dump/librte_flow_classify.dump
/home/dmarchan/builds/x86_64-native-linux-gcc+shared+kmods/install/dump/librte_flow_classify.dump'
Ferruh Yigit Feb. 21, 2020, 3:34 p.m. UTC | #4
On 2/21/2020 3:24 PM, David Marchand wrote:
> On Thu, Feb 20, 2020 at 8:55 PM Ferruh Yigit <ferruh.yigit@intel.com> wrote:
>>
>> The problem occurred when workaround that makes soname two digits
>> applied. With this change for the ABI version "20.0.1" the experimental
>> library version become ".so.2001".
>> After workaround removed in ABI version 21.0, the experimental library
>> version will become ".so.210".
>> "2001" is bigger value than "201" although it is a previous version of
>> the library version, this can break the version comparisons.
>>
>> To fix this, introducing a temporary sub level versioning for the
>> experimental libraries, so that minor version comparison will continue
>> to work.
>>
>> After change experimental libraries will follow below versioning:
>>
>> DPDK version  ABI version  soname       library name
>> ------------  -----------  ------       ------------
>> DPDK 19.11     20.0        .so.0.200    .so.0.200
>> DPDK 20.02     20.0.1      .so.0.200.1  .so.0.200.1
>> DPDK 20.05     20.0.2      .so.0.200.2  .so.0.200.2
>> DPDK 20.11     21.0        .so.0.210    .so.0.210
>> DPDK 21.02     21.1        .so.0.211    .so.0.211
>>
>> Note: After workaround removed in DPDK 20.11 and soname switch back to
>> single digit this patch won't work and needs to be updated.
>>
>> Fixes: f26c2b39b271 ("build: fix soname info for 19.11 compatibility")
>>
>> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> 
> The soname change breaks existing applications like testpmd (linked to
> various experimental libraries).
> I have the full details if needed in a pastebin (v19.11, master, patch_applied).
> 
> $ LD_LIBRARY_PATH=$HOME/builds/x86_64-native-linux-gcc+shared+kmods/install/lib
> $HOME/abi/v19.11/x86_64-native-linux-gcc+shared+kmods/bin/testpmd
> /home/dmarchan/abi/v19.11/x86_64-native-linux-gcc+shared+kmods/bin/testpmd:
> error while loading shared libraries: librte_flow_classify.so.0.200:
> cannot open shared object file: No such file or directory
> 
> 
> libabigail reports this change as an error, so if it is intended, we
> need to bypass the check for those libraries.

soname change was intended, we don't provide any ABI compatibility in the
experimental libraries, keeping same soname may mislead as if we do.

The impact of it is, any application linked against experimental library will
need to recompile in new release.

Can we add exception to the the libabigail for experimental libraries?

> 
> Functions changes summary: 0 Removed, 0 Changed (2 filtered out), 0
> Added functions
> Variables changes summary: 0 Removed, 0 Changed, 0 Added variable
> ELF SONAME changed
> Functions changes summary: 0 Removed, 0 Changed (7 filtered out), 0
> Added functions
> Variables changes summary: 0 Removed, 0 Changed, 0 Added variable
> SONAME changed from 'librte_flow_classify.so.0.200' to
> 'librte_flow_classify.so.0.200.1'
> Error: ABI issue reported for 'abidiff --suppr
> /home/dmarchan/dpdk/devtools/libabigail.abignore --no-added-syms
> --headers-dir1 /home/dmarchan/abi/v19.11/x86_64-native-linux-gcc+shared+kmods/include
> --headers-dir2 /home/dmarchan/builds/x86_64-native-linux-gcc+shared+kmods/install/include
> /home/dmarchan/abi/v19.11/x86_64-native-linux-gcc+shared+kmods/dump/librte_flow_classify.dump
> /home/dmarchan/builds/x86_64-native-linux-gcc+shared+kmods/install/dump/librte_flow_classify.dump'
> 
> 
>
David Marchand Feb. 21, 2020, 4:41 p.m. UTC | #5
On Thu, Feb 20, 2020 at 8:55 PM Ferruh Yigit <ferruh.yigit@intel.com> wrote:
>
> The problem occurred when workaround that makes soname two digits
> applied. With this change for the ABI version "20.0.1" the experimental
> library version become ".so.2001".
> After workaround removed in ABI version 21.0, the experimental library
> version will become ".so.210".
> "2001" is bigger value than "201" although it is a previous version of
> the library version, this can break the version comparisons.
>
> To fix this, introducing a temporary sub level versioning for the
> experimental libraries, so that minor version comparison will continue
> to work.
>
> After change experimental libraries will follow below versioning:
>
> DPDK version  ABI version  soname       library name
> ------------  -----------  ------       ------------
> DPDK 19.11     20.0        .so.0.200    .so.0.200
> DPDK 20.02     20.0.1      .so.0.200.1  .so.0.200.1
> DPDK 20.05     20.0.2      .so.0.200.2  .so.0.200.2
> DPDK 20.11     21.0        .so.0.210    .so.0.210
> DPDK 21.02     21.1        .so.0.211    .so.0.211
>
> Note: After workaround removed in DPDK 20.11 and soname switch back to
> single digit this patch won't work and needs to be updated.
>
> Fixes: f26c2b39b271 ("build: fix soname info for 19.11 compatibility")
>
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>

Acked-by: Luca Boccassi <bluca@debian.org>
Acked-by: Ray Kinsella <mdr@ashroe.eu>


Applied.
diff mbox series

Patch

diff --git a/config/meson.build b/config/meson.build
index 6c46767e3..d3d2370ce 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -31,8 +31,8 @@  abi_version = run_command(find_program('cat', 'more'),
 #      sonames => librte_stable.so.20.0, librte_experimental.so.0.200
 abi_va = abi_version.split('.')
 stable_so_version = abi_va.length() == 2 ? abi_va[0] : abi_va[0] + '.' + abi_va[1]
-experimental_abi_version = '0.' + ''.join(abi_va)
-experimental_so_version = '0.' + ''.join(stable_so_version.split('.'))
+experimental_abi_version = '0.' + abi_va[0] + abi_va[1] + '.' + abi_va[2]
+experimental_so_version = experimental_abi_version
 
 # extract all version information into the build configuration
 dpdk_conf.set('RTE_VER_YEAR', pver.get(0).to_int())
diff --git a/mk/rte.lib.mk b/mk/rte.lib.mk
index b1a8372cc..682b590db 100644
--- a/mk/rte.lib.mk
+++ b/mk/rte.lib.mk
@@ -15,8 +15,8 @@  LIBABIVER ?= $(shell cat $(RTE_SRCDIR)/ABI_VERSION)
 SOVER := $(basename $(LIBABIVER))
 ifeq ($(shell grep -s "^DPDK_" $(SRCDIR)/$(EXPORT_MAP)),)
 # EXPERIMENTAL ABI is versioned as 0.major+minor, e.g. 0.201 for 20.1 ABI
-LIBABIVER := 0.$(shell echo $(LIBABIVER) | tr -d '.')
-SOVER := 0.$(shell echo $(SOVER) | tr -d '.')
+LIBABIVER := 0.$(shell echo $(LIBABIVER) | awk 'BEGIN { FS="." }; { print $$1$$2"."$$3 }')
+SOVER := $(LIBABIVER)
 endif
 
 ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y)
@@ -135,7 +135,9 @@  $(RTE_OUTPUT)/lib/$(LIB): $(LIB)
 	$(Q)cp -f $(LIB) $(RTE_OUTPUT)/lib
 ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y)
 	$(Q)ln -s -f $< $(shell echo $@ | sed 's/\.so.*/.so/')
-	$(Q)ln -s -f $< $(shell echo $@ | sed 's/\.so.*/.so.$(SOVER)/')
+	$(Q)if [ $(SOVER) != $(LIBABIVER) ]; then \
+		ln -s -f $< $(shell echo $@ | sed 's/\.so.*/.so.$(SOVER)/') ; \
+	fi
 endif
 
 #