spring-projects / spring-shell

Spring based shell
http://projects.spring.io/spring-shell/
Apache License 2.0
710 stars 391 forks source link

node-gyp on macos fails in e2e tests #909

Open jvalkeal opened 8 months ago

jvalkeal commented 8 months ago

At least macos11 env is now erroring:

npm ERR! Traceback (most recent call last):
npm ERR!   File "/Users/runner/work/spring-shell/spring-shell/e2e/spring-shell-e2e/node_modules/node-gyp/gyp/gyp_main.py", line 42, in <module>
npm ERR!     import gyp  # noqa: E402
npm ERR!     ^^^^^^^^^^
npm ERR!   File "/Users/runner/work/spring-shell/spring-shell/e2e/spring-shell-e2e/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 9, in <module>
npm ERR!     import gyp.input
npm ERR!   File "/Users/runner/work/spring-shell/spring-shell/e2e/spring-shell-e2e/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 19, in <module>
npm ERR!     from distutils.version import StrictVersion
npm ERR! ModuleNotFoundError: No module named 'distutils'

Looks like runners envs are upgrading to python 3.12 and that distutils were removed in that version.

jvalkeal commented 8 months ago

Looks to be from node, not directly from node-pty. There's starting to be issues in https://github.com/nodejs/node-gyp about distutils as people see these type of failures on gh actions.

psaint-j commented 3 months ago

Hello, I have the same issue. How did you solve the problem?

codespearhead commented 3 weeks ago

@psaint-j You have to install setuptools as per issue https://github.com/electron/rebuild/issues/1116 .

A permanent solution is to upgrade to node-gyp to v10+ and revert https://github.com/spring-projects/spring-shell/commit/8097f1eb91b6d5bd8e6ff4296e8900d5649a812a , or even better: bump node-pyt https://github.com/spring-projects/spring-shell/issues/921 to get rid of this dependency altogether.