-
-
Notifications
You must be signed in to change notification settings - Fork 421
Conversation
Thanks for your pull request, @yshui! We are looking forward to reviewing it, and you should be hearing from a maintainer soon. Some tips to help speed things up:
Bear in mind that large or tricky changes may require multiple rounds of review and revision. Please see CONTRIBUTING.md for more information. Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. |
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.
Everything is scoped to Musl, so shouldn't affect anything else.
src/core/sys/posix/signal.d
Outdated
int sigev_notify; | ||
void function(sigval) sigev_notify_function; | ||
pthread_attr_t *sigev_notify_attributes; | ||
char[56-3*long.sizeof] __pad; |
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.
Nit, spaces between operators. Otherwise OK.
After all your work on using the Musl libc, I thought I'd try it out, so I whipped up an Alpine VPS at my host. I got dmd master built by bootstrapping through ldc ltsmaster and then druntime master built fine, after adding this patch and commenting out some backtrace declarations that aren't there on Alpine.
|
Alright, finally got all the druntime tests to run on Alpine with Musl, by applying this pull and making a few tweaks. Two test blocks from When I made the test runner skip |
@yshui Once the issues that @joakim-noah has pointed out, have been addressed, how about making adding a changelog entry and announcement in the NG?
As Alpine is getting more and more popular, how about doing this in a Dockerfile which can then be used by everyone who wants to use D applications with Alpine? The GoLang people do this: https://hub.docker.com/_/golang/ docker run --rm -ti -v $(pwd):/src dlang-alpine/dmd dmd -run hello_alpine.d Someone already missed it here: lindt/docker-dmd#1 |
@joakim-noah Yes, shared library doesn't work yet. I would need some time to look into that. |
Has gdc and ldc compilers been tested with these bindings? That would separate binding problems from just dmd problems. |
Why would you suspect dmd? |
Experience. GDC (and maybe LDC) just integrates into the environment if you compile it for that platform. |
@ibuclaw @joakim-noah I think it's a problem with musl. |
@@ -1294,11 +1294,11 @@ else version (CRuntime_Musl) | |||
timespec st_atim; | |||
timespec st_mtim; | |||
timespec st_ctim; | |||
extern(D) | |||
extern(D) @safe @property |
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 hit this too, wonder why @safe
is only needed with this C runtime.
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.
Not sure. Other C runtimes don't use this definition. e.g. in CRuntime_Glibc this is behind a (__USE_MISC || __USE_XOPEN2KB)
check, which is false.
Erm, at I'll push the change and see what the buildbot has to say. Edit: looks like the buildbot doesn't like it :( |
Looks like the glibc dynamic linker also relocates the entries in the dynamic section, while musl's doesn't. So I scoped the change to musl. |
test/shared/link assumes library constructors are always run before main constructors, which seems to not be true with musl. A couple other |
@joakim-noah Can you test again? |
Ran the druntime tests again with this latest pull, which fixes most of the problems. I still get a segfault in I went ahead and started running the Phobos tests too, most of them passed with these additions to druntime:
That first
One assert, three test blocks, and one linux test function were disabled. Also, the Other than that, looking good so far, just more polishing to do. I don't expect you to fix all these issues though, so whenever you're ready, we can get this pull in. |
This test make sure that locking will fail after the mutex is destroyed, which is not the case for musl.
@joakim-noah |
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.
@wilzbach, this is ready to go. This port still needs some polishing for shared libraries and phobos to pass all their tests, but we can get that in later. |
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.
Yes, please go step by step to success!
@@ -377,6 +377,7 @@ unittest | |||
// For example, Bionic doesn't appear to do so, so this test is | |||
// not run on Android. | |||
version (CRuntime_Bionic) {} else | |||
version (CRuntime_Musl) {} else |
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.
Weird, I thought Musl
is promoted as drop-in replacement for 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.
The compatibility only extends to the C source level, plus musl doesn't implement all features.
commit cb32bd4 Merge: edf321a e714ea0 Author: The Dlang Bot <code+dlang-bot@dawg.eu> Date: Sun Feb 11 15:09:55 2018 +0100 Merge pull request dlang#2085 from ibuclaw/linttrailing posix.mak: Add check for trailing whitespace from phobos merged-on-behalf-of: Sebastian Wilzbach <sebi.wilzbach@gmail.com> commit e714ea0 Author: Iain Buclaw <ibuclaw@gdcproject.org> Date: Sun Feb 11 11:01:26 2018 +0100 posix.mak: Add lint check for trailing whitespace from Phobos commit edf321a Merge: 7653199 fdc4779 Author: The Dlang Bot <code+dlang-bot@dawg.eu> Date: Sat Feb 10 23:42:13 2018 +0100 Merge pull request dlang#2071 from yshui/musl_fixes Some missing parts for musl merged-on-behalf-of: Sebastian Wilzbach <sebi.wilzbach@gmail.com> commit fdc4779 Author: Yuxuan Shui <yshuiv7@gmail.com> Date: Thu Feb 8 08:18:49 2018 -0500 Add pthread definitions for musl commit 9a7be0e Author: Yuxuan Shui <yshuiv7@gmail.com> Date: Thu Feb 8 08:15:30 2018 -0500 Define posix_memalign for musl commit 2c44836 Author: Yuxuan Shui <yshuiv7@gmail.com> Date: Thu Feb 8 08:14:19 2018 -0500 Mark math functions as pure commit 3441362 Author: Yuxuan Shui <yshuiv7@gmail.com> Date: Mon Feb 5 11:53:33 2018 -0500 Add definition of utimes for musl commit ea85b4d Author: Yuxuan Shui <yshuiv7@gmail.com> Date: Mon Feb 5 11:52:23 2018 -0500 Skip a test in core.sync.mutex for musl This test make sure that locking will fail after the mutex is destroyed, which is not the case for musl. commit f08f10b Author: Yuxuan Shui <yshuiv7@gmail.com> Date: Mon Feb 5 10:04:25 2018 -0500 Relocate the strtab for musl as well commit 6078897 Author: Yuxuan Shui <yshuiv7@gmail.com> Date: Mon Feb 5 04:31:52 2018 -0500 Mark stat_t.st_*time functions as @safe commit 4ddf2a1 Author: Yuxuan Shui <yshuiv7@gmail.com> Date: Wed Jan 31 00:24:25 2018 -0500 Add definition of errno for musl commit b37372f Author: Yuxuan Shui <yshuiv7@gmail.com> Date: Wed Jan 31 00:18:35 2018 -0500 Add musl definition to core/sys/posix/sys/utsname.d commit 4b9af0c Author: Yuxuan Shui <yshuiv7@gmail.com> Date: Wed Jan 31 00:16:12 2018 -0500 Add missing sigevent commit 525ddfb Author: Yuxuan Shui <yshuiv7@gmail.com> Date: Wed Jan 31 00:14:55 2018 -0500 Remove duplicate CLOCK_MONOTONIC
@yshui, any plans to finish off Phobos? I got that linux test function in |
@joakim-noah Since you had it working, you could go ahead and open a PR, if you want to. |
OK, just wanted to make sure we weren't duplicating effort. I will try to fix those remaining Phobos tests for Musl, not going to do anything with shared libraries though. |
No description provided.