-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
FAQ docs request: What is the distinction between 'crate' and 'package'? #3380
Comments
For reference, the questions the user asked on IRC:
|
It's confusing because we don't often use the terms in a clear way. A cargo.toml is associated with a package, which is why it has |
So the package is the "source" from which crates are created? And when I say "extern crate foo" in a Rust file, I'm actually referring to the rlib crate that's built by cargo after downloading the So, when I choose a target with (I was the one who asked the question on IRC). |
Yes.
Yes. Library, binaries, exercises, integration tests all are different targets/crates.
Yes. It's a Cargo.toml plus the Rust source code.
Yes. Cargo downloads the package named |
@steveklabnik @matklad Okay thank you. I think I am less confused now ;) |
So, the |
Well both. That is, packages contain one or more crates. The |
Dropping a quick info for others users following the first Google hit for "cargo crate vs package"... (... the doc request has been closed without comment, the link to the FAQ doesn't help, the discussion is a bit confusing, and now we even have workspaces.) The Rust Guide contains a great summary:
|
So https://crates.io/ is actually Rust |
It distributes crates, via packages. |
I spoke with @steveklabnik a couple nights ago and they informed that the terms 'crate' and 'package' are different concepts in the context of cargo. Someone in the #rust-tools channel on IRC just asked what the differences are. It might be worth clarifying this in the Frequently Asked Questions section (or maybe a different section?).
I'd be happy to write-up something for this, but I actually don't recall the distinctions from the conversation :)
The text was updated successfully, but these errors were encountered: