Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upFAQ docs request: What is the distinction between 'crate' and 'package'? #3380
Comments
This comment has been minimized.
This comment has been minimized.
|
For reference, the questions the user asked on IRC:
|
This comment has been minimized.
This comment has been minimized.
|
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 |
alexcrichton
added
the
A-documenting-cargo-itself
label
Dec 10, 2016
This comment has been minimized.
This comment has been minimized.
|
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). |
This comment has been minimized.
This comment has been minimized.
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 |
This comment has been minimized.
This comment has been minimized.
|
@steveklabnik @matklad Okay thank you. I think I am less confused now ;) |
This comment has been minimized.
This comment has been minimized.
|
So, the |
This comment has been minimized.
This comment has been minimized.
|
Well both. That is, packages contain one or more crates. The |
frewsxcv commentedDec 9, 2016
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 :)