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

Remove conversion from hyphen to underscore #1921

Closed
wants to merge 2 commits into from
Closed

Remove conversion from hyphen to underscore #1921

wants to merge 2 commits into from

Conversation

hskang9
Copy link

@hskang9 hskang9 commented Nov 24, 2019

resolves cargo's #2775 issue

@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 @smarnach (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@carols10cents
Copy link
Member

Hi, sorry, but I think there's a misunderstanding. Fixing rust-lang/cargo#2775 means that whether a Cargo.toml file says crate-name or crate_name, it will resolve to the one crate with crate_name on crates.io. This PR would have the effect of allowing the publishing of both crate-name and crate_name as different crates, which would be potentially confusing.

@hskang9
Copy link
Author

hskang9 commented Nov 24, 2019

Well making - and _ different name was what I was trying to do, but if that creates a confusion then, I should not make this pr. But here is the confusion happening in cargo side. For example, I uploaded cargo package ‘hyphen-example’ but crates.io considers it as ‘hyphen_example’. So I should be able to import package writing “hyphen_example” but running cargo install ‘hyphen_example’ cannot find the package, but when I run cargo install ‘hyphen-example’ then it successfully installs the package. Should I add same conversion logic in cargo as crates.io applies?

@Eh2406
Copy link
Contributor

Eh2406 commented Nov 25, 2019

Should I add same conversion logic in cargo as crates.io applies?

Short answer: Yes.
Long answer: We need to find a way to do the "conversion logic" for crates.io and not for other registries, or decide to break existing functionality for other registries. We also need to find a way to best support older cargos that do not have the "conversion logic", or decide to break existing users. Neither will be straightforward rust-lang/cargo#2775 (comment)

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.

None yet

5 participants