July 17, 2017
On Monday, 17 July 2017 at 18:42:39 UTC, Anonymous wrote:
> On Monday, 17 July 2017 at 17:18:23 UTC, Joakim wrote:
>> Unfortunately, dmd has not kept porters in mind and hasn't kept the C++ version updated, or kept a workflow that enables easy bootstrapping:
>>
>> http://forum.dlang.org/thread/xgtbpcvbikxlilanrzqa@forum.dlang.org
>>
>> You will have to build druntime and phobos for 2.067 also and collect it all in a different location, which you could invoke to bootstrap a new dmd.  You may run into issues related to D/C++ integration when building the latest dmd, as that hasn't been tested on OpenBSD, only FreeBSD.
>>
>> Why do you want the latest dmd on OpenBSD?  I ask because it will likely require some work, though likely not a lot.
>
> I've already tried building 2.067 druntime by mistake and run into problems. Most are resolvable by just adding TARGET_OPENBSD next to TARGET_FREEBSD. But yeah, it's gonna take some work. I want it because I'm using OpenBSD as my main OS and I have a project that I want to port to D.
>
> Btw I should've built the `install` target (got confused by the wiki). Now I get:
>
> cp: ../ini/openbsd/bin64/dmd.conf: No such file or directory
>
> which is more understandable.

Alright, there was a contributor who recently got ldc working on NetBSD, take a look at his PRs as a guide for what you'll likely have to do:

https://github.com/dlang/dmd/pulls?q=is%3Apr+author%3AnrTQgc
https://github.com/dlang/druntime/pulls?q=is%3Apr+author%3AnrTQgc
https://github.com/dlang/phobos/pulls?q=is%3Apr+author%3AnrTQgc

OpenBSD PRs welcome! :)

In the meantime, you can see that I've raised this bootstrap issue internally and hopefully we can make it easier for future porters.
July 18, 2017
On Monday, 17 July 2017 at 18:58:40 UTC, Joakim wrote:
> On Monday, 17 July 2017 at 18:42:39 UTC, Anonymous wrote:
>> On Monday, 17 July 2017 at 17:18:23 UTC, Joakim wrote:
>>> Unfortunately, dmd has not kept porters in mind and hasn't kept the C++ version updated, or kept a workflow that enables easy bootstrapping:
>>>
>>> http://forum.dlang.org/thread/xgtbpcvbikxlilanrzqa@forum.dlang.org
>>>
>>> You will have to build druntime and phobos for 2.067 also and collect it all in a different location, which you could invoke to bootstrap a new dmd.  You may run into issues related to D/C++ integration when building the latest dmd, as that hasn't been tested on OpenBSD, only FreeBSD.
>>>
>>> Why do you want the latest dmd on OpenBSD?  I ask because it will likely require some work, though likely not a lot.
>>
>> I've already tried building 2.067 druntime by mistake and run into problems. Most are resolvable by just adding TARGET_OPENBSD next to TARGET_FREEBSD. But yeah, it's gonna take some work. I want it because I'm using OpenBSD as my main OS and I have a project that I want to port to D.
>>
>> Btw I should've built the `install` target (got confused by the wiki). Now I get:
>>
>> cp: ../ini/openbsd/bin64/dmd.conf: No such file or directory
>>
>> which is more understandable.
>
> Alright, there was a contributor who recently got ldc working on NetBSD, take a look at his PRs as a guide for what you'll likely have to do:
>
> https://github.com/dlang/dmd/pulls?q=is%3Apr+author%3AnrTQgc
> https://github.com/dlang/druntime/pulls?q=is%3Apr+author%3AnrTQgc
> https://github.com/dlang/phobos/pulls?q=is%3Apr+author%3AnrTQgc
>
> OpenBSD PRs welcome! :)
>
> In the meantime, you can see that I've raised this bootstrap issue internally and hopefully we can make it easier for future porters.

:-)

In master there is already some OpenBSD support. Some time ago I worked on druntime support but I still need to finish this. Mostly there is nothing magic here - just translating the header files. The only non-obvious work is required for the module/shared library stuff (in rt.sections). If there is an OpenBSD expert around who can help here it would be nice.

Regards,
Kai
July 18, 2017
On Tuesday, 18 July 2017 at 05:11:30 UTC, Kai Nacke wrote:
> In master there is already some OpenBSD support. Some time ago I worked on druntime support but I still need to finish this. Mostly there is nothing magic here - just translating the header files. The only non-obvious work is required for the module/shared library stuff (in rt.sections). If there is an OpenBSD expert around who can help here it would be nice.

Maybe talk to OpenBSD porters on their mailing list. I'll put my stuff on github as soon as I can.

December 26, 2018
On Tuesday, 18 July 2017 at 21:01:24 UTC, Anonymous wrote:
> On Tuesday, 18 July 2017 at 05:11:30 UTC, Kai Nacke wrote:
>> In master there is already some OpenBSD support. Some time ago I worked on druntime support but I still need to finish this. Mostly there is nothing magic here - just translating the header files. The only non-obvious work is required for the module/shared library stuff (in rt.sections). If there is an OpenBSD expert around who can help here it would be nice.
>
> Maybe talk to OpenBSD porters on their mailing list. I'll put my stuff on github as soon as I can.

Sorry to drag up an old post but I am also interested in getting dmd on openbsd as it is my OS for my main laptop at home.  Has there been any progress with this anywhere?  If not, I would like to give it a try.  My experience with D is currently limited but I have a decent understanding of the OpenBSD build system (I am no expert but I have ported some things to OpenBSD in the past).

I did look around a bit but I could not find any (official) instructions on how to build the bootstrap version to use to build the latest version of dmd.  Is it pretty much straight forward or are there other considerations that I need to be aware of?
December 28, 2018
On Wednesday, 26 December 2018 at 21:17:13 UTC, Ryan wrote:
> On Tuesday, 18 July 2017 at 21:01:24 UTC, Anonymous wrote:
>> On Tuesday, 18 July 2017 at 05:11:30 UTC, Kai Nacke wrote:
>>> In master there is already some OpenBSD support. Some time ago I worked on druntime support but I still need to finish this. Mostly there is nothing magic here - just translating the header files. The only non-obvious work is required for the module/shared library stuff (in rt.sections). If there is an OpenBSD expert around who can help here it would be nice.
>>
>> Maybe talk to OpenBSD porters on their mailing list. I'll put my stuff on github as soon as I can.
>
> Sorry to drag up an old post but I am also interested in getting dmd on openbsd as it is my OS for my main laptop at home.  Has there been any progress with this anywhere?  If not, I would like to give it a try.  My experience with D is currently limited but I have a decent understanding of the OpenBSD build system (I am no expert but I have ported some things to OpenBSD in the past).
>
> I did look around a bit but I could not find any (official) instructions on how to build the bootstrap version to use to build the latest version of dmd.  Is it pretty much straight forward or are there other considerations that I need to be aware of?

There's the dmd-cxx branch of DMD which was an attempt of back-porting Ian's GDC fixes to DMD. So essentially dmd-cxx is something like 2.076 (though without static foreach), but it doesn't pass the druntime nor Phobos testsuite (it might be enough to build DMD master).

The last C++-only version of DMD is 2.068, but in the meantime a lot changed.

DragonflyBSD support for DMD and LDC has been added at the end of last year (see e.g. [1] or the respective GitHub PRs). I think the process should be relatively similar:
- fixing/adding the bindings in druntime in LTS DMD or LDC, s.t. it can be compiled for DMD (you don't need Phobos to build DMD, though the build scripts might expect it as the testsuite partially requires it).
- building the last LTS version
- bootstrap yourself to master (you'll probably need to build sth. like 2.079 as an intermediate step)
- build the latest master

However, it might be possible to use LDC to cross-compile directly for OpenBSD and self yourself all this bootstrapping pain.

Good luck and don't hesitate to ask for more help here, on IRC or GitHub.

[1]: https://forum.dlang.org/post/elihnyflzlrtfavqyhth@forum.dlang.org
December 28, 2018
On Friday, 28 December 2018 at 01:28:31 UTC, Seb wrote:
> On Wednesday, 26 December 2018 at 21:17:13 UTC, Ryan wrote:
>> On Tuesday, 18 July 2017 at 21:01:24 UTC, Anonymous wrote:
>>> On Tuesday, 18 July 2017 at 05:11:30 UTC, Kai Nacke wrote:
>>>> In master there is already some OpenBSD support. Some time ago I worked on druntime support but I still need to finish this. Mostly there is nothing magic here - just translating the header files. The only non-obvious work is required for the module/shared library stuff (in rt.sections). If there is an OpenBSD expert around who can help here it would be nice.
>>>
>>> Maybe talk to OpenBSD porters on their mailing list. I'll put my stuff on github as soon as I can.
>>
>> Sorry to drag up an old post but I am also interested in getting dmd on openbsd as it is my OS for my main laptop at home.  Has there been any progress with this anywhere?  If not, I would like to give it a try.  My experience with D is currently limited but I have a decent understanding of the OpenBSD build system (I am no expert but I have ported some things to OpenBSD in the past).
>>
>> I did look around a bit but I could not find any (official) instructions on how to build the bootstrap version to use to build the latest version of dmd.  Is it pretty much straight forward or are there other considerations that I need to be aware of?
>
> There's the dmd-cxx branch of DMD which was an attempt of back-porting Ian's GDC fixes to DMD. So essentially dmd-cxx is something like 2.076 (though without static foreach), but it doesn't pass the druntime nor Phobos testsuite (it might be enough to build DMD master).
>
> The last C++-only version of DMD is 2.068, but in the meantime a lot changed.

Hi Seb,

Thanks for the reply.  My initial thought was to build two ports for OpenBSD. One specifically to boot strap using version 2.068 and the other the actual port.  golang is setup in a similar fashion in OpenBSD ports today so I thought that structure would work. Do you think it is possible to build the most recent version of dmd using 2.068 as the boostrap?  And what compiler (and compiler version) should I use?

Also, i did some checking and I think that I can also use the FreeBSD makefile as a starting point to get the bootstrapper going since there are some similarities between the two systems.  Enough to see what it takes to build anyway.
>
> DragonflyBSD support for DMD and LDC has been added at the end of last year (see e.g. [1] or the respective GitHub PRs). I think the process should be relatively similar:
> - fixing/adding the bindings in druntime in LTS DMD or LDC, s.t. it can be compiled for DMD (you don't need Phobos to build DMD, though the build scripts might expect it as the testsuite partially requires it).
> - building the last LTS version
> - bootstrap yourself to master (you'll probably need to build sth. like 2.079 as an intermediate step)
> - build the latest master

I am expecting that I will need to do some patch work while trying to port.  My plan was to submit all of my patches during this process as a pull request (or requests depending on the patches) back to dlang for review and inclusion in future releases.  But, first thing is first....
>
> However, it might be possible to use LDC to cross-compile directly for OpenBSD and self yourself all this bootstrapping pain.

This could be a nice alternative, however LDC isn't in OpenBSD ports today either.  So either route I plan to take will require bootstrapping work of some kind.
>
> Good luck and don't hesitate to ask for more help here, on IRC or GitHub.


>
> [1]: https://forum.dlang.org/post/elihnyflzlrtfavqyhth@forum.dlang.org


December 28, 2018
On Fri, 28 Dec 2018 at 03:20, Ryan via Digitalmars-d <digitalmars-d@puremagic.com> wrote:
>
> On Friday, 28 December 2018 at 01:28:31 UTC, Seb wrote:
> > On Wednesday, 26 December 2018 at 21:17:13 UTC, Ryan wrote:
> >> On Tuesday, 18 July 2017 at 21:01:24 UTC, Anonymous wrote:
> >>> On Tuesday, 18 July 2017 at 05:11:30 UTC, Kai Nacke wrote:
> >>>> In master there is already some OpenBSD support. Some time ago I worked on druntime support but I still need to finish this. Mostly there is nothing magic here - just translating the header files. The only non-obvious work is required for the module/shared library stuff (in rt.sections). If there is an OpenBSD expert around who can help here it would be nice.
> >>>
> >>> Maybe talk to OpenBSD porters on their mailing list. I&apos;ll put my stuff on github as soon as I can.
> >>
> >> Sorry to drag up an old post but I am also interested in getting dmd on openbsd as it is my OS for my main laptop at home.  Has there been any progress with this anywhere?  If not, I would like to give it a try.  My experience with D is currently limited but I have a decent understanding of the OpenBSD build system (I am no expert but I have ported some things to OpenBSD in the past).
> >>
> >> I did look around a bit but I could not find any (official) instructions on how to build the bootstrap version to use to build the latest version of dmd.  Is it pretty much straight forward or are there other considerations that I need to be aware of?
> >
> > There's the dmd-cxx branch of DMD which was an attempt of back-porting Ian's GDC fixes to DMD. So essentially dmd-cxx is something like 2.076 (though without static foreach), but it doesn't pass the druntime nor Phobos testsuite (it might be enough to build DMD master).
> >
> > The last C++-only version of DMD is 2.068, but in the meantime a lot changed.
>
> Hi Seb,
>
> Thanks for the reply.  My initial thought was to build two ports for OpenBSD. One specifically to boot strap using version 2.068 and the other the actual port.  golang is setup in a similar fashion in OpenBSD ports today so I thought that structure would work. Do you think it is possible to build the most recent version of dmd using 2.068 as the boostrap?  And what compiler (and compiler version) should I use?
>

Strictly speaking, the last C++ version of DMD was 2.067, as idgen and impcnvgen were converted prior to the rest of the codebase (however, it's trivial to generate id.{c,h} and impcnvtab.c ahead of time).

If you're using 2.068 as a bootstrap, you'll have to make two jumps in order to get to the latest release, 2.068 -> 2.076 -> 2.084.  You can then keep 2.076 around as the baseline for building latter versions, which should be remain true for the next year or so before the next minimum version bump.

> >
> > However, it might be possible to use LDC to cross-compile directly for OpenBSD and self yourself all this bootstrapping pain.
>
> This could be a nice alternative, however LDC isn't in OpenBSD ports today either.  So either route I plan to take will require bootstrapping work of some kind.

What about gcc? Granted there will be one patch you'll need to apply to the compiler to add relevant OpenBSD versions, pthread_mutex_t sizes, etc... the rest should be only be adding druntime bindings.

-- 
Iain
December 28, 2018
On Friday, 28 December 2018 at 12:02:48 UTC, Iain Buclaw wrote:
> If you're using 2.068 as a bootstrap, you'll have to make two jumps in order to get to the latest release, 2.068 -> 2.076 -> 2.084.  You can then keep 2.076 around as the baseline for building latter versions, which should be remain true for the next year or so before the next minimum version bump.

I use ldc 0.17.6 to bootstrap directly to the latest ldc version.
I haven't tried it myself but it might be possible to bootstrap dmd directly from ldc 0.17.6.
December 28, 2018
On Friday, 28 December 2018 at 16:37:14 UTC, Thomas Mader wrote:
> On Friday, 28 December 2018 at 12:02:48 UTC, Iain Buclaw wrote:
>> If you're using 2.068 as a bootstrap, you'll have to make two jumps in order to get to the latest release, 2.068 -> 2.076 -> 2.084.  You can then keep 2.076 around as the baseline for building latter versions, which should be remain true for the next year or so before the next minimum version bump.

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 use ldc 0.17.6 to bootstrap directly to the latest ldc version.
> I haven't tried it myself but it might be possible to bootstrap dmd directly from ldc 0.17.6.

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.

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.




December 28, 2018
On Fri, 28 Dec 2018 at 22:55, Ryan via Digitalmars-d <digitalmars-d@puremagic.com> wrote:
>
> On Friday, 28 December 2018 at 16:37:14 UTC, Thomas Mader wrote:
> > On Friday, 28 December 2018 at 12:02:48 UTC, Iain Buclaw wrote:
> >> If you're using 2.068 as a bootstrap, you'll have to make two jumps in order to get to the latest release, 2.068 -> 2.076 -> 2.084.  You can then keep 2.076 around as the baseline for building latter versions, which should be remain true for the next year or so before the next minimum version bump.
>
> 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.

Well, you only need to bootstrap it once, and when you have the 2.076 compiler built, you just keep those binaries around, there's no need to use the 2.068 sources ever again.

Hopefully the dmd CI covers that version of ldc.  Though if it's based on 2.068, your mileage may vary, as the source code is not compatible with that version anymore.

Good luck!