Summary: | dev-python/pypcap fails to build | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Diego Elio Pettenò (RETIRED) <flameeyes> |
Component: | New packages | Assignee: | Python Gentoo Team <python> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | chad.simmons, gentoo.8eaf7cd8e5128d8191fe |
Priority: | High | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
Build log
Patch to correct include path detection mechanism in setup.py Fixed ebuild to utilize the patch |
Description
Diego Elio Pettenò (RETIRED)
![]() Created attachment 172055 [details]
Build log
Confirmed. No idea how to fix. The errors in pcap_ex.c are because the build system failed to define HAVE_PCAP_FILE. The libpcap maintainers do not provide a definition of the structure that backs pcap_t, probably to discourage people from accessing its members directly. If HAVE_PCAP_FILE were defined, pcap_ex.c would call pcap_file and not need the definition of pcap_t. Examination of setup.py reveals that this symbol is defined if the string 'pcap_file(' is found in a pcap header searched for in various places in the system. This seems incredibly fragile and vulnerable to both false positives and false negatives. If libpcap maintainers add whitespace, setup.py would incorrectly decide that pcap_file is missing. If a pcap header were installed in one of the search paths used by setup.py, but not the compiler, then setup.py would incorrectly decide that pcap_file was available. This probe should be replaced with a proper test the way autoconf probes for usability: write a test program, try to compile and link it, and decide based on the results. I have not examined the failures in pcap.c yet, since that is a generated file and thus quite ugly. Maintainers, if I write up the required patches to get setup.py to probe for the libpcap functions correctly, would you mind committing them to the Gentoo tree and/or pushing them upstream, as appropriate? Created attachment 188063 [details, diff]
Patch to correct include path detection mechanism in setup.py
Just changes the order of include paths from ['include', 'include/pcap'] to ['include/pcap', 'include'], so include/pcap dir with more complete pcap.h will be used first, if present.
Created attachment 188065 [details]
Fixed ebuild to utilize the patch
+ 18 Apr 2009; Patrick Lauer <patrick@gentoo.org> +files/include_path.patch, + +pypcap-1.1-r1.ebuild: + Small patch to fix compilation issues, thanks to Mike Kazantsev. Closes + #247145 |