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

Warn about path overrides that won't work #3136

Merged
merged 1 commit into from
Oct 6, 2016

Commits on Sep 29, 2016

  1. Warn about path overrides that won't work

    Cargo has a long-standing [bug] in path overrides where they will cause spurious
    rebuilds of crates in the crate graph. This can be very difficult to diagnose
    and be incredibly frustrating as well. Unfortunately, though, it's behavior that
    fundamentally can't be fixed in Cargo.
    
    The crux of the problem happens when a `path` replacement changes something
    about the list of dependencies of the crate that it's replacing. This alteration
    to the list of dependencies *cannot be tracked by Cargo* as the lock file was
    previously emitted. In the best case this ends up causing random recompiles. In
    the worst case it cause infinite registry updates that always result in
    recompiles.
    
    A solution to this intention, changing the dependency graph of an overridden
    dependency, was [implemented] with the `[replace]` feature in Cargo awhile back.
    With that in mind, this commit implements a *warning* whenever a bad dependency
    replacement is detected. The message here is pretty wordy, but it's intended to
    convey that you should switch to using `[replace]` for a more robust
    impelmentation, and it can also give security to anyone using `path` overrides
    that if they get past this warning everything should work as intended.
    
    [bug]: rust-lang#2041
    [implemented]: http://doc.crates.io/specifying-dependencies.html#overriding-dependencies
    
    Closes rust-lang#2041
    alexcrichton committed Sep 29, 2016
    8 Configuration menu
    Copy the full SHA
    fc0e642 View commit details
    Browse the repository at this point in the history