Skip to content

Cannot build on Mac Pre-Monterey #11364

Closed
@dwedul-figure

Description

Summary of Bug

Running make build fails on a Mac that isn't yet on Monterey (MacOS V12.0+).

$ make build
Makefile:75: RocksDB support is disabled; to build and test with RocksDB support, set ENABLE_ROCKSDB=true
go build -mod=readonly -tags "netgo ledger" -ldflags '-X github.com/cosmos/cosmos-sdk/version.Name=sim -X github.com/cosmos/cosmos-sdk/version.AppName=simd -X github.com/cosmos/cosmos-sdk/version.Version=0.46.0-alpha2-160-gf4d50a989 -X github.com/cosmos/cosmos-sdk/version.Commit=f4d50a989fec8ffbc2e640ad492d40f72580064c -X "github.com/cosmos/cosmos-sdk/version.BuildTags=netgo,ledger" -X github.com/tendermint/tendermint/version.TMCoreSemVer=v0.35.2 -w -s' -trimpath -o /Users/danielwedul/git/cosmos-sdk/build/ ./...
# github.com/keybase/go-keychain
cgo-gcc-prolog:203:11: warning: 'SecTrustedApplicationCreateFromPath' is deprecated: first deprecated in macOS 10.15 - No longer supported [-Wdeprecated-declarations]
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecTrustedApplication.h:59:10: note: 'SecTrustedApplicationCreateFromPath' has been explicitly marked deprecated here
# 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

Version

Master branch, current as of Friday Mar 11, 2022 19:20 UTC.
commit hash f4d50a989fec8ffbc2e640ad492d40f72580064c

Steps to Reproduce

  1. Be on a Mac that is still on Big Sur (or earlier).
  2. Download the cosmos-sdk repo and cd into it.
  3. Run make build.

Expected Results:
It builds without any errors.

Actual Results:

# 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

Extra Notes:
The kIOMainPortDefault variable is only available on MacOS 12.0+ (Monterey). Before that, it was named kIOMasterPortDefault.

$ go mod graph | grep -F 'github.com/zondax/hid'
github.com/cosmos/cosmos-sdk github.com/zondax/hid@v0.9.1-0.20220302062450-5552068d2266
github.com/cosmos/ledger-cosmos-go@v0.11.1 github.com/zondax/hid@v0.9.0
$ go mod graph | grep -F 'github.com/cosmos/ledger-cosmos-go'
github.com/cosmos/cosmos-sdk github.com/cosmos/ledger-cosmos-go@v0.11.1
github.com/cosmos/ledger-cosmos-go@v0.11.1 github.com/btcsuite/btcd@v0.0.0-20190115013929-ed77733ec07d
github.com/cosmos/ledger-cosmos-go@v0.11.1 github.com/cosmos/ledger-go@v0.9.2
github.com/cosmos/ledger-cosmos-go@v0.11.1 github.com/davecgh/go-spew@v1.1.1
github.com/cosmos/ledger-cosmos-go@v0.11.1 github.com/pkg/errors@v0.8.1
github.com/cosmos/ledger-cosmos-go@v0.11.1 github.com/stretchr/testify@v1.3.0
github.com/cosmos/ledger-cosmos-go@v0.11.1 github.com/zondax/hid@v0.9.0

Temporary workaround:

$ LEDGER_ENABLED=false make build

For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions