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

Add explicit include to Cargo.toml #69

Open
XAMPPRocky opened this issue Jun 21, 2021 · 5 comments
Open

Add explicit include to Cargo.toml #69

XAMPPRocky opened this issue Jun 21, 2021 · 5 comments

Comments

@XAMPPRocky
Copy link

XAMPPRocky commented Jun 21, 2021

I noticed that encoding-rs is the largest download in my crate graph at 1.4MB. While relatively it's not a lot, this could reduced significantly, by just adding a include to the Cargo.toml and only including what is needed to build the crate with the licence and copyright. I'm not too familiar with the project structure so there might more needed but this seems like everything.

include = [
    "COPYRIGHT",
    "LICENSE-APACHE",
    "LICENSE-MIT",
    "build.rs",
    "src/**/*",
]
@hsivonen
Copy link
Owner

The other stuff is needed for running cargo test. I'm not sure what the expectations are / etiquette is regarding publishing everything that's needed for running tests to crates.io.

@XAMPPRocky
Copy link
Author

XAMPPRocky commented Jun 21, 2021

I don't think you need to supply what's needed for cargo test. You can never run a dependencies tests from crates.io, unless you download a raw tarball and run cargo locally. FWIW tokei hasn't published its tests to crates.io in years and no one has ever asked about it.

@BurntSushi
Copy link
Contributor

I've generally tried to keep test stuff inside the crate, although I don't have any automated processes in place to check it. The reason why I have done that is because it seems like a generally good idea to make it possible to download a crate from crates.io and be able to run its test suite with whatever it is you downloaded. Particularly for tooling like crater. But @XAMPPRocky is right in that it's unlikely you'll hear any complaints. Otherwise, I don't think there is any firm established practice here.

@XAMPPRocky
Copy link
Author

XAMPPRocky commented Jun 21, 2021

Particularly for tooling like crater.

That doesn't affect this crate though right? The tests that encoding-rs has outside of src are fuzzing, which would not be run by crater. Crater would only run tests under tests. I think the main folder I'm not really sure about is the doc folder which seems like module docs but I can't see where that's used.

@BurntSushi
Copy link
Contributor

Ah gotya. I didn't look too closely at the specific setup here. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants