-
Notifications
You must be signed in to change notification settings - Fork 150
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
Add support for Alpine and other musl-based Linux distributions #331
Comments
Hi @SeanMsi, We've reproduced the issue with ClearScript 7.2 on Alpine in WSL. For us, ClearScript 7.0 with Anyway, it looks like Alpine requires special .NET SDK and runtime builds for some reason, and ClearScript could be in the same boat. Unfortunately, as it's a side project, supporting the three major desktop platforms – including the eight platform-specific V8 packages – is already stretching the limits of the resources available. Sorry! |
I built the latest mainline in an linux container and debugged in alpine. I was able to reproduce the error:
There's an exception coming from a missing dependency linkage.
I'm going to keep looking, but does this give any more insight? |
The exception in my previous message was my fault. I wasn't copying the lib to the expected subpath. Update: That make it seem to be related to threading not running | being supported | not detected at runtime. I'm not sure what the fix is exactly, but I did see on a quick glance through github issues elsewhere that there's been some issue with threading when compiled on gcc and run on musl. I don't know if these issues are related or not. Exception displayed by GDB
Stack Trace from V8Environment_InitializeICU
SIGABRT Stack Trace
Debug Console:
|
Thanks for looking into this.
Hmm,
ClearScript uses Clang to build its native Linux libraries. A quick search suggests that Clang may support a special target for musl. Please keep us posted on any additional insights or discoveries. Thank you! |
I've tried recompiling against musl but I've hit a few issues I'm hoping someone can advise on.
I'm going to keep looking into the V8 project to see if I can figure something out.
|
Thanks for investigating this!
Not sure what's going on there. On Ubuntu LTS, that path is Python 2.7.18. What happens when you run it in your container?
Yes. It'd probably be best to treat this as a new architecture – perhaps something like "x64_musl". For the native call routing to work as it does today, we'd need to be able to detect this architecture at runtime. Currently we use
We might be able to make it work either way, but a separate package would probably be best. Thanks again, and please keep us posted! |
In the alpine container the path is what I would expect and the version matches Ubuntu:
Running
I guess I can try to build with musl on ubuntu and copy to alpine and see if that works. |
Yeah, the V8 build process is finicky about its platform. For example, all 32-bit versions must be cross-compiled. Apparently, it's now using its own glibc-based Python. |
I was trying out the musl compilation without adding the higher-level changes (just replacing the existing linux-64.so with the musl version). I built on ubuntu and then swapped to alpine linux to test. You can view the diff here: William-Froelich#1 I verified the library builds targeting musl instead of glibc with ldd:
Unfortunately, the error output is exactly the same and the app crashes right after executing I realize that my branch breaks the gnu-libc build by adding 'alpine' to the target in the makefile so if I do get this working I will be fixing that! Steps to reproduce:
|
Quick question about your diff: You're defining Thanks! |
It's not being used. I had originally added it because I thought it would be necessary, since it was in most of the examples I found. However, as far as I can tell, the |
Hi,
|
Hi @Nikolay-Ch, Unfortunately, we have no update. Support for musl-based Linux platforms is still something we'd like to add in the future. Good luck! |
Has this issue been updated recently ? @Nikolay-Ch |
no update after 3 years...Maybe people prefer to use Debian image. The debian one is working well: mcr.microsoft.com/dotnet/aspnet:8.0 |
Any update for alpine linux? we're now at alpine 3.20 but it still doesn't work
|
Hi,
We've recently discovered an issue while using ClearScript version 7.2.0.
When trying to use ClearScript in an Alpine Docker Image, the following error occurs:
Adding the glibc compatability layer to try and solve this causes the following error:
Going back to version 7.0.0 with the glibc compatability layer works in an Alpine image without issues. Maybe this was caused by the following change in 7.1?:
Switched to static linking of C/C++ libraries to broaden Linux support
Steps to reproduce
Create simple C# project using ClearScript 7.2.0
Build/Publish project (
dotnet build && dotnet publish
)Build Docker image with:
mcr.microsoft.com/dotnet/aspnet:5.0-alpine
)RUN apk add gcompat
)Run the Docker image and output should be the error shown above
The text was updated successfully, but these errors were encountered: