Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 462030 - net-analyzer/wireshark-1.9.1 - optional dependency on dev-libs/libnl is automagic
Summary: net-analyzer/wireshark-1.9.1 - optional dependency on dev-libs/libnl is autom...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Netmon project
URL:
Whiteboard:
Keywords: PATCH, UPSTREAM
Depends on:
Blocks:
 
Reported: 2013-03-17 13:12 UTC by Michael Weiser
Modified: 2013-04-03 19:04 UTC (History)
1 user (show)

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


Attachments
add netlink use flag (wireshark-1.9.1-libnl-optional.ebuild,752 bytes, patch)
2013-03-17 13:13 UTC, Michael Weiser
Details | Diff
add --enable/disable-libnl configure option to wireshark-1.9.1 (wireshark-1.9.1-libnl.patch,925 bytes, patch)
2013-03-18 17:22 UTC, Michael Weiser
Details | Diff
explicitly disable libnl based on netlink USE flag when running configure (wireshark-1.9.1.ebuild-netlink.patch,1.17 KB, patch)
2013-03-18 17:24 UTC, Michael Weiser
Details | Diff
make dependency on libnl optional and non-automagic (wireshark-1.9.2.ebuild-netlink.patch,939 bytes, patch)
2013-04-03 17:34 UTC, Michael Weiser
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Weiser 2013-03-17 13:12:54 UTC
Netlink is Linux-specific and masked on other platforms. Wireshark compiles and works fine without (for me at least).

Reproducible: Always
Comment 1 Michael Weiser 2013-03-17 13:13:35 UTC
Created attachment 342374 [details, diff]
add netlink use flag

Patch ebuild to respect netlink USE flag and make dependency on libnl optional.
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2013-03-18 12:01:51 UTC
Comment on attachment 342374 [details, diff]
add netlink use flag

This alone would make it an automagic dependency.
Comment 3 Rick Farina (Zero_Chaos) gentoo-dev 2013-03-18 13:15:05 UTC
libnl is not linked by wireshark at all afaict.  Perhaps it looks like it does because wireshark links libpcap and you have USE=netlink on libpcap?

Anyway it doesn't seem right to me to adjust deps here at all.

Jer, if you don't see something I don't please close.
Comment 4 Michael Weiser 2013-03-18 14:55:26 UTC
> This alone would make it an automagic dependency.

wiresharks configure checks for libnl but doesn't require it and doesn't have a --enable-libnl. I'm on Mac OS X where there's no netlink and consequently, libnl fails to compile:

In file included from attr.c:12:
../include/netlink-private/netlink.h:42:25: error: linux/types.h: No such file or directory
In file included from ../include/netlink-private/netlink.h:46,
                 from attr.c:12:
../include/linux/if_arp.h:26:29: error: linux/netdevice.h: No such file or directory

So I need a way to tell the wireshark ebuild that I don't have and don't want libnl.

> libnl is not linked by wireshark at all afaict.  Perhaps it looks like it 
> does because wireshark links libpcap and you have USE=netlink on libpcap?

No, I do not have USE="netlink" on libpcap:

cat /usr/local/gentoo/var/db/pkg/net-libs/libpcap-1.3.0-r1/USE
elibc_Darwin ipv6 kernel_Darwin prefix userland_GNU x64-macos

This is because of:

portage/profiles/base/use.mask:# netlink is a Linux-specific interface
portage/profiles/base/use.mask:netlink
portage/profiles/default/linux/use.mask:# netlink is a Linux-specific interface
portage/profiles/default/linux/use.mask:-netlink

I don't have it set anywhere else. Otherwise libpcap would require libnl the same way as wireshark:

IUSE="bluetooth ipv6 netlink static-libs canusb"

RDEPEND="bluetooth? ( net-wireless/bluez )
        netlink? ( dev-libs/libnl:1.1 )

If wireshark doesn't link against libnl even with libnl installed and the USE flag activated, it's a different problem.
Comment 5 Rick Farina (Zero_Chaos) gentoo-dev 2013-03-18 15:08:27 UTC
I have libnl on my system, I don't see it linked into wireshark.  I am unable to replicate this issue.
Comment 6 Rick Farina (Zero_Chaos) gentoo-dev 2013-03-18 15:17:20 UTC
Wireshark's configure script makes no mention of netlink or libnl.

I'm not sure where your information is coming from but configure.in appears clean, and my wireshark isn't linked to libnl at all.  Are you using 1.8.6 or some other version?

Are you reporting this bug in the masked 1.9.1 release of wireshark?
Comment 7 Michael Weiser 2013-03-18 15:34:00 UTC
> Are you reporting this bug in the masked 1.9.1 release of wireshark?

Whoops, indeed I am. Sorry for not mentioning the version explicitly.
Comment 8 Rick Farina (Zero_Chaos) gentoo-dev 2013-03-18 15:51:13 UTC
(In reply to comment #7)
> > Are you reporting this bug in the masked 1.9.1 release of wireshark?
> 
> Whoops, indeed I am. Sorry for not mentioning the version explicitly.

This is an upstream issue, reported upstream.  I'm sure it is trivial for anyone good at autotools to write a patch to allow --enable/--disable; I'm just not that guy.
Comment 9 Michael Weiser 2013-03-18 17:22:32 UTC
Created attachment 342554 [details, diff]
add --enable/disable-libnl configure option to wireshark-1.9.1
Comment 10 Michael Weiser 2013-03-18 17:24:06 UTC
Created attachment 342558 [details, diff]
explicitly disable libnl based on netlink USE flag when running configure

I don't (yet) have an account for wireshark's bugzilla. Would you be willing to push this upstream?
Comment 11 Guy Harris 2013-03-18 17:45:26 UTC
(In reply to comment #4)
> > This alone would make it an automagic dependency.
> 
> wiresharks configure checks for libnl but doesn't require it and doesn't
> have a --enable-libnl. I'm on Mac OS X where there's no netlink and
> consequently, libnl fails to compile:

Why is OS X relevant here?  If you're building Wireshark on OS X, you:

    1) make sure you have the relevant required or optional support libraries (either by hand or by using the handy macosx-setup.sh script) - libnl is *NOT* one of those support libraries;

    2) ./configure;

    3) make;

    4) make install, if desired.

None of those steps involve building or installing libnl.

> So I need a way to tell the wireshark ebuild that I don't have and don't
> want libnl.

Yup.  If ebuild supports OSes other than Linux, it has to have some way of dealing with programs that can use library XXX on OS YYY, and have more capabilities when using library XXX on OS YYY, but where OS ZZZ doesn't have library XXX and where the program thus wouldn't use library XXX on OS ZZZ.
Comment 12 Rick Farina (Zero_Chaos) gentoo-dev 2013-03-18 17:46:58 UTC
(In reply to comment #9)
> Created attachment 342554 [details, diff] [details, diff]
> add --enable/disable-libnl configure option to wireshark-1.9.1

Forgive me but don't you need a --disable in this patch too?
Comment 13 Michael Weiser 2013-03-18 17:55:04 UTC
> Forgive me but don't you need a --disable in this patch too?

AC_ARG_ENABLE adds both.
Comment 14 Rick Farina (Zero_Chaos) gentoo-dev 2013-03-18 18:05:23 UTC
(In reply to comment #13)
> > Forgive me but don't you need a --disable in this patch too?
> 
> AC_ARG_ENABLE adds both.

Thanks for clarifying, submitted upstream, I'm also testing it now
Comment 15 Rick Farina (Zero_Chaos) gentoo-dev 2013-03-18 19:17:08 UTC
Should be in 1.9.2

Patch on this bug was accepted by upstream
Comment 16 Rick Farina (Zero_Chaos) gentoo-dev 2013-03-18 19:17:26 UTC
Should be in 1.9.2

Patch on this bug was accepted by upstream
Comment 17 Michael Weiser 2013-03-19 10:43:47 UTC
Thank you! Will I need to open a new bug for adjusting the =net-analyzer/wireshark-1.9.2 ebuild (once it comes out) to use this option or is this taken care of already?

Since there seems to be some confusion as to why I need this, I want to clarify: I build wireshark on Mac OS X using prefix portage. So I do build wireshark using the Gentoo ebuild on a non-Linux system. Therefore I need a way to tell the ebuild, that I don't have, want or need libnl. Portage has all the infrastructure for that in place already: There's a USE="netlink", that's only ever enabled on Linux and nowhere else. The only thing I need is for the ebuild to respect that USE flag.

Now I've learned that automagic dependencies are bad[tm]. That's a non-issue for Mac OS X since there never can be a libnl installed on it. But it's a problem for Linux systems which we have solved by providing a configure option for explictly disabling libnl support. This way nothing unexpected happens on a Linux system if libnl is installed but disabled by the user by disabling the netlink USE flag.
Comment 18 Rick Farina (Zero_Chaos) gentoo-dev 2013-03-19 11:06:48 UTC
(In reply to comment #17)
> Thank you! Will I need to open a new bug for adjusting the
> =net-analyzer/wireshark-1.9.2 ebuild (once it comes out) to use this option
> or is this taken care of already?

I and the other maintainer of wireshark are both aware of this issue, one of us should take care of it when bumping the package.  If we forget please feel free to open a new bug, but likely it will just be done.
Comment 19 Michael Weiser 2013-04-03 17:34:14 UTC
Created attachment 344266 [details, diff]
make dependency on libnl optional and non-automagic

This apparantly didn't happen as envisioned. Attached the patch for the 1.9.2 ebuild. Please apply.
Comment 20 Jeroen Roovers (RETIRED) gentoo-dev 2013-04-03 18:47:10 UTC
This shouldn't have been marked upstream if there was pending downstream work.
Comment 21 Jeroen Roovers (RETIRED) gentoo-dev 2013-04-03 19:04:52 UTC
Fixed in 1.9.2.