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

patch table fails to rewrite dep to local path if it’s published in Cargo registry #4936

Closed
sanmai-NL opened this issue Jan 12, 2018 · 13 comments
Labels
A-patch Area: [patch] table override

Comments

@sanmai-NL
Copy link

cargo 0.25.0-nightly (a88fbace4 2017-12-29)

Patching crates.io dependencies to use a local path does not work from a virtual manifest.

E.g. virtual manifest (./Cargo.toml):

[patch.crates-io]
sitemap = { path = "./in-house-sitemap/" }

Workspace member package manifest (./package/Cargo.toml):

[dependencies]
sitemap = "*"

This will pull in the sitemap crate from crates.io, unlike similarly rewritten dependencies where no crate with the same name is published in the Cargo registry.

@alexcrichton
Copy link
Member

Have you tried updating Cargo.lock? If not, can you provide an example to work with?

@sanmai-NL
Copy link
Author

You mean running cargo update? Yes. I’ll try to make a complete example if I have more time.

@alexcrichton
Copy link
Member

Hm so some dependencies are being rewritten when others aren't? Are you sure that package/Cargo.toml is in the same workspace as the root one perhaps?

@stale
Copy link

stale bot commented Sep 17, 2018

As there hasn't been any activity here in over 6 months I've marked this as stale and if no further activity happens for 7 days I will close it.

I'm a bot so this may be in error! If this issue should remain open, could someone (the author, a team member, or any interested party) please comment to that effect?

The team would be especially grateful if such a comment included details such as:

  • Is this still relevant?
  • If so, what is blocking it?
  • Is it known what could be done to help move this forward?

Thank you for contributing!

(The cargo team is currently evaluating the use of Stale bot, and using #6035 as the tracking issue to gather feedback.)

If you're reading this comment from the distant future, fear not if this was closed automatically. If you believe it's still an issue please leave a comment and a team member can reopen this issue. Opening a new issue is also acceptable!

@stale stale bot added the stale label Sep 17, 2018
@sanmai-NL
Copy link
Author

This issue is still relevant. Unclear whether any issue blocks this or what can be done other than fixing Cargo.

@stale stale bot removed the stale label Sep 18, 2018
@ghost

This comment was marked as off-topic.

@alexcrichton
Copy link
Member

@stjepang it's currently intended behavior that [patch] is read at the workspace level (not per-crate level). It's a bug, though, that we don't warn about [patch] in sub-crates.

@sanmai-NL were you able to make an example for this? It's difficult to fix as it's not clear to me how to reproduce and there's some unanswered questions above.

@sanmai-NL
Copy link
Author

@alexcrichton: I’m sorry, I haven’t got around to that. I thought the OP should be enough but so far it isn’t. I’ll make an example ASAP.

@ehuss ehuss added the A-patch Area: [patch] table override label Dec 18, 2018
@theduke
Copy link

theduke commented Jan 22, 2019

I have encountered this issue as well.
Issue was fixed by deleting Cargo.lock.

I tried to reproduce it for about half an hour, but it couldn't manage to get a simple workspace to run into the same issue.

The only observation I can offer: the error I received was related to a stale version of a dependency that was not required by any of the crates anymore.

@epage
Copy link
Contributor

epage commented Oct 17, 2023

As this has been sitting open for 5 years without reproduction steps, I'm closing it. If someone can figure it how to reproduce this, let us know!

@epage epage closed this as not planned Won't fix, can't repro, duplicate, stale Oct 17, 2023
@sanmai-NL
Copy link
Author

As this has been sitting open for 5 years without reproduction steps, I'm closing it. If someone can figure it how to reproduce this, let us know!

If anything, the repro steps are in the opening post.

@epage
Copy link
Contributor

epage commented Oct 18, 2023

I was going off of alex's comment

It's difficult to fix as it's not clear to me how to reproduce and there's some #4936 (comment) above.

That made me think something was left out of the reproduction steps.

In general, I feel the reproduction steps are inadequate. I might see an issue but it will be unclear if its the issue you are having. A repo would be a big help.

@weihanglo
Copy link
Member

It might be something similar to #12464.
But yup a clearer step to reproduce would be really helpful for investigation.

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
Projects
None yet
Development

No branches or pull requests

6 participants