-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Rustpkg isn't checking for freshness of crate files that aren't main.rs #9416
Comments
Still present in
Same issue for using |
I've been looking into this and it looks really painful for rustpkg to actually check the file modification times. These files are actually loaded by the parser (!) and there's no record saved of what files were used to build the AST for a crate. Rustpkg could walk the AST and duplicate the parser's logic to track down those external modules, but that seems sketchy, especially since I don't think it's possible to determine if the current module was an external or internal one at that point. What I think makes more sense is to hash the AST itself and compare that to the old version. This is nice since it takes care of #6522 as well. |
Doesn't the parser store the file from which things came as part of the span? |
Ah, it does look like you can get a filename out of a Span and the CodeMap in the Session. You would have to be careful to avoid the synthetic files like "<std-macros>". I do kind of like using the AST hash since it doesn't require a recompile of the library if you only changed tests for example. |
rustpkg is gone. |
When I go to build something with rustpkg after modifying any file other than main.rs, despite main.rs having
mod foo;
where the file I'm editing is foo.rs, it doesn't check if that file has been updated when I build.The text was updated successfully, but these errors were encountered: