From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by dpdk.org (Postfix) with ESMTP id 5EF937CFD for ; Wed, 13 Sep 2017 13:32:26 +0200 (CEST) Received: by mail-wm0-f67.google.com with SMTP id e64so414394wmi.2 for ; Wed, 13 Sep 2017 04:32:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:subject:from:to:cc:date:in-reply-to:references :content-transfer-encoding:mime-version; bh=mcWygL+Cfq0iG6IfYzRdvPWw1VEe/PYlwEYXWizC7B8=; b=WhJdtvTWe/fqZiXIvtNoEc0EfecAuXRIzuuEwKsq63vQQ6nkikLxd2NErNhP4P5ib+ vKS1D7ga/0S0ORTwijzFRyIecOi9PbumzpXv6VhEnXxpn1VMGGFkH6xQr21++3QAkmK8 DyBuvy2cq0RYWDse8GqKWouF1b/0ZjOoqqV1R2vbyu9qoAKtu9+9aBIogcKQLv9Mp/YV svBXC/EA+aGY8rCFekHoJ86PKtwJ4EQ8DMWjLj/W5kAza7JfVLqiv3kH/5F/EziS7ffF hdGuDcTykv4iyuJnbIQ2Ih4hE32wD3SrTOnuAdoSKOAPqoRLJlW9AkI1pRF8T9X8f35R hzwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:content-transfer-encoding:mime-version; bh=mcWygL+Cfq0iG6IfYzRdvPWw1VEe/PYlwEYXWizC7B8=; b=TI2mcFxbMle860MiJwPR9GcN9vZSiRGNbDmRl/+mNyWVEo+vxp7bX/z0TqGnQOeA+z Qx1wyk5EFOxd628O6XD/WPhAnaelqfEgwudHtCUiQCX/9reTbK7u+r1UFOhcQtf9MHdC HwwVRp+CmHaDBOyw5kTFgApHUSVER04rOrRjiWx4aQqngLJW7+MFxSbemOxehWB3aOq3 o/Yrc1bQ3LxBzRAYtG/ZuKVqrYG6Aj/uWRjKb3LACR5RqUOkNmnof4m0PT3y6wbYYoAB bTTURulJvoaQHoI+vHGavAPyH66ZQeOji8t6wVqzQtEwz9FLKTIAErDx9OVyULptv3CK PUqA== X-Gm-Message-State: AHPjjUhnCiBtTW18QVLp43bu8UKaJfeqNC8D89V0Gkz34YGewFlKjurt hWyOwpuDuKVYHM4AKXTzoG0= X-Google-Smtp-Source: AOwi7QDsQqIykW9pyscWvc/o5jI3XINR7lrgN1HmuN72NHaD5Qyh2WmGYzLSzfviOSkx8YTqlpsIOg== X-Received: by 10.28.186.135 with SMTP id k129mr694688wmf.100.1505302345984; Wed, 13 Sep 2017 04:32:25 -0700 (PDT) Received: from localhost ([2a00:23c5:bef3:400:4a51:b7ff:fe0b:4749]) by smtp.gmail.com with ESMTPSA id l126sm760042wmd.1.2017.09.13.04.32.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 13 Sep 2017 04:32:25 -0700 (PDT) Message-ID: <1505302344.31233.3.camel@gmail.com> From: Luca Boccassi To: Bruce Richardson , dev@dpdk.org Cc: nhorman@tuxdriver.com, harry.van.haaren@intel.com, Christian Ehrhardt Date: Wed, 13 Sep 2017 12:32:24 +0100 In-Reply-To: <20170912103809.140473-17-bruce.richardson@intel.com> References: <20170901100416.80264-1-bruce.richardson@intel.com> <20170912103809.140473-1-bruce.richardson@intel.com> <20170912103809.140473-17-bruce.richardson@intel.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Evolution 3.22.6-1 Mime-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2 16/17] build: add option to version libs using DPDK version 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: , X-List-Received-Date: Wed, 13 Sep 2017 11:32:26 -0000 On Tue, 2017-09-12 at 11:38 +0100, Bruce Richardson wrote: > Normally, each library has it's own version number based on the ABI. > Add an option to have all libs just use the DPDK version number as > the > .so version. >=20 > Signed-off-by: Bruce Richardson > Reviewed-by: Harry van Haaren > --- > =C2=A0drivers/meson.build | 8 +++++++- > =C2=A0lib/meson.build=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0| 8 +++++++- > =C2=A0meson_options.txt=C2=A0=C2=A0=C2=A0| 1 + > =C2=A03 files changed, 15 insertions(+), 2 deletions(-) >=20 > diff --git a/drivers/meson.build b/drivers/meson.build > index f19da16fb..0c251bd61 100644 > --- a/drivers/meson.build > +++ b/drivers/meson.build > @@ -92,6 +92,12 @@ foreach class:driver_classes > =C2=A0 depends: > [pmdinfogen, tmp_lib]) > =C2=A0 endforeach > =C2=A0 > + if get_option('per_library_versions') > + so_version =3D '@0@.1'.format(version) > + else > + so_version =3D meson.project_version() > + endif > + > =C2=A0 # now build the driver itself, and add to > the drivers list > =C2=A0 lib_name =3D driver_name_fmt.format(name) > =C2=A0 version_map =3D '@0@/@1@/@2@_version.map'.form > at( > @@ -105,7 +111,7 @@ foreach class:driver_classes > =C2=A0 c_args: cflags, > =C2=A0 link_args: '-Wl,--version-script=3D' + > version_map, > =C2=A0 link_depends: version_map, > - version: '@0@.1'.format(version), > + version: so_version, > =C2=A0 install: true, > =C2=A0 install_dir: driver_install_path) > =C2=A0 > diff --git a/lib/meson.build b/lib/meson.build > index d814721de..36652cfe1 100644 > --- a/lib/meson.build > +++ b/lib/meson.build > @@ -76,6 +76,12 @@ foreach l:libraries > =C2=A0 dep_objs +=3D [get_variable('dep_rte_' + d)] > =C2=A0 endforeach > =C2=A0 > + if get_option('per_library_versions') > + so_version =3D '@0@.1'.format(version) > + else > + so_version =3D meson.project_version() > + endif > + > =C2=A0 version_map =3D '@0@/@1@/rte_@2@_version.map'.format( > =C2=A0 meson.current_source_dir(), > dir_name, name) > =C2=A0 libname =3D 'rte_' + name > @@ -87,7 +93,7 @@ foreach l:libraries > =C2=A0 include_directories: > include_directories(dir_name), > =C2=A0 link_args: '-Wl,--version-script=3D' + > version_map, > =C2=A0 link_depends: version_map, > - version: '@0@.1'.format(version), > + version: so_version, > =C2=A0 install: true) > =C2=A0 dep =3D declare_dependency(link_with: lib, > =C2=A0 include_directories: > include_directories(dir_name), > diff --git a/meson_options.txt b/meson_options.txt > index 9c45b8159..636226ce8 100644 > --- a/meson_options.txt > +++ b/meson_options.txt > @@ -6,3 +6,4 @@ option('allow_invalid_socket_id', type: 'boolean', > value: false, > =C2=A0 description: 'allow out-of-range NUMA socket id\'s for > platforms that don\'t report the value correctly') > =C2=A0option('enable_kmods', type: 'boolean', value: true, description: > 'build kernel modules') > =C2=A0option('kernel_dir', type: 'string', value: '', description: 'path > to the kernel for building kernel modules') > +option('per_library_versions', type: 'boolean', value: true, > description: 'true: each lib gets its own version number, false: DPDK > version used for each lib') Hi Bruce, First of all thanks for implementing this option, and sorry for the delay. A couple of minor things: 1) The project version has 3 digits, but the ABI version should have 2 - eg: should be 17.08 but right now it's 17.08.0 - given point releases will be ABI compatible so they must not change the ABI version. In the packaging code we use cut to chop it off: DPDK_ABI :=3D $(shell echo $(DEB_VERSION_UPSTREAM) | cut -d '.'=C2=A0=C2=A0= -f1-2) Not sure how to achieve the same in a Meson script though (can it shell out? or are there string manipulation built-ins?), sorry - just starting to look at it. Right now the rte_config option allows the user to completely override the version - I'm fine with having a single boolean provided this change is applied, it simplifies packaging a bit, but if it's easier for you to just accepted a version instead of a boolean it's fine as well, as you prefer 2) When the option is true, it should not generate a symlink with the ABI "revision", as the first digit is really not the revision, so it does not make much sense. Worse, it will stop 2 versions being co- installable (which was the whole point :-) ), as, eg, 17.02, 17.05 and 17.08 will all ship a libfoo.so.17 symlink. I can fix it in the packaging, but I don't think it should be generated upstream at all when this option is enabled. IOW, the following is the current result: $ ls -l debian/librte-ethdev17.08/usr/lib/x86_64-linux-gnu/ total 72 lrwxrwxrwx 1 lboccass lboccass=C2=A0=C2=A0=C2=A0=C2=A024 Sep 13 11:50 librt= e_ethdev.so.17 -> librte_ethdev.so.17.08.0 -rw-r--r-- 1 lboccass lboccass 71672 Sep 13 11:50 librte_ethdev.so.17.08.0 The expected result would be to create a single file "librte_ethdev.so.17.0= 8" instead. --=20 Kind regards, Luca Boccassi