www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - build a project

reply Qian Xu <quian.xu stud.tu-ilmenau.de> writes:
Hi All,

I have a project with 300 d-files. I use WAF-tool to build my project. 

If I add one line comment in a d-file from the bottom of the dependency
tree, almost the whole project will be recompiled again. This is very time
consuming.

Is there any way to detect, whether the modification of a d-file does not
have affect to its dependency?

Best regards and have a good day
--Qian Xu
Mar 26 2009
parent reply "Denis Koroskin" <2korden gmail.com> writes:
On Thu, 26 Mar 2009 17:44:33 +0300, Qian Xu <quian.xu stud.tu-ilmenau.de> wrote:

 Hi All,

 I have a project with 300 d-files. I use WAF-tool to build my project.

 If I add one line comment in a d-file from the bottom of the dependency
 tree, almost the whole project will be recompiled again. This is very time
 consuming.

 Is there any way to detect, whether the modification of a d-file does not
 have affect to its dependency?

 Best regards and have a good day
 --Qian Xu
 
You can try comparing DMD-generated .di files from that modified file. There is no need to recompile dependencies if two headers match.
Mar 26 2009
next sibling parent reply "Vladimir Panteleev" <thecybershadow gmail.com> writes:
On Thu, 26 Mar 2009 16:54:27 +0200, Denis Koroskin <2korden gmail.com>  
wrote:

 On Thu, 26 Mar 2009 17:44:33 +0300, Qian Xu  
 <quian.xu stud.tu-ilmenau.de> wrote:

 Hi All,

 I have a project with 300 d-files. I use WAF-tool to build my project.

 If I add one line comment in a d-file from the bottom of the dependency
 tree, almost the whole project will be recompiled again. This is very  
 time
 consuming.

 Is there any way to detect, whether the modification of a d-file does  
 not
 have affect to its dependency?

 Best regards and have a good day
 --Qian Xu
You can try comparing DMD-generated .di files from that modified file. There is no need to recompile dependencies if two headers match.
Unless you compile with inlining enabled, AFAIK. -- Best regards, Vladimir mailto:thecybershadow gmail.com
Mar 26 2009
next sibling parent "Denis Koroskin" <2korden gmail.com> writes:
On Thu, 26 Mar 2009 18:09:22 +0300, Vladimir Panteleev
<thecybershadow gmail.com> wrote:

 On Thu, 26 Mar 2009 16:54:27 +0200, Denis Koroskin <2korden gmail.com>
 wrote:

 On Thu, 26 Mar 2009 17:44:33 +0300, Qian Xu
 <quian.xu stud.tu-ilmenau.de> wrote:

 Hi All,

 I have a project with 300 d-files. I use WAF-tool to build my project.

 If I add one line comment in a d-file from the bottom of the dependency
 tree, almost the whole project will be recompiled again. This is very
 time
 consuming.

 Is there any way to detect, whether the modification of a d-file does
 not
 have affect to its dependency?

 Best regards and have a good day
 --Qian Xu
You can try comparing DMD-generated .di files from that modified file. There is no need to recompile dependencies if two headers match.
Unless you compile with inlining enabled, AFAIK.
IIRC, whatever is getting *potentially* inlined stays in the header, so it should work regardless of the -inline switch.
Mar 26 2009
prev sibling parent reply grauzone <none example.net> writes:
Vladimir Panteleev wrote:
 On Thu, 26 Mar 2009 16:54:27 +0200, Denis Koroskin <2korden gmail.com> 
 wrote:
 
 On Thu, 26 Mar 2009 17:44:33 +0300, Qian Xu 
 <quian.xu stud.tu-ilmenau.de> wrote:

 Hi All,

 I have a project with 300 d-files. I use WAF-tool to build my project.

 If I add one line comment in a d-file from the bottom of the dependency
 tree, almost the whole project will be recompiled again. This is very 
 time
 consuming.

 Is there any way to detect, whether the modification of a d-file does 
 not
 have affect to its dependency?

 Best regards and have a good day
 --Qian Xu
You can try comparing DMD-generated .di files from that modified file. There is no need to recompile dependencies if two headers match.
Unless you compile with inlining enabled, AFAIK.
A method, that would guarantee correctness, is to let the compiler only read .di files of other modules. But then the build process would be more complicated. You had to generate all .di files of all depended modules (which would take a while) and deal with circular module dependencies. To Qian Xu (the OP): welcome to the funny world of the D tool chain. If you're using dsss/rebuild, you can speed up compilation a bit by putting oneatatime=no into the rebuild configuration file. Because of dmd bugs, you might need to use the -full switch to avoid linker errors.
Mar 26 2009
parent reply Qian Xu <quian.xu stud.tu-ilmenau.de> writes:
grauzone wrote:
 
 To Qian Xu (the OP): welcome to the funny world of the D tool chain. If
 you're using dsss/rebuild, you can speed up compilation a bit by putting
 oneatatime=no into the rebuild configuration file. Because of dmd bugs,
 you might need to use the -full switch to avoid linker errors.
