Skip to content
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

Closed
tiffany352 opened this issue Sep 23, 2013 · 5 comments
Closed

Comments

@tiffany352
Copy link

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.

$ rustpkg --version
WARNING: The Rust package manager is experimental and may be unstable
rustpkg 0.8-pre (4c6bf48 2013-09-17 20:35:54 -0700)
host: x86_64-unknown-linux-gnu
@clonejo
Copy link

clonejo commented Nov 3, 2013

Still present in

$ rustpkg --version
WARNING: The Rust package manager is experimental and may be unstable
rustpkg 0.9-pre (e0c01ca 2013-11-02 12:11:18 -0700)
host: x86_64-unknown-linux-gnu

Same issue for using rustpkg build with lib.rs, also rustpkg test with test.rs.

@sfackler
Copy link
Member

sfackler commented Nov 5, 2013

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.

@huonw
Copy link
Member

huonw commented Nov 5, 2013

Doesn't the parser store the file from which things came as part of the span?

@sfackler
Copy link
Member

sfackler commented Nov 5, 2013

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.

@alexcrichton
Copy link
Member

rustpkg is gone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants