Skip to content

-Zbuild-std in a project that uses compiler_builtins produces error: multiple rlib candidates #11140

Open
@saethlin

Description

@saethlin

Problem

I would really like to build https://github.com/saethlin/fls with -Zbuild-std but I get an error when I do:

error[E0465]: multiple rlib candidates for `compiler_builtins` found
  |
  = note: candidate #1: /tmp/fls/target/x86_64-unknown-linux-gnu/debug/deps/libcompiler_builtins-0aaf2effdc7e19f5.rlib
  = note: candidate #2: /tmp/fls/target/x86_64-unknown-linux-gnu/debug/deps/libcompiler_builtins-9294bddd5a5521a8.rlib

error: could not compile `fls` due to previous error

I have tried tweaking the version of fls's dependency on compiler_builtins and even adding the feature rustc-dep-of-std which I see alloc use I think. Doing so seems to change the hash embedded in the rlib name, but I haven't figured out how to make them line up. (of course this error shouldn't happen at all, but it would also be nice to have a hack around it)

Steps

Try to build fls with cargo +nightly b -Zbuild-std --target=x86_64-unknown-linux-gnu

Possible Solution(s)

No response

Notes

No response

Version

cargo 1.66.0-nightly (73ba3f35e 2022-09-18)
release: 1.66.0-nightly
commit-hash: 73ba3f35e0205844418260722c11602113179c4a
commit-date: 2022-09-18
host: x86_64-unknown-linux-gnu
libgit2: 1.5.0 (sys:0.15.0 vendored)
libcurl: 7.83.1-DEV (sys:0.4.55+curl-7.83.1 vendored ssl:OpenSSL/1.1.1q)
os: Arch Linux Rolling Release [64-bit]

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: bugS-triageStatus: This issue is waiting on initial triage.Z-build-stdNightly: build-std

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions