pierreinglebert / node-zopfli

Node bindings for Zopfli Compression Algorithm (zlib, gzip, deflate compatible)
MIT License
110 stars 39 forks source link

Needs to be updated to Python 3 #124

Open btfranklin opened 2 years ago

btfranklin commented 2 years ago

The current dependency on Python 2.7 is a problem moving forward, as many users who are Mac-based will begin experiencing build errors. macOS removes Python 2.7 as of version 12.3.

iMonZ commented 1 year ago

This tool is now completely broken since Xcode 14.1! Is there a workaround for that? There is a now way of getting this tool runned right now.

pierreinglebert commented 1 year ago

The python dependency comes from the code compilation ie prebuild / prebuild-install / node-gyp. I think it would need to revamp that part with the new tools

iMonZ commented 1 year ago

The python dependency comes from the code compilation ie prebuild / prebuild-install / node-gyp. I think it would need to revamp that part with the new tools

Actually I think node-gyp is the one failing:

npm ERR! code 1
npm ERR! path /Users/mvg/Downloads/Core/node_modules/isolated-vm
npm ERR! command failed
npm ERR! command sh -c -- node-gyp rebuild --release -j 4
npm ERR! CXX(target) Release/obj.target/nortti/src/external_copy/serializer_nortti.o
npm ERR!   CXX(target) Release/obj.target/nortti/src/isolate/allocator_nortti.o
npm ERR!   LIBTOOL-STATIC Release/nortti.a
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@7.1.0
npm ERR! gyp info using node@18.9.0 | darwin | arm64
npm ERR! gyp info find Python using Python version 3.10.6 found at "/opt/homebrew/opt/python@3.10/bin/python3.10"
npm ERR! (node:23443) [DEP0150] DeprecationWarning: Setting process.config is deprecated. In the future the property will be read-only.
npm ERR! (Use `node --trace-deprecation ...` to show where the warning was created)
npm ERR! gyp info spawn /opt/homebrew/opt/python@3.10/bin/python3.10
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/Users/mvg/Downloads/Core/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'make',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/mvg/Downloads/Core/node_modules/isolated-vm/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/mvg/Downloads/Core/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/mvg/Library/Caches/node-gyp/18.9.0/include/node/common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=/Users/mvg/Library/Caches/node-gyp/18.9.0',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/Users/mvg/Downloads/Core/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/Users/mvg/Library/Caches/node-gyp/18.9.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/Users/mvg/Downloads/Core/node_modules/isolated-vm',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build', '--jobs', 4 ]
npm ERR! env: python: No such file or directory
npm ERR! make: *** [Release/nortti.a] Error 127
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack     at ChildProcess.onExit (/Users/mvg/Downloads/Core/node_modules/node-gyp/lib/build.js:194:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
npm ERR! gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:291:12)
npm ERR! gyp ERR! System Darwin 22.1.0
npm ERR! gyp ERR! command "/opt/homebrew/Cellar/node/18.9.0/bin/node" "/Users/mvg/Downloads/Core/node_modules/.bin/node-gyp" "rebuild" "--release" "-j" "4"
npm ERR! gyp ERR! cwd /Users/mvg/Downloads/Core/node_modules/isolated-vm
npm ERR! gyp ERR! node -v v18.9.0
npm ERR! gyp ERR! node-gyp -v v7.1.0
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/mvg/.npm/_logs/2022-09-22T18_36_35_993Z-debug-0.log