From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4A80DA3168 for ; Wed, 16 Oct 2019 15:23:00 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1114C1E87C; Wed, 16 Oct 2019 15:23:00 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id B4CDB1E874 for ; Wed, 16 Oct 2019 15:22:57 +0200 (CEST) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Oct 2019 06:22:56 -0700 X-IronPort-AV: E=Sophos;i="5.67,303,1566889200"; d="scan'208";a="186148205" Received: from bricha3-mobl.ger.corp.intel.com ([10.237.221.95]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 16 Oct 2019 06:22:52 -0700 Date: Wed, 16 Oct 2019 14:22:49 +0100 From: Bruce Richardson To: Anatoly Burakov Cc: dev@dpdk.org, Marcin Baran , Thomas Monjalon , john.mcnamara@intel.com, david.marchand@redhat.com, Pawel Modrak Message-ID: <20191016132249.GA720@bricha3-MOBL.ger.corp.intel.com> References: <20190930092139.2440-1-marcinx.baran@intel.com> <6b0a64dba971a8d244271f36e283813814412efc.1571229052.git.anatoly.burakov@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6b0a64dba971a8d244271f36e283813814412efc.1571229052.git.anatoly.burakov@intel.com> User-Agent: Mutt/1.12.1 (2019-06-15) Subject: Re: [dpdk-dev] [PATCH v2 01/10] config: change ABI versioning for global X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Wed, Oct 16, 2019 at 01:43:16PM +0100, Anatoly Burakov wrote: > From: Marcin Baran > > The libraries should be maintained using global > ABI versioning. The changes includes adding global > ABI version support for both makefile and meson > build system. Experimental libraries should be > marked as 0. > > Signed-off-by: Marcin Baran > Signed-off-by: Pawel Modrak > Signed-off-by: Anatoly Burakov > --- Some comments inline below. /Bruce > buildtools/meson.build | 2 ++ > config/ABI_VERSION | 1 + > config/meson.build | 3 ++- > drivers/meson.build | 20 ++++++++++++++------ > lib/meson.build | 18 +++++++++++++----- > meson_options.txt | 2 -- > mk/rte.lib.mk | 19 +++++++++++-------- > 7 files changed, 43 insertions(+), 22 deletions(-) > create mode 100644 config/ABI_VERSION > > diff --git a/buildtools/meson.build b/buildtools/meson.build > index 32c79c1308..78ce69977d 100644 > --- a/buildtools/meson.build > +++ b/buildtools/meson.build > @@ -12,3 +12,5 @@ if python3.found() > else > map_to_def_cmd = ['meson', 'runpython', files('map_to_def.py')] > endif > + > +is_experimental_cmd = [find_program('grep', 'findstr'), '^DPDK_'] > diff --git a/config/ABI_VERSION b/config/ABI_VERSION > new file mode 100644 > index 0000000000..9a7c1e503f > --- /dev/null > +++ b/config/ABI_VERSION > @@ -0,0 +1 @@ > +20.0 > diff --git a/config/meson.build b/config/meson.build > index a27f731f85..25ecf928e4 100644 > --- a/config/meson.build > +++ b/config/meson.build > @@ -17,7 +17,8 @@ endforeach > # set the major version, which might be used by drivers and libraries > # depending on the configuration options > pver = meson.project_version().split('.') > -major_version = '@0@.@1@'.format(pver.get(0), pver.get(1)) > +major_version = run_command(find_program('cat', 'more'), > + files('ABI_VERSION')).stdout().strip() > I wonder if we should rename this to abi_version rather than major_version? > # extract all version information into the build configuration > dpdk_conf.set('RTE_VER_YEAR', pver.get(0).to_int()) > diff --git a/drivers/meson.build b/drivers/meson.build > index 2ed2e95411..5c5fe87c7e 100644 > --- a/drivers/meson.build > +++ b/drivers/meson.build > @@ -110,9 +110,20 @@ foreach class:dpdk_driver_classes > output: out_filename, > depends: [pmdinfogen, tmp_lib]) > > - if get_option('per_library_versions') > - lib_version = '@0@.1'.format(version) > - so_version = '@0@'.format(version) > + version_map = '@0@/@1@/@2@_version.map'.format( > + meson.current_source_dir(), > + drv_path, lib_name) > + > + if is_windows > + version_map = '\\'.join(version_map.split('/')) > + endif Don't think this block should be needed. Windows generally supports using "/" as a separator, even if traditionally "\" was used. > + > + is_experimental = run_command(is_experimental_cmd, > + files(version_map)).returncode() > + > + if is_experimental != 0 > + lib_version = '0.1' > + so_version = '0' > else > lib_version = major_version > so_version = major_version > @@ -128,9 +139,6 @@ foreach class:dpdk_driver_classes > install: true) > > # now build the shared driver > - version_map = '@0@/@1@/@2@_version.map'.format( > - meson.current_source_dir(), > - drv_path, lib_name) > shared_lib = shared_library(lib_name, > sources, > objects: objs, > diff --git a/lib/meson.build b/lib/meson.build > index e5ff838934..3892c16e8f 100644 > --- a/lib/meson.build > +++ b/lib/meson.build > @@ -97,9 +97,19 @@ foreach l:libraries > cflags += '-DALLOW_EXPERIMENTAL_API' > endif > > - if get_option('per_library_versions') > - lib_version = '@0@.1'.format(version) > - so_version = '@0@'.format(version) > + version_map = '@0@/@1@/rte_@2@_version.map'.format( > + meson.current_source_dir(), dir_name, name) > + > + if is_windows > + version_map = '\\'.join(version_map.split('/')) > + endif As above. > + > + is_experimental = run_command(is_experimental_cmd, > + files(version_map)).returncode() > + > + if is_experimental != 0 > + lib_version = '0.1' > + so_version = '0' > else > lib_version = major_version > so_version = major_version > @@ -120,8 +130,6 @@ foreach l:libraries > # then use pre-build objects to build shared lib > sources = [] > objs += static_lib.extract_all_objects(recursive: false) > - version_map = '@0@/@1@/rte_@2@_version.map'.format( > - meson.current_source_dir(), dir_name, name) > implib = dir_name + '.dll.a' > > def_file = custom_target(name + '_def', > diff --git a/meson_options.txt b/meson_options.txt > index 448f3e63dc..000e38fd98 100644 > --- a/meson_options.txt > +++ b/meson_options.txt > @@ -28,8 +28,6 @@ option('max_lcores', type: 'integer', value: 128, > description: 'maximum number of cores/threads supported by EAL') > option('max_numa_nodes', type: 'integer', value: 4, > description: 'maximum number of NUMA nodes supported by EAL') > -option('per_library_versions', type: 'boolean', value: true, > - description: 'true: each lib gets its own version number, false: DPDK version used for each lib') > option('tests', type: 'boolean', value: true, > description: 'build unit tests') > option('use_hpet', type: 'boolean', value: false, > diff --git a/mk/rte.lib.mk b/mk/rte.lib.mk > index 4df8849a08..f84161c6d5 100644 > --- a/mk/rte.lib.mk > +++ b/mk/rte.lib.mk > @@ -11,20 +11,23 @@ EXTLIB_BUILD ?= n > # VPATH contains at least SRCDIR > VPATH += $(SRCDIR) > > -ifneq ($(CONFIG_RTE_MAJOR_ABI),) > -ifneq ($(LIBABIVER),) > -LIBABIVER := $(CONFIG_RTE_MAJOR_ABI) > +ifeq ($(OS), Windows_NT) > +search_cmd = findstr > +print_cmd = more > +else > +search_cmd = grep > +print_cmd = cat We don't support make on windows, so no need for using findstr. > endif > + > +ifneq ($(shell $(search_cmd) "^DPDK_" $(SRCDIR)/$(EXPORT_MAP)),) > +LIBABIVER := $(shell $(print_cmd) $(RTE_SRCDIR)/config/ABI_VERSION) > +else > +LIBABIVER := 0 > endif > > ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y) > LIB := $(patsubst %.a,%.so.$(LIBABIVER),$(LIB)) > ifeq ($(EXTLIB_BUILD),n) > -ifeq ($(CONFIG_RTE_MAJOR_ABI),) > -ifeq ($(CONFIG_RTE_NEXT_ABI),y) > -LIB := $(LIB).1 > -endif > -endif > CPU_LDFLAGS += --version-script=$(SRCDIR)/$(EXPORT_MAP) > endif > endif > -- > 2.17.1