Skip to content

File names with spaces causes the project to be recompiled every time #648

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

Closed
tomaka opened this issue Sep 29, 2014 · 2 comments · Fixed by #663
Closed

File names with spaces causes the project to be recompiled every time #648

tomaka opened this issue Sep 29, 2014 · 2 comments · Fixed by #663

Comments

@tomaka
Copy link
Contributor

tomaka commented Sep 29, 2014

If you have a code that looks like this:

#[path="test test.rs"]
mod test;

The value src/test test.rs will be added to the dependencies, but will be interpreted as two elements: src/test and test.rs, causing cargo build to recompile the library/binary every time.

@alexcrichton
Copy link
Member

I had a feeling this would come up eventually! This is currently a problem with rustc --dep-info in the sense that it doesn't emit a makefile syntax which properly escapes things like spaces (and probably other things as well!). I've opened rust-lang/rust#17627 about this.

To see what I'm talking about:

#[path = "foo foo.rs"]
mod foo;
$ rustc foo.rs --dep-info dep --crate-type lib
$ cat dep
libfoo.rlib: foo.rs foo foo.rs

Now, that being said, cargo itself only splits these dependencies on spaces, so it would also need to be updated!

@tomaka
Copy link
Contributor Author

tomaka commented Sep 29, 2014

That's a shitty solution, but maybe Cargo could try to concat the paths?
For example if the dependencies are src/foo foo.rs, try src/foo and if it doesn't exist try src/foo foo.rs.

alexcrichton added a commit to alexcrichton/cargo that referenced this issue Oct 3, 2014
This means that if a project has a file with a space in the name it will
properly have its freshness calculated as opposed to always having it as a
candidate to be rebuilt.

Closes rust-lang#648
bors added a commit that referenced this issue Oct 6, 2014
This means that if a project has a file with a space in the name it will
properly have its freshness calculated as opposed to always having it as a
candidate to be rebuilt.

Closes #648
@bors bors closed this as completed in #663 Oct 6, 2014
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

Successfully merging a pull request may close this issue.

2 participants