`cargo publish` omit some source code

Hello, I am having a couple of very heavy git submodules (120M) in the tree and cargo publish wants to publish them as the source code, which inevitably fails with error (it has 10M limit). Reading cargo publish --help I didn't find anything useful. What can I do? I extremely don't want to remove those submodules and make a dirty publish each time..

How is this large project structured?
Are those submodules organized as separate crates within a common workspace?

The exclude and include fields in your manifest can be used to tell Cargo what files and directories to include when bundling your code for distribution.

1 Like

Those submodules are C deps and they are used in the build script. They are on the root, together with Cargo.toml etc. They should not appear in source on docs.rs

The files used by the build script have to be included. But perhaps you can exclude the test suite or whatever is so large in the submodule.

1 Like