resurrecting Bud and Rebuild

Derek Parnell derek at nomail.afraid.org
Wed Feb 7 15:46:47 PST 2007


On Wed, 07 Feb 2007 15:38:40 -0800, Gregor Richards wrote:

> Walter Bright wrote:
>> It was (correctly) pointed out that textual import breaks Bud and 
>> Rebuild. It's also been pointed out that textual import may be an 
>> unexpected vector for security problems.
>> 
>> Both can be resolved by only allowing textual import if a command 
>> switch, say, -Jpath, is given. 'path' gives the location of where to 
>> look for the file; and the file will be restricted to being under that 
>> path. No -Jpath, and textual import won't be allowed.
>> 
>> For Bud and Rebuild, if there's no -J, they know there are no textual 
>> imports, so they work as before. With -J, they always recompile.
> 
> I can't speak to the security aspect, but I don't think that -J would be 
> helpful to rebuild.
> ...
> The solution? Right now, there's no way to get the list of dependant 
> files without compiling one. Since rebuild gets meta-data out of files, 
> it would then have to compile it again, which is why I'm not doing it 
> that way. I'd like to see something like this:
> 
> $ [g]dmd -p -files foo.d
> file foo.d foo
> file /opt/something/src/phobos/object.d object
> file /opt/something/src/phobos/std/path.d std.path
> 
> That way, I could simply run the compiler, and get the list of actual 
> files (not just imports) from its output. However, the compiler wouldn't 
> actually compile anything (-p meaning parse-only), and it would list all 
> the /files/ used (not just the imports).
> 
> Any way you'd add this feature? :)

I totally agree with Gregor. The -J switch might give us a hint that the
files /on the command line/ must be recompiled, but it still doesn't make
it easier to find out what other files are needed in the application. One
purpose of Bud, and I assume Rebuild, is to allow the coder to just enter
one name on the command line and get all the other required files magically
included in the compilation process. The alternative is to require the
coder to maintain makefiles and/or type every required file onto the
command line.

-- 
Derek
(skype: derek.j.parnell)
Melbourne, Australia
"Down with mediocrity!"
8/02/2007 10:42:00 AM



More information about the Digitalmars-d mailing list