-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Closed
Copy link
Labels
C-bugCategory: bugCategory: bugCommand-packageS-triageStatus: This issue is waiting on initial triage.Status: This issue is waiting on initial triage.
Description
Problem
When using package.exclude or package.include (which will exclude everything not included) on a file that is referenced by a Cargo target with a default path (not specifying a path), cargo publish will fail.
Steps
- Initialize an empty crate with the following
Cargo.tomlfile:
[package]
name = "test-publish-target"
version = "0.0.0"
edition = "2021"
exclude = ["tests"]
[[test]]
name = "test"
test = false- Run
cargo publish --dry-run
Possible Solution(s)
Specifying a path solves the problem:
[[test]]
name = "test"
path = "tests/test.rs"
test = falseNotes
This was also reported here: https://users.rust-lang.org/t/cargo-publish-with-excluded-benchmark-fails-validation/53444. But I didn't find a corresponding issue report.
Version
cargo 1.57.0 (b2e52d7ca 2021-10-21)
release: 1.57.0
commit-hash: b2e52d7cab0a286ee9fcc0c17510b1e72fcb53eb
commit-date: 2021-10-21
host: x86_64-apple-darwin
libgit2: 1.3.0 (sys:0.13.23 vendored)
libcurl: 7.77.0 (sys:0.4.49+curl-7.79.1 system ssl:(SecureTransport) LibreSSL/2.8.3)
os: Mac OS 12.0.1 [64-bit]
Metadata
Metadata
Assignees
Labels
C-bugCategory: bugCategory: bugCommand-packageS-triageStatus: This issue is waiting on initial triage.Status: This issue is waiting on initial triage.