Add DragonFlyBSD support for phobos#5941
Conversation
Exclude assertion for dragonfly in std/experimental/allocator/mallocator.d (Needs further investigation, not sure why alliagned_realloc is causing trouble) cleanup in std/datetime/timezone.d
Notes: - Exclude assertion for dragonfly in std/experimental/allocator/mallocator.d (Needs further investigation, not sure why alliagned_realloc is causing trouble)
…dragonflybsd-master
|
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 references
|
wilzbach
left a comment
There was a problem hiding this comment.
Thanks a lot for making this happen! A quick, initial review ;-)
posix.mak
Outdated
| # OS can be linux, win32, win32wine, osx, freebsd, netbsd or dragonflybsd. The system will be | ||
| # determined by using uname | ||
|
|
||
| #QUIET:=@ |
There was a problem hiding this comment.
Any reason for this to be added?
There was a problem hiding this comment.
It was needed while debugging, accidentally committed. Retracted now.
posix.mak
Outdated
| # Configurable stuff, usually from the command line | ||
| # | ||
| # OS can be linux, win32, win32wine, osx, or freebsd. The system will be | ||
| # OS can be linux, win32, win32wine, osx, freebsd, netbsd or dragonflybsd. The system will be |
There was a problem hiding this comment.
Nit: break it at 80 chars here (i.e. after dragonflybsd).
std/conv.d
Outdated
|
|
||
| // Test attribute propagation for UDTs | ||
| pure nothrow @safe /* @nogc */ unittest | ||
| pure nothrow @safe /+@nogc+/ unittest |
There was a problem hiding this comment.
Unrelated change - remove?
There was a problem hiding this comment.
Made it easier to exclude ranges of unittests, while trying to track down a particular issue.
But reverting the change.
| } | ||
| else version (DragonFlyBSD) | ||
| { | ||
| asm pure nothrow @nogc // assembler by W. Bright |
There was a problem hiding this comment.
For the record: I'm not a huge fan of copying blocks as this means a bug fix will very likely miss one of these bits.
Anyhow as far as I know is Walter a huge proponent of using version(A) and not of static if( A || B)
There was a problem hiding this comment.
I completely agree. I did see this 'argument' pop up several time in different PR's and Forum discussions. I even wanted to suggest a generic 'BSD' version flag, as they all have common origins, similar to the 'Posix' version. But i did not want to reopen this discussion.
There was a problem hiding this comment.
Or maybe we do away with the asm implementation and implement a better poly algorithm.
There was a problem hiding this comment.
It's possible too to put the implementation in a token string enum polyAsm = q{ asm pure nothrow @nogc { ... } }; and to mix it
There was a problem hiding this comment.
I think this discussion should be had outside this PR. Sounds more like a structural (ie ASM) discussion, than pertaining to this particular PR (correct ?).
| } | ||
| else version(DragonFlyBSD) | ||
| { | ||
| auto nameStr = "hw.ncpu\0".ptr; |
There was a problem hiding this comment.
Off topic: this looks like a very old style. IIRC are strings literals always zero-terminated?
There was a problem hiding this comment.
Don't know, maybe someone else can answer this one.
There was a problem hiding this comment.
Yes, that's true, the string literals are always zero-terminated. I was wondering if something is also doing nameStr.length in which case it makes sense putting this \0 but it doesn't look like it.
There was a problem hiding this comment.
@nemanja-boric-sociomantic
So should i rewrite this to: auto nameStr = "hw.ncpu".ptr;, or just leave it as is.
The surrounding lines are doing the same, though. and i do not want to correct them (Only DragonFlyBSD related lines should be touched in this PR).
There was a problem hiding this comment.
I would leave them as is IMHO and do this separately (meaning just leave the "hw.ncpu\0".
…dragonflybsd-master
Notes: - FIXME message related to dragonfly malloc issue (issue reported on upstream dragonfly issue database)
jmdavis
left a comment
There was a problem hiding this comment.
The std.datetime portions definitely look fine, and I don't see any issues in the other changes either. It'll be nice to see another BSD added to the list of systems that work with D.
PetarKirov
left a comment
There was a problem hiding this comment.
Overall everything looks good to me, except for two changes, that I would prefer if you could figure out why they are needed.
std/regex/internal/parser.d
Outdated
| {//@@@BUG@@@ write is @system | ||
| with(zis) | ||
| { | ||
| import std.regex.internal.kickstart; |
There was a problem hiding this comment.
Are you sure that this import is needed? I wonder why it hasn't shown up as problem on other platforms.
There was a problem hiding this comment.
I had some trouble in line 1095 when running without this added import. I will recheck.
There was a problem hiding this comment.
Looks like the issue was resolved (possible/maybe by the git rebase i did before committing the PR). Will remove the import.
Thanks for finding this one.
| assert(c.ptr); | ||
|
|
||
| version (DragonFlyBSD) {} else /* FIXME: assertion below fails, have not been able to figure out why, yet */ | ||
| assert(!AlignedMallocator.instance.alignedReallocate(c, size_t.max, 4096)); |
There was a problem hiding this comment.
If this assert fails it follows that alignedReallocate successfully called posix_memalign, allocating more virtual memory than what could be reasonably available on the system. Can you try to debug this test and see what exactly breaks down?
There was a problem hiding this comment.
Reported this error to dragonfly (dragonfly bug report)
See PR Discussion
Will update this entry to add both these links, so the issue can be tracked.
|
@ZombineDev Thanks for Reviewing BTW |
PetarKirov
left a comment
There was a problem hiding this comment.
Thanks @dkgroot for the swift reply and changes. Please squash your commits into one and this PR will be good to go.
|
@ZombineDev Thanks for the review. I guess i will still have to wait a little, to allow other to review, before squashing, right ? How do you guys normally like to see this squash done, using 'rebase -i HEAD~5'? |
|
@dkgroot. Yes, git rebase and then fix up all commits into one. Amending the original commit message if necessary. |
|
I think the PR is good to go, so we don't need to wait more. I prefer doing squashing with |
|
@ZombineDev I did the |
|
Just do |
|
@dkgroot Yes, as @nemanja-boric-sociomantic said, first rebase your branch on top of upstream master and then squash it. (Sorry for not mentioning this before.) |
aa3822f to
cae4a30
Compare
|
I see you lost all of your commits :-). |
|
@dkgroot what I do when I have unrelated commits in my PR is I remove them during |
|
@dkgroot you may want to send me email (see http://erdani.com/index.php/contact) and I'll invite you to https://dlang.slack.com. Then you can get community help in real time via text chat in the browser. |
|
@andralex - He is already on slack. :-) |
|
Sorry for the 'git mess' I created. Accoding to @Geod24 it is merge able as is, so leaving it alone for now. |
|
Thanks for the work and many thanks to the reviewers! I'll do the honors unless someone beats me to it. |
|
Oh, was too hasty - many commits. Will undo this. |
|
Thanks a lot everyone for the help / review / git stuff and the final merge ! |
|
Thanks for your contribution.
Well a missing squash isn't the end of the world, it's only a single merge commit on master after all. |
Related:
Bootstrapped via 'dmd-cxx' branch: See
Notes: