Building DMD on OpenBSD

Ryan ryan at boggshome.net
Mon Jan 14 15:34:21 UTC 2019


On Wednesday, 2 January 2019 at 21:38:19 UTC, Thomas Mader wrote:
> On Friday, 28 December 2018 at 21:52:30 UTC, Ryan wrote:
>> ugh, I can see that sort of setup becoming cumbersome to 
>> maintain overtime in the OpenBSD ports world.  Maybe using 
>> 2.068 as the bootstrapper isn't the best approach after all.
>
> I decided against a multi level bootstrap process in NixOS 
> because it increases the build time immensely.
> In NixOS every dependent package is automatically rebuild if 
> only the slightest change is happening in the base package.
> The more levels the more complex it gets.
>
>> I looked around a bit more and I found some initial work 
>> porting ldc to OpenBSD.  It's old and doesn't look like it has 
>> been touched in a while but it is a start.  There are some 
>> patches in there as well.  They may need some updating but 
>> it's good to know what is needed.
>
> I don't know nothing about OpenBSD. What is the problem with 
> packaging LDC? What makes the packaging in OpenBSD so special?
Nothing really.  It's about the same as trying to get LDC to work 
on a new OS that LDC doesn't know about yet.
>
>> Using LDC as the bootstrapper may be best approach after all, 
>> if it can bootstrap dmd.  If so, we could potentially use LDC 
>> 0.17.6 not only to boot strap dmd but the main version of LDC 
>> as well.  Thus killing two birds with one stone.  Unless there 
>> are other thoughts or considerations, I think I will try the 
>> ldc bootstrap route.
>
> In NixOS I use LDC 0.17.6 to bootstrap the latest LDC version 
> and then the latest LDC version to bootstrap dmd.
> For now it seems that the LDC maintainers find it important to 
> keep the bootstrapping version 0.17.x working as there are new 
> versions every now and then.
> If you want to have LDC and dmd, which is not a bad idea 
> anyway, you are probably spending your time the most effective 
> way possible currently.
> Bootstrapping dmd with dmd doesn't have a fixed N as nobody 
> cares really hard about the version required to build the 
> latest version. Because of this it's quite obvious that N will 
> grow in the near future as people might want/need newer 
> features to implement stuff in the dmd frontend or backend.
This is what I am doing at the moment.  It's taking time because 
there are OS specific items that need to be added to LDC (mainly 
druntime so far) for it to work on OpenBSD.

Just to bring everyone else up to speed on this. I'm currently 
focused on porting over LDC 0.17.6 as a bootstrap port for 
OpenBSD. I have a working Makefile on OpenBSD ports but the
build is currently bombing on the DRuntime build, which was 
expected based on conversations with the person who initially 
started porting this about a year ago.  I'm trying to build 
patches to get DRuntime to build but it is a slow process, as you 
can imagine.

Quick question for those in the know:
I'm working on patching sys/signal.d for this and there is a 
struct in here called "sigstack" that seems to need defining.  
However, the struct doesn't seem to exist on OpenBSD.  Does 
anyone know if this struct is actually required or is there a 
known alternative that I can try?


More information about the Digitalmars-d mailing list