Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hid_enabled: fix a build-error on docker / alpine #51

Merged
merged 5 commits into from
Mar 6, 2024
Merged

Conversation

holiman
Copy link
Collaborator

@holiman holiman commented Mar 5, 2024

This PR fixes an error on docker/alpine builds.

Error:

7.675 In file included from ./hid_enabled.go:47:                                                                                                                                                                            
7.675 ./libusb/libusb/os/threads_posix.c:54:5: error: conflicting types for 'usbi_cond_timedwait'; have 'int(pthread_cond_t *, pthread_mutex_t *, const struct timeval *)'                                                  
7.675    54 | int usbi_cond_timedwait(pthread_cond_t *cond,                                                                                                                                                                 
7.675       |     ^~~~~~~~~~~~~~~~~~~
7.675 In file included from ./hid_enabled.go:44:
7.675 ./libusb/libusb/os/threads_posix.h:67:5: note: previous declaration of 'usbi_cond_timedwait' with type 'int(usbi_cond_t *, usbi_mutex_t *, const struct timeval *)' {aka 'int(pthread_cond_t *, pthread_mutex_t *, const struct timeval *)'}
7.675    67 | int usbi_cond_timedwait(usbi_cond_t *cond,

This PR also adds two docker-files, which can be used to verify that both gcc and musl can build it.

$ docker build . -f ./Dockerfile.libc -t test && docker run test
...
hid.Supported() true
...
$ docker build . -f ./Dockerfile.musl -t test && docker run test
...
hid.Supported() true

Copy link
Owner

@karalabe karalabe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM

@holiman holiman merged commit 5732460 into master Mar 6, 2024
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants