www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Bootstrapped D to OpenBSD; need help with (hopefully!) the last push

reply Brian <bcallah openbsd.org> writes:
Hello all --

I hope this is the right part of the forum (if not please let me 
know).

I was able to successfully build GDC on OpenBSD. I used the tip 
of the GCC tree.
I was then able to build both LDC and DMD with GDC.

On my GitHub account, I set up forks for each of dmd, druntime, 
and phobos.  I have also committed the current WIP to each (in 
branches dmd-openbsd, druntime-openbsd, and phobos-openbsd):
https://github.com/ibara/dmd
https://github.com/ibara/druntime
https://github.com/ibara/phobos
I am aware that much of this is ugly. Happy to fix as needed to 
get it into shape.

I also placed a bootstrap dmd for openbsd-64 in the dmd repo as 
well:
https://github.com/ibara/dmd/releases/tag/bootstrap

All three compilers are able to successfully build a hello world 
(https://en.wikibooks.org/wiki/D_(The_Programming_Language)/d2/Hello,_World!)
and dub.

dub init works fine. Using dub to build and run the skeleton 
project also works fine. However, dub fetch (or anything using 
network access, really) causes dub to segfault. The backtrace can 
be found in the same place as the bootstrap dmd:
https://github.com/ibara/dmd/releases/tag/bootstrap (dub-gdb.txt)

I am happy to provide any other information or code needed to get 
D fully working. I am new to the D world, and I'd both like to be 
able to use D on OpenBSD as well as offer a package of dmd to our 
users (I am an OpenBSD developer) once this (hopefully last!) 
issue is overcome.

I am aware of other OpenBSD efforts on this forum. However, the 
code repos for some of those efforts appear to have gone to the 
great bitbucket in the sky.
Mar 12 2021
next sibling parent James Blachly <james.blachly gmail.com> writes:
On 3/12/21 5:55 PM, Brian wrote:
 Hello all --
 
 I hope this is the right part of the forum (if not please let me know).
 
 I was able to successfully build GDC on OpenBSD. I used the tip of the 
 GCC tree.
 I was then able to build both LDC and DMD with GDC.
Awesome, thank you!
 dub init works fine. Using dub to build and run the skeleton project 
 also works fine. However, dub fetch (or anything using network access, 
 really) causes dub to segfault. The backtrace can be found in the same 
 place as the bootstrap dmd:
 https://github.com/ibara/dmd/releases/tag/bootstrap (dub-gdb.txt)
 
Interestingly, the segfault appears not to be in network code but here: std.regex.RegexMatch!(char[]).RegexMatch.this!(std.regex.internal.ir.Regex!(char) Regex).this(char[], std.regex.internal.ir.Regex!(char).Regex) () when parsing the header. based on the backtrace.
Mar 12 2021
prev sibling parent reply Walter Bright <newshound2 digitalmars.com> writes:
On 3/12/2021 2:55 PM, Brian wrote:
 I am aware of other OpenBSD efforts on this forum. However, the code repos for 
 some of those efforts appear to have gone to the great bitbucket in the sky.
This is nice work, thank you! Even though the D Foundation doesn't officially support OpenBSD, the changes needed to support it are welcome in the official dlang repository. Please submit PRs for your changes! (That way they won't go that great bitbucket in the sky!)
Mar 13 2021
parent Brian <bcallah openbsd.org> writes:
On Saturday, 13 March 2021 at 20:34:37 UTC, Walter Bright wrote:
 On 3/12/2021 2:55 PM, Brian wrote:
 I am aware of other OpenBSD efforts on this forum. However, 
 the code repos for some of those efforts appear to have gone 
 to the great bitbucket in the sky.
This is nice work, thank you! Even though the D Foundation doesn't officially support OpenBSD, the changes needed to support it are welcome in the official dlang repository. Please submit PRs for your changes! (That way they won't go that great bitbucket in the sky!)
Thanks Walter. I will tidy up what I have and send some PRs your way.
Mar 13 2021