Cargo exclude gives "failed to open for archiving" for cargo publish --dry-run

Hi all,

I'm trying to exclude some files when doing a cargo publish --dry-run, but it's failing:

# For crates.io
include = [
    "vendor/librecast/COPYING",
    "vendor/librecast/README.md",
    "vendor/librecast/Makefile.in",
    "vendor/librecast/configure",
    "vendor/librecast/configure.ac",
    "vendor/librecast/include",
    "vendor/librecast/libs",
    "vendor/librecast/src",
    "**/*.rs",
    "./.gitignore",
    "./.gitmodules",
    "Cargo.toml",
    "CHANGELOG.md",
    "README.md",
    "wrapper.h"
]

exclude = [
    "vendor/librecast/libs/libmld/test/all/*.test"
]

gives:

cargo publish --dry-run --allow-dirty
    Updating crates.io index
warning: both package.include and package.exclude are specified; the exclude list will be ignored
   Packaging librecast-sys v1.0.0 (/home/ghenry/RustroverProjects/librecast-sys)
    Updating crates.io index
error: failed to prepare local package for uploading

Caused by:
  failed to open for archiving: `/home/ghenry/RustroverProjects/librecast-sys/vendor/librecast/libs/libmld/test/all/0000-0000.test`

Have I missed something here?

Thanks.

include and exclude are mutually exclusive:

The options are mutually exclusive; setting include will override an exclude.

which is also indicated by the warning in the console output you shared. You can negate a pattern by prefixing it with ! (like .gitignore patterns), so

include = [
    ...
    "!vendor/librecast/libs/libmld/test/all/*.test",
    ...
]

should exclude all the *.test files from the vendor/librecast/libs/libmld/test/all/ directory during bundling.

Apologies @jofas and everyone. I didn't even spot the warning message. I was playing for ages too. Even the docs are clear:

The options are mutually exclusive: setting include will override an exclude. Note that include must be an exhaustive list of files as otherwise necessary source files may not be included. The package's Cargo.toml is automatically included