-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
cargo publish/package ignores include
section and fails when subdirectory contains a Cargo.toml
#8597
Comments
Following: I'm encountering what appears to be a similar issue. |
@scouten fwiw I ended up fixing this by removing the |
@yaahc thanks. In my case, it turned out to be a false alarm. It looked like the dir wasn't there, but in fact it was an unrelated issue. |
#9017 is another instance of this. |
This wasn't really working, the compile succeeded during cargo publish but the sources are still not included in the crate. This is because cargo ignores all subdirectories with a Cargo.toml file: rust-lang/cargo#8597
More details there rust-lang/cargo#8597
include
section and fails when submodule (maybe just subdirectory) contains a Cargo.tomlinclude
section and fails when subdirectory contains a Cargo.toml
From #9643 (comment) by @tmplt:
|
From #9643 (comment) by @gdesmott:
|
Problem
I'm trying to publish https://github.com/ZcashFoundation/zcashconsensus which compiles and re-exports a c++ library as a rust crate. This library is defined in another repository we do not control and we just include it as a git submodule. However, when attempting to publish the
build.rs
file fails because the c++ files it needs to build aren't pulled in with the rest of the files before packaging.I tried to fix this by explicitly specifying an
include
list in the[package]
section of myCargo.toml
but cargo seems to completely ignore theinclude
section for files in the git submodule. I believe this is the same issue as seen in this older issue #2657However, I cannot fix this the same way they did because the way brson fixed the issue was by using a previous version of cargo from before the feature to filter out files in subdirectories was introduced, and presumably such a version of cargo is 4 years old now...
Steps
cargo package --list --allow-dirty
to show that the "zcash/src/script/zcashconsensus.h" file has not been included.Notes
Output of
cargo version
:❯ cargo version
cargo 1.45.0 (744bd1f 2020-06-15)
The text was updated successfully, but these errors were encountered: