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

Deprecate replace? #7092

Closed
nrc opened this issue Jul 3, 2019 · 9 comments
Closed

Deprecate replace? #7092

nrc opened this issue Jul 3, 2019 · 9 comments
Labels
A-patch Area: [patch] table override A-replace Area: [replace] table override

Comments

@nrc
Copy link
Member

nrc commented Jul 3, 2019

I don't see any good reason to have replace and patch and it is confusing that we have two features that do the same thing in subtly different ways.

@nrc
Copy link
Member Author

nrc commented Jul 3, 2019

We'd obviously take a long time to deprecate and probably can't remove the feature until the next edition.

@alexcrichton
Copy link
Member

Generous 👍 from me, this was always the initial intention but we never got around to doing it. I'd be game to do this at any time!

@est31
Copy link
Member

est31 commented Jul 5, 2019

I can vaguely recall replace having some capabilities that patch doesn't but can't remember any specifics.

@ehuss
Copy link
Contributor

ehuss commented Jul 5, 2019

The primary problem with [patch] that I'm aware of is that you cannot target different versions (#6169) whereas you can with [replace]. I'm not sure if it is possible to support that, or how important it is. Would that be a blocker to deprecating?

There are also some bugs (https://github.com/rust-lang/cargo/issues?q=is%3Aopen+is%3Aissue+label%3AA-patch), particularly around patching git dependencies (such as #5478 and #4509). Not being able to switch branches seems particularly not good.

I don't know enough the judge how important these issues are.

@alexcrichton
Copy link
Member

I think that's something we do want to support in [patch], just haven't had a chance to add yet! I just posted a strawman syntax and I suspect it would be pretty uncontroversial to add support for it. It's a good point about git repos, though! I suspect that [replace] suffers from basically the same issues though.

I personally think there's enough bugs and usage issues with [replace] that it's not worthwhile to keep around. We should definitely be funneling all development of features/fixes into [patch] instead of [replace]

@ehuss ehuss added A-patch Area: [patch] table override A-source-replacement Area: [source] replacement A-replace Area: [replace] table override and removed A-source-replacement Area: [source] replacement labels Jul 28, 2019
ehuss added a commit to ehuss/cargo that referenced this issue Dec 21, 2019
@workingjubilee
Copy link
Member

There are error messages emitted that still point to [replace] that should probably point to using a [patch] table instead.

@akien-mga
Copy link
Contributor

There are error messages emitted that still point to [replace] that should probably point to using a [patch] table instead.

Indeed, I saw that so I made a PR: #9533.

bors added a commit that referenced this issue Jun 2, 2021
…r=alexcrichton

Replace deprecated `[replace]` references with `[patch]`

Cf. #7092.

Note: Untested, but given the changes I figure that if the testsuite passes it should be fairly safe.
@elibroftw
Copy link

elibroftw commented Mar 26, 2022

I was reading https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html#the-replace-section, and I'm completely dumbfounded with how to force the use of a specific version of a dependency that is also required by a sub dependency that is from git.

I'm trying to use https://github.com/tauri-apps/tauri-plugin-window-state, however, it breaks my build since one of its sub-dependencies is broken.
The plugin depends on a version of tauri that is not the same as the one I depend on which depends on the broken wry.

The docs says replace is deprecated, but why is this issue still open then?
There are plenty of simple examples for patch, but they are not explained and they don't demonstrate flexibility.

@epage
Copy link
Contributor

epage commented Oct 17, 2023

Replace was marked as deprecated in #7733, so I take it this is resolved? If there is something I'm missing, let us know so we can re-open this.

@epage epage closed this as not planned Won't fix, can't repro, duplicate, stale Oct 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-patch Area: [patch] table override A-replace Area: [replace] table override
Projects
None yet
Development

No branches or pull requests

8 participants