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

Cross building doesn't work for alpine3.7 #20

Closed
TeBoring opened this issue Jun 6, 2018 · 10 comments
Closed

Cross building doesn't work for alpine3.7 #20

TeBoring opened this issue Jun 6, 2018 · 10 comments

Comments

@TeBoring
Copy link

TeBoring commented Jun 6, 2018

I used this docker to build gem for protobuf. However, when running the linux gem on alpine3.7 docker, there is segmentation fault. If I build the gem on alpine 3.7 directly, there is no segmentation fault.
For more details see protocolbuffers/protobuf#4460

@larskanis
Copy link
Member

@TeBoring , @nicolasnoble Have you been able to solve the compatibility issue between Alpine linux and binary gems for protobuf?

@TeBoring
Copy link
Author

In our continuous test, we found ruby 2.5.0 has internal error that can cause protobuf's test to fail on segment fault.
Previously, we also built gem for ruby 2.5.0. I guess that's the cause.
Does rake-compiler-dock provides support for ruby 2.5.1?

@larskanis
Copy link
Member

rake-compiler doesn't recognize 2.5 as a version spec, but only 2.5.0 in RUBY_CC_VERSION. On the other hand, only the the header files of the cross ruby version are relevant, since the libruby.dll file of the cross build is replaced by the libruby.dll of the runtime ruby version, later on. That's why there's usually no need to update minor versions of the cross rubies.

Do you know whether the segfault is related to the header files? If so I'll have to find a way to update cross rubies, without breaking 3-part version specs of dependent projects.

@TeBoring
Copy link
Author

Sorry, I don't know if it's the header file that caused the problem.
I am currently building my own docker image for 2.5.1, using similar script in https://github.com/rake-compiler/rake-compiler-dock/blob/v0.6.2/Dockerfile.
However, my image only have linux-x86 for 2.5.1, although I also mentioned x86_64 in my script. Any idea?

@TeBoring
Copy link
Author

Changing parallel -j6 to j1 fixes the problem.

@TeBoring
Copy link
Author

The gem built by the new docker image still doesn't work.

@TeBoring
Copy link
Author

docker-library/ruby#196
Is this related?

@TeBoring
Copy link
Author

I noticed that the gem we built using rake-compiler-dock is linking against glibc.
But alpine is using musl.

@nicolasnoble
Copy link

musl and glibc are both named the same way in the filesystem, and are nearly interchangeable. Emphasis on nearly.

It's possible if difficult to build binaries that work for both, but it's honestly a lot of work.

The fault here really lies in the gem software, that doesn't offer any proper framework for installing precompiled binaries that work on musl, unlike python with manylinux, or unlike nodejs that will make the libc name into the package name.

@larskanis
Copy link
Member

Nokogiri is running fine on Alpine, but required a change to sprintf() on musl. That is beyond the scope of rake-compiler-dock, so I think rake-compiler-dock-1.0 does everything it can do to support alpine.

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

No branches or pull requests

3 participants