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

[prebuild] feat(prebuild): support of Alpine binaries #2370

Open
wants to merge 7 commits into
base: prebuilds
Choose a base branch
from

Conversation

Delagen
Copy link

@Delagen Delagen commented Mar 28, 2024

  • update dependencies
  • rework binding.gyp
  • rework msys bundle for Windows
  • add bundle for MUSL (Alpine)
  • rework bundle scripts and ci

moved to prebuild

Thanks for contributing!

  • Have you updated CHANGELOG.md?

@Delagen
Copy link
Author

Delagen commented Mar 28, 2024

Moved from #2366

@Delagen Delagen force-pushed the rework-prebuilds branch 17 times, most recently from 74a9009 to d68fb7a Compare March 28, 2024 13:10
@Delagen
Copy link
Author

Delagen commented Mar 28, 2024

@zbjornson reworked. This is second.

@Delagen Delagen force-pushed the rework-prebuilds branch 6 times, most recently from 8be0372 to 1c328a7 Compare March 28, 2024 17:33
@ifurther
Copy link

Hi I had the suggest for your comment. You should split the comment for different system.

@Delagen Delagen force-pushed the rework-prebuilds branch 2 times, most recently from 89029a9 to fb5452a Compare April 26, 2024 15:25
@Delagen
Copy link
Author

Delagen commented Apr 26, 2024

Hi I had the suggest for your comment. You should split the comment for different system.

@ifurther What do you suggest?

@Delagen
Copy link
Author

Delagen commented Apr 26, 2024

Reworked to support 22 version, remove error suppression in Windows test due to fix in 20.x Node

@Delagen Delagen force-pushed the rework-prebuilds branch 6 times, most recently from 38c39fe to 8a47aab Compare April 26, 2024 15:50
- update dependencies
- rework binding.gyp
- rework msys bundle for Windows
- add bundle for MUSL (Alpine)
- rework bundle scripts and ci

moved to prebuild
#!/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
Copy link
Collaborator

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?

Copy link
Collaborator

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.

Copy link
Collaborator

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.

Copy link
Author

@Delagen Delagen Jun 24, 2024

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.

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.

None yet

4 participants