1 year ago

#373720

test-img

Kyle

plist fails to copy to output folder as node-gyp throws 'TypeError: ExecCopyInfoPlist() missing 1 required positional argument: 'convert_to_binary''

So I am following this documentation on how to write a binding.gyp file for node-gyp. Here is the reduced snippet of it:

        {
            'target_name': 'configResolver_unity_osx',
            'type': 'executable',
            'mac_bundle': 1,
            'product_extension': 'bundle',
            'dependencies': [
               ..
            ],
            'include_dirs': [
                ..
            ],
            'sources': [
                ..
            ],
            'xcode_settings': {
                'INFOPLIST_FILE': 'Info.plist'
            },

However, I get this error when I try to build. I've omitted / shortened some source paths to reduce bloat.

node-gyp build --silly
gyp info it worked if it ends with ok
gyp verb cli [
gyp verb cli   '/usr/local/bin/node',
gyp verb cli   '/usr/local/bin/node-gyp',
gyp verb cli   'build',
gyp verb cli   '--silly'
gyp verb cli ]
gyp info using node-gyp@8.4.1
gyp info using node@16.13.1 | darwin | x64
gyp verb command build []
gyp verb build type Release
gyp verb architecture x64
gyp verb node dev dir /Users/kyle.whitelaw/Library/Caches/node-gyp/16.13.1
gyp verb `which` succeeded for `make` /usr/bin/make
gyp info spawn make
gyp info spawn args [ 'V=1', 'BUILDTYPE=Release', '-C', 'build' ]
  cd ..; /usr/local/lib/node_modules/node-gyp/gyp/gyp_main.py -fmake --ignore-environment "-Dlibrary=shared_library" "-Dvisibility=default" "-Dnode_root_dir=/Users/kyle.whitelaw/Library/Caches/node-gyp/16.13.1" "-Dnode_gyp_dir=/usr/local/lib/node_modules/node-gyp" "-Dnode_lib_file=/Users/kyle.whitelaw/Library/Caches/node-gyp/16.13.1/<(target_arch)/node.lib" "-Dmodule_root_dir=/Users/kyle.whitelaw/Documents/git/./." "-Dnode_engine=v8" "--depth=." "-Goutput_dir=." "--generator-output=build" -I/Users/kyle.whitelaw/Documents/git/././build/config.gypi -I/usr/local/lib/node_modules/node-gyp/addon.gypi -I/Users/kyle.whitelaw/Library/Caches/node-gyp/16.13.1/include/node/common.gypi "--toplevel-dir=." binding.gyp
  ./gyp-mac-tool copy-info-plist ../Info.plist "Release/configResolver_unity_osx.bundle/Contents/Info.plist"
Traceback (most recent call last):
  File "./gyp-mac-tool", line 772, in <module>
    sys.exit(main(sys.argv[1:]))
  File "./gyp-mac-tool", line 29, in main
    exit_code = executor.Dispatch(args)
  File "./gyp-mac-tool", line 44, in Dispatch
    return getattr(self, method)(*args[1:])
TypeError: ExecCopyInfoPlist() missing 1 required positional argument: 'convert_to_binary'
make: *** [Release/configResolver_unity_osx.bundle/Contents/Info.plist] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (node:events:390:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
gyp ERR! System Darwin 21.3.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/bin/node-gyp" "build" "--silly"
gyp ERR! cwd /Users/kyle.whitelaw/Documents/git/./.
gyp ERR! node -v v16.13.1
gyp ERR! node-gyp -v v8.4.1
gyp ERR! not ok 

Currently perusing the source from the node-gyp GitHub repo, initially I can see convert_to_binary is not an optional parameter and is probably not passed through but need to see if that is really the issue. Thought I will ask to save me going down this rabbit hole and debugging node-gyp itself. Is there something I am missing or is it a genuine bug in the code? I can't find an exisitng issue on GitHub, open or closed, that recognises this. Can I pass anything via the binding.gyp file to solve this?

Thank you for any insight.

python

node.js

macos

node-gyp

0 Answers

Your Answer

Accepted video resources