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

Bug in the recent macOS 12.0 build fix #29

Open
benma opened this issue May 10, 2022 · 2 comments
Open

Bug in the recent macOS 12.0 build fix #29

benma opened this issue May 10, 2022 · 2 comments

Comments

@benma
Copy link

benma commented May 10, 2022

This commit:

c7c6bc0#diff-030195b530be26a69d54ce9487a942a3b24568c08397d003492f4507e1217f16R33

uses MAC_OS_X_VERSION_MAX_ALLOWED to determine whether to use the old or new name. This definition can be 120000 even if compiling on macOS 11, resulting in compiler warnings and a broken build.

It looks like MAC_OS_X_VERSION_MIN_REQUIRED should be used instead?

Like in this patch:

https://bug-224632-attachments.webkit.org/attachment.cgi?id=426166 (from https://bugs.webkit.org/show_bug.cgi?id=224632).

@benma
Copy link
Author

benma commented May 10, 2022

For reference, here is the error I ran when compiling on macOS 11:

n file included from vendor/github.com/karalabe/usb/libs.go:50:
vendor/github.com/karalabe/usb/libusb/libusb/os/darwin_usb.c:253:39: warning: 'kIOMainPortDefault' is only available on macOS 12.0 or newer [-Wunguarded-availability-new]

When I print the MAC_OS_X_VERSION_MAX_ALLOWED var during compilation, it was shown to be 120000.

@benma
Copy link
Author

benma commented Feb 6, 2023

Running into this again. @karalabe is this package still maintained?

The above fix was suboptimal also in that it uses the definition made in libusb inside of hidapi, even though these are separate libraries. The two libraries have in the meantime fixed it upstream by simply using 0 instead of kIOMainPortDefault. It would be good to pull the latest upstream changes instead of doing local patches.

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

No branches or pull requests

1 participant