Join GitHub today
Rake does not rebuild files that depend on deleted files #286
The following Rakefile behaves in an undesirable way which is inconsistent with GNU Make:
file 'foo' => 'bar' do sh 'echo hi > foo' end file 'bar' do sh 'running bar task' end
Suppose the file
The expected output of the "rake" command is:
The actual output of the "rake" command is:
GNU Make behaves in the expected way. If I use the following Makefile and run "make foo" while
foo: bar echo hi > foo bar: @echo running bar task
So clearly GNU Make and Rake are behaving differently, and I would argue that the GNU Make behavior is better. If you are building a C or C++ program, then the GNU Make behavior in this situation is necessary to properly support the case where a header file has been deleted, and therefore all C files that previously depended on it need to be rebuilt.
It should be easy to fix this issue: we can just change https://github.com/jimweirich/rake/blob/master/lib/rake/file_task.rb#L24 to use
In case it matters, I am using Rake 10.1.0, JRuby 1.7.13, and Windows 8 64-bit.
Jul 31, 2014
referenced this issue
Jul 31, 2014
My initial reaction was that the header example was not a good reproduction of this behaviour and then I realized that I never explicitly define headers as dependencies, these are always generated fresh so the deleted files just vanish.
Having said that I would go as far as to say the original behaviour is a bug and should be fixed on the following reasoning:
Yeah, in my example Rakefile above,