-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Use clang to build nodejs in alpine #281
Conversation
The test build is failing with:
|
Fixed, I forgot to add clang-dev for the headers, sorry. |
BTW, it took about 4.5 mins with gcc but only 3.5 mins with clang to build v4 on my computer. |
Hi @nodejs/docker This change seems reasonable to me, but I'm not sure if there are any unintended consequences with switching to Clang when building Node.js under Alpine Linux. Any thoughts or feedback on this? |
Hi @nodejs/docker ! Can anyone help review this? |
Two reasons: 1. Faster speed 2. Smaller image
This appears to have been talked about before by the @nodejs/build group with no real concensus given: nodejs/build#1 (comment) But It looks like clang will be officially supported? nodejs/node#8922 I'm 👍 assuming the Build WG is okay with it 😄 |
Yeah I think it's officially supported: |
clang is supported; alpine not so much - but that's irrelevant here. I'm Another thing to consider: if people were to install node-gyp; would they pull gcc or clang? do we need to readme this? |
@jbergstroem the gcc dependency is just keep there so that we can directly use the library/header dependency, otherwise I'll need to write lots of dependency packages to be installed. by the |
@PeterDaveHello not saying that there would be auto-pulls, rather that people would choose gcc by default over clang because that's what they're used to. Mentioning this use-case in a readme could avoid any fallout as a result. WRT deps: why not just mention all packages that are required instead of installing extra stuff? |
I can mention them all once we have conclusion here to decide move to clang :) |
Given the added complexity for users (having to know that they need clang for node-gyp instead of Ggcc), I'm not sure this change is really worth it. I don't think a note in a README is good enough. We're only saving about 2MB in image file size for an image that's already pretty small already. I guess the shorter build time is a bonus, but it didn't seem that much of a dramatic improvement to me and not something that probably matters to end users who pull this image from the Docker Hub. Also, eventually we want to use a pre-built Node.js binary for Alpine/musl which would more than likely be built with gcc. After thinking about this, I'm 👎 on this change. |
So does using clang to compiler make user need to use clang as well when using node-gyp? Just want to figure out the problem. |
I'm assuming that was implied based on what was said in #281 (comment) but it would be good to have that clarified. |
Two reasons: