-
Notifications
You must be signed in to change notification settings - Fork 45
Failing to install under Alpine Linux #86
Comments
npm-debug.log here: https://gist.github.com/nathankunicki/675f04fa24f8ca6f0a3e7f1560b1eff4 |
I'm not familiar with Alpine Linux but doing a quick query on it's package manager suggests execinfo.h is part of libexecinfo-dev: It provides the backtrace() function that we use to generate obtain the native stack at the point the report is created so it's a fairly key piece of function. Adding that package might resolve this issue. Alpine linux looks like it tries to stay quite small so I wouldn't be surprised if you found another header missing further on but you might be able to find packages for the others the same way. If you are able to compile it let us know what you had to install, if it is able to build we might be able to add the info to the README. |
Thank you, that definitely helped. Turns out libexecinfo-dev is only available in the edge repo, so what I did is add the edge repo with the tag "edge" and use that tag to fetch it with apk. Like so:
Now installs fine. :) |
Just as an update to this, while install works now, execution doesn't. When included in a project, the process terminates with a message along the lines of "backtrace: symbol not found".
Some Googling suggests that this is because Alpine doesn't support glibc, and the Node.js inside the container isn't compiled with glibc or something (Not 100% sure on this). For reference, I'm using the official Node.js Alpine Docker image: My Dockerfile begins with: |
Looks like libexecinfo-dev should provide the backtrace function, maybe we need to add a library dependency to the node-report binding.gyp, for alpine. Or maybe you'll need to install libexecinfo as well as libexecinfo-dev |
@nathankunicki you are right, the problem is that Alpine does not support glibc, in particular the backtrace API that we use. PR #89 raised. I tested on |
@nathankunicki if you get a chance, could you try the fix in PR #89 on your Alpine environment:
I needed to install git first ( |
Apologies for the late response, I've gotten around to testing this now! Node-report worked fine, but there's no call stack - I'm guessing since the libbacktrace functionality was ifdef'ed out. I'm guessing it's a large amount of working to get it (and its dependencies) working in Alpine? |
Thanks, I will land the fix shortly. Yes, I just ifdef'ed out the code that calls the Linux backtrace api (http://man7.org/linux/man-pages/man3/backtrace.3.html) - as that is not available in Alpine. I think Alpine intentionally leave out quite a few libraries, to keep the footprint small. To get the backtrace working, possible solutions would need either a) our own native backtrace implementation, or b) bundle the missing libraries in node-report, or c) get a change to Alpine. All of those are quite a bit of work unfortunately, any suggestions welcome. |
Alpine supports execinfo / the backtrace function. I'm using it for my own project, found this issue by accident. If you install libexecinfo-dev and link against libexecinfo.so, it works identically to when running under glibc. |
Hi,
I'm attempting to use this inside a Docker container (Alpine Linux), however the install (npm install node-report) fails with this:
These are the build tools/deps I'm installing:
Any ideas?
Thanks. :)
The text was updated successfully, but these errors were encountered: