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

Change a published crate's canonincal name from hyphen to underscore or vice versa (once cargo recognizes either) #166

Closed
Fraser999 opened this issue Jul 10, 2015 · 22 comments
Labels
C-enhancement ✨ Category: Adding new behavior or a change to the way an existing feature works

Comments

@Fraser999
Copy link

I mistakenly published a crate with a trailing _sys in its name instead of -sys. I can't now publish under the correct name as this is identified as a rename which is forbidden.

The ideal situation would be to rename the _sys crate, but failing that, is it possible to delete it and republish under the correct name?

The crate in question is https://crates.io/crates/maidsafe_libsodium_sys.

This relates to https://internals.rust-lang.org/t/pre-rfc-hyphens-in-crate-names-redux/1655. If that RFC were accepted and implemented, this wouldn't be an issue I guess?

@alexcrichton
Copy link
Member

I can delete crates manually (allowing a re-publishing), but I do agree it would be nice to have the ability to do this automatically in some whitelisted scenarios.

Feel free to reach out to me on IRC (acrichto) if you want me to delete the crate to allow a republish.

@aidanhs
Copy link
Member

aidanhs commented Apr 27, 2016

This would also be useful for trying out releasing without permanently polluting crates.io (exposing the staging crates.io index somewhere for use with cargo publish --host would also work I think - I couldn't see it anywhere).

@steveklabnik steveklabnik added C-enhancement ✨ Category: Adding new behavior or a change to the way an existing feature works E-help-wanted labels Aug 24, 2016
@ducks
Copy link

ducks commented Sep 2, 2016

Did anyone have more thoughts on how this would work?

How does the --host thing sound? Maybe a --dry-run type flag that does everything up to the upload point? And I've never actually published a crate but is there a confirmation before pushing it up?

@Kerollmops
Copy link

Kerollmops commented Jan 10, 2017

up someone ? I have published some crates that doesn't work and was renamed.

@ostrokach
Copy link

ostrokach commented Jan 15, 2017

I ran into this problem too. I pushed a bunch of packages to crates.io before realizing that it'd be more useful if they were combined into a single package. I ended up yanking those packages, but they still show up on my dashboard.

Would it be possible to add an option to permanently delete packages which don't have other packages depending on them? This would prevent packages that you require from randomly being pulled from crates.io, but would allow people starting out to delete / rename their packages at will?

@carols10cents
Copy link
Member

Would it be possible to add an option to permanently delete packages which don't have other packages depending on them?

The packages that depend on the yanked crates might not be on crates.io :(

@alexcrichton wdym you delete people's crates from the database for them?!?!? doesn't this break reproducible builds????

I think NPM's current policy is to only allow deletion within 24 hours of publishing... I'm checking on that.

Rename... I could see a case for leaving the old crate where it is for install purposes, but allowing someone to change the name and have /crate/oldname redirect to /crate/newname with a notice at the top or something...

@carols10cents
Copy link
Member

Aha, here's npm's current policy: http://blog.npmjs.org/post/141905368000/changes-to-npms-unpublish-policy

@steveklabnik
Copy link
Member

Rename... I could see a case for leaving the old crate where it is for install purposes, but allowing someone to change the name and have /crate/oldname redirect to /crate/newname with a notice at the top or something...

I'd be in favor of treating rename as a specifc kind of yank, that is, the old one would stay, but you couldn't depend on it; you'd get the new one.

@alexcrichton
Copy link
Member

@carols10cents in general yeah it'd cause breakage (e.g. to delete libc), but deleting a crate with 0 downloads and one user is unlikely to break anyone when the one user asks for it :)

@C4K3
Copy link

C4K3 commented Mar 27, 2017

An alternative solution to this problem: Allow owners of crates to set them to hidden, so they by default don't show up on searches on crates.io, and have a "Show hidden crates" checkbox or something when searching.

This would maintain the crates never get deleted policy, while significantly reducing the annoyance from unmaintained crates.

@gilescope
Copy link

Can we reform the problem, everyone updates crates a lot, far more than creates new crates. Can we just introduce a special flag —yes-its-a-new-crate ? Then most of these crates would not get created in the first place. Obviously the error would say this crate doesn’t yet exist but if you want to create it just add this flag.

@fweimer
Copy link

fweimer commented Oct 4, 2018

I submitted a pull request to document existing practice regarding removals: #1506

@ndrewxie
Copy link

ndrewxie commented Feb 3, 2019

@alexcrichton Could you please yank every single crate/library/application under my name? Thanks. (Sounds like a ridiculous request, but there only are 2 crates under my name, which are related to each other. I wrote both of those crates in my first month of Rust, so they're obviously very nooby. Also I published to crates.io before they even worked properly lmao) It would be great if you could "delist" crates, or even delete them (but there might be dependencies that aren't on crates.io)

@jonhoo
Copy link
Contributor

jonhoo commented Feb 4, 2019

This is somewhat related to the ongoing discussion in rust-lang/rfcs#2614. Figured it'd be useful to have them be cross-linked.

@carols10cents
Copy link
Member

@ndrewxie You should be able to yank the crate versions yourself; please email [email protected] if you have any problems!

@jonhoo
Copy link
Contributor

jonhoo commented Feb 4, 2019

@carols10cents I think what @ndrewxie wants is to entirely disown the crate such that other can (potentially) take over the time. Yanking all the published versions doesn't (as far as I know) delete the crate in question.

@ndrewxie
Copy link

ndrewxie commented Feb 4, 2019

@carols10cents How do you yank crate versions (my understanding is that you remove that version)? I don't see any option to do that on crates.io

EDIT: Oh wait, nevermind, cargo yank is what I was looking for.

@DevQps
Copy link

DevQps commented Feb 6, 2019

@carols10cents @alexcrichton I also own a namespace that is currently not being used anymore. I do agree that allowing the deletion of versions or entire namespaces might result in broken crates that depend on them (either crates being published on crates.io or local projects). Maybe it is nice to include some kind of deprecation period? For example that a warning is generated when cargo attempts to download such a package, and to release a certain namespace after x months?

I guess there should be some kind of balance between existing crates not breaking and many namespaces with code that is not to be used anymore.

@fweimer
Copy link

fweimer commented Mar 19, 2019

I was told that crates are never removed except for legal reason.
It feels strange that the only way to give up a name is to publish offensive material under it, triggering a Code of Conduct violation and eventual removal.

@DevQps
Copy link

DevQps commented Mar 19, 2019

I understand why they do that because you don't want to end up with broken crates. Displaying a warning and deprecation period as I proposed before doesn't solve this problem on a second thought.

However I was thinking about this:

If an author that wishes to have its namespace removed it should first yank all public versions of the crate. If the crate then hasn't been downloaded for X months, it can "safely" be removed.

It's not 100% safe but I think it is safe in 99.9% of all cases. I think retrieving back these namespaces is worth this risk (but that is my personal opinion of course)

What do you think about this @alexcrichton @carols10cents ?

@photex
Copy link

photex commented Jun 21, 2019

I've renamed a crate to use '_' instead of '-' and am now unable to publish. :(

@carols10cents carols10cents changed the title Remove or rename a published crate Change a published crate's canonincal name from hyphen to underscore or vice versa (once cargo recognizes either) Oct 9, 2019
@carols10cents
Copy link
Member

I'm going to close this as a duplicate of #728.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement ✨ Category: Adding new behavior or a change to the way an existing feature works
Projects
None yet
Development

No branches or pull requests