FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Build compile order

 
Post new topic   Reply to topic     Forum Index -> Build
View previous topic :: View next topic  
Author Message
kris



Joined: 27 Mar 2004
Posts: 1494
Location: South Pacific

PostPosted: Sat Oct 29, 2005 11:50 am    Post subject: Build compile order Reply with quote

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
View user's profile Send private message
kris



Joined: 27 Mar 2004
Posts: 1494
Location: South Pacific

PostPosted: Sat Oct 29, 2005 1:45 pm    Post subject: Reply with quote

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
View user's profile Send private message
Derek Parnell



Joined: 22 Apr 2004
Posts: 408
Location: Melbourne, Australia

PostPosted: Sat Oct 29, 2005 4:07 pm    Post subject: Re: Build compile order Reply with quote

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
View user's profile Send private message
kris



Joined: 27 Mar 2004
Posts: 1494
Location: South Pacific

PostPosted: Sat Oct 29, 2005 5:00 pm    Post subject: Reply with quote

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
View user's profile Send private message
Derek Parnell



Joined: 22 Apr 2004
Posts: 408
Location: Melbourne, Australia

PostPosted: Sat Oct 29, 2005 5:07 pm    Post subject: Reply with quote

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
View user's profile Send private message
kris



Joined: 27 Mar 2004
Posts: 1494
Location: South Pacific

PostPosted: Mon Oct 31, 2005 1:19 pm    Post subject: Reply with quote

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
View user's profile Send private message
Derek Parnell



Joined: 22 Apr 2004
Posts: 408
Location: Melbourne, Australia

PostPosted: Mon Oct 31, 2005 3:22 pm    Post subject: Reply with quote

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
View user's profile Send private message
kris



Joined: 27 Mar 2004
Posts: 1494
Location: South Pacific

PostPosted: Mon Oct 31, 2005 3:46 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Build All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group