I am working in Linux. There is no dsss/rebuild in Linux, isn't there? --Qian ^^)
Mar 26 2009
parent reply grauzone <none example.net> writes:
Qian Xu wrote:
 grauzone wrote:
 To Qian Xu (the OP): welcome to the funny world of the D tool chain. If
 you're using dsss/rebuild, you can speed up compilation a bit by putting
 oneatatime=no into the rebuild configuration file. Because of dmd bugs,
 you might need to use the -full switch to avoid linker errors.
I am working in Linux. There is no dsss/rebuild in Linux, isn't there?
Yes, there is. The thing I described above will only make dsss/rebuild to compile everything in one go. Even if a single file is modified, everything is recompiled. But this is still much faster than incremental compilation. What build system are you using? You said "WAF-tool", but I didn't find anything about it.
 --Qian ^^)
Mar 26 2009
next sibling parent reply Don <nospam nospam.com> writes:
grauzone wrote:
 Qian Xu wrote:
 grauzone wrote:
 To Qian Xu (the OP): welcome to the funny world of the D tool chain. If
 you're using dsss/rebuild, you can speed up compilation a bit by putting
 oneatatime=no into the rebuild configuration file. Because of dmd bugs,
 you might need to use the -full switch to avoid linker errors.
I am working in Linux. There is no dsss/rebuild in Linux, isn't there?
I'd say the reverse is true -- there is dsss/rebuild ONLY in Linux. I wouldn't recommend it for Windows.
 
 Yes, there is.
 
 The thing I described above will only make dsss/rebuild to compile 
 everything in one go. Even if a single file is modified, everything is 
 recompiled. But this is still much faster than incremental compilation.
 
 What build system are you using? You said "WAF-tool", but I didn't find 
 anything about it.
 
 --Qian ^^)
Mar 26 2009
parent reply "Nick Sabalausky" <a a.a> writes:
"Don" <nospam nospam.com> wrote in message 
news:gqglkh$1dpg$2 digitalmars.com...
 grauzone wrote:
 Qian Xu wrote:
 grauzone wrote:
 To Qian Xu (the OP): welcome to the funny world of the D tool chain. If
 you're using dsss/rebuild, you can speed up compilation a bit by 
 putting
 oneatatime=no into the rebuild configuration file. Because of dmd bugs,
 you might need to use the -full switch to avoid linker errors.
I am working in Linux. There is no dsss/rebuild in Linux, isn't there?
I'd say the reverse is true -- there is dsss/rebuild ONLY in Linux. I wouldn't recommend it for Windows.
I'm curious why you say that about the Windows version and what you world recommend instead of rebuild on Windows.
Mar 26 2009
parent reply Don <nospam nospam.com> writes:
Nick Sabalausky wrote:
 "Don" <nospam nospam.com> wrote in message 
 news:gqglkh$1dpg$2 digitalmars.com...
 grauzone wrote:
 Qian Xu wrote:
 grauzone wrote:
 To Qian Xu (the OP): welcome to the funny world of the D tool chain. If
 you're using dsss/rebuild, you can speed up compilation a bit by 
 putting
 oneatatime=no into the rebuild configuration file. Because of dmd bugs,
 you might need to use the -full switch to avoid linker errors.
I am working in Linux. There is no dsss/rebuild in Linux, isn't there?
I'd say the reverse is true -- there is dsss/rebuild ONLY in Linux. I wouldn't recommend it for Windows.
I'm curious why you say that about the Windows version and what you world recommend instead of rebuild on Windows.
Rebuild can't make DLLs. That's a showstopper for me. I use bud. Even though it hasn't been touched since rebuild began. :-(.
Mar 26 2009
next sibling parent Trass3r <mrmocool gmx.de> writes:
Don schrieb:
 Rebuild can't make DLLs. That's a showstopper for me.
 I use bud. Even though it hasn't been touched since rebuild began. :-(.
In the end (D) dlls don't work on Windows anyway. ;)
Mar 26 2009
prev sibling parent reply Derek Parnell <derek psych.ward> writes:
On Thu, 26 Mar 2009 21:21:47 +0100, Don wrote:

 I use bud. Even though it hasn't been touched since rebuild began. :-(.
How would like Bud to be 'touched'. I'm happy to make it better but I'm not sure what you need from it. -- Derek Parnell Melbourne, Australia skype: derek.j.parnell
Mar 26 2009
parent Daniel Keep <daniel.keep.lists gmail.com> writes:
Derek Parnell wrote:
 On Thu, 26 Mar 2009 21:21:47 +0100, Don wrote:
 
 I use bud. Even though it hasn't been touched since rebuild began. :-(.
How would like Bud to be 'touched'. I'm happy to make it better but I'm not sure what you need from it.
My current project builds using a Python script which does some stuff including calling bud (along with a bunch of other utilities.) I switched to rebuild for everything else for the -dc switch since I tend to have a number of DMD installs (1.x tango stable, 1.x tango trunk + changes, 1.x phobos, 2.x phobos). Really, I always saw bud as being "done." It doesn't really have any major issues with it. Things like -dc or -oq and the like are nice, but it does its job well. :) <3 bud -- Daniel
Mar 26 2009
prev sibling parent "Xu, Qian" <qian.xu funkwerk-itk.com> writes:
"grauzone" <none example.net> wrote in message 
news:gqg99j$pj1$1 digitalmars.com...
 What build system are you using? You said "WAF-tool", but I didn't find 
 anything about it.
http://code.google.com/p/waf/ we use this tool for building. but it calculates the dependency incorrectly. --Qian
Mar 26 2009
prev sibling parent reply Qian Xu <quian.xu stud.tu-ilmenau.de> writes:
Denis Koroskin wrote:

 On Thu, 26 Mar 2009 17:44:33 +0300, Qian Xu <quian.xu stud.tu-ilmenau.de>
 wrote:
 
 Hi All,

 I have a project with 300 d-files. I use WAF-tool to build my project.

 If I add one line comment in a d-file from the bottom of the dependency
 tree, almost the whole project will be recompiled again. This is very
 time consuming.

 Is there any way to detect, whether the modification of a d-file does not
 have affect to its dependency?

 Best regards and have a good day
 --Qian Xu
 
You can try comparing DMD-generated .di files from that modified file. There is no need to recompile dependencies if two headers match.
To generate header files takes also much time --Qian
Mar 26 2009
parent reply "Denis Koroskin" <2korden gmail.com> writes:
On Thu, 26 Mar 2009 18:58:34 +0300, Qian Xu <quian.xu stud.tu-ilmenau.de> wrote:

 Denis Koroskin wrote:

 On Thu, 26 Mar 2009 17:44:33 +0300, Qian Xu <quian.xu stud.tu-ilmenau.de>
 wrote:

 Hi All,

 I have a project with 300 d-files. I use WAF-tool to build my project.

 If I add one line comment in a d-file from the bottom of the dependency
 tree, almost the whole project will be recompiled again. This is very
 time consuming.

 Is there any way to detect, whether the modification of a d-file does not
 have affect to its dependency?

 Best regards and have a good day
 --Qian Xu
You can try comparing DMD-generated .di files from that modified file. There is no need to recompile dependencies if two headers match.
To generate header files takes also much time --Qian
It's certainly much faster to generate 1 header file than recompile all the dependencies each time.
Mar 26 2009
parent reply "Xu, Qian" <qian.xu funkwerk-itk.com> writes:
"Denis Koroskin" <2korden gmail.com> wrote in message 
news:op.urepy0lro7cclz hood.creatstudio.intranet...
 It's certainly much faster to generate 1 header file than recompile all 
 the dependencies each time.
Yes. but it works for certain redundancy (like comments) only. If you change your implementation not your interface, the header file will be changed as well. so I cannot take much advantage of header files of D. (Am I wrong?) for instance: class Foo { void bar() { int i = 0; i ++; // add/remove this line, to see, if the header file changes. } } --Qian
Mar 26 2009
parent Frits van Bommel <fvbommel REMwOVExCAPSs.nl> writes:
Xu, Qian wrote:
 "Denis Koroskin" <2korden gmail.com> wrote in message 
 news:op.urepy0lro7cclz hood.creatstudio.intranet...
 It's certainly much faster to generate 1 header file than recompile 
 all the dependencies each time.
Yes. but it works for certain redundancy (like comments) only. If you change your implementation not your interface, the header file will be changed as well. so I cannot take much advantage of header files of D. (Am I wrong?)
DMD should only include bodies for functions it considers for inlining. That should mean the header might change due to changes in small functions, but probably not for changes in big ones. (I'm not sure how GDC handles this. I do know LDC does inlining later in the process (*after* "codegen"), but I'm not sure what header generation does)
Mar 26 2009