View previous topic :: View next topic |
Author |
Message |
kris
Joined: 27 Mar 2004 Posts: 1494 Location: South Pacific
|
Posted: Sat Oct 29, 2005 11:50 am Post subject: Build compile order |
|
|
Hi Derek,
How does Build construct the list of files to compile? And, what would cause the order of that list to change between two different machines (assuming they're using the same @brf file) ?
There's a topic over in the Mango forum that's causing some grief, and I wonder if you can help shed some light on it?
Thanks; |
|
Back to top |
|
|
kris
Joined: 27 Mar 2004 Posts: 1494 Location: South Pacific
|
Posted: Sat Oct 29, 2005 1:45 pm Post subject: |
|
|
Apparently the problem was sidestepped by using an older version of Build ~ on the face of it, this would tend to indicate a DMD bug with respect to the order of compilation. Any ideas?
Here's that thread I mentioned: http://www.dsource.org/forums/viewtopic.php?t=1052 |
|
Back to top |
|
|
Derek Parnell
Joined: 22 Apr 2004 Posts: 408 Location: Melbourne, Australia
|
Posted: Sat Oct 29, 2005 4:07 pm Post subject: Re: Build compile order |
|
|
kris wrote: | Hi Derek,
How does Build construct the list of files to compile? And, what would cause the order of that list to change between two different machines (assuming they're using the same @brf file) ?
There's a topic over in the Mango forum that's causing some grief, and I wonder if you can help shed some light on it?
Thanks; |
The compilation order is a function of DMD's associative array hashing algorithm.
Build processes each file in a deterministic manner based of the import tree and dependancies, but as it gets each file (and path) it stores them in an AA. When it comes to build the compilation list, it just does a foreach() on the AA.keys, and the order of that is whatever the hashing algo places the entries in.
Thus on different machines it is very likely that the path info is different and that would effect the hashing order.
My basic assumption was that the order of compilation and linkagewas not significant. If it is, then how should one know which order to compile them it? _________________ --
Derek
skype name: derek.j.parnell |
|
Back to top |
|
|
kris
Joined: 27 Mar 2004 Posts: 1494 Location: South Pacific
|
Posted: Sat Oct 29, 2005 5:00 pm Post subject: |
|
|
Ah ~ thanks!
The Mango topic claims an earlier version of Build resolved the issue. That makes me a bit uncomfortable about DMD. |
|
Back to top |
|
|
Derek Parnell
Joined: 22 Apr 2004 Posts: 408 Location: Melbourne, Australia
|
Posted: Sat Oct 29, 2005 5:07 pm Post subject: |
|
|
kris wrote: | The Mango topic claims an earlier version of Build resolved the issue. |
That could be the case too. I believe at some stage I chose the keep the simplified path info in the AA rather than the fully expanded path name. _________________ --
Derek
skype name: derek.j.parnell |
|
Back to top |
|
|
kris
Joined: 27 Mar 2004 Posts: 1494 Location: South Pacific
|
Posted: Mon Oct 31, 2005 1:19 pm Post subject: |
|
|
There was also some weird kind of issue with an Access Violation during compilation. I found a way to reproduce it, and then compiled a debug version of build to track it down (the GPF was in build.exe).
Naturally, the debug version did not GPF. So I built the production version, which also does not GPF ... though it's a different size to the downloadable build.exe from dsource.org (~20K larger).
I guess that means the prebuild version on dsource.org is somehow bogus? |
|
Back to top |
|
|
Derek Parnell
Joined: 22 Apr 2004 Posts: 408 Location: Melbourne, Australia
|
Posted: Mon Oct 31, 2005 3:22 pm Post subject: |
|
|
kris wrote: | There was also some weird kind of issue with an Access Violation during compilation. I found a way to reproduce it, and then compiled a debug version of build to track it down (the GPF was in build.exe).
Naturally, the debug version did not GPF. So I built the production version, which also does not GPF ... though it's a different size to the downloadable build.exe from dsource.org (~20K larger).
I guess that means the prebuild version on dsource.org is somehow bogus? |
The prebuilt distro has been compiled with -release and -inline.
I won't be able to track it down easily unitl I can reproduce it. _________________ --
Derek
skype name: derek.j.parnell |
|
Back to top |
|
|
kris
Joined: 27 Mar 2004 Posts: 1494 Location: South Pacific
|
Posted: Mon Oct 31, 2005 3:46 pm Post subject: |
|
|
I was using the Mango examples like so:
Code: | Build -DCPATH\d\dmd\bin @randomio |
An initial compile would be OK, but a subsequent time would fail. Using the -R option would always work cleanly. I had a hunch it was failing in the -clean code somewhere. Just a hunch, based upon timing.
Using a new, local, Build after construction via @full or via @debug now works correctly for me. |
|
Back to top |
|
|
|