Comments (10)
Linux: Debian Testing/Buster
libusb package: libusb-1.0-0:i386 2:1.0.22-2
gousb: 5115a55
from gousb.
To clarify: does this break the build (i.e. go build aborts with an error), or is it just a matter of build displaying a warning message?
If it's the latter, then I'd rather not make any changes in gousb to accomodate the new options - we would do that when we make the next large revision of the API, at which point I can simply require libusb >= 1.0.22 and don't need to define conditions based on libusb version.
If it's the former, I've updated the branch "set_debug" (https://github.com/google/gousb/tree/set_debug), would you mind trying it out? Travis offers me "trusty" as the newest ubuntu environment, which has much older libusb, my personal systems also don't have 1.0.22 yet. I could install a new system just for this, but since you already have an environment where it fails...
from gousb.
It does not break the build. However, the extra warning output messes (the source disappears, filed issue: fatih/vim-go#1832) with the vim-go plugin and editing, and consequently, other go files.
I will try set_debug today. Thank you.
from gousb.
Almost there. Now getting:
go build -v
# <redacted>/vendor/github.com/google/gousb
cgo-gcc-prolog: In function ‘_cgo_843581783fcb_Cfunc_libusb_set_debug’:
cgo-gcc-prolog:518:2: warning: ‘libusb_set_debug’ is deprecated: Use libusb_set_option instead [-Wdeprecated-declarations]
In file included from vendor/github.com/google/gousb/libusb.go:28:0:
/usr/include/libusb-1.0/libusb.h:1300:18: note: declared here
void LIBUSB_CALL libusb_set_debug(libusb_context *ctx, int level);
^~~~~~~~~~~~~~~~
from gousb.
That doesn't sound right: the code in that branch doesn't call C.libusb_set_debug anymore (as indicated by Cfunc_libusb_set_debug in your snippet), it should now be calling C.gousb_set_debug (see libusb.go line 223). Can you make sure that the vendored code you're using was checked out from the set_debug branch?
from gousb.
The set_debug branch works great. Thank you.
from gousb.
I performed a git pull and my master is c6e7809.
The above problem has returned. The set_debug branch has disappeared, however I do have the has where your fix is. Any ideas what I have done wrong? Thank you.
$ go build -v
# <redacted ...>/vendor/github.com/google/gousb
cgo-gcc-prolog: In function ‘_cgo_843581783fcb_Cfunc_libusb_set_debug’:
cgo-gcc-prolog:518:2: warning: ‘libusb_set_debug’ is deprecated: Use libusb_set_option instead [-Wdeprecated-declarations]
In file included from ../vendor/github.com/google/gousb/libusb.go:28:0:
/usr/include/libusb-1.0/libusb.h:1300:18: note: declared here
void LIBUSB_CALL libusb_set_debug(libusb_context *ctx, int level);
^~~~~~~~~~~~~~~~
$ dpkg-query -W libusb\*
libusb-1.0-0:i386 2:1.0.22-2
libusb-1.0-0-dev:i386 2:1.0.22-2
libusb-1.0-doc 2:1.0.22-2
$ git status
On branch set_debug
Your branch is up to date with 'origin/set_debug'.
nothing to commit, working tree clean
$ git log | head -20
commit 9b217d35e1709b0e73fb7f48c3010dc748e3b030 (HEAD -> set_debug, origin/set_debug)
Author: Sebastian Zagrodzki <[email protected]>
Date: Sat May 19 18:57:23 2018 +0200
Support libusb_set_option in additon to libusb_set_debug.
The latter is deprecated in libusb 1.0.22 and later.
commit d0366361a25268248b2e53405b91eaa0deadf761
Author: Sebastian Zagrodzki <[email protected]>
Date: Sun Nov 12 03:32:09 2017 +0100
Add missing arguments to Interface() error on failed descriptor
retrieval.
commit b893afb0188fc0c9f9c3ae60bee6beb1b87af1b2
Author: Sebastian Zagrodzki <[email protected]>
Date: Sun Nov 12 03:28:47 2017 +0100
Add missing endpoint argument to Fatalf.
from gousb.
I'm guessing that the version in ../vendor/..../gousb is different from the one you pulled. Your message says: "In function ‘_cgo_843581783fcb_Cfunc_libusb_set_debug". Current master doesn't have Cfunc_libusb_set_debug anymore, it would be Cfunc_gousb_set_debug. This means that contrary to what you think, you're using an older revision of the code.
from gousb.
The only gousb I have is in my vendor directory.
The current master does have libusb_set_debug.
$ grep -nHr set_debug *
libusb.go:34:void gousb_set_debug(libusb_context *ctx, int lvl);
libusb.go:223: C.gousb_set_debug((*C.libusb_context)(c), C.int(lvl))
libusb.go:503: C.libusb_set_debug((*C.libusb_context)(c), C.int(lvl))
usb.c:18:void gousb_set_debug(libusb_context *ctx, int lvl) {
usb.c:24: libusb_set_debug(ctx, lvl);
I was able to suppress the warning with the following code change:
func libusbSetDebug(c *libusbContext, lvl int) {
//#pragma GCC diagnostic push
//#pragma GCC diagnostic ignored "-Wdeprecated-declaration"
C.libusb_set_debug((*C.libusb_context)(c), C.int(lvl))
//#pragma GCC diagnostic pop
}
I would prefer to use gousb master instead of my own branch.
from gousb.
I see, you're right. There are two places where libusb_set_debug used to be called, and I've updated only one of them. The other one is used only in tests, but it's part of the library, because using C in tests doesn't work well for some reason or other (as I recall). Updated the other one. Please check now. Sorry for confusion.
from gousb.
Related Issues (20)
- Clear installation of Gosub on the Windows 10 - using msys64 HOT 3
- Latest package not picked up by go get HOT 9
- I can't open hp printer device with gousb HOT 7
- why connect printer return code -5? HOT 1
- Linux: How to get block devices list provided by usb stick? HOT 1
- incorrect device class HOT 2
- WinUSB drivers HOT 3
- libusb: bad access [code -3] HOT 8
- Windows: go build github.com/google/gousb: C:\Program Files\Go\pkg\tool\windows_amd64\cgo.exe: exit status 2 HOT 1
- Can't detach kernel driver. Invalid param [code -2] for iOS 16 devices HOT 5
- How to use in a Docker container without --privileged HOT 1
- CDC device HOT 5
- Cannot claim interface even when there are no other apps are using the device HOT 6
- Status of the tag v2.1.0 HOT 1
- Errors on install; macos HOT 3
- Error when WriteContext is called HOT 10
- Device detach: libusb: error [darwin_claim_interface] USBInterfaceOpen: another process has device opened for exclusive access HOT 3
- Memory Leak in CGO part HOT 1
- Memory Leak HOT 4
- Android Support HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gousb.