www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Compiling DMD on Windows: A journey of mystery and madness

reply NX <nightmarex1337 hotmail.com> writes:
[warning: rant ahead]

I'm amazed by the lack of documentation - or to say it better, 
documentation that works - on how to compile DMD and eventually 
Phobos. Here 
[https://wiki.dlang.org/Starting_as_a_Contributor#Windows_2] we 
have awfully categorized yet promising information on how to 
seriously compile DMD from source.
Before I compile dmd, I attempted to compile druntime & phobos 
and failed miserably. For God's sake no place in docs say that I 
need DMC, which is something I figured from make error output. I 
reinstalled dmd and this time I checked that box which makes 
installer automatically download and install dmc. After making 
dmc available from %path%, I was able to compile phobos, that 
seemed too good to be true. Then here comes the part about 
compiling dmd:

$ make -fwin32.mak release
This innocent looking command which supposed to compile dmd 
failed with an error message that killed my brain cells:
$ run idgen
$ Error: 'run' not found

WTF? Are we seriously trying to execute "run"? Ohh the horror!

Walking on the edge of going mad, I noticed a horrible detail in 
win32.mak file:

#HOST_DC=dmd

The fact that HOST_DC=dmd is commented out and not being defined 
as an environment variable is shameful to the max.

After fixing make file, I was finally able to compile dmd. Now I 
want to sue D Language Foundation for dealing me mental damage. 
Thanks for reading.
Aug 21 2016
next sibling parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 08/21/2016 12:41 PM, NX wrote:
 [warning: rant ahead]

 I'm amazed by the lack of documentation - or to say it better,
 documentation that works - on how to compile DMD and eventually Phobos.
 Here [https://wiki.dlang.org/Starting_as_a_Contributor#Windows_2] we
 have awfully categorized yet promising information on how to seriously
 compile DMD from source.
"Awfully categorized" is right. The initial step-by-step document I wrote for Posix got corrupted into this mess. Folks, I have in two instances asked nicely the authors or anyone else to fix this mess. I shouldn't need to worry about this stuff. Posix and Windows interspersed in the same document is not the way to go. Please fix this once and for all by splitting into two documents: one for Posix and one for Windows, thanks.
 Before I compile dmd, I attempted to compile druntime & phobos and
 failed miserably.
Hmmm, I'd think dmd would be the first to build. Even the botched document sequences things that way.
 For God's sake no place in docs say that I need DMC,
 which is something I figured from make error output. I reinstalled dmd
 and this time I checked that box which makes installer automatically
 download and install dmc. After making dmc available from %path%, I was
 able to compile phobos, that seemed too good to be true.
Might be nice to contribute this tidbit to the wiki.
 Then here comes
 the part about compiling dmd:

 $ make -fwin32.mak release
 This innocent looking command which supposed to compile dmd failed with
 an error message that killed my brain cells:
 $ run idgen
 $ Error: 'run' not found

 WTF? Are we seriously trying to execute "run"? Ohh the horror!

 Walking on the edge of going mad, I noticed a horrible detail in
 win32.mak file:

 #HOST_DC=dmd

 The fact that HOST_DC=dmd is commented out and not being defined as an
 environment variable is shameful to the max.

 After fixing make file, I was finally able to compile dmd. Now I want to
 sue D Language Foundation for dealing me mental damage. Thanks for reading.
Thanks for bearing through it. A post will scroll into yesterday's news. A change to the wiki is the way to go. Thanks, Andrei
Aug 21 2016
next sibling parent NX <nightmarex1337 hotmail.com> writes:
On Sunday, 21 August 2016 at 16:49:53 UTC, Andrei Alexandrescu 
wrote:
 On 08/21/2016 12:41 PM, NX wrote:
 For God's sake no place in docs say that I need DMC,
 which is something I figured from make error output. I 
 reinstalled dmd
 and this time I checked that box which makes installer 
 automatically
 download and install dmc. After making dmc available from 
 %path%, I was
 able to compile phobos, that seemed too good to be true.
Might be nice to contribute this tidbit to the wiki.
Actually I just noticed that it *is* actually mentioned: https://wiki.dlang.org/Starting_as_a_Contributor#Windows This kind of shows how an unstructured doc can result in info-missing by people...
Aug 21 2016
prev sibling parent reply Jack Stouffer <jack jackstouffer.com> writes:
On Sunday, 21 August 2016 at 16:49:53 UTC, Andrei Alexandrescu 
wrote:
 "Awfully categorized" is right. The initial step-by-step 
 document I wrote for Posix got corrupted into this mess.

 Folks, I have in two instances asked nicely the authors or 
 anyone else to fix this mess. I shouldn't need to worry about 
 this stuff. Posix and Windows interspersed in the same document 
 is not the way to go. Please fix this once and for all by 
 splitting into two documents: one for Posix and one for 
 Windows, thanks.
Sorry Andrei, this is the first time I've seen you talk about it. I'll fix it when I have some time. Probably this weekend.
Aug 23 2016
parent Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 08/23/2016 10:54 AM, Jack Stouffer wrote:
 I'll fix it when I have some time. Probably this weekend.
Very much appreciated. Thanks! -- Andreui
Aug 23 2016
prev sibling next sibling parent Cauterite <cauterite gmail.com> writes:
On Sunday, 21 August 2016 at 16:41:27 UTC, NX wrote:
 [warning: rant ahead]
Consider using Digger ( https://github.com/CyberShadow/Digger ) in your future attempts to build DMD, to save yourself some trouble. I've had a great experience using it, apart from the dependency on visual studio.
Aug 21 2016
prev sibling next sibling parent reply Seb <seb wilzba.ch> writes:
On Sunday, 21 August 2016 at 16:41:27 UTC, NX wrote:
 [warning: rant ahead]

 I'm amazed by the lack of documentation - or to say it better, 
 documentation that works - on how to compile DMD and eventually 
 Phobos. Here 
 [https://wiki.dlang.org/Starting_as_a_Contributor#Windows_2] we 
 have awfully categorized yet promising information on how to 
 seriously compile DMD from source.
There are usually three Makefile posix.mak, win32.mak and win64.mak. As you might expect it's quite a pain to keep them updated and as core developers on Windows are in the minority, the Windows Makefiles often lack features or have other "mysterious ways". Imho the best way to deal with this problem is to unify the Makefiles by (a) using a cross-platform build tool like reggae (see [1] for one of the discussions), (b) figure out what commands are possible in a cross-platform way and merge win{32, 64}.mak back to the common Makefile. [1] http://forum.dlang.org/post/wckshfgkltmmcgmbbitu forum.dlang.org
Aug 21 2016
parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 08/21/2016 12:56 PM, Seb wrote:
 On Sunday, 21 August 2016 at 16:41:27 UTC, NX wrote:
 [warning: rant ahead]

 I'm amazed by the lack of documentation - or to say it better,
 documentation that works - on how to compile DMD and eventually
 Phobos. Here
 [https://wiki.dlang.org/Starting_as_a_Contributor#Windows_2] we have
 awfully categorized yet promising information on how to seriously
 compile DMD from source.
There are usually three Makefile posix.mak, win32.mak and win64.mak. As you might expect it's quite a pain to keep them updated and as core developers on Windows are in the minority, the Windows Makefiles often lack features or have other "mysterious ways". Imho the best way to deal with this problem is to unify the Makefiles by (a) using a cross-platform build tool like reggae (see [1] for one of the discussions), (b) figure out what commands are possible in a cross-platform way and merge win{32, 64}.mak back to the common Makefile. [1] http://forum.dlang.org/post/wckshfgkltmmcgmbbitu forum.dlang.org
How does the makefile unification help the lack of documentation? -- Andrei
Aug 21 2016
parent reply Seb <seb wilzba.ch> writes:
On Sunday, 21 August 2016 at 18:57:25 UTC, Andrei Alexandrescu 
wrote:
 On 08/21/2016 12:56 PM, Seb wrote:
 On Sunday, 21 August 2016 at 16:41:27 UTC, NX wrote:
 [warning: rant ahead]

 I'm amazed by the lack of documentation - or to say it better,
 documentation that works - on how to compile DMD and 
 eventually
 Phobos. Here
 [https://wiki.dlang.org/Starting_as_a_Contributor#Windows_2] 
 we have
 awfully categorized yet promising information on how to 
 seriously
 compile DMD from source.
There are usually three Makefile posix.mak, win32.mak and win64.mak. As you might expect it's quite a pain to keep them updated and as core developers on Windows are in the minority, the Windows Makefiles often lack features or have other "mysterious ways". Imho the best way to deal with this problem is to unify the Makefiles by (a) using a cross-platform build tool like reggae (see [1] for one of the discussions), (b) figure out what commands are possible in a cross-platform way and merge win{32, 64}.mak back to the common Makefile. [1] http://forum.dlang.org/post/wckshfgkltmmcgmbbitu forum.dlang.org
How does the makefile unification help the lack of documentation? -- Andrei
because (1) you need less documentation (just one file to document) and (2) the single file will be more tested/bullet-proof. Anyways sorry about mentioning it - I know that such (a) a change shouldn't be taken lightly and it also may cause additional troubles and (b) it isn't that related to the problem of the poster.
Aug 21 2016
parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 08/21/2016 03:01 PM, Seb wrote:
 because (1) you need less documentation (just one file to document) and
Wouldn't it be better to optimize documentation for the reader instead of the writer? After all if reading is impaired, that's bound to make the maintainer unhappy even if she has fewer documents to maintain.
 (2) the single file will be more tested/bullet-proof.
How does that work? Aren't step-by-step documents "how to do this on Posix" and "how to do this for Windows" best tested in one environment at a time?
 Anyways sorry about mentioning it - I know that such (a) a change
 shouldn't be taken lightly and it also may cause additional troubles and
What troubles would there be? How were troubles taken into account when the document got modified from its initial Posix-only stance to the current state?
 (b) it isn't that related to the problem of the poster.
NX has noted the information is there, it's just lost exactly because the document is poorly structured. Is that plausible evidence against your assertion? Please just fix it with no debate. It's mostly a matter of moving Windows-related stuff from this document to another, fresh document. I'm mulling over a big contract for the Foundation. Let me do what I do best. It's the third level this has gotten to my level of consciousness, and that's more than two times too many. Thanks, Andrei
Aug 21 2016
next sibling parent reply Walter Bright <newshound2 digitalmars.com> writes:
On 8/21/2016 12:12 PM, Andrei Alexandrescu wrote:
 How does that work? Aren't step-by-step documents "how to do this on Posix" and
 "how to do this for Windows" best tested in one environment at a time?
I know when I'm following step-by-step procedures, I prefer it to be specific to my case, not a catch-all one with callouts for other cases melded in.
Aug 21 2016
parent reply ixid <adamsibson hotmail.com> writes:
On Monday, 22 August 2016 at 02:34:37 UTC, Walter Bright wrote:
 On 8/21/2016 12:12 PM, Andrei Alexandrescu wrote:
 How does that work? Aren't step-by-step documents "how to do 
 this on Posix" and
 "how to do this for Windows" best tested in one environment at 
 a time?
I know when I'm following step-by-step procedures, I prefer it to be specific to my case, not a catch-all one with callouts for other cases melded in.
Some users might just about know they're on Windows but have no idea what Posix is so won't know to ignore those parts or will at least be confused and intimidated. The path into using things needs to be as easy as possible.
Aug 23 2016
parent reply Walter Bright <newshound2 digitalmars.com> writes:
On 8/23/2016 2:15 AM, ixid wrote:
 Some users might just about know they're on Windows but have no idea what Posix
 is so won't know to ignore those parts or will at least be confused and
 intimidated. The path into using things needs to be as easy as possible.
Sometimes I have customers that don't know what a command prompt or a subdirectory is, and I've learned to just send their money back.
Aug 23 2016
parent reply Meta <jared771 gmail.com> writes:
On Tuesday, 23 August 2016 at 10:28:35 UTC, Walter Bright wrote:
 On 8/23/2016 2:15 AM, ixid wrote:
 Some users might just about know they're on Windows but have 
 no idea what Posix
 is so won't know to ignore those parts or will at least be 
 confused and
 intimidated. The path into using things needs to be as easy as 
 possible.
Sometimes I have customers that don't know what a command prompt or a subdirectory is, and I've learned to just send their money back.
When your software is free your currency is people's attention. We really don't want to be giving out refunds.
Aug 23 2016
parent reply Walter Bright <newshound2 digitalmars.com> writes:
On 8/23/2016 10:58 AM, Meta wrote:
 On Tuesday, 23 August 2016 at 10:28:35 UTC, Walter Bright wrote:
 Sometimes I have customers that don't know what a command prompt or a
 subdirectory is, and I've learned to just send their money back.
When your software is free your currency is people's attention. We really don't want to be giving out refunds.
I don't like to lose any customers. They do have expectations when they pay money for a product, but I can't teach someone via email how their computer works when all they know is click & drag. I've tried, it ended badly every time. You can't remotely teach someone to fly an F-104 when they don't know what a rudder is. At least with D I can point them to the learn forum.
Aug 23 2016
parent reply Meta <jared771 gmail.com> writes:
On Tuesday, 23 August 2016 at 19:59:41 UTC, Walter Bright wrote:
 On 8/23/2016 10:58 AM, Meta wrote:
 When your software is free your currency is people's 
 attention. We really don't
 want to be giving out refunds.
I don't like to lose any customers. They do have expectations when they pay money for a product, but I can't teach someone via email how their computer works when all they know is click & drag. I've tried, it ended badly every time. You can't remotely teach someone to fly an F-104 when they don't know what a rudder is. At least with D I can point them to the learn forum.
Yes, very true. However, getting back to the complaint of both documentation sets being in a single document: I'm experienced with box Linux-based and Windows-based systems and I still find the combined documentation annoying and a pain because I have to scroll through the Posix stuff every time to get to the Windows section. Except, as of today the two pages have been split and it looks much better. Thanks to whoever did that.
Aug 23 2016
parent Seb <seb wilzba.ch> writes:
On Tuesday, 23 August 2016 at 20:54:19 UTC, Meta wrote:
 Except, as of today the two pages have been split and it looks 
 much better. Thanks to whoever did that.
Nothing to thank - it wasn't much work, but I did that yesterday, so it was quite funny to observe the conversation ;-)
Aug 23 2016
prev sibling parent Seb <seb wilzba.ch> writes:
On Sunday, 21 August 2016 at 19:12:27 UTC, Andrei Alexandrescu 
wrote:
 On 08/21/2016 03:01 PM, Seb wrote:
 because (1) you need less documentation (just one file to 
 document) and
Wouldn't it be better to optimize documentation for the reader instead of the writer? After all if reading is impaired, that's bound to make the maintainer unhappy even if she has fewer documents to maintain.
 (2) the single file will be more tested/bullet-proof.
How does that work? Aren't step-by-step documents "how to do this on Posix" and "how to do this for Windows" best tested in one environment at a time?
If in both cases the build commands would only be sth. like: <my-fancy-build-toold> build <my-fancy-build-toold> test ... then there would be no need for a second Windows-only document.
 Anyways sorry about mentioning it - I know that such (a) a 
 change
 shouldn't be taken lightly and it also may cause additional 
 troubles and
What troubles would there be? How were troubles taken into account when the document got modified from its initial Posix-only stance to the current state?
I was referring to switching from Makefiles to a different cross-platform tool like reggae, which bears some troubles with it due to many existing setups and infrastructure.
 Please just fix it with no debate.
Sorry, it wasn't intended as a debate, we just posted at the same time initially. https://wiki.dlang.org/Building_under_Posix https://wiki.dlang.org/Building_under_Windows
Aug 21 2016
prev sibling parent ketmar <ketmar ketmar.no-ip.org> writes:
On Sunday, 21 August 2016 at 16:41:27 UTC, NX wrote:
crybaby. Real Programmers laughs at you. didn't they tell you 
that programming means "pain" -- that is the reason they starting 
with the same letter?
Aug 21 2016