forked from rust-lang/cargo
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Always build libraries into the same location
Previously Cargo would compile a library into a different location depending on whether it was the "root crate" or not. In the ongoing saga of reducing Cargo's reliance on the idea of a "root crate" this PR is the next step. With workspaces the root crate of a compliation changes all the time, so the output needs to be the same whether a crate is at the root or not. Fixing this inconsistence in turn fixes bugs like rust-lang#2855 and rust-lang#2897 which arise due to this discrepancy. Additionally, Cargo will no longer recompile a library when it's used as a "root crate" or not. This is fixed by taking a few steps: * Everything is now compiled into the `deps` directory, regardless of whether it's a root output or not. * If a "root crate" is being compiled, then the relevant outputs are hard-linked up one level to where they are today. This means that your binaries, dylibs, staticlibs, etc, will all show up where they used to. * The `-C metadata` flag is always omitted for path dependencies now. These dependencies are always path dependencies and already all have unique crate names. Additionally, they're the only crates in the DAG without metadata, so there's no need to provide additional metadata. This in turn means that none of the file names of the generated crates are mangled. Closes rust-lang#2855
- Loading branch information
1 parent
0c08bd1
commit 0863469
Showing
18 changed files
with
156 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.