www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - "-inline" is bad!

reply Sascha Katzner <sorry.no spam.invalid> writes:
Hi,

I've just found out the hard way that it is really not wise to just 
rebuild the changed files in a project when using "-inline", because D 
is also inlining funtions from other files/modules and when you change 
such a file without rebuilding the file in which it was inlined the 
changes will not be in the resulting executable.

Just wanted to mention this, perhaps I can save some people hours of 
debugging. Perhaps Walter could include a warning in the documentation 
of this parameter. ;-)

LLAP,
Sascha Katzner
Nov 16 2007
next sibling parent reply "Janice Caron" <caron800 googlemail.com> writes:
On 11/16/07, Sascha Katzner <sorry.no spam.invalid> wrote:
 when you change
 such a file without rebuilding the file in which it was inlined the
 changes will not be in the resulting executable.
Or put another way, when you modify a source file in any way whatsoever, regardless of compiler options, the wise thing to do is to recompile that file and all dependencies of that file. That's what makefiles were for back in the bad old days, and what proper build utilities are for now.
Nov 16 2007
parent reply Bruce Adams <tortoise_74 yeah.who.co.uk> writes:
Janice Caron Wrote:

 On 11/16/07, Sascha Katzner <sorry.no spam.invalid> wrote:
 when you change
 such a file without rebuilding the file in which it was inlined the
 changes will not be in the resulting executable.
Or put another way, when you modify a source file in any way whatsoever, regardless of compiler options, the wise thing to do is to recompile that file and all dependencies of that file. That's what makefiles were for back in the bad old days, and what proper build utilities are for now.
The trouble with proper build utilities is that they are often too specific. This is why I an inevitably drawn back to make, even if I allow it to palm some of the work off onto other utilities. For example, will dsss build my doxygen documentation for me, run my integration tests (hopefully it does the unit tests) and format my coverage report the way I like it. Nor would I expect it to. Make is horrible and should be replaced but none of the many general purpose replacements seem to have really taken off. Its a bit like democracy. Obviously flawed but there doesn't seem to be anything better. Still it would be interesting to do a quick survey of what people are using for D as well for their non-D (heresy!) stuff. Regards, Bruce.
Nov 16 2007
next sibling parent Jason House <jason.james.house gmail.com> writes:
Bruce Adams Wrote:
 The trouble with proper build utilities is that they are often too specific.
This is why I an inevitably drawn back to make, even if I allow it to palm some
of the work off onto other utilities. For example, will dsss build my doxygen
documentation for me, run my integration tests (hopefully it does the unit
tests) and format my coverage report the way I like it.  Nor would I expect it
to. Make is horrible and should be replaced but none of the many general
purpose replacements seem to have really taken off. Its a bit like democracy.
Obviously flawed but there doesn't seem to be anything better.
 Still it would be interesting to do a quick survey of what people are using
for D as well for their non-D (heresy!) stuff.
I use gnu make. It may be redundant for specifying how to build files, but I've found it to be more flexible for handling whatever crazy stuff I decide to do. I've had gnu build doxygen documentation, run regression tests, and collect results into a draft report. I've never had a problem that I've tried to solve with gnu make that I wasn't able to figure out how to do it. The only limitation I've ever found is that I can't specify rules with multiple wildcards in build rules
Nov 16 2007
prev sibling next sibling parent BCS <BCS pathlink.com> writes:
Bruce Adams wrote:
 Janice Caron Wrote:
 
 
On 11/16/07, Sascha Katzner <sorry.no spam.invalid> wrote:

when you change
such a file without rebuilding the file in which it was inlined the
changes will not be in the resulting executable.
Or put another way, when you modify a source file in any way whatsoever, regardless of compiler options, the wise thing to do is to recompile that file and all dependencies of that file. That's what makefiles were for back in the bad old days, and what proper build utilities are for now.
The trouble with proper build utilities is that they are often too specific. This is why I an inevitably drawn back to make, even if I allow it to palm some of the work off onto other utilities. For example, will dsss build my doxygen documentation for me, run my integration tests (hopefully it does the unit tests) and format my coverage report the way I like it. Nor would I expect it to. Make is horrible and should be replaced but none of the many general purpose replacements seem to have really taken off. Its a bit like democracy. Obviously flawed but there doesn't seem to be anything better. Still it would be interesting to do a quick survey of what people are using for D as well for their non-D (heresy!) stuff. Regards, Bruce.
I use a bash script that calls build about 4 time. (and it always uses the -full flag, a.k.a. it always does a full rebuild)
Nov 16 2007
prev sibling next sibling parent Henning Hasemann <hhasemann web.de> writes:
Bruce Adams <tortoise_74 yeah.who.co.uk> wrote:

 Still
 it would be interesting to do a quick survey of what people are using
 for D as well for their non-D (heresy!) stuff.
I began with rebuild than switched back to GNU make, now I use and would recommend waf (http://freehackers.org/~tnagy/bksys.html) Henning -- GPG Public Key: http://gpg-keyserver.de/pks/lookup?op=get&search=0xDDD6D36D41911851
Nov 16 2007
prev sibling parent Robert Fraser <fraserofthenight gmail.com> writes:
Bruce Adams Wrote:
 Still it would be interesting to do a quick survey of what people are using
for D as well for their non-D (heresy!) stuff.
Most projects have a big Perl script to build stuff. For D projects, this invokes rebuild/d3s to do the actual building, while the script handles expansion of inline Perl in comments, documentation building, unit/integration testing, deployment, etc.
Nov 16 2007
prev sibling parent Michel Fortin <michel.fortin michelf.com> writes:
On 2007-11-16 13:00:21 -0500, Sascha Katzner <sorry.no spam.invalid> said:

 I've just found out the hard way that it is really not wise to just 
 rebuild the changed files in a project when using "-inline", because D 
 is also inlining funtions from other files/modules and when you change 
 such a file without rebuilding the file in which it was inlined the 
 changes will not be in the resulting executable.
Take note that this also apply when you have templates in a file, whether you use -inline or not, since other files may instanciate the templates. That's unless your templates are private (and inaccessible from other modules) of course. -- Michel Fortin michel.fortin michelf.com http://michelf.com/
Nov 16 2007