zstd: add libzstd package to minimize runtime dependencies

Message ID 20220325101831.1451-1-stefan.herbrechtsmeier-oss@weidmueller.com
State New
Headers show
Series zstd: add libzstd package to minimize runtime dependencies | expand

Commit Message

Stefan Herbrechtsmeier March 25, 2022, 10:18 a.m. UTC
From: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>

Add a libzstd package to remove libstdc++ runtime dependency from
library users and reduce the size of the library package and its
dependencies.

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>

---

 meta/recipes-extended/zstd/zstd_1.5.2.bb | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Alexander Kanavin March 25, 2022, 10:48 a.m. UTC | #1
The standard way to do this is to inherit lib_package.

Alex

On Fri, 25 Mar 2022 at 11:19, Stefan Herbrechtsmeier
<stefan.herbrechtsmeier-oss@weidmueller.com> wrote:
>
> From: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
>
> Add a libzstd package to remove libstdc++ runtime dependency from
> library users and reduce the size of the library package and its
> dependencies.
>
> Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
>
> ---
>
>  meta/recipes-extended/zstd/zstd_1.5.2.bb | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/meta/recipes-extended/zstd/zstd_1.5.2.bb b/meta/recipes-extended/zstd/zstd_1.5.2.bb
> index 0ddff469b8..3887f31ecf 100644
> --- a/meta/recipes-extended/zstd/zstd_1.5.2.bb
> +++ b/meta/recipes-extended/zstd/zstd_1.5.2.bb
> @@ -36,4 +36,8 @@ do_install () {
>      oe_runmake install 'DESTDIR=${D}' PREFIX=${prefix} -C contrib/pzstd
>  }
>
> +PACKAGE_BEFORE_PN = "libzstd"
> +
> +FILES:libzstd = "${libdir}/libzstd${SOLIBS}"
> +
>  BBCLASSEXTEND = "native nativesdk"
> --
> 2.30.2
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#163632): https://lists.openembedded.org/g/openembedded-core/message/163632
> Mute This Topic: https://lists.openembedded.org/mt/90019254/1686489
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alex.kanavin@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Stefan Herbrechtsmeier March 25, 2022, 10:54 a.m. UTC | #2
Am 25.03.2022 um 11:48 schrieb Alexander Kanavin:
> The standard way to do this is to inherit lib_package.

Do you propose to move the binaries to a new zstd-bin package and break 
backward compatibility?

Regards
   Stefan

> On Fri, 25 Mar 2022 at 11:19, Stefan Herbrechtsmeier
> <stefan.herbrechtsmeier-oss@weidmueller.com> wrote:
>>
>> From: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
>>
>> Add a libzstd package to remove libstdc++ runtime dependency from
>> library users and reduce the size of the library package and its
>> dependencies.
>>
>> Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
>>
>> ---
>>
>>   meta/recipes-extended/zstd/zstd_1.5.2.bb | 4 ++++
>>   1 file changed, 4 insertions(+)
>>
>> diff --git a/meta/recipes-extended/zstd/zstd_1.5.2.bb b/meta/recipes-extended/zstd/zstd_1.5.2.bb
>> index 0ddff469b8..3887f31ecf 100644
>> --- a/meta/recipes-extended/zstd/zstd_1.5.2.bb
>> +++ b/meta/recipes-extended/zstd/zstd_1.5.2.bb
>> @@ -36,4 +36,8 @@ do_install () {
>>       oe_runmake install 'DESTDIR=${D}' PREFIX=${prefix} -C contrib/pzstd
>>   }
>>
>> +PACKAGE_BEFORE_PN = "libzstd"
>> +
>> +FILES:libzstd = "${libdir}/libzstd${SOLIBS}"
>> +
>>   BBCLASSEXTEND = "native nativesdk"
>> --
>> 2.30.2
>>
>>
>> -=-=-=-=-=-=-=-=-=-=-=-
>> Links: You receive all messages sent to this group.
>> View/Reply Online (#163632): https://lists.openembedded.org/g/openembedded-core/message/163632
>> Mute This Topic: https://lists.openembedded.org/mt/90019254/1686489
>> Group Owner: openembedded-core+owner@lists.openembedded.org
>> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alex.kanavin@gmail.com]
>> -=-=-=-=-=-=-=-=-=-=-=-
>>
Alexander Kanavin March 25, 2022, 11:06 a.m. UTC | #3
Yes.

Alex

On Fri, 25 Mar 2022 at 11:55, Stefan Herbrechtsmeier
<stefan.herbrechtsmeier-oss@weidmueller.com> wrote:
>
> Am 25.03.2022 um 11:48 schrieb Alexander Kanavin:
> > The standard way to do this is to inherit lib_package.
>
> Do you propose to move the binaries to a new zstd-bin package and break
> backward compatibility?
>
> Regards
>    Stefan
>
> > On Fri, 25 Mar 2022 at 11:19, Stefan Herbrechtsmeier
> > <stefan.herbrechtsmeier-oss@weidmueller.com> wrote:
> >>
> >> From: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
> >>
> >> Add a libzstd package to remove libstdc++ runtime dependency from
> >> library users and reduce the size of the library package and its
> >> dependencies.
> >>
> >> Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
> >>
> >> ---
> >>
> >>   meta/recipes-extended/zstd/zstd_1.5.2.bb | 4 ++++
> >>   1 file changed, 4 insertions(+)
> >>
> >> diff --git a/meta/recipes-extended/zstd/zstd_1.5.2.bb b/meta/recipes-extended/zstd/zstd_1.5.2.bb
> >> index 0ddff469b8..3887f31ecf 100644
> >> --- a/meta/recipes-extended/zstd/zstd_1.5.2.bb
> >> +++ b/meta/recipes-extended/zstd/zstd_1.5.2.bb
> >> @@ -36,4 +36,8 @@ do_install () {
> >>       oe_runmake install 'DESTDIR=${D}' PREFIX=${prefix} -C contrib/pzstd
> >>   }
> >>
> >> +PACKAGE_BEFORE_PN = "libzstd"
> >> +
> >> +FILES:libzstd = "${libdir}/libzstd${SOLIBS}"
> >> +
> >>   BBCLASSEXTEND = "native nativesdk"
> >> --
> >> 2.30.2
> >>
> >>
> >> -=-=-=-=-=-=-=-=-=-=-=-
> >> Links: You receive all messages sent to this group.
> >> View/Reply Online (#163632): https://lists.openembedded.org/g/openembedded-core/message/163632
> >> Mute This Topic: https://lists.openembedded.org/mt/90019254/1686489
> >> Group Owner: openembedded-core+owner@lists.openembedded.org
> >> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alex.kanavin@gmail.com]
> >> -=-=-=-=-=-=-=-=-=-=-=-
> >>
Khem Raj March 25, 2022, 1:47 p.m. UTC | #4
On 3/25/22 03:48, Alexander Kanavin wrote:
> The standard way to do this is to inherit lib_package.
> 

that is appropriate when main package is a library but it also has some 
utilities accompanying it. This case seems reverse, where its tryin to
create a fine grained packaging and separating the lib out instead.

> Alex
> 
> On Fri, 25 Mar 2022 at 11:19, Stefan Herbrechtsmeier
> <stefan.herbrechtsmeier-oss@weidmueller.com> wrote:
>>
>> From: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
>>
>> Add a libzstd package to remove libstdc++ runtime dependency from
>> library users and reduce the size of the library package and its
>> dependencies.
>>
>> Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
>>
>> ---
>>
>>   meta/recipes-extended/zstd/zstd_1.5.2.bb | 4 ++++
>>   1 file changed, 4 insertions(+)
>>
>> diff --git a/meta/recipes-extended/zstd/zstd_1.5.2.bb b/meta/recipes-extended/zstd/zstd_1.5.2.bb
>> index 0ddff469b8..3887f31ecf 100644
>> --- a/meta/recipes-extended/zstd/zstd_1.5.2.bb
>> +++ b/meta/recipes-extended/zstd/zstd_1.5.2.bb
>> @@ -36,4 +36,8 @@ do_install () {
>>       oe_runmake install 'DESTDIR=${D}' PREFIX=${prefix} -C contrib/pzstd
>>   }
>>
>> +PACKAGE_BEFORE_PN = "libzstd"
>> +
>> +FILES:libzstd = "${libdir}/libzstd${SOLIBS}"
>> +
>>   BBCLASSEXTEND = "native nativesdk"
>> --
>> 2.30.2
>>
>>
>>
>>
>>
>>
>> -=-=-=-=-=-=-=-=-=-=-=-
>> Links: You receive all messages sent to this group.
>> View/Reply Online (#163633): https://lists.openembedded.org/g/openembedded-core/message/163633
>> Mute This Topic: https://lists.openembedded.org/mt/90019254/1997914
>> Group Owner: openembedded-core+owner@lists.openembedded.org
>> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [raj.khem@gmail.com]
>> -=-=-=-=-=-=-=-=-=-=-=-
>>
Alexander Kanavin March 25, 2022, 1:54 p.m. UTC | #5
On Fri, 25 Mar 2022 at 14:47, Khem Raj <raj.khem@gmail.com> wrote:
> > The standard way to do this is to inherit lib_package.
> >
>
> that is appropriate when main package is a library but it also has some
> utilities accompanying it. This case seems reverse, where its tryin to
> create a fine grained packaging and separating the lib out instead.

No, it's the same here: most (or all) of the consumers link to the
library, and utilities are mostly for interactive development.

Alex
Stefan Herbrechtsmeier March 25, 2022, 2:15 p.m. UTC | #6
Am 25.03.2022 um 14:54 schrieb Alexander Kanavin:
> On Fri, 25 Mar 2022 at 14:47, Khem Raj <raj.khem@gmail.com> wrote:
>>> The standard way to do this is to inherit lib_package.
>>>
>>
>> that is appropriate when main package is a library but it also has some
>> utilities accompanying it. This case seems reverse, where its tryin to
>> create a fine grained packaging and separating the lib out instead.
> 
> No, it's the same here: most (or all) of the consumers link to the
> library, and utilities are mostly for interactive development.

We have examples for both solutions. xz has a liblzma package and brotli 
a brotli-bin package.
Alexander Kanavin March 25, 2022, 2:20 p.m. UTC | #7
On Fri, 25 Mar 2022 at 15:15, Stefan Herbrechtsmeier
<stefan.herbrechtsmeier-oss@weidmueller.com> wrote:
> > No, it's the same here: most (or all) of the consumers link to the
> > library, and utilities are mostly for interactive development.
>
> We have examples for both solutions. xz has a liblzma package and brotli
> a brotli-bin package.

Then it's RP's call. I don't have a particularly strong opinion here.

Alex

Patch

diff --git a/meta/recipes-extended/zstd/zstd_1.5.2.bb b/meta/recipes-extended/zstd/zstd_1.5.2.bb
index 0ddff469b8..3887f31ecf 100644
--- a/meta/recipes-extended/zstd/zstd_1.5.2.bb
+++ b/meta/recipes-extended/zstd/zstd_1.5.2.bb
@@ -36,4 +36,8 @@  do_install () {
     oe_runmake install 'DESTDIR=${D}' PREFIX=${prefix} -C contrib/pzstd
 }
 
+PACKAGE_BEFORE_PN = "libzstd"
+
+FILES:libzstd = "${libdir}/libzstd${SOLIBS}"
+
 BBCLASSEXTEND = "native nativesdk"