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
TaskManager#synthesize_file_task results in surprising command line behavior #234
Comments
This appears to be a (more informative) dupe of #127 If one issue must prevail, I suggest this one :) |
Recently encountered this issue as well due to some unexpected pattern matching from the shell. I have a
My naive understanding of this behavior is that it appears to be a side effect of how Rake handles dependencies. If a task or rule depends on a file, Rake will automatically create a NOP task for it if the file exists. The task can then be added to part of the dependency chain. |
This is entirely consistent with rake's ancestry being a ruby version of make. The original purpose of make (and thus rake) is to make files. What we call tasks are an extension of the underlying recipes for making files (typically by compiling from source files). Just like make, if a file exists, then its task is considered satisfied (modulo, the file's mtime). Thus the noop task is necessary to allow any tasks or dependencies to depend on files. |
I have a Rakefile with the
report
task defined. There are no FileTasks in my Rakefile. I also have areports
dir at my project toplevel.If I run
rake report
then my task is executed as expected. If I runrake reportx
then I get the expected error about "don't know how to build task". If I runrake reports
then I get a NOOP. No errors.I don't understand why, for any existing file or dir passed to
rake
as a target, rake will create a NOOP FileTask. What is gained from having tons of (potential) NOOP tasks that correspond to every single file and dir (and possible path to such) on the filesystem?In my
rake reports
case, I would much prefer an error. So the downside is that the user doesn't get an error for erroneous tasks that were never defined. What is the upside ofTaskManager#synthesize_file_task
?I believe its invocation here is causing the problem (lacking an error) for my
rake reports
case.The text was updated successfully, but these errors were encountered: