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

[replace] silently ignored if crate is part of a workspace #3099

Closed
lilith opened this issue Sep 17, 2016 · 11 comments
Closed

[replace] silently ignored if crate is part of a workspace #3099

lilith opened this issue Sep 17, 2016 · 11 comments
Labels
A-diagnostics Area: Error and warning messages generated by Cargo itself.

Comments

@lilith
Copy link
Contributor

lilith commented Sep 17, 2016

Using cargo 0.13.0-nightly (b78beb1 2016-09-01)
Also reproduced with cargo 0.13.0-nightly (9399229 2016-09-14)
Repro:

git clone https://github.com/nathanaeljones/cargo_replace_test
cd cargo_replace_test/any_crate
cargo build
(note pkg-config pulled from crates.io)
cd ..
git checkout no_workspace
cargo build
(note pkg-config pulled from replacement location)
@SergioBenitez
Copy link
Contributor

SergioBenitez commented Sep 19, 2016

Just ran into the issue (I believe) you're describing. To be clear, Cargo ignores the [replace] section in workspace non-root crates without emitting a warning. However, not emitting a warning will surely lead to confusion (as it did for me). Thus, Cargo should emit a warning when it ignores [replace]or, better yet, fail with an error.

@lilith
Copy link
Contributor Author

lilith commented Sep 19, 2016

What do you mean by root crate? Are there any circumstances in which Cargo honors [replace] if workspaces are in use?

@SergioBenitez
Copy link
Contributor

SergioBenitez commented Sep 19, 2016

Yes. Cargo honors [replace] if the section is placed in the root crate or virtual root crate.

@lilith
Copy link
Contributor Author

lilith commented Sep 19, 2016

I cannot reproduce success in that scenario.

@SergioBenitez
Copy link
Contributor

I'm on IRC as @sergio. Ping me and let's see if we can find the differences.

@lilith
Copy link
Contributor Author

lilith commented Sep 19, 2016

So, I can now reproduce that success. I have a failed build against a August nightly of cargo where it fails, and some corner cases where the lockfile cache doesn't get updated, but I think I have a path to success for my actual project as well as the repro above.

Raising an error would be super helpful, though.

@alexcrichton
Copy link
Member

@nathanaeljones ah ok, looks like things got sorted out with the right build here? Could you clarify though what error should be raised?

@SergioBenitez
Copy link
Contributor

@alexcrichton No, the issue still exists. See my original comment:

Just ran into the issue (I believe) you're describing. To be clear, Cargo ignores the [replace] section in workspace non-root crates without emitting a warning. However, not emitting a warning will surely lead to confusion (as it did for me). Thus, Cargo should emit a warning when it ignores [replace]or, better yet, fail with an error.

@alexcrichton
Copy link
Member

Oh right, indeed! Sounds good to me.

@alexcrichton alexcrichton added the A-diagnostics Area: Error and warning messages generated by Cargo itself. label Sep 29, 2016
@sanmai-NL
Copy link

So this issue can be closed? @alexcrichton

@alexcrichton
Copy link
Member

I believe so, yes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Error and warning messages generated by Cargo itself.
Projects
None yet
Development

No branches or pull requests

4 participants