Skip to content

warning: output filename collision #15423

Closed as duplicate of#6313
Closed as duplicate of#6313
@wdanilo

Description

@wdanilo

Problem

Hi, let's imagine I have this siutation:

workspace:

  • Cargo.toml (members: [crates/*])
  • crates
    • lib/Cargo.toml
    • macro/Cargo.toml
    • helper/Cargo.toml

Now, lib imports helper and macro imports helper. When I build it, cargo tells me:

output filename collision.
The lib target `helper` in package `helper v1.0.0 (<mylib>/crates/helper)` has the same output filename as the lib target `helper` in package `helper v1.0.0 (<mylib>/crates/helper)`.
Colliding filename is: <mylib>/target/release/deps/libhelper.rlib
The targets should have unique names.

And I believe this is because lib and macro use other rustc config to compile their targets. What to do in this situation?

Steps

  1. Replicate struct shown above.

Possible Solution(s)

None so far

Notes

No response

Version

cargo 1.85.0-nightly (c86f4b3a1 2024-12-24)

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: bugS-needs-infoStatus: Needs more info, such as a reproduction or more background for a feature request.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions