I'm running into this issue when including a crate that is of crate_type cdylib, I get a duplicate split compilation unit error. Here is a minimal test case.
Cargo.toml
[package]
name = "dupcomp"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
tokio = { version = "1.12.0", features = ["full"] }
sysinfo = { version = "0.26.7" }
[profile.release]
lto = "thin"
opt-level = 2
debug-assertions = false
codegen-units = 16
incremental = true
split-debuginfo = "packed"
debug = true
main.rs
#[tokio::main]
async fn main() {
println!("Hello, world!");
}
Split debug info on Mac and Windows are also fine for this case. When including the same crate that is of crate_type rlib it also builds fine on linux with split-debuginfo.
It seems the num_cpus crate included in sysinfo is being added by Thorin first and then the same compilation unit is being added again in tokio (verified this by using the Thorin CLI). Updating the sysinfo library to version 0.29 (where it is no longer a cdylib) resolves this issue.
I'm running into this issue when including a crate that is of crate_type
cdylib, I get aduplicate split compilation uniterror. Here is a minimal test case.Cargo.tomlmain.rsSplit debug info on Mac and Windows are also fine for this case. When including the same crate that is of crate_type
rlibit also builds fine on linux withsplit-debuginfo.It seems the
num_cpuscrate included insysinfois being added by Thorin first and then the same compilation unit is being added again intokio(verified this by using the Thorin CLI). Updating thesysinfolibrary to version 0.29 (where it is no longer acdylib) resolves this issue.