Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 947293 - net-analyzer/wireshark[binpkg]: needs sys-libs/zlib-ng
Summary: net-analyzer/wireshark[binpkg]: needs sys-libs/zlib-ng
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal
Assignee: Sam James
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2025-01-01 10:03 UTC by Marcus
Modified: 2025-01-07 18:54 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Suggested changes for pure zlib-ng dependencies (zlib-ng-only.patch,1013 bytes, patch)
2025-01-06 13:39 UTC, Holger Hoffstätte
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Marcus 2025-01-01 10:03:28 UTC
> $ wireshark 
> wireshark: error while loading shared libraries: libz-ng.so.2: cannot open shared object file: No such file or directory

> # emerge -av1g zlib-ng
> [...]

> $ wireshark # works
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-01-01 10:04:37 UTC
I remember seeing the zlib-ng bits in the build system diff but I was sure it was default off so I hadn't worried about it. I must have got it wrong.

I'll take a look, thanks.
Comment 2 Marcus 2025-01-01 10:43:11 UTC
Note, I have used the wireshark from our binhost.
Comment 3 Holger Hoffstätte 2025-01-01 12:30:27 UTC
(In reply to Marcus from comment #2)
> Note, I have used the wireshark from our binhost.

I was curious what had happened here and this was the missing bit. :)
Indeed: the binhost version of libwireshark.so.18.0.2 is built against zlib-ng (so it's not some accidental transitive dependency):

$lddtree image/usr/lib64/libwireshark.so.18.0.2 | grep -A1 -B1 libz   
    libwiretap.so.15 => /usr/lib64/libwiretap.so.15
        libz.so.1 => /usr/lib64/libz.so.1
    libcares.so.2 => /usr/lib64/libcares.so.2
--
    libm.so.6 => /lib64/libm.so.6
    libz-ng.so.2 => not found
    libzstd.so.1 => /usr/lib64/libzstd.so.1
    libwsutil.so.16 => /usr/lib64/libwsutil.so.16


Looks like cmake added this when zlib-ng was found on the binhost:
https://gitlab.com/wireshark/wireshark/-/blob/master/CMakeLists.txt#L1484

because it defaults to ON:
https://gitlab.com/wireshark/wireshark/-/blob/master/CMakeOptions.txt#L89

So we either need an explicit ENABLE_ZLIBNG=OFF or add a USE for zlibng.
Of course this raises the question whether this should continue to link against old zlib as well..?
Comment 4 Marcus 2025-01-01 18:42:24 UTC
Yes, if I then set “net-analyzer/wireshark” in world, emerge points to @preserved-rebuild.

Unfortunately, I can't help you. But I would suggest to prefer an optional USE flag. Wireshark (still) works with the version in the tree.
Comment 5 Holger Hoffstätte 2025-01-06 12:35:15 UTC
(In reply to Holger Hoffstätte from comment #3)
> So we either need an explicit ENABLE_ZLIBNG=OFF or add a USE for zlibng.
> Of course this raises the question whether this should continue to link
> against old zlib as well..?

The wireshark cmake build first tries to find zlib-ng and only falls back to old zlib if -ng wasn't found.

This is a good opportunity to discuss how we can/should handle zlib vs. zlib-ng in general. After thinking about this a bit more I don't think adding zlib-ng as USE is a good idea when the package can use -ng natively. It introduces ambiguity (what does it mean when both are set?) and fixes nothing. Simply using zlib as shortcut for zlib-ng should be enough in those cases.

This would also ease transition (= no action required) when zlib-ng eventually becomes a system-wide option.

I'll try and see if I can get this going and whether it uncovers any other pitfalls.
Comment 6 Holger Hoffstätte 2025-01-06 13:39:52 UTC
Created attachment 915986 [details, diff]
Suggested changes for pure zlib-ng dependencies

This turned out to be easier than expected; the attached patch (for discussion purposes only - no revbump etc.) shows that only a handful of changes were necessary. The wireshark binaries and libs are built purely against zlib-ng, and the only zlib-old dependency is transitively via Qt (which is fine). A headless wireshark on my server has no zlib-old dependency at all. \o/

I'll leave it to Sam to decide whether this is how we want to handle this and/or commit to -9999.
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-01-06 20:12:38 UTC
(In reply to Holger Hoffstätte from comment #5)
> This would also ease transition (= no action required) when zlib-ng
> eventually becomes a system-wide option.
> 

(Still not convinced that's ever going to happen given their attitudes on compatibility.)
Comment 8 Holger Hoffstätte 2025-01-07 17:08:45 UTC
Suggestions for how to proceed:

- we close 945994 since 4.2.9 is gone

- 4.4.2 is already being stabilised in 945995, so to keep things simple and rebuild the broken binpkg (does this happen automagically?) we just make a direct-to-stable -r1 with explicit -DENABLE_ZLIBNG=OFF and clean up 4.4.1/4.4.2

- with the next release (4.4.3?) we add zlib-ng as USE=zlib preference & dependency - like outlined in my patch
 
- I accept my fate and add myself as proxy-maint :-}

OK?
Comment 9 Larry the Git Cow gentoo-dev 2025-01-07 18:54:21 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=268938dd6737276136bb3773466bff0ba4d701b2

commit 268938dd6737276136bb3773466bff0ba4d701b2
Author:     Holger Hoffstätte <holger@applied-asynchrony.com>
AuthorDate: 2025-01-07 17:46:35 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2025-01-07 18:53:35 +0000

    net-analyzer/wireshark: avoid automagic zlib-ng dependency
    
    Explicitly disable zlib-ng to prevent an automagic dependency.
    zlib-ng is the preferred choice by upstream and will be enabled in
    future releases.
    
    Closes: https://bugs.gentoo.org/947293
    Signed-off-by: Holger Hoffstätte <holger@applied-asynchrony.com>
    Signed-off-by: Sam James <sam@gentoo.org>

 net-analyzer/wireshark/wireshark-4.4.2-r1.ebuild | 344 +++++++++++++++++++++++
 1 file changed, 344 insertions(+)

Additionally, it has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9a429b9703e75a47273ed5dc331819ea61efaa15

commit 9a429b9703e75a47273ed5dc331819ea61efaa15
Author:     Holger Hoffstätte <holger@applied-asynchrony.com>
AuthorDate: 2025-01-07 17:51:28 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2025-01-07 18:53:37 +0000

    net-analyzer/wireshark: prefer zlib-ng by default in live
    
    Upstream prefers zlib-ng to zlib and supports it natively.
    
    Bug: https://bugs.gentoo.org/947293
    Signed-off-by: Holger Hoffstätte <holger@applied-asynchrony.com>
    Closes: https://github.com/gentoo/gentoo/pull/40029
    Signed-off-by: Sam James <sam@gentoo.org>

 net-analyzer/wireshark/wireshark-9999.ebuild | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)