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 rebuilds workspace member when building root even if workspace member was just built #6337

Closed
jackcmay opened this issue Nov 20, 2018 · 6 comments

Comments

@jackcmay
Copy link

Problem

Building a workspace root after building a workspace member causes the workspace member to be rebuilt. Seem to be related to project dependencies and that fact that the member is a cdylib.

The example project below's README.md has a number of different to make the problem go away but none of them should be the solution to the problem.

Steps
Example project that recreates the issue:
https://github.com/jackcmay/sandbox_rust_rebuilds/blob/master/README.md

Notes

Output of cargo version: cargo 1.30.0 (a1a4ad3 2018-11-02)

@ehuss
Copy link
Contributor

ehuss commented Nov 20, 2018

This should be fixed in beta (1.31) via #6170.

@jackcmay
Copy link
Author

Thanks! I verified that the rebuild issue goes away on beta 1.3.1.

@jackcmay jackcmay reopened this Nov 21, 2018
@jackcmay
Copy link
Author

We've noticed that locally the build times between stable and beta 1.31 are the same but in docker, we are seeing a noticeable difference in build times. (2 for stable, 13 for beta)

@ehuss
Copy link
Contributor

ehuss commented Nov 21, 2018

@jackcmay Can you provide a reproduction or more information? Is it building more stuff in beta, or is it just running more slowly?

@jackcmay
Copy link
Author

@ehuss I'm not able to recreate the issue outside of our CI environment, sorry.

@Arnavion
Copy link

For anyone landing here from web search, this issue still happens for crates that have panic=abort and are compiled for both cdylib as well as rlib (for other dependencies). It appears to be tracked by #6313

panic="abort" and cdylibs and tests: Create a project with a lib (cdylib crate type), binary, and an integration test, with panic="abort" in the profile. When cargo test runs, the cdylib is built twice (once with panic=abort for the binary, and once without for the test), with the same filename. Building the lib for the test should probably skip the cdylib crate type (assuming rlib is also available), but implementing this is very difficult. See #6313 (comment).

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

3 participants