Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs/Dependencies: lerna subdependency incompatible with macOS Python3.12 #3914

Open
kadamwhite opened this issue Apr 29, 2024 · 1 comment
Labels
bug For bugs or other software errors

Comments

@kadamwhite
Copy link
Contributor

When trying to run yarn to set up the repo for contribution, I found that the install failed because a (Python) dependency package distutils was missing when trying to build the binary for node-gyp, one of the project's build dependencies.

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

I found that running,

python3 -m pip install setuptools

resolved the issue — distutils was deprecated and removed in Python 3.12, but still seems to be needed by this version of node-gyp in order for the Vega repo dependencies to install with yarn.

node-gyp is included in the project as a subdependency of lerna:

npm ls node-gyp
vega@ /Users/kadam/gh/vega/vega
└─┬ lerna@7.4.2
  └─┬ @npmcli/run-script@6.0.2
    └── node-gyp@9.4.1

I'd suggest either adding a note to the contributing.md with this gotcha, or evaluating an upgrade to lerna v8. node-gyp has resolved the issue internally and I believe lerna 8 has incorporated the updated version.

@kadamwhite kadamwhite added the bug For bugs or other software errors label Apr 29, 2024
@sm-thirdman
Copy link

Hi @kadamwhite,
Thanks for resolving this issue, as this got me past this point.

However at top level or in the vega-cli package it will now not install/complie/whatever canvas.

If I go into the node-packages/canvas and yarn install, it completes, although with plenty or warnings.

But dependent packages, such as vega-cli, will not build. It seems to think canvas hasn't been built, tries to download it, can't then tries to build it again.

Then I get errors like:

gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
  SOLINK_MODULE(target) Release/canvas-postbuild.node
  CXX(target) Release/obj.target/canvas/src/backend/Backend.o
In file included from ../src/backend/Backend.cc:1:
In file included from ../src/backend/Backend.h:6:
../../nan/nan.h:2546:8: error: no matching member function for call to 'SetAccessor'
  tpl->SetAccessor(
  ~~~~~^~~~~~~~~~~
/Users/N/Library/Caches/node-gyp/22.2.0/include/node/v8-template.h:1055:8: note: candidate function not viable: no known conversion from 'v8::AccessControl' to 'v8::PropertyAttribute' for 5th argument
  void SetAccessor(
       ^
/Users/N/Library/Caches/node-gyp/22.2.0/include/node/v8-template.h:1049:8: note: candidate function not viable: no known conversion from 'imp::NativeGetter' (aka 'void (*)(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value> &)') to 'v8::AccessorGetterCallback' (aka 'void (*)(Local<v8::String>, const PropertyCallbackInfo<v8::Value> &)') for 2nd argument

Also macOS, Python 3.12

Have you seen this and got past it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug For bugs or other software errors
Projects
None yet
Development

No branches or pull requests

2 participants