Jump to page: 1 2 3
Thread overview
Building DMD on OpenBSD
Jul 16, 2017
Anonymous
Jul 16, 2017
Seb
Jul 16, 2017
Anonymous
Jul 16, 2017
Seb
Jul 16, 2017
Anonymous
Jul 17, 2017
Joakim
Jul 17, 2017
Anonymous
Jul 17, 2017
Joakim
Jul 17, 2017
Anonymous
Jul 17, 2017
Joakim
Jul 18, 2017
Kai Nacke
Jul 18, 2017
Anonymous
Dec 26, 2018
Ryan
Dec 28, 2018
Seb
Dec 28, 2018
Ryan
Dec 28, 2018
Iain Buclaw
Dec 28, 2018
Thomas Mader
Dec 28, 2018
Ryan
Dec 28, 2018
Iain Buclaw
Jan 02, 2019
Thomas Mader
Jan 14, 2019
Ryan
Jan 19, 2019
Ryan
Jan 26, 2019
Ryan
Jul 17, 2017
Jonathan M Davis
July 16, 2017
I did some googling (well, duckduckgoing) and found a few posts on this forum indicating that this could work. So I gave it a try and followed https://wiki.dlang.org/Building_under_Posix
The build failed because src/posix.mak in the dmd repo was trying to download http://downloads.dlang.org/releases/2.x/2.072.2/dmd.2.072.2.openbsd.tar.xz which doesn't exist. What do I do now?

OTOH it's a good thing that the build failed. When I saw http:// instead of https:// in the console output I went to check what the makefile was doing and - wait for it - it was trying to download an executable from the internet and run it. I couldn't believe my eyes. I mean, you sure can use an unencrypted channel but then you need some kind of cryptographic signature to verify the downloaded file. I tried the above with 2.074.1 (the latest stable) but the trunk version has this too.

July 16, 2017
On Sunday, 16 July 2017 at 19:00:32 UTC, Anonymous wrote:
> I did some googling (well, duckduckgoing) and found a few posts on this forum indicating that this could work. So I gave it a try and followed https://wiki.dlang.org/Building_under_Posix
> The build failed because src/posix.mak in the dmd repo was trying to download http://downloads.dlang.org/releases/2.x/2.072.2/dmd.2.072.2.openbsd.tar.xz which doesn't exist. What do I do now?
>
> OTOH it's a good thing that the build failed. When I saw http:// instead of https:// in the console output I went to check what the makefile was doing and - wait for it - it was trying to download an executable from the internet and run it. I couldn't believe my eyes. I mean, you sure can use an unencrypted channel but then you need some kind of cryptographic signature to verify the downloaded file. I tried the above with 2.074.1 (the latest stable) but the trunk version has this too.

Auto-bootstrapping is __only__ used if no host compiler is found on the system.
This should only happen on esoteric platforms (not intended as an offense) like yours.
There are usually plenty of ways to get your host compiler safely:

http://dlang.org/download.html

The simplest one on a Posix system is:

curl -fsS https://dlang.org/install.sh | bash -s dmd

If you have GPG, it will verify the integrity of the downloaded archive.

In any case, I submitted a PR to use SSL for AUTO_BOOSTRAP:

https://github.com/dlang/dmd/pull/7000
July 16, 2017
On Sunday, 16 July 2017 at 19:47:20 UTC, Seb wrote:
> Auto-bootstrapping is __only__ used if no host compiler is found on the system.
> This should only happen on esoteric platforms (not intended as an offense) like yours.

So I should use digger then? I looked through its repo briefly and I can't really tell if I'm gonna run into the same issue or not.
I guess another option is to build GDC and then use it to build DMD.

> In any case, I submitted a PR to use SSL for AUTO_BOOSTRAP:
>
> https://github.com/dlang/dmd/pull/7000

Thanks.

July 16, 2017
On Sunday, 16 July 2017 at 21:05:53 UTC, Anonymous wrote:
> On Sunday, 16 July 2017 at 19:47:20 UTC, Seb wrote:
>> Auto-bootstrapping is __only__ used if no host compiler is found on the system.
>> This should only happen on esoteric platforms (not intended as an offense) like yours.
>
> So I should use digger then? I looked through its repo briefly and I can't really tell if I'm gonna run into the same issue or not.
> I guess another option is to build GDC and then use it to build DMD.

Yes digger could work, but it's written in D and you would need to build it on a different OS.
How about simply building the bootstrap binary yourself then?
I think 2.067 is the last version that's still written in C++:

https://github.com/dlang/dmd/tree/2.067

PS: Do you manually insert the HTML codes? They are escaped.
July 16, 2017
On Sunday, 16 July 2017 at 21:37:12 UTC, Seb wrote:
> How about simply building the bootstrap binary yourself then?
> I think 2.067 is the last version that's still written in C++:
>
> https://github.com/dlang/dmd/tree/2.067

Yep, that should work. I believe this should be put somewhere on the wiki because otherwise bootstrapping is hard to figure out.

> PS: Do you manually insert the HTML codes? They are escaped.

I noticed them added after a redirect to the captcha page (I'm using tor).

July 17, 2017
On Sunday, 16 July 2017 at 22:40:18 UTC, Anonymous wrote:
> On Sunday, 16 July 2017 at 21:37:12 UTC, Seb wrote:
>> How about simply building the bootstrap binary yourself then?
>> I think 2.067 is the last version that's still written in C++:
>>
>> https://github.com/dlang/dmd/tree/2.067
>
> Yep, that should work. I believe this should be put somewhere on the wiki because otherwise bootstrapping is hard to figure out.

The wiki does explain that you need a bootstrap compiler, it tells you what will be done.  Unfortunately, it doesn't explain that the auto-bootstrap will not work for OpenBSD, because we don't put out builds for that OS.  The only BSD we regularly put out builds for is FreeBSD.  I will update the wiki page to say that.

As for bootstrapping, it appears that we have not documented it anywhere on the wiki, I'll add some info on that.  The last dmd we released that was written in C++ was 2.067, for which you can still check out the branch.  You'd have to build that bootstrap compiler 2.067 first, then worry about the latest dmd.

Since we don't regularly build for OpenBSD, it's possible that support has slipped behind.  Usually, it's as easy as adding OpenBSD to a couple more #ifdefs, but sometimes you need to adapt the dmd source also for a rarely used platform like OpenBSD.
July 17, 2017
On Sunday, July 16, 2017 19:00:32 Anonymous via Digitalmars-d wrote:
> I did some googling (well, duckduckgoing) and found a few posts
> on this forum indicating that this could work. So I gave it a try
> and followed https://wiki.dlang.org/Building_under_Posix
> The build failed because src/posix.mak in the dmd repo was trying
> to download
> http://downloads.dlang.org/releases/2.x/2.072.2/dmd.2.072.2.openbsd.tar.xz
> which doesn't exist. What do I do now?
>
> OTOH it's a good thing that the build failed. When I saw http:// instead of https:// in the console output I went to check what the makefile was doing and - wait for it - it was trying to download an executable from the internet and run it. I couldn't believe my eyes. I mean, you sure can use an unencrypted channel but then you need some kind of cryptographic signature to verify the downloaded file. I tried the above with 2.074.1 (the latest stable) but the trunk version has this too.

I'm pretty sure that druntime would need to be updated before you'd get much of anywhere with OpenBSD. dmd _might_ work as-is, depending on what's missing in druntime, but all of the various bindings would need to be updated. grepping druntime, it does look like there are a number of version blocks checking OpenBSD, but nowhere near as many as FreeBSD or linux. So, to have the same level of functionality, I'd expect that more places would need to be doing else version(OpenBSD) and doing the right thing for OpenBSD, but I don't know how many would be required to get off the ground so to speak. Clearly, someone put in some time and effort towards getting OpenBSD working, but I have no idea how close they got. Most of the missing bindings would probably be pretty close to what's in the FreeBSD version blocks though. Most of the time, the tedium with getting the system bindings set up for a new POSIX system is going over each section and making sure that when it's created, the bindings match the new system. They're generally _very_ close but slightly different - which is why they aren't just put under version(Posix) and left at that.

- Jonathan M Davis

July 17, 2017
On Monday, 17 July 2017 at 09:58:42 UTC, Joakim wrote:
> The last dmd we released that was written in C++ was 2.067, for which you can still check out the branch.  You'd have to build that bootstrap compiler 2.067 first, then worry about the latest dmd.
>
> Since we don't regularly build for OpenBSD, it's possible that support has slipped behind.  Usually, it's as easy as adding OpenBSD to a couple more #ifdefs, but sometimes you need to adapt the dmd source also for a rarely used platform like OpenBSD.

I managed to build the bootstrap dmd without any trouble. Btw the wiki page doesn't mention that the dependency is *GNU* Make which is typically installed as gmake on BSDs. Then I tried building the new dmd and got (in dmd/src):

CC=c++ dmd -of../generated/openbsd/release/64/idgen ddmd/idgen.d
Error: cannot find source code for runtime library file 'object.d'
       dmd might not be correctly installed. Run 'dmd -man' for installation instructions.
       config file: /etc/dmd.conf
Specify path to file 'object.d' with -I switch
gmake[1]: *** [posix.mak:437: ../generated/openbsd/release/64/idgen] Error 1

Now I'm trying to figure out the /etc/dmd.conf business. I found ini/freebsd/bin64/dmd.conf in the 2.067 dmd folder so I guess I'll start from there. Thanks for the help so far.

July 17, 2017
On Monday, 17 July 2017 at 16:45:28 UTC, Anonymous wrote:
> On Monday, 17 July 2017 at 09:58:42 UTC, Joakim wrote:
>> The last dmd we released that was written in C++ was 2.067, for which you can still check out the branch.  You'd have to build that bootstrap compiler 2.067 first, then worry about the latest dmd.
>>
>> Since we don't regularly build for OpenBSD, it's possible that support has slipped behind.  Usually, it's as easy as adding OpenBSD to a couple more #ifdefs, but sometimes you need to adapt the dmd source also for a rarely used platform like OpenBSD.
>
> I managed to build the bootstrap dmd without any trouble. Btw the wiki page doesn't mention that the dependency is *GNU* Make which is typically installed as gmake on BSDs. Then I tried building the new dmd and got (in dmd/src):
>
> CC=c++ dmd -of../generated/openbsd/release/64/idgen ddmd/idgen.d
> Error: cannot find source code for runtime library file 'object.d'
>        dmd might not be correctly installed. Run 'dmd -man' for installation instructions.
>        config file: /etc/dmd.conf
> Specify path to file 'object.d' with -I switch
> gmake[1]: *** [posix.mak:437: ../generated/openbsd/release/64/idgen] Error 1
>
> Now I'm trying to figure out the /etc/dmd.conf business. I found ini/freebsd/bin64/dmd.conf in the 2.067 dmd folder so I guess I'll start from there. Thanks for the help so far.

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.
July 17, 2017
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.

« First   ‹ Prev
1 2 3