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

Install a Python interpreter at buildtime when node-gyp is used #691

Open
ryanmoran opened this issue Dec 13, 2022 · 5 comments
Open

Install a Python interpreter at buildtime when node-gyp is used #691

ryanmoran opened this issue Dec 13, 2022 · 5 comments
Assignees

Comments

@ryanmoran
Copy link
Member

Describe the Enhancement

I'd like to be able to use node-gyp to install native addons to node_modules. Some of these native addons require a Python interpreter. This will only need to be available during the build phase.

Possible Solution

This buildpack should include the cpython buildpack as an optional buildpack in all of its order groups.

Motivation

The Paketo Base stack does not have a Python interpreter installed and so requires that I use the Full stack. I'd like to eventually see Python removed from the Full stack, and I'd like to be able to compile native addons that require Python on the current Base stack as well.

@ryanmoran
Copy link
Member Author

cc/ @voor

@robdimsdale
Copy link
Member

@ryanmoran if the cpython buildpack is optional, which buildpack (if any) in nodejs build order would require it, and under what conditions?

It seems like we'd need to define both sides of the requires/provides contract, otherwise we end up with an optional buildpack that is never used. Am I missing something?

@ryanmoran
Copy link
Member Author

You are totally right. Its unspecified here, but the npm-install and yarn-install buildpacks would need to detect that node-gyp is a dependency and that cpython is required.

@ryanmoran
Copy link
Member Author

An example app that would require cpython through node-gyp can be found at https://github.com/Gerg/gyp-app.

@c0d1ngm0nk3y
Copy link

@ryanmoran This issue is rather old, but still valid I guess. It sounded handy to me first, but I am not so sure about the actual value add anymore. It would only work for very specific stacks. right? For stacks NOT having python BUT a compiler chain to build the native extensions.

That is true for the base stack, but isn't it quite specific?

And what is the difference to just use the full stack for building, but the run image from the base stack? That would basically be the same right? But with some user action.

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

No branches or pull requests

3 participants