Repository: mozilla/cbindgen (language: rust)

Issue:
0.16.0: tests/rust/expand_dep/cbindgen.toml isn't part of the source from cargo
tests/rust/expand_dep/cbindgen.toml is expected for the test suite but not part of the source tarball.

```
---- bin_default_uses_debug_build stdout ----
thread 'bin_default_uses_debug_build' panicked at 'build should succed: Os { code: 2, kind: NotFound, message: "No such file or directory" }', tests/profile.rs:62:10
stack backtrace:
   0: rust_begin_unwind
             at /usr/src/rustc-1.48.0/library/std/src/panicking.rs:483
   1: core::panicking::panic_fmt
             at /usr/src/rustc-1.48.0/library/core/src/panicking.rs:85
   2: core::result::unwrap_failed
             at /usr/src/rustc-1.48.0/library/core/src/result.rs:1220
   3: core::result::Result<T,E>::expect
             at /usr/src/rustc-1.48.0/library/core/src/result.rs:933
   4: profile::build_using_bin
             at /usr/share/cargo/registry/cbindgen-0.16.0/tests/profile.rs:57
   5: profile::bin_default_uses_debug_build
             at /usr/share/cargo/registry/cbindgen-0.16.0/tests/profile.rs:98
   6: profile::bin_default_uses_debug_build::{{closure}}
             at /usr/share/cargo/registry/cbindgen-0.16.0/tests/profile.rs:97
   7: core::ops::function::FnOnce::call_once
             at /usr/src/rustc-1.48.0/library/core/src/ops/function.rs:227
   8: core::ops::function::FnOnce::call_once
             at /usr/src/rustc-1.48.0/library/core/src/ops/function.rs:227
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
```
str:
```
$ cargo download cbindgen > foo.tar.gz
$ tar zxvf foo.tar.gz   
$ cd cbindgen-0.16.0 && cargo test
```


Discussion / hints:

Fix patch:
diff --git a/.github/workflows/cbindgen.yml b/.github/workflows/cbindgen.yml
index b09e5eee8..ae6615621 100644
--- a/.github/workflows/cbindgen.yml
+++ b/.github/workflows/cbindgen.yml
@@ -78,10 +78,14 @@ jobs:
       run: |
         cargo test --verbose
 
-    - name: Cargo update minimal-versions
+    - name: Test package
+      env:
+        CBINDGEN_TEST_VERIFY: 1
       run: |
-        cargo update -Zminimal-versions
+        cargo package --verbose
+        (cd target/package/cbindgen-$(cargo run -- --version | cut -d ' ' -f 2) && cargo test --verbose)
 
     - name: Test minimal-versions
       run: |
+        cargo update -Zminimal-versions
         cargo test
diff --git a/Cargo.toml b/Cargo.toml
index 7c322f442..f21d755fa 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -13,6 +13,9 @@ keywords = ["bindings", "ffi", "code-generation"]
 categories = ["external-ffi-bindings", "development-tools::ffi"]
 repository = "https://github.com/eqrion/cbindgen/"
 edition = "2018"
+exclude = [
+  "tests/profile.rs", # Test relies in a sub-crate, see https://github.com/rust-lang/cargo/issues/9017
+]
 
 [badges]
 travis-ci = { repository = "eqrion/cbindgen" }


Test patch: