build: keep debug info in the test profile only, not release

[profile.release] debug = true forced full DWARF into release builds.
On ELF targets (the manylinux/musllinux wheels) the debug sections are
embedded in the .so (~160 MB, over PyPI's 100 MB file limit); MSVC emits
a sidecar .pdb instead and the apple/zig link path drops it, so only the
Linux wheels were bloated. Move debug=true to [profile.test] so cargo
still gets readable backtraces without fattening the release wheels.
This commit is contained in:
w.pomp committed 2026-10-29 17:20:13 +01:00
1 parent 8338af454f
commit 05ed9112d8
1 file changed
+7 -1
+7 -1
View File
@@ -17,9 +17,15 @@ categories = ["multimedia::images", "science"]
[profile.test] [profile.test]
inherits = "release" inherits = "release"
# Full debug info goes in the TEST profile only (readable cargo-test
# backtraces). It must NOT be in the release profile: on ELF targets
# (Linux/musl wheels) the DWARF gets embedded in the .so (~160 MB, over
# PyPI's 100 MB limit) - MSVC puts it in a sidecar .pdb and the
# apple/zig link path drops it, which is why only the Linux wheels were
# bloated.
debug = true
[profile.release] [profile.release]
debug = true
[profile.dev.package.backtrace] [profile.dev.package.backtrace]
opt-level = 3 opt-level = 3