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

Handle renamed dependencies coming from Cargo #1487

Merged
merged 1 commit into from
Sep 16, 2018

Conversation

alexcrichton
Copy link
Member

This commit is intended to be coupled with
rust-lang/cargo#5993 where Cargo will start sending the
registry more information about locally renamed crates to persist into the
index.

@alexcrichton
Copy link
Member Author

Note that this likely shouldn't be merged until rust-lang/cargo#5993 is decided on

@Eh2406
Copy link
Contributor

Eh2406 commented Sep 7, 2018

Sorry for being out of the loop, why does the index need to know what a crate chose to rename a dependency to?

@alexcrichton
Copy link
Member Author

Ah no worries, I thought the same as you! With features, however, it becomes significant because the implicit feature name for the dependency is named after the left-hand-side of what you write in Cargo.toml, which isn't the package name (which is what we're publishing right now)

@Eh2406
Copy link
Contributor

Eh2406 commented Sep 7, 2018

So if I have an optional dependency on serde = "1" that I have renamed to serde1 then the feature will be called serde1? Has the feature part of the resolver ben tealt to read that correctly?

@alexcrichton
Copy link
Member Author

Correct yeah! To do that you'd do serde1 = { version = "1", package = "serde" }, and there should be tests yeah in Cargo for having this plumbed everywhere inside Cargo at least

@alexcrichton
Copy link
Member Author

Ok it looks like we'd like to merge rust-lang/cargo#5993, in light of that r? on this PR to get it merged?

@carols10cents
Copy link
Member

Could you add some tests please, that the correct value is written to the index, like this test? I want to make sure we don't break this :)

Copy link
Member

@carols10cents carols10cents left a comment

Choose a reason for hiding this comment

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

Tests please! :)

This commit is intended to be coupled with
rust-lang/cargo#5993 where Cargo will start sending the
registry more information about locally renamed crates to persist into the
index.
@alexcrichton
Copy link
Member Author

Now with a test!

@carols10cents
Copy link
Member

Yay tests! Thank you!

bors: r+

bors-voyager bot added a commit that referenced this pull request Sep 16, 2018
1487: Handle renamed dependencies coming from Cargo r=carols10cents a=alexcrichton

This commit is intended to be coupled with
rust-lang/cargo#5993 where Cargo will start sending the
registry more information about locally renamed crates to persist into the
index.

Co-authored-by: Alex Crichton <alex@alexcrichton.com>
@bors-voyager
Copy link
Contributor

bors-voyager bot commented Sep 16, 2018

Build succeeded

@bors-voyager bors-voyager bot merged commit c04208b into rust-lang:master Sep 16, 2018
@carols10cents
Copy link
Member

And I've deployed this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants