Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 435866 - sys-apps/usbutils-006 with dev-libs/libusbx-1.0.13 - lsusb.c: In function ‘dump_config’: lsusb.c:440:50: error: ‘struct libusb_config_descriptor’ has no member named ‘MaxPower’
Summary: sys-apps/usbutils-006 with dev-libs/libusbx-1.0.13 - lsusb.c: In function ‘du...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-22 14:58 UTC by Zoltan Puskas
Modified: 2012-09-26 10:47 UTC (History)
1 user (show)

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


Attachments
build.log (build.log,20.94 KB, text/plain)
2012-09-22 15:05 UTC, Zoltan Puskas
Details
patch to fix lsusb.c (maxpower.patch,539 bytes, patch)
2012-09-22 15:10 UTC, Zoltan Puskas
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Zoltan Puskas 2012-09-22 14:58:47 UTC
lsusb command in usbutils will not build with latest libusbx

Reproducible: Always

Steps to Reproduce:
1. emerge -1 usbutils
Actual Results:  
Build fails

Expected Results:  
Successful build

emerge --info
Portage 2.1.11.20 (default/linux/amd64/10.0/desktop/kde, gcc-4.6.3, glibc-2.15-r2, 3.5.4-gentoo x86_64)
=================================================================
System uname: Linux-3.5.4-gentoo-x86_64-Intel-R-_Core-TM-2_Duo_CPU_T7250_@_2.00GHz-with-gentoo-2.2
Timestamp of tree: Sat, 22 Sep 2012 11:00:01 +0000
distcc 3.1 x86_64-pc-linux-gnu [enabled]
app-shells/bash:          4.2_p37
dev-java/java-config:     2.1.12
dev-lang/python:          2.7.3-r2, 3.2.3-r1
dev-util/cmake:           2.8.9
dev-util/pkgconfig:       0.27.1
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.10.5
sys-apps/sandbox:         2.6
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.9.6-r3, 1.11.6, 1.12.4
sys-devel/binutils:       2.22.90
sys-devel/gcc:            4.6.3
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r3
sys-kernel/linux-headers: 3.5 (virtual/os-headers)
sys-libs/glibc:           2.15-r2
Repositories: gentoo
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=core2 -mtune=core2 -mcx16 -msahf -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/openvpn/easy-rsa /usr/share/themes/oxygen-gtk/gtk-2.0"
CONFIG_PROTECT_MASK="${EPREFIX}/etc/gconf /etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=core2 -mcx16 -msahf -mtune=core2 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distcc distlocks ebuild-locks fixlafiles news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://gentoo.inf.elte.hu/ http://gd.tuwien.ac.at/opsys/linux/gentoo/ "
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j10"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi alsa amd64 bash-completion berkdb bluetooth branding bzip2 cairo cdda cdr cli consolekit cracklib crypt cups cxx dbus declarative dell dri dts dvd dvdr emboss encode exif fam firefox flac fortran gdbm gif gphoto2 gpm handbook hardened iconv ipv6 java6 javascipt jpeg jpeg2k kde kipi laptop lcms ldap libnotify lm_sensors mad mmx mng modules mp3 mp4 mpeg mudflap multilib ncurses networkmanager nls nptl ogg opengl openmp pam pango pcmcia pcre pdf phonon plasma png policykit posix ppds pppd qt3support qt4 readline sdl semantic-desktop session smp spell sse sse2 sse3 ssl ssse3 startup-notification svg tcpd threads tiff truetype udev udisks unicode upower usb vaapi vcd vdpau vim-syntax vorbis wifi wxwidgets x264 xcb xcomposite xinerama xml xpm xscreensaver xv xvid xvmc zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse evdev wacom synaptics joystick" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LIRC_DEVICES="alsa_usb" PHP_TARGETS="php5-3" PYTHON_TARGETS="python3_2 python2_7" RUBY_TARGETS="ruby18 ruby19" SANE_BACKENDS="plustek" USERLAND="GNU" VIDEO_CARDS="nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 1 Zoltan Puskas 2012-09-22 15:05:54 UTC
Created attachment 324628 [details]
build.log
Comment 2 Zoltan Puskas 2012-09-22 15:10:15 UTC
Created attachment 324630 [details, diff]
patch to fix lsusb.c

’struct libusb_config_descriptor’ member named ‘MaxPower’ was renamed to ’bMaxPower’. This patch fixes the variable reference.
Comment 3 Samuli Suominen (RETIRED) gentoo-dev 2012-09-24 11:31:05 UTC
(In reply to comment #2)
> Created attachment 324630 [details, diff] [details, diff]
> patch to fix lsusb.c
> 
> ’struct libusb_config_descriptor’ member named ‘MaxPower’ was renamed to
> ’bMaxPower’. This patch fixes the variable reference.

Does this still work for =dev-libs/libusb-1.0.9? We still need to maintain compability with both.

Reported also here for comments:

https://github.com/libusbx/libusbx/issues/47
Comment 4 Samuli Suominen (RETIRED) gentoo-dev 2012-09-24 11:36:26 UTC
(In reply to comment #2)
> Created attachment 324630 [details, diff] [details, diff]
> patch to fix lsusb.c
> 
> ’struct libusb_config_descriptor’ member named ‘MaxPower’ was renamed to
> ’bMaxPower’. This patch fixes the variable reference.

Verified this breaks compilation against libusb-1.0.9 :-(
Comment 5 Samuli Suominen (RETIRED) gentoo-dev 2012-09-24 11:43:59 UTC
(In reply to comment #3)
> Reported also here for comments:
> 
> https://github.com/libusbx/libusbx/issues/47

And here:

https://github.com/gregkh/usbutils/issues/12
Comment 6 Samuli Suominen (RETIRED) gentoo-dev 2012-09-24 11:46:01 UTC
Since both upstreams are now informed and asked to work together on the issue, I've fixed this in tree in a backwards compability way:

+  24 Sep 2012; Samuli Suominen <ssuominen@gentoo.org> usbutils-006.ebuild,
+  +files/usbutils-006-libusbx-1.0.13.patch:
+  Fix building against >=dev-libs/libusbx-1.0.13 wrt #435866 by Zoltan Puskas

http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/usbutils/usbutils-006.ebuild?r1=1.1&r2=1.2
Comment 7 Juergen Rose 2012-09-24 12:54:38 UTC
Hey,

where can I find usbutils-006-libusbx-1.0.13.patch? At https://github.com/libusbx/libusbx/issues/47 I can only find a maxpower.patch.
Should I rename this patch to usbutils-006-libusbx-1.0.13.patch?
Comment 9 Samuli Suominen (RETIRED) gentoo-dev 2012-09-24 12:57:21 UTC
I guess the patch could be improved with, for example:

#if defined(LIBUSBX_API_VERSION)
...
#else
...
#endif
Comment 10 Pete Batard 2012-09-25 00:33:21 UTC
Actually, the way to handle bMaxPower/MaxPower is provided in the libusbx 1.0.13 release, in the NEWS file.

It should be:

#if defined(LIBUSBX_API_VERSION) && (LIBUSBX_API_VERSION >= 0x01000100)
  // code using bMaxPower
#else
  // code using MaxPower
#endif

This code works with all versions of libusbx and libusb, but would need to be applied in usbutils. Since the maintainer of usbutils doesn't want to do that without a library version change, we will revert the change in libusbx 1.0.14, and shortly after issue a libusbx 1.1 that reinstates it.
Comment 11 Samuli Suominen (RETIRED) gentoo-dev 2012-09-25 06:18:59 UTC
(reopening for a bit to import revised patch in tree, sorry for bugspam)
Comment 12 Samuli Suominen (RETIRED) gentoo-dev 2012-09-25 09:02:50 UTC
(In reply to comment #11)
> (reopening for a bit to import revised patch in tree, sorry for bugspam)

applied in tree:

http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/usbutils/files/usbutils-006-libusbx-1.0.13.patch?r1=1.1&r2=1.2

but I guess this breaks yet again once upstream releases 1.0.14 with bMaxPower reverted to MaxPower... what a mess, but closing for now
Comment 13 Samuli Suominen (RETIRED) gentoo-dev 2012-09-25 09:06:35 UTC
(In reply to comment #10)
> Actually, the way to handle bMaxPower/MaxPower is provided in the libusbx
> 1.0.13 release, in the NEWS file.
> 
> It should be:
> 
> #if defined(LIBUSBX_API_VERSION) && (LIBUSBX_API_VERSION >= 0x01000100)
>   // code using bMaxPower
> #else
>   // code using MaxPower
> #endif
> 
> This code works with all versions of libusbx and libusb, but would need to
> be applied in usbutils. Since the maintainer of usbutils doesn't want to do
> that without a library version change, we will revert the change in libusbx
> 1.0.14, and shortly after issue a libusbx 1.1 that reinstates it.

I suppose that should be == instead of >= then, or otherwise the logic fails when 1.0.14 is released? Of course this won't be a problem if both 1.0.14 and 1.1 are released at the same time, allowing us to skip 1.0.14 entirely.
Let's hope it turns out like that.
Comment 14 Pete Batard 2012-09-25 20:29:17 UTC
(In reply to comment #13)
> I suppose that should be == instead of >= then, or otherwise the logic fails
> when 1.0.14 is released?

Not at all. LIBUSBX_API_VERSION will be _decreased_ on 1.0.14 since we are reverting. So the code above works will actually work with ALL versions of libusb/libusbx.
Comment 15 Samuli Suominen (RETIRED) gentoo-dev 2012-09-26 10:47:34 UTC
(In reply to comment #14)
> (In reply to comment #13)
> > I suppose that should be == instead of >= then, or otherwise the logic fails
> > when 1.0.14 is released?
> 
> Not at all. LIBUSBX_API_VERSION will be _decreased_ on 1.0.14 since we are
> reverting. So the code above works will actually work with ALL versions of
> libusb/libusbx.

ah. perfect. thank you.