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

kIOMasterPortDefault is deprecated in MacOSX12.sdk #4

Open
SgtPooki opened this issue Feb 16, 2022 · 7 comments
Open

kIOMasterPortDefault is deprecated in MacOSX12.sdk #4

SgtPooki opened this issue Feb 16, 2022 · 7 comments

Comments

@SgtPooki
Copy link

SgtPooki commented Feb 16, 2022

During the install of lotus, the following error is received:

# github.com/zondax/hid
In file included from /Users/lindsayjowalker/Library/Caches/Homebrew/go_mod_cache/pkg/mod/github.com/zondax/hid@v0.9.0/hid_enabled.go:38:
./hidapi/mac/hid.c:693:34: error: use of undeclared identifier 'kIOMasterPortDefault'; did you mean 'kIOMainPortDefault'?
        entry = IORegistryEntryFromPath(kIOMasterPortDefault, path);
                                        ^~~~~~~~~~~~~~~~~~~~
                                        kIOMainPortDefault
/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:123:19: note: 'kIOMainPortDefault' declared here
const mach_port_t kIOMainPortDefault
                  ^
1 error generated.
make: *** [lotus-miner] Error 2
make: *** Waiting for unfinished jobs....
make: *** [lotus] Error 2
make: *** [lotus-worker] Error 2
SgtPooki added a commit to SgtPooki/hid that referenced this issue Feb 16, 2022
Replace kIOMasterPortDefault with kIOMainPortDefault.

Pulled in an update from https://github.com/Zondax/hid/blob/6f30845d880fbf88a7b5ee8f446ac5e8c10c760b/hidapi/mac/hid.c which belongs to Zondax#3 instead of trying to write something myself.

Caveat: I have not verified a successful build.

Fixes Zondax#4
@dwedul-figure
Copy link

dwedul-figure commented Mar 11, 2022

I noticed that v0.9.0 differs from master in only one place, hidapi/mac/hid.c line 693:

  • master has entry = IORegistryEntryFromPath(kIOMainPortDefault, path)
  • v0.9.0 has entry = IORegistryEntryFromPath(kIOMasterPortDefault, path);

The kIOMainPortDefault variable does not yet exist in MacOS 11.0+ (BIg Sur). It was added in MacOS 12.0+ (Monterey).

On my Big Sur Mac, in another repo that pulls in this library as a dependency of a library in its go.mod, trying to build gives this error:

# github.com/zondax/hid
In file included from ../../go/pkg/mod/github.com/zondax/hid@v0.9.1-0.20220302062450-5552068d2266/hid_enabled.go:38:
./hidapi/mac/hid.c:693:34: error: use of undeclared identifier 'kIOMainPortDefault'
        entry = IORegistryEntryFromPath(kIOMainPortDefault, path);
                                        ^
1 error generated.
make: *** [build] Error 2

@web3jenks
Copy link

Any update on this issue?

@santanaluiz
Copy link

Yes, this was fix already on this PR
#5

Just missing to create a release/tag

@santanaluiz
Copy link

@jleni can you help us out here?

@ianconsolata
Copy link

@jleni can you cut a 0.9.1 release with this change? We'd like to update our dependencies to fix this issue, but can't without a new release.

@santanaluiz
Copy link

@ianconsolata you could point your dependency to the the branch or commit hash.
That would workaround. I faced some other issues on my dependency tree and gave up, but this step of the release you could skip :)

@ianconsolata
Copy link

Yup! That’s what I did in the PR linked above for now.

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 a pull request may close this issue.

5 participants