-
Notifications
You must be signed in to change notification settings - Fork 284
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
Fix compilation on DMD v2.067 #992
Conversation
@@ -760,7 +761,7 @@ final class LibasyncManualEvent : ManualEvent { | |||
auto evloop = getEventLoop(); | |||
shared AsyncSignal sig = cast(shared AsyncSignal) signal; | |||
if (!sig.trigger(evloop)) | |||
throw new Exception(sig.error); | |||
return; //throw new Exception(sig.error); |
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.
In which situation could this happen ? Wouldn't an asset be better over a silent fail ?
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.
Oops, that's an artifact when I was experimenting making this method nothrow
Still fails, because |
Yes, that one was removed recently in favor of just libasync |
It's in need for a rebase. I still don't consider 7cca2ba as a good solution though, especially given the fact it turns an |
I think the proper solution is to stop inheriting from |
Into segmentation fault actually (with |
I got a strange segmentation fault in -release using dmd master with libasync (Windows). This isn't supposed to happen, what platform are you on. |
Nevermind, that's actually what usually happens on assertion failures in release ^^ |
I hope this commit will settle the question :) |
Sorry, but in this form this is not a solution. This is all public code and changing the inheritance like this is a breaking change. All breaking changes must at least go through a deprecation phase. |
How do you deprecate broken code (on DMD 2.067)? Unless I wrap it in a static if version clause? |
This new fix adds some features when running DMD <= 2.066, and removes other features for DMD 2.067 to make vibe.d compatible with it. Unfortunately, it'll break anything that tries to run on DMD 2.067 with certain mutex uses, but that was already broken and is simply bubbling up from druntime. I don't know how to deprecate it properly, but the changes for DMD >= 2.067 are as follows:
|
What would have to be deprecated is the old API. This would for example be the whole BTW, |
Didn't think the UFCS would allow me to remove parenthesis. So this last fix should be good, if you can merge the travis exclusion I'm sure we can see the whole thing go green. |
I would have liked to keep the mutex changes separate from the libasync ones (defer it until the Druntime case is settled), but anyway, that can always be changed again before release. But the first commit still seems to contain merge errors (reverts some changes in the libevent driver), or was that intended (Travis still passes)? |
That was intentional, the changes I submitted are in a different direction and the
They allow libasync to run on 2.067, which is relevant to the pull :) |
Travis passes on everything except the 4 versions that aren't supported by libasync (yet) |
So did you make the changes in libevent.d on purpose? Why are they in the commit that fixes the libasync driver? |
They're in the libasync driver pull because it must address the whole of the mutex issues in 2.067, where the proposed solution was to make the drivers nothrow. The libevent driver had a few added nothrows, which I removed because it seemed unnecessary given the fact that the new approach is to let the mutexes and drivers remain throwable. I can revert the changes if you like. |
No no, I think it's most probably a step in the right direction. It just seemed out of place in the commit order back then. |
Made libevent default again Fix dub.json Remove artifact Add assertions to replace caught exceptions Update version for travis tests Remove libasync.all Add sorting import for redis test Implement throwable task mutexes Removed memory changes fix segfault Lock using with statement in synchronized-like syntax Add compatibility with previous DMD versions Add deprecation messages for TaskMutex & RecursiveTaskMutex update test
Green! |
Yay! |
Fix compilation on DMD v2.067
And thanks of course! |
@trusted bool tryLock(); | ||
@trusted void lock(); | ||
@trusted void unlock(); | ||
} |
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.
This won't work with synchronized
and really looks like an abysmal solution.
This also adds a fix for HashMap reallocation issue pointed out earlier.