{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreigwayuqv6zmqk73a7g3x27osh4cwzdyyx2zzax7nhpmpvudoo4mbq",
    "uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3mk7hilejlyb2"
  },
  "path": "/t/pre-rfc-cargo-package-should-include-fewer-files-by-default/24188#post_13",
  "publishedAt": "2026-04-24T01:49:05.000Z",
  "site": "https://internals.rust-lang.org",
  "tags": [
    "Exclude .github and .gitignore from published packages by default?",
    "tools and infrastructure",
    "here"
  ],
  "textContent": "Somewhat relevant proposal:\n\nExclude .github and .gitignore from published packages by default? tools and infrastructure\n\n> Recently I was a bit surprised that Cargo includes .github/ and .gitignore into packages generated for crates hosted in a one-crate repository (e.g. see here). Interestingly, Cargo already ignores items listed in .gitignore, but the file itself gets included. Both items are useless in published packages and I don't see any practical reason for including them. I think it's worth to exclude them by default instead of requiring manual addition of exclude = [\".github/\", \".gitignore\"] to Cargo.toml.…\n\nkornel:\n\n> I'm leaning towards excluding all test files from packages to save bandwidth, and I'd prefer Cargo to exclude `tests/` by default to make it clear that packages are not meant to be self-testable\n\nI think that crater is an important enough use case in favor of not \"excluding\" tests outright (also, do not forget about benchmarks). But I agree that they probably should not be part of \"package\" which is used as a dependency. As an example, some cryptographic crates have pretty extensive test vector collections (~MiB in binary form, more if we are to keep original text KAT files) and forcing users to download those files as part of the crate package seems quite unnecessary to me.\n\nSo having separate \"dev\" packages containing tests (but not `src/`) looks like an interesting potential idea to me.",
  "title": "[Pre-RFC] `cargo package` should include fewer files by default"
}