Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linker error: duplicate symbol only on CI #2386

Open
dev-ardi opened this issue Jan 3, 2025 · 0 comments
Open

Linker error: duplicate symbol only on CI #2386

dev-ardi opened this issue Jan 3, 2025 · 0 comments

Comments

@dev-ardi
Copy link

dev-ardi commented Jan 3, 2025

          ld.lld: error: duplicate symbol: ffi_acme_mail_common_rust_future_free_u16
          >>> defined at lib.rs:43 (mail/mail-common/src/lib.rs:43)
          >>>            /builds/rust/acme-rust/target/debug/deps/proton_mail_common-7cec9c6870e7ff37.dmebg5zwg7p92w3ow7yauihgv.rcgu.o:(ffi_proton_mail_common_rust_future_free_u16)
          >>> defined at lib.rs:43 (mail/mail-common/src/lib.rs:43)
          >>>            acme_mail_common-08ac6ddaf12194af.9lql9jv0btadkdtkwrx2qn7bt.rcgu.o:(.text.ffi_proton_mail_common_rust_future_free_u16+0x0) in archive /builds/rust/proton-rust/target/debug/deps/libproton_mail_common-08ac6ddaf12194af.rlib
          
          ld.lld: error: duplicate symbol: ffi_acme_mail_common_rust_future_poll_i16
          >>> defined at lib.rs:43 (mail/mail-common/src/lib.rs:43)
          >>>            /builds/rust/acme-rust/target/debug/deps/proton_mail_common-7cec9c6870e7ff37.dmebg5zwg7p92w3ow7yauihgv.rcgu.o:(ffi_proton_mail_common_rust_future_poll_i16)
          >>> defined at lib.rs:43 (mail/mail-common/src/lib.rs:43)
          >>>            acme_mail_common-08ac6ddaf12194af.9lql9jv0btadkdtkwrx2qn7bt.rcgu.o:(.text.ffi_proton_mail_common_rust_future_poll_i16+0x0) in archive /builds/rust/proton-rust/target/debug/deps/libproton_mail_common-08ac6ddaf12194af.rlib
          
          ld.lld: error: duplicate symbol: ffi_acme_mail_common_rust_future_cancel_i16
          >>> defined at lib.rs:43 (mail/mail-common/src/lib.rs:43)
          >>>            /builds/rust/acme-rust/target/debug/deps/proton_mail_common-7cec9c6870e7ff37.dmebg5zwg7p92w3ow7yauihgv.rcgu.o:(ffi_proton_mail_common_rust_future_cancel_i16)
          >>> defined at lib.rs:43 (mail/mail-common/src/lib.rs:43)
          >>>            acme_mail_common-08ac6ddaf12194af.9lql9jv0btadkdtkwrx2qn7bt.rcgu.o:(.text.ffi_proton_mail_common_rust_future_cancel_i16+0x0) in archive /builds/rust/proton-rust/target/debug/deps/libproton_mail_common-08ac6ddaf12194af.rlib
          
          ld.lld: error: duplicate symbol: ffi_acme_mail_common_rust_future_complete_i16
          >>> defined at lib.rs:43 (mail/mail-common/src/lib.rs:43)
          >>>            /builds/rust/acme-rust/target/debug/deps/proton_mail_common-7cec9c6870e7ff37.dmebg5zwg7p92w3ow7yauihgv.rcgu.o:(ffi_proton_mail_common_rust_future_complete_i16)
          >>> defined at lib.rs:43 (mail/mail-common/src/lib.rs:43)
          >>>            acme_mail_common-08ac6ddaf12194af.9lql9jv0btadkdtkwrx2qn7bt.rcgu.o:(.text.ffi_proton_mail_common_rust_future_complete_i16+0x0) in archive /builds/rust/proton-rust/target/debug/deps/libproton_mail_common-08ac6ddaf12194af.rlib
          
          ld.lld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors)
          collect2: error: ld returned 1 exit status

I'm getting a lot of these linker errors.
I have 2 crates, both call uniffi_setup_scaffolding!() (no namespace override)

I get this error in the following cases:

  1. cargo build
  2. cargo build --profile test (no error) -> cargo test error!
  3. both using lld and system linker

Using stable rust 1.82, and this only happens in our CI.

Any ideas would help here, at least to reproduce the issue locally!
cc: #2384

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant