Skip to content

Split into lib and bin #933

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
wants to merge 1 commit into from
Closed

Split into lib and bin #933

wants to merge 1 commit into from

Conversation

Manishearth
Copy link
Member

This improves compile times since we don't need to effectively create a second
rustc when running cargo build --lib or using clippy as a dependency. cargo build will still be slowly

@Manishearth
Copy link
Member Author

Boiling down the travis issue, it seems like when we cargo install this, it builds a bin depending on a dynamic clippy instead of a static one. Adding crate-type = ["dylib", "rlib"] to the lib section doesn't improve things.

cc @alexcrichton

@alexcrichton
Copy link
Member

I believe this may be a limitation of the compiler today. There's a nice fat comment about what we do today, but it boils down to basically a "poor man's heuristic" where if we link anything dynamically (like the compiler) we maximize the number of dynamic dependencies. Which is to say that we prefer the dylib to the rlib when both are found.

You may be able to fix this by having an executable depending on an rlib (the implementation), and the plugin is a dylib also depending on the rlib.

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 this pull request may close these issues.

2 participants