Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to delete a published crate from crates.io?

Tags:

rust

I have accidentally published my private crate to crates.io. How do I delete it? I checked the documentation but it seems like there is no way to delete a published crate.

like image 771
Allen Lee Avatar asked Oct 04 '18 04:10

Allen Lee


People also ask

How do I get rid of crate rust?

Remove the crate or version from the index. To remove an entire crate, remove the entire crate file. For a version, remove the line corresponding to the relevant version. Remove the crate archive(s) and readme file(s) from S3.

How do I publish crate io?

Publishing a new version of an existing crate In order to release a new version, change the version value specified in your Cargo. toml manifest. Keep in mind the SemVer rules which provide guidelines on what is a compatible change. Then run cargo publish as described above to upload the new version.

What is crates io?

crates-io-apiA Rust API client for the crates.io API. This crate aims to provide an easy to use and complete client for retrieving detailed information about Rusts crate ecosystem. The library uses the reqwest HTTP client and provides both an async and synchronous interface.

Is crates IO open source?

The crate registry at crates.io distributes the source code of your packages, so it primarily hosts code that is open source.


2 Answers

You cannot delete a crate once it is published. However, you can yank it to mark your crate as not usable: basically, nobody will use it, and no or few people will want to see the content. This policy allows to forbid the arbitrary breakage of other crates that use your package as a dependency.

If you have code or information in this crate that you do not want to be public, refer to the other answer.

like image 93
Boiethios Avatar answered Oct 24 '22 07:10

Boiethios


The Crates.io policies say this under Removal:

We will do what the law requires us to do, and address flagrant violations of the Rust Code of Conduct. […] Crates.io will respect Mozilla Legal’s decisions with regards to content that is hosted.

I suggest to send mail to [email protected] as a start, and if they prove uncooperative, escalate to Mozilla Legal. Only as a last resort, add a deliberate Code of Conduct violation to trigger the removal.

EDIT I agree that this is not a desirable situation, so I submitted a pull request with a proposed policy change.

like image 33
Florian Weimer Avatar answered Oct 24 '22 06:10

Florian Weimer