You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[compatibility] libusbx replaced by libusb-1.0 in most distros #897
As of March 2020 on most distros libusbx has been replaced by the maintained libusb-1.0.
This reflects the re-merging of the libusbx-project-fork back into the libusb-project (see https://github.com/libusb/libusb/wiki/FAQ#libusborg_libusbxorg_and_libusbinfo) as referenced by @slyshykO in #782. As mentioned in PR #895, I did some small research on this topic to find out about the current state of support by various distributions currently maintained.
This initiated a ongoing discussion in PR #895 which shall be continued here, as the related PR should solely focus on (direct) changes in the code. The beginning of this discussion is now posted here:
Nightwalker-87: @Vascom: You are on Fedora right? What do you think about this? Why does Fedora still use libusbx BTW? Is your library that outdated as well?
Reply by Vascom:
@Nightwalker-87 I don't know why it still not updated in rawhide. Need to ask maintainer.
But even if this update will be done it will be never updated for current releases of Fedora and RHEL/CentOS.
No.
libusb - for compatibility with 0.1 API.
libusbx - main libusb as I know.
Reply by slyshykO:
@Vascom Yes. My point is they (Fedora) use sources from libusb-project for libusbx-package.
Reply by Vascom:
upstream libusbx has merged back with libusb and is now called libusb again, but we already have a libusb package for the old libusb-compat-0.1, renaming that to libusb-compat while at the same time giving this its name is a bit tricky, lets stick with the libusbx name for now
As @slyshykO mentioned before: the package name is not the relevant thing, but if LIBUSBX_API_VERSION is used by the package which then remains from the libusbx-codebase
Nobody cares about libusb-compat, libusb-0.1 or whatever the older packages for libusb 0.1 compatibility versions are called. These are neither addressed by this issue, nor relevant.
¯\ _(ツ) _/¯
Please test the current development branch with your fedora environment as it comes without any reference to LIBUSBX_API_VERSION. If it works we are fine here, if not, the incompatibility with fedora is present for quite a long time, as previously LIBUSBX_API_VERSION could only be called on FreeBSD systems anyway (where it was not needed anymore, as we found out in [compatibility] LIBUSBX_API_VERSION undef #782 previously).
One can conclude that this is done equally in Fedora 31, so we are fine here. That's the reason why it works even without any LIBUSBX_API_VERSION remnants currently. 👍
@lhondareyte@DanielO: It appears you both use (or used) FreeBSD. Can you provide us some information regarding the libusb versions present on recent releases (11, 12, 13)? pkgs.org was not very helpful in this aspect.
Hi,
For FreeBSD, libusb is in the base system, it's not a package. It's compatible with libusb1 & 2 . You can get more informations with "pkconf":
pkgconf --libs --cflags libusb-1.0
pkgconf --libs --cflags libusb-2.0
pkgconf is, as far I know, specific to FreeBSD.
Hope this help.
Regards
@lhondareyte: Thx for the useful feedback. What FreeBSD-Version/Release are you on? Can you also checkout the develop branch and test-compile the stlink-tools? With this we could rule out possible regression when we merge the related PR. By now current FreeBSD Releases seem to be the only left "unknowns" (see list above).
I am running the latest stable version (12.1p1) (almost). I tried to compile the latest snapshot and it actually failed: /usr/home/luc/stlink/src/usb.c:34:22: error: use of undeclared identifier 'INT_MAX'
The compilation works with
// src/usb.c
#if defined (__FreeBSD__)
#include <sys/limits.h>
#endif
Which commit/branch do you want to try exactly?
About FreeBSD current (latest dev branch), I only use it on ARM platform. I'll give it a try this week-end: just try to compile only (USB support can be tricky)
@DanielO: Thx for checking! Please let us know if this changes someday.
ok, so we actually have to stay on libusb 1.0.16 ... 1.0.18 codebase then for FreeBSD for compatibility reasons. In terms of implementation we will likely check for the 0x01000102 in cmake here.
I'll do a new table for our documentation that is going to list all what we have found out by now.
@slyshykO: Can you extend you PR #895 with the discussed check for windows and maybe also update the cmake routine for FreeBSD?
Activity
Nightwalker-87 commentedon Mar 26, 2020
This initiated a ongoing discussion in PR #895 which shall be continued here, as the related PR should solely focus on (direct) changes in the code. The beginning of this discussion is now posted here:
Nightwalker-87:
@Vascom: You are on Fedora right? What do you think about this? Why does Fedora still use libusbx BTW? Is your library that outdated as well?
Reply by Vascom:
Reply by slyshykO:
Reply by Vascom:
Reply by slyshykO:
Reply by Vascom:
Nightwalker-87 commentedon Mar 26, 2020
@Vascom: There are three relevant things:
LIBUSBX_API_VERSIONis used by the package which then remains from the libusbx-codebaselibusb-compat,libusb-0.1or whatever the older packages for libusb 0.1 compatibility versions are called. These are neither addressed by this issue, nor relevant.¯\ _(ツ) _/¯
LIBUSBX_API_VERSION. If it works we are fine here, if not, the incompatibility with fedora is present for quite a long time, as previouslyLIBUSBX_API_VERSIONcould only be called on FreeBSD systems anyway (where it was not needed anymore, as we found out in [compatibility] LIBUSBX_API_VERSION undef #782 previously).Vascom commentedon Mar 26, 2020
1.0.23 pushed to Fedora rawhide now https://src.fedoraproject.org/rpms/libusbx/c/5684853d449b7fe3a81112cd59f9336fbc274319?branch=master
Nightwalker-87 commentedon Mar 26, 2020
That's good news for us.
Nightwalker-87 commentedon Mar 26, 2020
Similar result for Fedora 30 (oldest supported version):
Here it is
libusb1.0.22 despite the (false) package name: https://src.fedoraproject.org/rpms/libusbx/c/cbd5348ee14638264fe3bb79c3b27a5ed34271ed?branch=f30One can conclude that this is done equally in Fedora 31, so we are fine here. That's the reason why it works even without any
LIBUSBX_API_VERSIONremnants currently. 👍Nightwalker-87 commentedon Mar 26, 2020
@lhondareyte @DanielO: It appears you both use (or used) FreeBSD. Can you provide us some information regarding the
libusbversions present on recent releases (11, 12, 13)? pkgs.org was not very helpful in this aspect.lhondareyte commentedon Mar 26, 2020
Hi,
For FreeBSD, libusb is in the base system, it's not a package. It's compatible with libusb1 & 2 . You can get more informations with "pkconf":
pkgconf --libs --cflags libusb-1.0
pkgconf --libs --cflags libusb-2.0
pkgconf is, as far I know, specific to FreeBSD.
Hope this help.
Regards
Nightwalker-87 commentedon Mar 26, 2020
@lhondareyte: Thx for the useful feedback. What FreeBSD-Version/Release are you on? Can you also checkout the develop branch and test-compile the stlink-tools? With this we could rule out possible regression when we merge the related PR. By now current FreeBSD Releases seem to be the only left "unknowns" (see list above).
lhondareyte commentedon Mar 26, 2020
I am running the latest stable version (12.1p1) (almost). I tried to compile the latest snapshot and it actually failed:
/usr/home/luc/stlink/src/usb.c:34:22: error: use of undeclared identifier 'INT_MAX'The compilation works with
Which commit/branch do you want to try exactly?
About FreeBSD current (latest dev branch), I only use it on ARM platform. I'll give it a try this week-end: just try to compile only (USB support can be tricky)
22 remaining items
Nightwalker-87 commentedon Mar 28, 2020
@DanielO: Thx for checking! Please let us know if this changes someday.
ok, so we actually have to stay on
libusb1.0.16 ... 1.0.18 codebase then for FreeBSD for compatibility reasons. In terms of implementation we will likely check for the0x01000102in cmake here.I'll do a new table for our documentation that is going to list all what we have found out by now.
@slyshykO: Can you extend you PR #895 with the discussed check for windows and maybe also update the cmake routine for FreeBSD?
slyshykO commentedon Mar 28, 2020
I've updated the #895. Please, take a look.
[doc] compiling & version support
Updated compiling doc & version support
Updated compiling doc & version support