Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.
/ druntime Public archive

Comments

Add DragonFlyBSD support : src/core/sys/posix related changes#2001

Merged
dlang-bot merged 1 commit intodlang:masterfrom
dkgroot:dragonfly-core.sys.posix
Jan 6, 2018
Merged

Add DragonFlyBSD support : src/core/sys/posix related changes#2001
dlang-bot merged 1 commit intodlang:masterfrom
dkgroot:dragonfly-core.sys.posix

Conversation

@dkgroot
Copy link
Contributor

@dkgroot dkgroot commented Dec 19, 2017

Split PR : #1999
Moved the src/core/sys/posix related changes into this PR

@dlang-bot
Copy link
Contributor

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:

  • smaller, focused PRs are easier to review than big ones

  • try not to mix up refactoring or style changes with bug fixes or feature enhancements

  • provide helpful commit messages explaining the rationale behind each change

Bear in mind that large or tricky changes may require multiple rounds of review and revision.

Please see CONTRIBUTING.md for more information.

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

Copy link
Contributor

@joakim-noah joakim-noah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 */

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No reason to take this out.

@joakim-noah
Copy link
Contributor

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.

Copy link
Contributor

@wilzbach wilzbach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enum sigfn_t2

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wilzbach Can you clarify what you want me to do ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

@dlang-bot dlang-bot added Needs Work Needs Rebase needs a `git rebase` performed and removed Needs Rebase needs a `git rebase` performed labels Jan 2, 2018
@dkgroot dkgroot force-pushed the dragonfly-core.sys.posix branch from 32e72eb to ba08e51 Compare January 3, 2018 16:59
@dkgroot dkgroot force-pushed the dragonfly-core.sys.posix branch from ba08e51 to 4cbd1b8 Compare January 3, 2018 17:30
@dkgroot dkgroot force-pushed the dragonfly-core.sys.posix branch from 919bc60 to 46c1fd0 Compare January 4, 2018 19:11
enum SIG_CATCH = cast(sigfn_t2) 2;
enum SIG_HOLD = cast(sigfn_t2) 3;
enum SIG_CATCH = 2;
enum SIG_HOLD = 3;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

@dkgroot dkgroot Jan 5, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@CyberShadow Thanks for reviewing the code :-)
I just made that change (10 minutes ago).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

@dkgroot dkgroot Jan 6, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(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).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;
...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update 😉. Glad I rolled it back just before ibuclaw merged it 😙

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I saw the earlier messages. No objections to that, of course.

@ibuclaw
Copy link
Member

ibuclaw commented Jan 5, 2018

@dkgroot rebase / fix up?

@dkgroot dkgroot force-pushed the dragonfly-core.sys.posix branch from 2574cca to 1e63c94 Compare January 6, 2018 12:28
Copy link
Member

@ibuclaw ibuclaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been approved by two other maintainers, and a quick skim looks fine to me.

@dlang-bot dlang-bot merged commit c8eaa49 into dlang:master Jan 6, 2018
@dkgroot
Copy link
Contributor Author

dkgroot commented Jan 6, 2018

Thanks for all your reviewing work guys !
@ibuclaw: Because this was part of a split druntime PR, this merge might have a slight side effect of causing trouble with CI's until the other two parts are also merged.

@joakim-noah
Copy link
Contributor

joakim-noah commented Jan 6, 2018

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.

@dkgroot
Copy link
Contributor Author

dkgroot commented Jan 6, 2018

I saw some issues in the Autotester on its windows slaves complaining about these prs. Not 100% what was causing the issue.

@wilzbach
Copy link
Contributor

wilzbach commented Jan 6, 2018

Let us know about spurious failures in #ci

@dkgroot
Copy link
Contributor Author

dkgroot commented Jan 6, 2018

@wilzbach will do. Looks ok at the moment

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants