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

Bump node-gyp from v9.4.0 to v11.1.0 #122

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ianyong
Copy link

@ianyong ianyong commented Mar 9, 2025

Issue #, if available:

Fixes #116

Description of changes:

When attempting to run the post-install script with Python >= 3.12, the following error occurs:

44.89 .../node_modules/aws-lambda-ric postinstall: Traceback (most recent call last):
44.89 .../node_modules/aws-lambda-ric postinstall:   File "/app/node_modules/.pnpm/[email protected]/node_modules/node-gyp/gyp/gyp_main.py", line 42, in <module>
44.89 .../node_modules/aws-lambda-ric postinstall:     import gyp  # noqa: E402
44.89 .../node_modules/aws-lambda-ric postinstall:     ^^^^^^^^^^
44.89 .../node_modules/aws-lambda-ric postinstall:   File "/app/node_modules/.pnpm/[email protected]/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 9, in <module>
44.89 .../node_modules/aws-lambda-ric postinstall:     import gyp.input
44.89 .../node_modules/aws-lambda-ric postinstall:   File "/app/node_modules/.pnpm/[email protected]/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 19, in <module>
44.89 .../node_modules/aws-lambda-ric postinstall:     from distutils.version import StrictVersion
44.89 .../node_modules/aws-lambda-ric postinstall: ModuleNotFoundError: No module named 'distutils'
44.90 .../node_modules/aws-lambda-ric postinstall: gyp ERR! configure error 
44.90 .../node_modules/aws-lambda-ric postinstall: gyp ERR! stack Error: `gyp` failed with exit code: 1
44.90 .../node_modules/aws-lambda-ric postinstall: gyp ERR! stack     at ChildProcess.onCpExit (/app/node_modules/.pnpm/[email protected]/node_modules/node-gyp/lib/configure.js:325:16)
44.90 .../node_modules/aws-lambda-ric postinstall: gyp ERR! stack     at ChildProcess.emit (node:events:518:28)
44.90 .../node_modules/aws-lambda-ric postinstall: gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:293:12)

This is because node-gyp v9.4.0 relies on the distutils module which was removed from Python in v3.12. node-gyp v10 fixes this issue by relying on a version of gyp-next that removes the reliance on the distutils module and vendors in the packaging module.

To allow the post-install script to work on Python >= 3.12, we bump the version of node-gyp to the latest version as of this PR.

Target (OCI, Managed Runtime, both):

OCI

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@ianyong
Copy link
Author

ianyong commented Mar 17, 2025

Hi @godcrampy @maxday @trivenay, could this PR and #123 be reviewed so that a patch version can be released? These 2 fixes would solve several of the build issues reported over the past 2 years. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade to node-gyp >=10.0.0 to support python >= 3.12
1 participant