Fix paths given to compiler.is_outdated.
The check to see whether or not a source file is outdated was being passed the `input_path` and `output_path` variables, which are not the actual paths to files on disk. In particular, `input_path` is the path which will be searched for using the staticfiles finders, and `output_path` is the relative path within the staticfiles root. If the staticfiles root was not the same as the root directory of the project, this would result in the check always reporting that the file was outdated. In addition, if a source file required a finder to locate, the check would fail. Changing this to use `infile` and `outfile` instead means that the check operates on the same file paths that the compiler will. This therefore checks the files that were copied by the collector against the files which are outputted by the compiler, which is a much more correct idea of whether something is out of date. This was tested in conjunction with a custom LessCompiler that uses a helper to introspect dependencies. Before this change, that helper was seeing file paths that did not exist (since STATIC_ROOT is a few subdirectories deep in our codebase). Afterwards, it is able to successfully introspect all the source files to build the dependency tree.
Showing
Please
register
or
sign in
to comment