Skip to content
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

Exclude more files in Cargo.toml #1186

Closed
RazrFalcon opened this issue Feb 18, 2018 · 7 comments
Closed

Exclude more files in Cargo.toml #1186

RazrFalcon opened this issue Feb 18, 2018 · 7 comments
Labels
A-meta Area: administrative question or tracking issue C-enhancement Category: Raise on the bar on expectations E-easy Call for participation: Experience needed to fix: Easy / not much E-medium Call for participation: Experience needed to fix: Medium / intermediate

Comments

@RazrFalcon
Copy link

Exclusion of CHANGELOG.md, CONTRIBUTORS.md and README.md will decrease .crate file size from 186KiB to 133KiB.

@kbknapp
Copy link
Member

kbknapp commented Feb 19, 2018

Great catch, thanks @RazrFalcon! I actually started doing this in v3, but didn't backport it to v2.

If someone wants an easy PR this is a great one. If it hasn't been knocked out by the time I make the next merge I'll knock it out.

@kbknapp kbknapp added C-enhancement Category: Raise on the bar on expectations D: easy E-medium Call for participation: Experience needed to fix: Medium / intermediate A-meta Area: administrative question or tracking issue E-easy Call for participation: Experience needed to fix: Easy / not much labels Feb 19, 2018
@kbknapp
Copy link
Member

kbknapp commented Feb 19, 2018

Slightly on a different note, I wonder if anyone has done any testing with removing all comments during cargo package, I'd imagine that'd save quite a bit community wide. Considering clap is nearly 45% comments (counting src/ dir only and only counting lines). And comment lines I'd imagine are far more dense than code.

kevin@beefcake: ~/Projects/clap-rs 
➜ tokei src
-------------------------------------------------------------------------------
 Language            Files        Lines         Code     Comments       Blanks
-------------------------------------------------------------------------------
 Rust                   40        19373        10852         7468         1053
-------------------------------------------------------------------------------
 Total                  40        19373        10852         7468         1053
-------------------------------------------------------------------------------

@kbknapp
Copy link
Member

kbknapp commented Feb 19, 2018

In my unscientific test, doing both more excludes (*.md) and removing all comments brings it down to 68K. I'd say that's decently substantial (basically 33% of the original size).

@kbknapp
Copy link
Member

kbknapp commented Feb 19, 2018

Hmm, actually excluding the README.md might be a bad idea. This is what is rendered on the crates.io package page :\

@kbknapp
Copy link
Member

kbknapp commented Feb 19, 2018

I'm not sure any more...partially because it's late, but also looking through the cargo and crates.io source, it looks like the readme may get uploaded separately...but to be safe we should ask someone from the cargo or crates.io team to confirm.

@RazrFalcon
Copy link
Author

This is what is rendered on the crates.io package page

I thought that it uses github repo. My bad.

The problem with .crate files is that they can contain anything, but only src dir and Cargo.toml are important (afaiu). There are no official guidelines about it.

But if, for some reasons, original repo will disappear - this is the only way of retrieving the source code, so at least tests should still be present.

Have no idea what should be done in this case, but currently we just decreasing the bandwidth and bloating the .cargo dir (last time I've check it was 3GiB).

@kbknapp
Copy link
Member

kbknapp commented Jul 22, 2018

This has started on v3-master. I'm going to close this issue as I don't plan on backporting to v2 and any further work would need some official Rust guidelines on the matter.

@kbknapp kbknapp closed this as completed Jul 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-meta Area: administrative question or tracking issue C-enhancement Category: Raise on the bar on expectations E-easy Call for participation: Experience needed to fix: Easy / not much E-medium Call for participation: Experience needed to fix: Medium / intermediate
Projects
None yet
Development

No branches or pull requests

2 participants