You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using -Zbuild-std there is output collision between build dependencies that are common to the given project and standard library itself.
Steps
One minimal reproducer would be a project with a following Cargo.toml:
[package]
name = "a"version = "0.1.0"edition = "2018"build = "build.rs"
[build-dependencies]
cc = "1.0"
And a build.rs:
externcrate cc;fnmain(){}
During build cargo warns about output collision:
$ cargo -Zbuild-std build --target x86_64-unknown-linux-gnu
warning: output filename collision.
The lib target `cc`in package `cc v1.0.50` has the same output filename as the lib target `cc`in package `cc v1.0.50`.
Colliding filename is: /.../target/debug/deps/libcc-737974c580f2da8c.rlib
The targets should have unique names.
Consider changing their names to be unique or compiling them separately.
This may become a hard error in the future; see <https://github.com/rust-lang/cargo/issues/6313>.
warning: output filename collision.
The lib target `cc`in package `cc v1.0.50` has the same output filename as the lib target `cc`in package `cc v1.0.50`.
Colliding filename is: /.../target/debug/deps/libcc-737974c580f2da8c.rmeta
The targets should have unique names.
Consider changing their names to be unique or compiling them separately.
This may become a hard error in the future; see <https://github.com/rust-lang/cargo/issues/6313>.
...
When building with multiple parallel jobs the conflicts do happen and result in failures observable in a variety of ways:
SIGBUS: access to undefined memory
error: failed to build archive: No such file or directory
error: linking with cc failed: exit code: 1
and potentially more informative:
error[E0658]: use of unstable library feature 'rustc_private': this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via `Cargo.toml` instead?
--> build.rs:1:1
|
1 | extern crate cc;
| ^^^^^^^^^^^^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/27812
= help: add `#![feature(rustc_private)]` to the crate attributes to enable
Notes
cargo 1.42.0-nightly (9d32b7b01 2020-01-26)
The text was updated successfully, but these errors were encountered:
Problem
When using
-Zbuild-std
there is output collision between build dependencies that are common to the given project and standard library itself.Steps
One minimal reproducer would be a project with a following
Cargo.toml
:And a
build.rs
:During build cargo warns about output collision:
When building with multiple parallel jobs the conflicts do happen and result in failures observable in a variety of ways:
SIGBUS: access to undefined memory
error: failed to build archive: No such file or directory
error: linking with
ccfailed: exit code: 1
and potentially more informative:
Notes
cargo 1.42.0-nightly (9d32b7b01 2020-01-26)
The text was updated successfully, but these errors were encountered: