Add DragonFlyBSD support : src/core/sys/posix related changes#2001
Add DragonFlyBSD support : src/core/sys/posix related changes#2001dlang-bot merged 1 commit intodlang:masterfrom
Conversation
|
Thanks for your pull request, @dkgroot! 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. |
joakim-noah
left a comment
There was a problem hiding this comment.
Skimmed for basic formatting issues and to make sure everything was scoped to version(DragonFlyBSD), found only one spurious newline removal worth changing.
| SO_NOSIGPIPE = 0x0800, /* no SIGPIPE from EPIPE */ | ||
| SO_ACCEPTFILTER = 0x1000, /* there is an accept filter */ | ||
| SO_TIMESTAMP = 0x2000, /* timestamp received dgram traffic */ | ||
|
|
There was a problem hiding this comment.
No reason to take this out.
|
Ping, @wilzbach, checked that everything was scoped to DragonFly but not for correctness. There was only a single comment on these headers when put up for review before. |
wilzbach
left a comment
There was a problem hiding this comment.
Yep, everything is scoped nicely in DragonFlyBSD blocks. However, I am rather new to the porting process, so I am leaving the decision to more experienced members.
Nevertheless I agree with you that we can't check for correctness here.
| } | ||
| else version( DragonFlyBSD ) | ||
| { | ||
| enum SIG_HOLD = cast(sigfn_t2) 3; |
There was a problem hiding this comment.
@wilzbach Can you clarify what you want me to do ?
There was a problem hiding this comment.
He's saying to just set the type of the enum, rather than casting the value. Does that work for a function pointer like this?
There was a problem hiding this comment.
Done... Thanks !
Note: if this is an important change, the other version(OS) entries do perform the same cast, so you might want to make a similar change to the other implementations (in a separate PR).
32e72eb to
ba08e51
Compare
ba08e51 to
4cbd1b8
Compare
919bc60 to
46c1fd0
Compare
src/core/sys/posix/signal.d
Outdated
| enum SIG_CATCH = cast(sigfn_t2) 2; | ||
| enum SIG_HOLD = cast(sigfn_t2) 3; | ||
| enum SIG_CATCH = 2; | ||
| enum SIG_HOLD = 3; |
There was a problem hiding this comment.
I think Sebastian meant to change this to enum sigfn_t2 SIG_CATCH = 2;, i.e. move the type from the cast to the enum declaration, but not sure if it makes any difference.
There was a problem hiding this comment.
@CyberShadow Thanks for reviewing the code :-)
I just made that change (10 minutes ago).
There was a problem hiding this comment.
I just made that change (10 minutes ago).
Unless you're talking about something else which you haven't pushed yet, then my comment was about the code you did just push. There is no type declaration in it. I don't know if it matters or not, I just wanted to clarify on Sebastian's behalf.
To clarify even further, your code goes:
enum SIG_CATCH = 2;I believe the suggested change was:
enum sigfn_t2 SIG_CATCH = 2;Hopefully that should clear things up.
There was a problem hiding this comment.
(Please: Do note that sigfn_f2 is a function pointer)
@CyberShadow That gives
"Error: cannot implicitly convert expression 2 of type int to extern (C) void function(int) nothrow @nogc"
This does work:
enum sigfn_t2 SIG_CATCH = cast(sigfn_t2) 2;
enum sigfn_t2 SIG_HOLD = cast(sigfn_t2) 3;
But I think i can just as well go back to to original definition in that case (using only the cast).
There was a problem hiding this comment.
Ping @wilzbach , @joakim-noah and @CyberShadow
Reverted the previous patch... I think the requested change might require a little more deliberation/discussion.
Source fragment (to give some context):
nothrow @nogc
{
private alias void function(int) sigfn_t2;
private alias void function(int, siginfo_t*, void*) sigactfn_t2;
}
...
else version( DragonFlyBSD )
{
enum SIG_CATCH = cast(sigfn_t2) 2;
enum SIG_HOLD = cast(sigfn_t2) 3;
...
There was a problem hiding this comment.
The way you had it initially was fine. We weren't sure if you could just apply the type to the left, but as you found, it needs to be cast.
There was a problem hiding this comment.
Thanks for the update 😉. Glad I rolled it back just before ibuclaw merged it 😙
There was a problem hiding this comment.
@CyberShadow As mentioned in the dlang/druntime PR, that does not work (compiler error), i reverted it to the original version using the cast. The PR has already been merged now. If it does need to change (now or in the future), it would have to be done in a seperate PR and should also involve the other OS implementations.
There was a problem hiding this comment.
Yes, I saw the earlier messages. No objections to that, of course.
|
@dkgroot rebase / fix up? |
2574cca to
1e63c94
Compare
ibuclaw
left a comment
There was a problem hiding this comment.
This has been approved by two other maintainers, and a quick skim looks fine to me.
|
Thanks for all your reviewing work guys ! |
|
The split shouldn't matter to any of our CIs, since we don't test DragonFlyBSD and these are all scoped. I'm not sure what's up with the single D project that fails, unit-threaded, guessing that's unrelated to this PR. |
|
I saw some issues in the Autotester on its windows slaves complaining about these prs. Not 100% what was causing the issue. |
|
Let us know about spurious failures in #ci |
|
@wilzbach will do. Looks ok at the moment |
Split PR : #1999
Moved the src/core/sys/posix related changes into this PR