-
Notifications
You must be signed in to change notification settings - Fork 168
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 musl c #7067
Add support for musl c #7067
Conversation
3030c0f
to
4f75509
Compare
Pull Request Test Coverage Report for Build yavor.georgiev_380
💛 - Coveralls |
4f75509
to
210aff0
Compare
@fealebenpae There is a test failing on Evergreen (Sync_BundledRealmFile). Could this be caused by the changes here? |
Not from what I can tell - the changes here are mostly about low-level things in Core and shouldn’t be affecting existing targets. I will run tests a couple more times and see if I catch a sporadic failure or not. |
I'm pretty sure the sync test failures are unrelated. I haven't been able to consistently trigger them across many CI runs and we have sporadic failures in other branches as well. |
# Conflicts: # Jenkinsfile
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good - I was wondering if we should add a CMake define for Alpine/Musl c, but I don't think we need it.
@@ -64,7 +64,12 @@ TEST(BasicSystemErrors_Category) | |||
|
|||
TEST(BasicSystemErrors_Messages) | |||
{ | |||
#if defined(__linux__) && !defined(__GLIBC__) | |||
// Linux and not glibc implies Musl, which has its own message |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course it does...
FYI - The TSAN failure seems to be around the |
unfortunately there isn't a way I could find to easily detect the C library we're targeting, especially if cross-compilation is involved, and musl deliberately doesn't expose any macros that allow detection like |
I'll try downgrading the POSIX version and see if that has an impact on the tsan warning. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -64,7 +64,12 @@ TEST(BasicSystemErrors_Category) | |||
|
|||
TEST(BasicSystemErrors_Messages) | |||
{ | |||
#if defined(__linux__) && !defined(__GLIBC__) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it could be nice to make a REALM_MUSL macro in features.h for readability
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wouldn't do that outside of tests as there isn't a sure-fire way to detect musl based on macros alone - in this particular case we know we only build the tests against glibc and musl on Linux, but if someone were to build Core itself with something like uclibc, for example, it would trigger the above code path if it were in Core itself and not just in the tests we build and run ourselves.
@@ -310,6 +312,58 @@ def doCheckInDocker(Map options = [:]) { | |||
} | |||
} | |||
|
|||
def doCheckAlpine(Map options = [:]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like it took CI 18 minutes to compile with musl c. It's not the bottleneck on CI so doesn't matter too much, but that's around double the time for our other linux builders 😄
What, How & Why?
As it says on the tin.
The changes are mostly about things that don't exist in musl, or need configure-time detection:
posix_fallocate
pthread_getname_np
/pthread_setname_np
backtrace
And various other quirks like the hardcoded messages produced by
strerror
that are different between glibc and musl.☑️ ToDos