Skip to content

Commit fa60681

Browse files
committed
Emit a warning if a file is excluded from the archive by matching the target
This implements the proposal in #2867
1 parent fe823be commit fa60681

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/module_writer/sdist_writer.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ impl ModuleWriter for SDistWriter {
5252

5353
let target = target.as_ref();
5454
if self.exclude(target) {
55+
eprintln!(
56+
"⚠️ Warning: {} was excluded from the archive by the target path in the archive instead of the source path on the filesystem",
57+
target.display(),
58+
);
59+
eprintln!("\n This behavior will be deprecated in future versions of maturin");
5560
return Ok(());
5661
}
5762

src/module_writer/wheel_writer.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,19 @@ impl ModuleWriter for WheelWriter {
4040
mut data: impl Read,
4141
executable: bool,
4242
) -> Result<()> {
43+
if let Some(source) = source {
44+
if self.exclude(source) {
45+
return Ok(());
46+
}
47+
}
48+
4349
let target = target.as_ref();
4450
if self.exclude(target) {
51+
eprintln!(
52+
"⚠️ Warning: {} was excluded from the archive by the target path in the archive instead of the source path on the filesystem",
53+
target.display(),
54+
);
55+
eprintln!("\n This behavior will be deprecated in future versions of maturin");
4556
return Ok(());
4657
}
4758

0 commit comments

Comments
 (0)