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 and some dependencies are compiled twice on CI #48223

Closed
alexcrichton opened this issue Feb 15, 2018 · 6 comments
Closed

Cargo and some dependencies are compiled twice on CI #48223

alexcrichton opened this issue Feb 15, 2018 · 6 comments
Labels
T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.

Comments

@alexcrichton
Copy link
Member

I noticed on the most recently timed out mipsel dist builder that Cargo, the library, was compiled twice. This is no small chunk of time!

Investigating it looks like a number of libraries were compiled at least twice, including: cargo, chrono, crates-io, docopt, env_logger, failure_derive, failure, num, serde_derive_internals, serde_derive, synstructure.

My guess is that the feature selection is changing for deeply nested crates like syn or num between top-level targets like the RLS and Cargo. We should make sure that the feature selection is the same so the dependencies can be shared, and then we should probably add a check to CI that Cargo isn't compiled twice.

@alexcrichton alexcrichton added the T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. label Feb 15, 2018
@alexcrichton
Copy link
Member Author

cc @Mark-Simulacrum, @kennytm

@ishitatsuyuki
Copy link
Contributor

I think I brought up this before, and as a result you closed the issue at Cargo side.

@alexcrichton
Copy link
Member Author

Cargo is working as intended, our CI is not

@ishitatsuyuki
Copy link
Contributor

So this is rust-lang/cargo#4048. I think this is definitely a feature worth implement in Cargo.

alexcrichton added a commit to alexcrichton/derive-new that referenced this issue Mar 1, 2018
In tracking down the cause of rust-lang/rust#48223 I found that the `syn` crate
was compiled twice and with different features than the ones that Cargo
activated. It turns out that the RLS pulls in this crate which depends on `syn`,
and this crate enabled the `full` feature in `syn` where a standalone build of
Cargo didn't activate such a feature. Consequently this means that when Cargo
was compiled for the RLS and for itself it was compiled twice!

I initially started out by removing the dependency on the `full` feature in this
crate (hurray faster compiles too!) but ended up updating to syn 0.12 as well
which is the updated version that works better with spans and such.

I've also done some reorganization of the tests cases to hopefully be more
amenable to CI as well, but let me know if any of it looks odd!
@alexcrichton
Copy link
Member Author

I think this will be fixed with nrc/derive-new#28 and #48642

@alexcrichton
Copy link
Member Author

Fixed in #48642

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

2 participants