spring-shell icon indicating copy to clipboard operation
spring-shell copied to clipboard

node-gyp on macos fails in e2e tests

Open jvalkeal opened this issue 2 years ago • 3 comments
trafficstars

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 avatar Nov 03 '23 14:11 jvalkeal

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.

jvalkeal avatar Nov 07 '23 09:11 jvalkeal

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

psaint-j avatar Apr 09 '24 08:04 psaint-j

@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.

codespearhead avatar Jun 25 '24 13:06 codespearhead