-
Notifications
You must be signed in to change notification settings - Fork 613
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rake -n does not mark dependents for Execution #92
Comments
|
I think rake cannot know if fileB is going to have it's file timestamp updated or not, that depends on what the actual So at most, rake can say something like
Or maybe i am missing something. |
I think I've always assumed that if the code for building If this check was in place, then it wouldn't be a problem for the dry-run to print this:
because the semantics would be the following: " In fact, whenever there is more than one line such as But then, all of this would require rake to actually fail on error (instead of failing silently) when its |
Hi Silvio, thanks for responding.
Whether rake should or should not raise an error if the file task doesn't update the file as part of the file task execution seems like an interesting but separate discussion to me. Back to the original issue about |
Well, whenever there are two tasks marked for execution, we can never know if the second one will ever execute. Even if we run The reason why mentioned my assumption of rake raising an error is that any other solution would require silent failure (I think). For example, if If we go for option (c), then I don't see any problem in saying both Maybe there's an option (d) that I'm missing? Or maybe options (a) or (b) are better than I think? Side note:
Actually, I think rake does assume that file tasks update the timestamps. That's why it will not run |
Keep in mind file "fileB" => %W[fileA] do |t|
if something_happens?
sh %Q[touch #{t.name}]
end
end Implementation of the task, including the update of the file timestamp it's up to the user, plus rake doesn't assume anything about the implementation of the task as of now.
Cool, we agree on that 👍 So if we cannot assume that
in the output of the dry-run? |
Rake does assume that file tasks update the timestamps. That's why it will not run
Whenever there are two tasks marked for execution, we can never know if the second one will ever execute. Even if we run Should |
" |
I have a Rakefile with these file tasks:
I perform this setup, where everything is built and then the first file in the chain (
fileA
) is updated:And now
rake -n
tells me that onlyfileB
needs to be updated...Even though it knows it must update both
fileB
andfileC
:I expected
rake -n
to tell me this:The problem seems to stem from the fact that the internal function
out_of_date?
(infile_task.rb
) does not take into account when a file should have updated its timestamp (but didn't, because this is a dry-run).The text was updated successfully, but these errors were encountered: