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

Add musl build based on alpine linux image #116

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

Conversation

Logikgate
Copy link

This is an attempt to add pre-built musl binaries, ref #77

For some reason this only works for nodejs v12 and higher. The binary builds without errors on lower versions but the final node -e "require('./node-canvas')" test results in a Segmentation Fault. I have tried trouble shooting it but can't seem to get anywhere. If you have any ideas why this would be I would appreciate a second set of 👀 .

In the meantime it seems adding node 12 and 13 musl binaries would still be of value so I'm opening this PR now for review, please let me know what you think.

Copy link
Member

@chearon chearon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thank you!

Not sure about the segfault but only supporting newer Node seems reasonable.

@@ -0,0 +1,46 @@
FROM alpine:3.11
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that Alpine 3.11 uses musl libc 1.1.24, released in October. Assuming musl adds symbols between releases, anyone with older versions won't be able to link against the binary. That's why the other Dockerfile uses an old Debian and compiles from source. So I think that might be one pre-req to merging this.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. I can make the change to an older version of alpine. How far back are you looking to go though?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chearon I was looking at this again and I think it makes sense to leave musl at 1.1.24. They are planning to EOL the 1.1 branch with the release of 1.2 in February but will be back-porting bug fixes down to 1.1.25 in the future. Also, all versions prior to 1.1.24 have security issues.

Similar to how musl will only be supported for node versions >= 12 (released in April 2019) I don't think it's unreasonable to only "officially" support musl >= 1.1.24 (released in Oct 2019). What do you think?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry to jump in - given the EOL, eventual complications and that there are no better options either ways so far - having recent support now is better than having legacy support but too late.
Probably a lot of people in the K8S world are using Alpine as a base and are struggling / consuming power to build these for nothing :)

@Crazymax11
Copy link

what's about this pull request? Will it be merged?

@smoke
Copy link

smoke commented May 29, 2020

closes #31
closes #77

@chearon
Copy link
Member

chearon commented Jun 7, 2020

We're wrapping up some work to do builds in the main repo using GitHub Actions, so once we get that completed we can move this PR to node-canvas. @Logikgate sounds good on #116 (comment), sorry for the late reply.

@ianvieira
Copy link

@chearon Do you have any update about this PR? Seems like #1568 was already merged.

@chearon
Copy link
Member

chearon commented Aug 12, 2020

Sorry, we ran into issues: Automattic/node-canvas#1622 (comment). If someone else wants to help over there and/or migrate this PR, I'll do my best to help get it merged. Native build stuff takes a lot of time so not sure when I'll be able to do it otherwise.

@chrycheng
Copy link

Automattic/node-canvas#1622 is closed already. What else is needed here for this PR to be accepted? I would be willing to help if I can.

@coeing
Copy link

coeing commented Jul 25, 2022

Is this pull request still active? If yes, what is missing? If no, is there another pull request/issue that is?
It would be really great to have a prebuilt package to speed up the builds of alpine docker containers which use node-canvas :)

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.

7 participants