-
Notifications
You must be signed in to change notification settings - Fork 1.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
[prebuild] feat(prebuild): support of Alpine binaries #2370
base: prebuilds
Are you sure you want to change the base?
Conversation
Moved from #2366 |
74a9009
to
d68fb7a
Compare
@zbjornson reworked. This is second. |
8be0372
to
1c328a7
Compare
38c39fe
to
8a47aab
Compare
- update dependencies - rework binding.gyp - rework msys bundle for Windows - add bundle for MUSL (Alpine) - rework bundle scripts and ci moved to prebuild
8a47aab
to
f22fbfe
Compare
e9c5286
to
8b238be
Compare
#!/usr/bin/env sh | ||
|
||
sudo apt-get update | ||
sudo apt-get install -y build-essential libcairo2-dev libjpeg-dev libpango1.0-dev libgif-dev librsvg2-dev libpixman-1-dev patchelf |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chearon did you build all of the Linux deps from source for a reason, or can we use precompiled packages as this PR does?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we need to build on an old OS for maximum compatibility. Programs built against a newer libc may have symbols that don't exist on older OSes (this happened to real users). But we want newer libraries, so have to build from source.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But we want newer libraries
👍 forgot about this part.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You describe preference to run code on old OS, but you require at least NodeJS 18.
Node 18 via NVM ubuntu 14.04
node: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.27' not found (required by node)
node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.25' not found (required by node)
node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by node)
node: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by node)
node: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by node)
node: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by node)
Node 18 via NVM Ubuntu 18.04
node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by node)
Node-source distribution doesn't target any Ubuntu lower than 20.04
https://github.com/nodesource/distributions?tab=readme-ov-file#ubuntu-versions
Current build with not precompiled libraries works perfectly on Ubuntu 20.04 with Node 18 from NVM.
Npm test result
206 passing (125ms)
6 pending
3 failing
1) Canvas
color parser:
AssertionError [ERR_ASSERTION]: 'rgba(255, 200, 90, 0.40)' == '#ffc85a'
+ expected - actual
-rgba(255, 200, 90, 0.40)
+#ffc85a
at Context.<anonymous> (test/canvas.test.js:217:12)
at process.processImmediate (node:internal/timers:476:21)
2) Canvas
Context2d#measureText()
works:
AssertionError [ERR_ASSERTION]: Expected 14 to be 0.5 +/- 0.5
+ expected - actual
-false
+true
at assertApprox (test/canvas.test.js:24:3)
at Context.<anonymous> (test/canvas.test.js:1029:7)
at process.processImmediate (node:internal/timers:476:21)
3) Canvas
Context2d#measureText()
actualBoundingBox is correct for left, center and right alignment (#1909):
AssertionError [ERR_ASSERTION]: Expected 39 to be 21 +/- 6
+ expected - actual
-false
+true
at assertApprox (test/canvas.test.js:24:3)
at Context.<anonymous> (test/canvas.test.js:1057:7)
at process.processImmediate (node:internal/timers:476:21)
That pretty the same issues as Alpine build.
Any other suggestions to build from source?
I thinks that build from source was designed as a way to bundle libraries with compiled node binding, because base libraries without patching tries to resolve dependencies via precompiled path. Patching libraries with patchelf
resolves this issue. So I don't think that manually compile libraries is overkill.
ee65e2b
to
02b26d1
Compare
moved to prebuild
Thanks for contributing!