Skip to content

Add explicit include to Cargo.toml #69

Closed

Description

@XAMPPRocky

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/**/*",
]

Activity

  1. hsivonen commented on Jun 21, 2021

    @hsivonen
    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.

  2. XAMPPRocky commented on Jun 21, 2021

    @XAMPPRocky
    Author

    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.

  3. BurntSushi commented on Jun 21, 2021

    @BurntSushi
    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.

  4. XAMPPRocky commented on Jun 21, 2021

    @XAMPPRocky
    Author

    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.

  5. BurntSushi commented on Jun 21, 2021

    @BurntSushi
    Contributor

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

  6. hsivonen commented on Aug 6, 2026

    @hsivonen
    Owner

    This was done in #113

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions