-
-
Notifications
You must be signed in to change notification settings - Fork 4k
Only include files when packaging bevy
, rather than excluding
#18571
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
Only include files when packaging bevy
, rather than excluding
#18571
Conversation
Can you keep the tests and examples as included? They are used as compilation tests front the crates, and examples are used when building docs on docs.rs |
@mockersf Done. I will admit, I'm a little bothered by how this brings the resulting file size back up to nearly 600 KB. It's not so bad since it's only downloaded once by Cargo, and I understand the examples are used by the docs, but it still feels... weird to me. |
bevy
's packaged size by only including files, rather than excludingbevy
, rather than excluding
…n` since that wasn't being packaged
a68d569
to
5d926e4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clicking approve as I've done some basic tests and didn't spot any problems.
Tested cargo package
on Win10. I also unpacked the crate and made a new crate with a path dependency on the unpacked folder. I replaced the new crate's main.rs
with the 3d_scene
example and confirmed it built and ran.
One consideration is that switching to |
sticking to exclude for now |
Objective
Reduce the size of
.crate
files generated bycargo package
orcargo publish
for thebevy
package.Solution
Change what files are included in a
.crate
file, by only including necessary folders and files, rather than excluding a few specific folders and keeping the rest.As a result of this change, several files and folders are no longer included in the generated
.crate
files:.cargo/
- Only containsconfig_fast_builds.toml
, which does nothing unless renamed toconfig.toml
docs-template/
- Only used for generating documentationexamples/wasm/
- Does not contain any examples that would be scraped by rustdoc.examples/no_std/README.md
,examples/stress_tests/README.md
,examples/README.md
- These README files aren't used anywhere in the docs, so they just take up space in the.crate
working-migration-guides/
,working-release-notes/
- These are only relevant for building up documentation that will be released alongside0.16
proper..gitattributes
,.gitignore
- Only used for the repo, and have no effect on how Cargo handles the packageclippy.toml
,deny.toml
,rustfmt.toml
,typos.toml
- Only relevant when developing BevyCODE_OF_CONDUCT.md
,CONTRIBUTING.md
,CREDITS.md
- Only relevant in their latest form as contained on the repo (so there's not much point to packaging these up, since they can quickly become outdated)Testing
This change was tested following these steps:
cargo package
at the root of the repo.crate
file so it isn't overwritten later/Cargo.toml
cargo package
at the root of the repo.crate
file sizesI performed my testing on Windows 10 22H2, with Rust 1.85.1, using commit 0d90da8. Only one change was made from this commit that was unrelated to testing: The removal of an instance of
"bevy_internal/bevy_anti_aliasing"
from/Cargo.toml
. This was done because Cargo would complain about the use of a non-existent feature otherwise - I do not believe it affects the results in any major way.