Skip to content
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.

Alpine target binary is missing symbols #726

Closed
adrukh opened this issue Jun 27, 2019 · 6 comments
Closed

Alpine target binary is missing symbols #726

adrukh opened this issue Jun 27, 2019 · 6 comments

Comments

@adrukh
Copy link

adrukh commented Jun 27, 2019

👋 and thank you so much for this valuable project! We've been using it successfully for the past 2 years, and really appreciate the hard work behind it!

We're facing an issue where building our project for the alpine platform generates a binary file that segfaults has missing symbols when executed.

Our workaround is to spin up an alpine container and build our project inside it for the alpine platform. This generates a proper binary.
This wasn't really the workaround, it's just that node:alpine includes libstdc++, and alpine:latest doesn't.

Our project is https://github.com/snyk/snyk, and our workaround is described here - snyk/cli#608 and we now simply build against the alpine target.

1. How can we help troubleshoot and fix this issue?
2. If you are facing something similar, please see if our workaround can help you.

@adrukh adrukh changed the title Alpine target images as segfaulting if built on non-alpine platform Alpine target images are segfaulting if built on non-alpine platform Jun 27, 2019
@adrukh adrukh changed the title Alpine target images are segfaulting if built on non-alpine platform Alpine target binary is segfaulting if built on a non-alpine platform Jun 27, 2019
@adrukh
Copy link
Author

adrukh commented Jun 27, 2019

Further investigation reveals that for the alpine target, pkg pulls in a libstdc++ based nodejs build, so alpine users need to run apk add libstdc++ prior to running the binary we've built.

Please comment here if we got something wrong, or if you can confirm this is the expected behaviour.

@adrukh adrukh changed the title Alpine target binary is segfaulting if built on a non-alpine platform Alpine target binary is missing symbols Jun 27, 2019
@chrisdlangton
Copy link

+1

If users are expected to make environments ready for your produced binaries by installing prerequisites to use the binary ? that is defeating the entire purpose of there being a binary release of the software..

I.e. until the binary release is working standalone as designed, we users cannot use software packaged by this at all in most circumstances a binary release would be required (i.e. environments that are unable to install said prerequisite/s)

@rclark
Copy link

rclark commented Dec 31, 2019

I've run into this problem in mapbox/ecs-watchbot#327 (comment).

However, @adrukh's suggested workaround of adding libstdc++ to the containers that run the alpine binary doesn't seem to work for me. Instead, the only functional alpine binaries I've been able to produce I've had to construct on alpine OS.

This came up after switching from a pkg node8-alpine to node10-alpine target. Builds are currently run on Amazon Linux 2 containers.

@drazisil
Copy link

drazisil commented May 8, 2020

Adding the following two libs got the binary working for me. I'd love a way to compile them in statically though, any thoughts?

apk add libstdc++
apk add libgcc

@vasicvuk
Copy link

vasicvuk commented Mar 12, 2021

Does anyone has an issue that alpine binary just runs and quits immediately? I added the libstdc++ and libgcc. I have express server inside and on Windows everything works just fine
It seems that i get Segmentation fault

@jesec
Copy link
Contributor

jesec commented May 14, 2021

This issue has been resolved. Please let me know if it is still relevant.

vercel/pkg-fetch@21ab8a2

@jesec jesec closed this as completed May 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants