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

A project can not depend on itself as a path dependency #9702

Closed
wants to merge 1 commit into from

Conversation

yerke
Copy link
Contributor

@yerke yerke commented Jul 17, 2021

Closes #9518

@rust-highfive
Copy link

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @ehuss (or someone else) soon.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 17, 2021
tests/testsuite/features2.rs Outdated Show resolved Hide resolved
@alexcrichton
Copy link
Member

If we want to explicitly disallow this then I think it's best to do it in the cyclic detection of the resolver rather than in the manifest parsing code, since the resolver has a better idea of what connects to what.

@ehuss ehuss added S-waiting-on-author Status: The marked PR is awaiting some action (such as code changes) from the PR author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 26, 2021
@bors
Copy link
Collaborator

bors commented Aug 25, 2021

☔ The latest upstream changes (presumably #9827) made this pull request unmergeable. Please resolve the merge conflicts.

@ehuss
Copy link
Contributor

ehuss commented Dec 14, 2021

Ping @yerke Just checking in to see if you are still interested in working on this, or if you had any questions.

@yerke
Copy link
Contributor Author

yerke commented Dec 14, 2021

@ehuss thanks for checking. I am sorry for taking forever. I hope I will have time around Christmas for this.

@yerke yerke force-pushed the forbid-self-path-dependency branch from d13c889 to 2009343 Compare December 25, 2021 03:04

// And this should be no different.
p.cargo("test").run();
// TODO: Figure out how to properly fix this test case.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure how to correctly test this after my changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ehuss @alexcrichton Do you have any suggestions on how to modify that test? Thanks.

@yerke
Copy link
Contributor Author

yerke commented Dec 25, 2021

@ehuss @alexcrichton Do you mind having a look when you get a chance? I want to know if I am on the right track. Thanks!

Copy link
Member

@alexcrichton alexcrichton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be along the right lines, yeah. Can you add a comment in check_cycles about what this is doing? It feels a bit odd that it's only checking for one-level-deep cycles when cycles can generally be many layers deep, but this is only applicable for dev-dependecies-on-itself and other packages transitively depending back on the first seems ok

@daxpedda
Copy link
Contributor

daxpedda commented Jan 4, 2022

There is a discussion on why this shouldn't be made a hard-error just yet here:
#9518 (comment)

@yerke yerke force-pushed the forbid-self-path-dependency branch from 2009343 to ca0163b Compare January 9, 2022 05:19
@yerke
Copy link
Contributor Author

yerke commented Jan 9, 2022

@alexcrichton Thanks for your feedback. I added the comment.

@ehuss
Copy link
Contributor

ehuss commented Mar 23, 2022

I'm going to close this for now, as there is some uncertainty if this is the right thing to do (per #9518 (comment)) and this is not a high priority for us to fix at this time. Thank you for the PR, though! We may resurrect this in the future when we have more capacity to review and clarity on how this should work.

@ehuss ehuss closed this Mar 23, 2022
@yerke yerke deleted the forbid-self-path-dependency branch March 23, 2022 03:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: The marked PR is awaiting some action (such as code changes) from the PR author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

A dependency on path = "." should have a good error message
6 participants