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 tests folder and Gir.toml, versions.txt files #1491

Closed
wants to merge 1 commit into from

Conversation

pentamassiv
Copy link
Contributor

Similar to gtk-rs/gtk-rs-core#1158

The size of the crates can be reduced by excluding the tests folder and the Gir.toml + versions.txt files from being published to crates.io. All crates that are generated by gir have the two files and most will have a tests folder. They never have to get published to crates.io so gir can automatically generate that line for us. If for whatever reason they do need to be published, the entries can be removed from the list. The entry is never overwritten if it exists. There can also be an include list. If that is the case, no exclude is added.

While this in most cases will only save a few KB, the gtk, gstreamer and related crates do get a lot of downloads so I believe it is beneficial.

You can see which files will be included without publishing the crates by running cargo package --list.

@pentamassiv
Copy link
Contributor Author

pentamassiv commented Aug 7, 2023

Another option would be to use something like this:

include = ["src/*", "build.rs", "Cargo.toml", "LICENSE", "COPYRIGHT"]

but that probably is more error prone and would lead to more questions.

@sdroege
Copy link
Member

sdroege commented Aug 7, 2023

Same questions as for gtk-rs/gtk-rs-core#1158 (review)

@pentamassiv
Copy link
Contributor Author

I did not know packagers use the tests from crates.io and the other included files

@pentamassiv pentamassiv closed this Aug 7, 2023
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

Successfully merging this pull request may close these issues.

2 participants