nstepien / iltorb

Node.js module for brotli compression/decompression with native bindings
Other
172 stars 24 forks source link

node-gyp compilation issues with python 3 (version of node-gyp@5.0.5) #105

Open davegermiquet opened 4 years ago

davegermiquet commented 4 years ago

Problem:

Platform: Mac Os X (Version 10.14.6) Python Version: Python 3.7.4 Node version: v12.14.0 node-gyp: gyp info using node-gyp@5.0.5 (however i do have it set higher not sure why its choosing this one) Yarn: v1.16.0,v1.21.1

On a yarn install this happens:


yarn install v1.16.0
[1/5] πŸ”  Validating package.json...
[2/5] πŸ”  Resolving packages...
[3/5] 🚚  Fetching packages...
[4/5] πŸ”—  Linking dependencies...
warning " > foundation-sites@6.5.3" has unmet peer dependency "jquery@>=2.2.0".
warning " > foundation-sites@6.5.3" has unmet peer dependency "what-input@>=4.1.0".
warning "gatsby > react-hot-loader@4.12.18" has unmet peer dependency "@types/react@^15.0.0 || ^16.0.0".
warning "gatsby > @typescript-eslint/eslint-plugin > tsutils@3.17.1" has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta".
warning "gatsby > gatsby-cli > ink@2.6.0" has unmet peer dependency "@types/react@>=16.8.0".
warning " > gatsby-plugin-conecad@1.0.0" has incorrect peer dependency "onestart-foundation@git+https://github.kdc.capitalone.com/onestart/onestart-foundation.git#v2.2.1".
warning " > gatsby-plugin-conecad@1.0.0" has unmet peer dependency "spray-cans@^4.0.0".
warning " > gatsby-plugin-conecad@1.0.0" has unmet peer dependency "webpack@^4.35.3".
warning "gatsby-plugin-sass > sass-loader@7.1.0" has unmet peer dependency "webpack@^3.0.0 || ^4.0.0".
warning " > spray-cans-build-template@7.9.1" has incorrect peer dependency "react@^16.9.0".
warning " > spray-cans-build-template@7.9.1" has incorrect peer dependency "react-dom@^16.9.0".
warning " > eslint-config-airbnb@17.1.1" has incorrect peer dependency "eslint@^4.19.1 || ^5.3.0".
warning " > eslint-config-airbnb-base@13.2.0" has incorrect peer dependency "eslint@^4.19.1 || ^5.3.0".
warning " > eslint-watch@5.1.2" has incorrect peer dependency "eslint@>=4 <6.0.0".
[5/5] πŸ”¨  Building fresh packages...
[6/18] β ‚ node-sass
[14/18] β ‚ canvas
[7/18] β ‚ sharp
[-/18] β ‚ waiting...
error /Users/XXXXX/develop/XXXX/node_modules/iltorb: Command failed.
Exit code: 1
Command: node ./scripts/install.js || node-gyp rebuild
Arguments: 
Directory: /Users/XXXXXXXX/develop/XXXXXXXX/node_modules/iltorb
Output:
info looking for cached prebuild @ /Users/XXXXXXXX/.npm/_prebuilds/d152bd-iltorb-v2.4.3-node-v72-darwin-x64.tar.gz
http request GET https://github.com/MayhemYDG/iltorb/releases/download/v2.4.3/iltorb-v2.4.3-node-v72-darwin-x64.tar.gz
http request Proxy setup detected (Host:PROXY.HIDDEN, Port: 8099, Authentication: No) Tunneling with httpsOverHttp
WARN install self signed certificate in certificate chain
gyp info it worked if it ends with ok
gyp info using node-gyp@5.0.5
gyp info using node@12.14.0 | darwin | x64
gyp info find Python using Python version 3.7.4 found at "/Users/XXXXXXXX/develop/XXXXXXXX/build_XXXXXXXX/bin/python"
gyp info spawn /Users/XXXXXXXX/develop/XXXXXXXX/build_XXXXXXXX/bin/python
gyp info spawn args [
gyp info spawn args   '/Users/XXXXXXXX/.nvm/versions/node/v12.14.0/lib/node_modules/npm/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/XXXXXXXX/develop/XXXXXXXX/node_modules/iltorb/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/XXXXXXXX/.nvm/versions/node/v12.14.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/XXXXXXXX/Library/Caches/node-gyp/12.14.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/XXXXXXXX/Library/Caches/node-gyp/12.14.0',
gyp info spawn args   '-Dnode_gyp_dir=/Users/XXXXXXXX/.nvm/versions/node/v12.14.0/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/XXXXXXXX/Library/Caches/node-gyp/12.14.0/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/Users/XXXXXXXX/develop/XXXXXXXX/node_modules/iltorb',
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 ]
Traceback (most recent call last):
  File "/Users/XXXXXXXX/.nvm/versions/node/v12.14.0/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py", line 50, in <module>
    sys.exit(gyp.script_main())
  File "/Users/XXXXXXXX/.nvm/versions/node/v12.14.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 554, in script_main
    return main(sys.argv[1:])
  File "/Users/XXXXXXXX/.nvm/versions/node/v12.14.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 547, in main
    return gyp_main(args)
  File "/Users/XXXXXXXX/.nvm/versions/node/v12.14.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 532, in gyp_main
    generator.GenerateOutput(flat_list, targets, data, params)
  File "/Users/XXXXXXXX/.nvm/versions/node/v12.14.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 2215, in GenerateOutput
    part_of_all=qualified_target in needed_targets)
  File "/Users/XXXXXXXX/.nvm/versions/node/v12.14.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 802, in Write
    self.WriteCopies(spec['copies'], extra_outputs, part_of_all)
  File "/Users/XXXXXXXX/.nvm/versions/node/v12.14.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 1145, in WriteCopies
    env = self.GetSortedXcodeEnv()
  File "/Users/XXXXXXXX/.nvm/versions/node/v12.14.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 1885, in GetSortedXcodeEnv
    additional_settings)
  File "/Users/XXXXXXXX/.nvm/versions/node/v12.14.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 1616, in GetSortedXcodeEnv
    additional_settings)
  File "/Users/XXXXXXXX/.nvm/versions/node/v12.14.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 1527, in _GetXcodeEnv
    if XcodeVersion() >= '0500' and not env.get('SDKROOT'):
TypeError: '>=' not supported between instances of 'tuple' and 'str'
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/Users/XXXXXXXX/.nvm/versions/node/v12.14.0/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:210:5)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Darwin 18.7.0
gyp ERR! command "/Users/XXXXXXXX/.nvm/versions/node/v12.14.0/bin/node" "/Users/XXXXXXXX/.nvm/versions/node/v12.14.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/XXXXXXXX/develop/XXXXXXXX/node_modules/iltorb

How can we fix this issue?

addaleax commented 4 years ago

@davegermiquet I’m not an expert on yarn, but does using npm or updating yarn help? At least npm ships with its own copy of node-gyp.

davegermiquet commented 4 years ago

@davegermiquet I’m not an expert on yarn, but does using npm or updating yarn help? At least npm ships with its own copy of node-gyp.

I'll upgrade yarn now, is it a node-gyp version issue or a iltorb issue in compilation?

addaleax commented 4 years ago

@davegermiquet I would be relatively sure that it’s the former.

davegermiquet commented 4 years ago

@davegermiquet I would be relatively sure that it’s the former.

Ok. Same issue happens on latest version of yarn. Let me see if i can force a node-gyp version then.

nstepien commented 4 years ago

@davegermiquet is it still happening?

davegermiquet commented 4 years ago

I was able resolve the issue by doing the following:

Also may need to use resolutions feature with yarn for package.json depending on the dependencies

see below:

"resolutions": { "{package-name}/node-gyp": "^6.X.X" },

Hope this helps someone until the complete upgrades of python3