microsoft / microsoft/node-native-keymap
Error when building on macOS 12
Open
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 152
- Forks
- 43
- Avg merge
- 19h 38m
- Merged PRs (30d)
- 2
Description
I'm getting an error when building on macOS 12.
$ node-gyp configure
gyp info it worked if it ends with ok
gyp info using node-gyp@9.3.1
gyp info using node@18.16.0 | darwin | x64
gyp info find Python using Python version 3.8.2 found at "/Library/Developer/CommandLineTools/usr/bin/python3"
gyp info spawn /Library/Developer/CommandLineTools/usr/bin/python3
gyp info spawn args [
gyp info spawn args '/Users/baptiste/.nvm/versions/node/v18.16.0/lib/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'make',
gyp info spawn args '-I',
gyp info spawn args '/Users/baptiste/Development/Projects/github/node-native-keymap/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/baptiste/.nvm/versions/node/v18.16.0/lib/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/baptiste/Library/Caches/node-gyp/18.16.0/include/node/common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=/Users/baptiste/Library/Caches/node-gyp/18.16.0',
gyp info spawn args '-Dnode_gyp_dir=/Users/baptiste/.nvm/versions/node/v18.16.0/lib/node_modules/node-gyp',
gyp info spawn args '-Dnode_lib_file=/Users/baptiste/Library/Caches/node-gyp/18.16.0/<(target_arch)/node.lib',
gyp info spawn args '-Dmodule_root_dir=/Users/baptiste/Development/Projects/github/node-native-keymap',
gyp info spawn args '-Dnode_engine=v8',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'build',
gyp info spawn args '-Goutput_dir=.'
gyp info spawn args ]
gyp info ok
$ node-gyp build
gyp info it worked if it ends with ok
gyp info using node-gyp@9.3.1
gyp info using node@18.16.0 | darwin | x64
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
CXX(target) Release/obj.target/keymapping/src/string_conversion.o
CXX(target) Release/obj.target/keymapping/src/keymapping.o
CXX(target) Release/obj.target/keymapping/src/keyboard_mac.o
In file included from ../src/keyboard_mac.mm:6:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:12:
/Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:91:143: error: function does not return NSString
- (NSAttributedString *)localizedAttributedStringForKey:(NSString *)key value:(nullable NSString *)value table:(nullable NSString *)tableName NS_FORMAT_ARGUMENT(1) NS_REFINED_FOR_SWIFT API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0));
~~~~~~~~~~~~~~ ^ ~
/Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:103:48: note: expanded from macro 'NS_FORMAT_ARGUMENT'
#define NS_FORMAT_ARGUMENT(A) __attribute__ ((format_arg(A)))
^ ~
1 error generated.
make: *** [Release/obj.target/keymapping/src/keyboard_mac.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/Users/baptiste/.nvm/versions/node/v18.16.0/lib/node_modules/node-gyp/lib/build.js:203:23)
gyp ERR! stack at ChildProcess.emit (node:events:513:28)
gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:291:12)
gyp ERR! System Darwin 20.6.0
gyp ERR! command "/Users/baptiste/.nvm/versions/node/v18.16.0/bin/node" "/Users/baptiste/.nvm/versions/node/v18.16.0/bin/node-gyp" "build"
gyp ERR! cwd /Users/baptiste/Development/Projects/github/node-native-keymap
gyp ERR! node -v v18.16.0
gyp ERR! node-gyp -v v9.3.1
gyp ERR! not ok
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the reported node-gyp configure and node-gyp build commands on macOS 12, then inspect src/keyboard_mac.mm and binding.gyp alongside the Foundation header error. Done means the native module builds successfully without the NSBundle.h format-argument error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, macos, node.js
- Domain
- build-system, desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100