Skip to content

Generated libraries with the same name fail to link #3735

@finn-ball

Description

@finn-ball

If Rust tries to link against two generated libraries with the same name, there will be the error:

ld.lld: error: undefined symbol: app_function
          >>> referenced by app.1555d9328bfdc04c-cgu.0
          >>>               bazel-out/k8-fastbuild/bin/app.app.1555d9328bfdc04c-cgu.0.rcgu.o:(app::main::h288a2b8d569cac4d)
          collect2: error: ld returned 1 exit status

Possible breaking change introduced here: #3647

It's likely the depsets before allowed same name binaries to exist due to a nested structure.

Example which shows the breaking change along with workarounds:
https://github.com/finn-ball/rules_rust_binary_clash

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions