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

Error during build steps on macos #16311

Closed
ericsnekbytes opened this issue May 9, 2024 · 6 comments · Fixed by #16314
Closed

Error during build steps on macos #16311

ericsnekbytes opened this issue May 9, 2024 · 6 comments · Fixed by #16314
Labels
bug os:macos Issues specific to macOS operating system tag:Build System

Comments

@ericsnekbytes
Copy link
Contributor

ericsnekbytes commented May 9, 2024

Description

Cannot build vanilla clone of the Lab repo using the "setting up a local development environment" and "installing jupyterlab" section steps on macos/Python 3.12.

This may be related to the Canvas package build (a dependency), possibly involving node-gyp and/or possibly due to distutils usage during a build substep (which was deprecated and removed in Python 3.12...). @krassowski suggested that upgrading the dependency may be a solution.

Reproduce

Follow these steps from the contributor guide:

conda install -c conda-forge nodejs
conda install -c conda-forge pkg-config pango libpng cairo jpeg giflib librsvg glib pixman
export PKG_CONFIG_PATH=$CONDA_PREFIX/lib/pkgconfig
git clone https://github.com/jupyter/jupyterlab.git
cd jupyterlab
pip install -e ".[dev,test]"
jlpm install
jlpm run build  # Build the dev mode assets (optional)

^Note that an error happens on pip install -e ".[dev,test]".

Context

  • Operating System and version: macOS 13.6 (ventura)
Error encountered on pip install
pip install -e ".[dev,test]"
Obtaining file:///Users/egentry/envdemo/jupyterlab
  Installing build dependencies ... done
  Checking if build backend supports build_editable ... done
  Getting requirements to build editable ... done
  Installing backend dependencies ... done
  Preparing editable metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error

× Preparing editable metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [83 lines of output]
INFO:hatch_jupyter_builder.utils:Running jupyter-builder
INFO:hatch_jupyter_builder.utils:Writing pre-commit hook
INFO:hatch_jupyter_builder.utils:Building with buildapi.builder
INFO:hatch_jupyter_builder.utils:With kwargs: {'build_cmd': 'build', 'source_dir': 'packages', 'build_dir': 'dev_mode/static', 'npm': ['node', 'jupyterlab/staging/yarn.js']}
INFO:hatch_jupyter_builder.utils:Installing build dependencies with npm. This may take a while...
INFO:hatch_jupyter_builder.utils:> /Users/egentry/workspace_ana/armconda/envs/envdemo/bin/node jupyterlab/staging/yarn.js install
➤ YN0000: ┌ Project validation
➤ YN0057: │ @jupyterlab/application-top: Resolutions field will be ignored
➤ YN0057: │ @jupyterlab/example-federated-core: Resolutions field will be ignored
➤ YN0000: └ Completed
➤ YN0000: ┌ Resolution step
➤ YN0002: │ @jupyterlab/cell-toolbar-extension@workspace:packages/cell-toolbar-extension doesn't provide react (p9b3fb), requested by @jupyterlab/settingregistry
➤ YN0002: │ @jupyterlab/completer@workspace:packages/completer doesn't provide react (pb6629), requested by @jupyterlab/settingregistry
➤ YN0002: │ @jupyterlab/console-extension@workspace:packages/console-extension doesn't provide react (p43f42), requested by @jupyterlab/settingregistry
➤ YN0002: │ @jupyterlab/csvviewer-extension@workspace:packages/csvviewer-extension doesn't provide react (pc0654), requested by @jupyterlab/settingregistry
➤ YN0002: │ @jupyterlab/debugger-extension@workspace:packages/debugger-extension doesn't provide react (p03594), requested by @jupyterlab/settingregistry
➤ YN0002: │ @jupyterlab/documentsearch-extension@workspace:packages/documentsearch-extension doesn't provide react (p625eb), requested by @jupyterlab/settingregistry
➤ YN0002: │ @jupyterlab/extensionmanager-extension@workspace:packages/extensionmanager-extension doesn't provide react (pf4c35), requested by @jupyterlab/settingregistry
➤ YN0060: │ @jupyterlab/extensionmanager@workspace:packages/extensionmanager provides react (pc6bfe) with version 18.2.0, which doesn't satisfy what react-paginate requests
➤ YN0002: │ @jupyterlab/filebrowser-extension@workspace:packages/filebrowser-extension doesn't provide react (p297ab), requested by @jupyterlab/settingregistry
➤ YN0002: │ @jupyterlab/fileeditor-extension@workspace:packages/fileeditor-extension doesn't provide react (p034cc), requested by @jupyterlab/settingregistry
➤ YN0002: │ @jupyterlab/galata-extension@workspace:galata/extension doesn't provide react (p94674), requested by @jupyterlab/settingregistry
➤ YN0002: │ @jupyterlab/galata@workspace:galata doesn't provide react (pf71ca), requested by @jupyterlab/settingregistry
➤ YN0002: │ @jupyterlab/htmlviewer-extension@workspace:packages/htmlviewer-extension doesn't provide react (p251e4), requested by @jupyterlab/settingregistry
➤ YN0002: │ @jupyterlab/mainmenu-extension@workspace:packages/mainmenu-extension doesn't provide react (pe6ae9), requested by @jupyterlab/settingregistry
➤ YN0002: │ @jupyterlab/markdownviewer-extension@workspace:packages/markdownviewer-extension doesn't provide react (p3482b), requested by @jupyterlab/settingregistry
➤ YN0002: │ @jupyterlab/metadataform-extension@workspace:packages/metadataform-extension doesn't provide react (p7f08d), requested by @jupyterlab/settingregistry
➤ YN0002: │ @jupyterlab/metadataform@workspace:packages/metadataform doesn't provide @rjsf/utils (p26354), requested by @rjsf/core
➤ YN0002: │ @jupyterlab/metadataform@workspace:packages/metadataform doesn't provide @rjsf/utils (p4b312), requested by @rjsf/validator-ajv8
➤ YN0002: │ @jupyterlab/metapackage@workspace:packages/metapackage doesn't provide react (pc1a66), requested by @jupyterlab/settingregistry
➤ YN0060: │ @jupyterlab/repo-top@workspace:. provides stylelint (pb09b9) with version 15.10.1, which doesn't satisfy what stylelint-config-prettier requests
➤ YN0002: │ @jupyterlab/repo-top@workspace:. doesn't provide typescript (p38c70), requested by typedoc
➤ YN0002: │ @jupyterlab/services@workspace:packages/services doesn't provide react (p3d5c2), requested by @jupyterlab/settingregistry
➤ YN0002: │ @jupyterlab/settingeditor-extension@workspace:packages/settingeditor-extension doesn't provide react (p1bbc0), requested by @jupyterlab/settingregistry
➤ YN0002: │ @jupyterlab/statusbar-extension@workspace:packages/statusbar-extension doesn't provide react (pba42f), requested by @jupyterlab/settingregistry
➤ YN0002: │ @jupyterlab/terminal-extension@workspace:packages/terminal-extension doesn't provide react (p7805a), requested by @jupyterlab/settingregistry
➤ YN0002: │ @jupyterlab/toc-extension@workspace:packages/toc-extension doesn't provide react (p336fb), requested by @jupyterlab/settingregistry
➤ YN0002: │ @jupyterlab/translation-extension@workspace:packages/translation-extension doesn't provide react (p854cf), requested by @jupyterlab/settingregistry
➤ YN0002: │ @nrwl/devkit@npm:16.5.2 doesn't provide nx (p83c1a), requested by @nx/devkit
➤ YN0000: │ Some peer dependencies are incorrectly met; run yarn explain peer-requirements for details, where is the six-letter p-prefixed code
➤ YN0000: └ Completed in 0s 212ms
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed in 0s 731ms
➤ YN0000: ┌ Link step
➤ YN0009: │ canvas@npm:2.11.2 couldn't be built successfully (exit code 1, logs can be found here: /private/var/folders/gd/_3z74zks7dl2z3h4xn_5svxr0000gn/T/xfs-5fd2b08f/build.log)
➤ YN0000: └ Completed in 24s 496ms
➤ YN0000: Failed with errors in 25s 684ms
Traceback (most recent call last):
File "/Users/egentry/workspace_ana/armconda/envs/envdemo/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 167, in prepare_metadata_for_build_editable
hook = backend.prepare_metadata_for_build_editable
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'hatchling.build' has no attribute 'prepare_metadata_for_build_editable'

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "/Users/egentry/workspace_ana/armconda/envs/envdemo/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
      main()
    File "/Users/egentry/workspace_ana/armconda/envs/envdemo/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/Users/egentry/workspace_ana/armconda/envs/envdemo/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 176, in prepare_metadata_for_build_editable
      whl_basename = build_hook(metadata_directory, config_settings)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/private/var/folders/gd/_3z74zks7dl2z3h4xn_5svxr0000gn/T/pip-build-env-owz9yr7s/overlay/lib/python3.12/site-packages/hatchling/build.py", line 83, in build_editable
      return os.path.basename(next(builder.build(directory=wheel_directory, versions=['editable'])))
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This file contains the result of Yarn building a package (canvas@npm:2.11.2)

Script name: install

node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using [email protected]
node-pre-gyp info using [email protected] | darwin | arm64
node-pre-gyp http GET https://github.com/Automattic/node-canvas/releases/download/v2.11.2/canvas-v2.11.2-node-v115-darwin-unknown-arm64.tar.gz
node-pre-gyp ERR! install response status 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.11.2/canvas-v2.11.2-node-v115-darwin-unknown-arm64.tar.gz
node-pre-gyp WARN Pre-built binaries not installable for [email protected] and [email protected] (node-v115 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp WARN Hit error response status 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.11.2/canvas-v2.11.2-node-v115-darwin-unknown-arm64.tar.gz
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | darwin | arm64
gyp info ok
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | darwin | arm64
gyp info find Python using Python version 3.12.3 found at "/Users/egentry/workspace_ana/armconda/envs/envdemo/bin/python3"
gyp info spawn /Users/egentry/workspace_ana/armconda/envs/envdemo/bin/python3
gyp info spawn args [
gyp info spawn args '/Users/egentry/envdemo/jupyterlab/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/egentry/envdemo/jupyterlab/node_modules/canvas/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/egentry/envdemo/jupyterlab/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/egentry/Library/Caches/node-gyp/20.12.2/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/egentry/Library/Caches/node-gyp/20.12.2',
gyp info spawn args '-Dnode_gyp_dir=/Users/egentry/envdemo/jupyterlab/node_modules/node-gyp',
gyp info spawn args '-Dnode_lib_file=/Users/egentry/Library/Caches/node-gyp/20.12.2/<(target_arch)/node.l
ib',
gyp info spawn args '-Dmodule_root_dir=/Users/egentry/envdemo/jupyterlab/node_modules/canvas',
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/egentry/envdemo/jupyterlab/node_modules/node-gyp/gyp/gyp_main.py", line 42, in
import gyp # noqa: E402
^^^^^^^^^^
File "/Users/egentry/envdemo/jupyterlab/node_modules/node-gyp/gyp/pylib/gyp/init.py", line 9, in
import gyp.input
File "/Users/egentry/envdemo/jupyterlab/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 19, in
from distutils.version import StrictVersion
ModuleNotFoundError: No module named 'distutils'
gyp ERR! configure error
File "/private/var/folders/gd/_3z74zks7dl2z3h4xn_5svxr0000gn/T/pip-build-env-owz9yr7s/overlay/lib/python3.12/site-packages/hatchling/builders/plugin/interface.py", line 147, in build
build_hook.initialize(version, build_data)
File "/private/var/folders/gd/_3z74zks7dl2z3h4xn_5svxr0000gn/T/pip-build-env-owz9yr7s/normal/lib/python3.12/site-packages/hatch_jupyter_builder/plugin.py", line 94, in initialize
raise e
File "/private/var/folders/gd/_3z74zks7dl2z3h4xn_5svxr0000gn/T/pip-build-env-owz9yr7s/normal/lib/python3.12/site-packages/hatch_jupyter_builder/plugin.py", line 89, in initialize
build_func(self.target_name, version, **build_kwargs)
File "/Users/egentry/envdemo/jupyterlab/buildapi.py", line 20, in builder
npm_builder(target_name, version, *args, **kwargs)
File "/private/var/folders/gd/_3z74zks7dl2z3h4xn_5svxr0000gn/T/pip-build-env-owz9yr7s/normal/lib/python3.12/site-packages/hatch_jupyter_builder/utils.py", line 115, in npm_builder
run([*npm_cmd, "install"], cwd=str(abs_path))
File "/private/var/folders/gd/_3z74zks7dl2z3h4xn_5svxr0000gn/T/pip-build-env-owz9yr7s/normal/lib/python3.12/site-packages/hatch_jupyter_builder/utils.py", line 231, in run
return subprocess.check_call(cmd, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/egentry/workspace_ana/armconda/envs/envdemo/lib/python3.12/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/Users/egentry/workspace_ana/armconda/envs/envdemo/bin/node', 'jupyterlab/staging/yarn.js', 'install']' returned non-zero exit status 1.
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

Log file content referenced in the error message:
cat /private/var/folders/gd/_3z74zks7dl2z3h4xn_5svxr0000gn/T/xfs-5fd2b08f/build.log
# This file contains the result of Yarn building a package (canvas@npm:2.11.2)
# Script name: install

node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using [email protected]
node-pre-gyp info using [email protected] | darwin | arm64
node-pre-gyp http GET https://github.com/Automattic/node-canvas/releases/download/v2.11.2/canvas-v2.11.2-node-v115-darwin-unknown-arm64.tar.gz
node-pre-gyp ERR! install response status 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.11.2/canvas-v2.11.2-node-v115-darwin-unknown-arm64.tar.gz
node-pre-gyp WARN Pre-built binaries not installable for [email protected] and [email protected] (node-v115 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp WARN Hit error response status 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.11.2/canvas-v2.11.2-node-v115-darwin-unknown-arm64.tar.gz
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | darwin | arm64
gyp info ok
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | darwin | arm64
gyp info find Python using Python version 3.12.3 found at "/Users/egentry/workspace_ana/armconda/envs/envdemo/bin/python3"
gyp info spawn /Users/egentry/workspace_ana/armconda/envs/envdemo/bin/python3
gyp info spawn args [
gyp info spawn args '/Users/egentry/envdemo/jupyterlab/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/egentry/envdemo/jupyterlab/node_modules/canvas/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/egentry/envdemo/jupyterlab/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/egentry/Library/Caches/node-gyp/20.12.2/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/egentry/Library/Caches/node-gyp/20.12.2',
gyp info spawn args '-Dnode_gyp_dir=/Users/egentry/envdemo/jupyterlab/node_modules/node-gyp',
gyp info spawn args '-Dnode_lib_file=/Users/egentry/Library/Caches/node-gyp/20.12.2/<(target_arch)/node.lib',
gyp info spawn args '-Dmodule_root_dir=/Users/egentry/envdemo/jupyterlab/node_modules/canvas',
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/egentry/envdemo/jupyterlab/node_modules/node-gyp/gyp/gyp_main.py", line 42, in
import gyp # noqa: E402
^^^^^^^^^^
File "/Users/egentry/envdemo/jupyterlab/node_modules/node-gyp/gyp/pylib/gyp/init.py", line 9, in
import gyp.input
File "/Users/egentry/envdemo/jupyterlab/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 19, in
from distutils.version import StrictVersion
ModuleNotFoundError: No module named 'distutils'
gyp ERR! configure error
gyp ERR! stack Error: gyp failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/Users/egentry/envdemo/jupyterlab/node_modules/node-gyp/lib/configure.js:325:16)
gyp ERR! stack at ChildProcess.emit (node:events:518:28)
gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:294:12)
gyp ERR! System Darwin 22.6.0
gyp ERR! command "/Users/egentry/workspace_ana/armconda/envs/envdemo/bin/node" "/Users/egentry/envdemo/jupyterlab/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--update-binary" "--module=/Users/egentry/envdemo/jupyterlab/node_modules/canvas/build/Release/canvas.node" "--module_name=canvas" "--module_path=/Users/egentry/envdemo/jupyterlab/node_modules/canvas/build/Release" "--napi_version=9" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v115"
gyp ERR! cwd /Users/egentry/envdemo/jupyterlab/node_modules/canvas
gyp ERR! node -v v20.12.2
gyp ERR! node-gyp -v v9.3.1
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/Users/egentry/workspace_ana/armconda/envs/envdemo/bin/node /Users/egentry/envdemo/jupyterlab/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --update-binary --module=/Users/egentry/envdemo/jupyterlab/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/Users/egentry/envdemo/jupyterlab/node_modules/canvas/build/Release --napi_version=9 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v115' (1)
node-pre-gyp ERR! stack at ChildProcess. (/Users/egentry/envdemo/jupyterlab/node_modules/@mapbox/node-pre-gyp/lib/util/compile.js:89:23)
node-pre-gyp ERR! stack at ChildProcess.emit (node:events:518:28)
node-pre-gyp ERR! stack at maybeClose (node:internal/child_process:1105:16)
node-pre-gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:305:5)
node-pre-gyp ERR! System Darwin 22.6.0
node-pre-gyp ERR! command "/Users/egentry/workspace_ana/armconda/envs/envdemo/bin/node" "/Users/egentry/envdemo/jupyterlab/node_modules/@mapbox/node-pre-gyp/bin/node-pre-gyp" "install" "--fallback-to-build" "--update-binary"
node-pre-gyp ERR! cwd /Users/egentry/envdemo/jupyterlab/node_modules/canvas
node-pre-gyp ERR! node -v v20.12.2
node-pre-gyp ERR! node-pre-gyp -v v1.0.10
node-pre-gyp ERR! not ok
Failed to execute '/Users/egentry/workspace_ana/armconda/envs/envdemo/bin/node /Users/egentry/envdemo/jupyterlab/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --update-binary --module=/Users/egentry/envdemo/jupyterlab/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/Users/egentry/envdemo/jupyterlab/node_modules/canvas/build/Release --napi_version=9 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v115' (1)

@ericsnekbytes ericsnekbytes added bug status:Needs Triage Applied to new issues that need triage labels May 9, 2024
@RRosio RRosio added tag:Build System os:macos Issues specific to macOS operating system labels May 9, 2024
@krassowski
Copy link
Member

After the lab call I realised that the CI is running on arm Macs so it should be tested and we should have caught it. The difference appears to be that you are using Python 3.12 and the CI is using 3.11:

jobs:
macostests:
name: macOS
strategy:
matrix:
group: [integrity, python, usage, usage2]
python-version: [3.11]

It is easy to add 3.12 to the matrix, the problem is that Mac tests are timing out so frequently because the GitHub runners for MacOS are under-powered compared to Linux and Windows runners. However, adding something like:

include:
  - group: "python"
    python-version: "3.12"

Seems like a good trade-off.

@krassowski
Copy link
Member

I can reproduce this on CI when running with Python 3.12: https://github.com/jupyterlab/jupyterlab/actions/runs/9029765269/job/24812738688?pr=16314 (#16314).

As per nodejs/node-gyp#2869 this was fixed in node-gyp v10+. We do not depend on node-gyp directly so we cannot just bump it. We could force a resolution, but ideally we would track down which dependencies depend on it for compilation.

@krassowski
Copy link
Member

Beside the issue with node-gyp, it is worth to rewind to see that it is only used because there are no pre-compiled binaries for node-canvas for arm64 macs, as seen in logs:

node-pre-gyp info using [email protected] | darwin | arm64
node-pre-gyp http GET https://github.com/Automattic/node-canvas/releases/download/v2.11.2/canvas-v2.11.2-node-v115-darwin-unknown-arm64.tar.gz
node-pre-gyp ERR! install response status 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.11.2/canvas-v2.11.2-node-v115-darwin-unknown-arm64.tar.gz
node-pre-gyp WARN Pre-built binaries not installable for [email protected] and [email protected] (node-v115 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp WARN Hit error response status 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.11.2/canvas-v2.11.2-node-v115-darwin-unknown-arm64.tar.gz
gyp info it worked if it ends with ok

The upstream PR Automattic/node-canvas#2354 would solve it and simplify the install instructions.

@krassowski
Copy link
Member

The alternative is to remove the canvas dependency. It is essentially used only in tests to mock the canvas API which is not implemented in node.js (but available in browsers).

"canvas": "^2.11.2",

"canvas": "^2.11.2",

Maybe we could use jest-canvas-mock

@krassowski
Copy link
Member

Attempting this in 437ebec

@ericsnekbytes
Copy link
Contributor Author

@krassowski Thanks for your work on this, I'm sure this fix will become more necessary over time as adoption of newer versions of Python increases :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug os:macos Issues specific to macOS operating system tag:Build System
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants