Skip to content

cargo check compiles library object code if a binary exists #3418

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
alexcrichton opened this issue Dec 16, 2016 · 1 comment
Closed

cargo check compiles library object code if a binary exists #3418

alexcrichton opened this issue Dec 16, 2016 · 1 comment

Comments

@alexcrichton
Copy link
Member

Looks like if there's a binary target then the libraries are compiled entirely instead of only requiring metadata.

I ran cargo new foo followed by touch src/main.rs, and also added a dependency on libc from crates.io. After that a cargo check -v yielded:

     Running `rustc --crate-name libc /.../src/lib.rs --crate-type metadata `
     Running `rustc --crate-name libc /.../src/lib.rs --crate-type lib `
     Running `rustc --crate-name foo src/lib.rs --crate-type metadata `
     Running `rustc --crate-name foo src/lib.rs --crate-type lib ...`
     Running `rustc --crate-name foo src/main.rs --crate-type metadata ...`
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

1 participant