[Rake-devel] Advanced rule's proc not executed

Tassilo Philipp tphilipp at potion-studios.com
Fri Apr 25 06:17:43 EDT 2008

Hello mailing list,

I'm working with rake 0.8.1, and I have a problem with advanced rules as they are outlined in the documentation. In my case, I try to calculate the name of a .c file's path from an .o file path:

rule '.o' => [ proc { |p| getCSourcePath(p) } ] do |t|
    (do some stuff...)

If there is no .o file at all, this works like a charm. The proc will be called calculating the source file's path, etc.. However, if the .o file exists, the rule won't be executed anymore, even with the source file having a more recent timestamp than the object file.

Another thing I noticed is that running rake -P doesn't list the source file as a prerequisite of the object file at all.

So, to put it in a nutshell, rake only seems to run the proc used to calculate the source file's path if the rule itself will be executed anyway (which seems kind of wrong to me, since it should always check the prerequisites).
So, my question is: Do I overlook something obvious, or is this behaviour intended ?

Thanks in advance, and thanks for writing rake in the first place, it's a great tool
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rake-devel/attachments/20080425/d1fddcc7/attachment-0001.html>

More information about the Rake-devel mailing list