-
Notifications
You must be signed in to change notification settings - Fork 645
Add possibility to rename crates #2902
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
Comments
The problem with renaming is that the crates registry is supposed to be immutable, so it would be more like a copy, not a rename. This would generally be possible from what I can tell, but we should probably restrict people from renaming too often. It might make sense to disallow another "rename" for the next e.g. 6 months or so. |
@Turbo87 Then I ask rather like this: Why is the crates repository immutable?
@Turbo87 This is a good approach. |
because otherwise we'd risk breaking existing projects if dependencies could just be removed like that |
So you can set up some kind of forwarding to the new repository |
For that we would need to adjust As I said above, the best thing we can do it copy an existing crate including all of its version to have a new name, but a proper rename is basically impossible without breaking users. |
@Turbo87 Thank you very much for this statement.
Is there a method to copy a project completely and relatively "easy"? To my knowledge there is no
For example, you could use these redirections, but also a "legacy"-mode, which simply downloads the new cargo package when the old one is called. And new versions could then warn the end user that the package name is deprecated. Another possibility would be to mark old names as deprecated for e.g. 12 months (during this time hopefully all packages should be updated). And afterwards you can claim the project name again. As long as it has not been claimed, it will redirect to the new project page. |
A small addition, as I have described above, should make it possible to change the case and I plead for the introduction of a strict case-sensitivity rule, that for example capital letters are not used. One suggestion would be that all current crate names are converted to a crate name that complies with the rule and that all requests with the wrong case are forwarded to this name. |
AFAIK such changes would have to go through the RFC process (see https://github.com/rust-lang/rfcs/). Feel free to propose such an RFC.
not that I'm aware of. all of these suggestions would have to be built by someone first. (and we're all doing this in our free time... 😉) |
We already change all crate names to lowercase before considering uniqueness-- in other words, a crate named In order for Cargo to use case insensitive lookup when downloading crates specified in a Cargo.toml, changes need to be made to Cargo's resolution code. That issue is rust-lang/cargo#5678. Then there is allowing a change to a crate's canonical capitalization, which is #1451. So, if I understand correctly, that leaves the feature request to allow renaming of crates, and if someone has the old name in their Cargo.toml and runs I do think this should go through the RFC process; I'm concerned about the perceived security angle. I think it would be quite unexpected to ask for package So I'm closing this issue for now, pending an RFC. Thanks! |
I would suggest that crates can be renamed. As long as no other crate has used the old name, this should be redirected to the new name.
Changes that only change the case sensitivity or the characters _ and - should also be possible. Since there are crates that have the crate names written in the wrong upper and lower case and would like to change this.
The text was updated successfully, but these errors were encountered: