www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - What is up with building DMD (et al.) on Windows?

reply Jeremy DeHaan <dehaan.jeremiah gmail.com> writes:
I went to build DMD on Windows for the first time tonight and I 
have to say that it was a terrible experience when compared with 
Linux.

First issue I ran into was having HOST_DC not being set. I'm not 
sure if the DMD installer is supposed to do this or if I needed 
to take care of it, but it wasn't mentioned anywhere I could 
find. I finally just set it myself.

Then it builds DMD, but gets placed in dmd/src/ instead of its 
own directory.

After DMD is built, other things keep getting built by DMC. I get 
more than a few errors due to having an eof character on the 
first line of some .h files, or something like that.

I also built druntime, but instead of trying to use a freshly 
built dmd.exe in the neighboring DMD source directory, it went 
for the one in PATH. I haven't bothered to build Phobos on 
Windows yet.

Building DMD, Phobos, and druntime on Linux is so easy and 
straight forward. It all works as expected. What's up with 
building DMD on Windows?
May 09 2016
next sibling parent Seb <seb wilzba.ch> writes:
On Tuesday, 10 May 2016 at 04:48:23 UTC, Jeremy DeHaan wrote:
 I went to build DMD on Windows for the first time tonight and I 
 have to say that it was a terrible experience when compared 
 with Linux.

 First issue I ran into was having HOST_DC not being set. I'm 
 not sure if the DMD installer is supposed to do this or if I 
 needed to take care of it, but it wasn't mentioned anywhere I 
 could find. I finally just set it myself.

 Then it builds DMD, but gets placed in dmd/src/ instead of its 
 own directory.

 After DMD is built, other things keep getting built by DMC. I 
 get more than a few errors due to having an eof character on 
 the first line of some .h files, or something like that.

 I also built druntime, but instead of trying to use a freshly 
 built dmd.exe in the neighboring DMD source directory, it went 
 for the one in PATH. I haven't bothered to build Phobos on 
 Windows yet.

 Building DMD, Phobos, and druntime on Linux is so easy and 
 straight forward. It all works as expected. What's up with 
 building DMD on Windows?
The problem is that not many people use Windows to develop dmd. AFAIK the makefile is supposed to work as autotester runs the same. There are a couple of devs using Windows, but it seems like they aren't around here. Maybe you can try to ping them in our irc? Anyhow probably the best hope you got is that we move away from Makefiles to a cross-platform solution. It's work in progress, but hopefully reaches us soon: https://github.com/dlang/phobos/pull/4194
May 10 2016
prev sibling next sibling parent Poul Jensen <jenlepou online.uk> writes:
On Tuesday, 10 May 2016 at 04:48:23 UTC, Jeremy DeHaan wrote:
 I went to build DMD on Windows for the first time tonight and I 
 have to say that it was a terrible experience when compared 
 with Linux.

 First issue I ran into was having HOST_DC not being set. I'm 
 not sure if the DMD installer is supposed to do this or if I 
 needed to take care of it, but it wasn't mentioned anywhere I 
 could find. I finally just set it myself.

 Then it builds DMD, but gets placed in dmd/src/ instead of its 
 own directory.

 After DMD is built, other things keep getting built by DMC. I 
 get more than a few errors due to having an eof character on 
 the first line of some .h files, or something like that.

 I also built druntime, but instead of trying to use a freshly 
 built dmd.exe in the neighboring DMD source directory, it went 
 for the one in PATH. I haven't bothered to build Phobos on 
 Windows yet.

 Building DMD, Phobos, and druntime on Linux is so easy and 
 straight forward. It all works as expected. What's up with 
 building DMD on Windows?
I used to have an awesome script that automates DMD+druntime+Phobos construction. In the past it used to be in the wiki but it was deleted since. https://wiki.dlang.org/?title=Building_DMD&diff=6074&oldid=5567#Windows_-_AIO_solutions It was just after the bootstrap and I've moved to Linux since, so it's not granted to still work ! Be warned. Personnaly I don't build dmd anymore, usually a simple -main -unittest over a phobos module is enough to test locally a PR but I know you will build a lot because of the GSOC so you need a robust method. A script is fine is the obvious solution.
May 11 2016
prev sibling parent reply Vladimir Panteleev <thecybershadow.lists gmail.com> writes:
On Tuesday, 10 May 2016 at 04:48:23 UTC, Jeremy DeHaan wrote:
 After DMD is built, other things keep getting built by DMC. I 
 get more than a few errors due to having an eof character on 
 the first line of some .h files, or something like that.
I've never seen such an error. Do you have the details?
 Building DMD, Phobos, and druntime on Linux is so easy and 
 straight forward. It all works as expected. What's up with 
 building DMD on Windows?
For historical reasons, the Windows makefiles take a different approach in many aspects. One important point is that they are limited to the feature set of the Digital Mars make implementation, which is extremely basic. For a build tool which can build D and all its components from source today, you can have a look at Digger: https://github.com/CyberShadow/Digger
May 11 2016
next sibling parent Jeremy DeHaan <dehaan.jeremiah gmail.com> writes:
On Wednesday, 11 May 2016 at 14:30:44 UTC, Vladimir Panteleev 
wrote:
 On Tuesday, 10 May 2016 at 04:48:23 UTC, Jeremy DeHaan wrote:
 After DMD is built, other things keep getting built by DMC. I 
 get more than a few errors due to having an eof character on 
 the first line of some .h files, or something like that.
I've never seen such an error. Do you have the details?
Late reply, but I was building DMD on a different computer today and it reminded me of this. After dmd.exe is built, I see the command `dmd -run checkwhitespace` with a bunch of files following it. The errors I see are from this. Error - file 'aggregate.h' contains windows line endings at line 1 Error - file 'aliasthis.h' contains windows line endings at line 1 Error - file 'arraytypes.h' contains windows line endings at line 1 And so on.
May 24 2016
prev sibling parent Jeremy DeHaan <dehaan.jeremiah gmail.com> writes:
On Wednesday, 11 May 2016 at 14:30:44 UTC, Vladimir Panteleev 
wrote:
 On Tuesday, 10 May 2016 at 04:48:23 UTC, Jeremy DeHaan wrote:
 Building DMD, Phobos, and druntime on Linux is so easy and 
 straight forward. It all works as expected. What's up with 
 building DMD on Windows?
For historical reasons, the Windows makefiles take a different approach in many aspects. One important point is that they are limited to the feature set of the Digital Mars make implementation, which is extremely basic.
There is one thing that I don't understand about the Windows makefiles though. The Posix makefiles for druntime and phobos use the dmd executable found in dmd/src/ and that makes sense. It is the one you should be using. That is not the case for the Windows makefiles though. It uses the one found on PATH even though it would be easy to do the same as the Posix version. Why is that?
May 24 2016