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

cargo build always rebuilds some crates needlessly #8

Open
Xion opened this issue Jun 24, 2017 · 1 comment
Open

cargo build always rebuilds some crates needlessly #8

Xion opened this issue Jun 24, 2017 · 1 comment
Labels

Comments

@Xion
Copy link
Owner

Xion commented Jun 24, 2017

It is probably be a bug in Cargo but noting it here for posterity.

Rebuilding the library crate always triggers a rebuild of certain dependencies:

$ cargo build -p rofl                                                                                                   
   Compiling unreachable v0.1.1
   Compiling thread_local v0.3.3
   Compiling regex v0.2.2
   Compiling rofl v0.0.1 (file:///home/xion/Code/rofld/src/lib)
    Finished dev [unoptimized + debuginfo] target(s) in 23.69 secs

and more so for the server crate:

$ cargo build -p rofld
   Compiling unreachable v0.1.1
   Compiling thread_local v0.3.3
   Compiling slog-extra v0.1.2
   Compiling regex v0.2.2
   Compiling slog-stream v1.2.1
   Compiling slog-term v1.5.0
   Compiling slog-stdlog v1.1.0
   Compiling slog-envlogger v0.5.0
   Compiling rofl v0.0.1 (file:///home/xion/Code/rofld/src/lib)
   Compiling rofld v0.0.1 (file:///home/xion/Code/rofld/src/server)
    Finished dev [unoptimized + debuginfo] target(s) in 56.76 secs

This persists not only through cargo clean or nuking of Cargo.lock, but also apparently between machines AND systems (observed on OSX and Linux). The deps which are rebuilt needlessly are always the same.

It may have started happening with Rust 1.18 but not completely sure about that. In either case, it adds quite a bit to the already long build time :(

@Xion Xion added the bug label Jun 24, 2017
@Xion
Copy link
Owner Author

Xion commented Jun 24, 2017

Clarification: this only happens if you alternate the build of library & server crates. If you only build one or the other in a row, the deps won't be rebuilt redundantly.

Something something {path = "..."} dependency in the server crate?

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

No branches or pull requests

1 participant