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
In a workspace with two packages, with the two packages set to two different targets with the cargo per-package-target nightly feature, compilation fails (when invoked from workspace root) if the two separate packages depend on two crates that respectively share a dependency with one crate
However, compilation succeeds if compiling each of the packages separately (with --package or by cding into each dir and running cargo build there).
Steps
Create a workspace with 2 separate crates
Set them to two different targets, using forced-target or default-target -- one baremetal and one with std
Add two crates to them, like uefi and clap respectively that both depend on the same crate. In this case, they both depend upon bitflags.
Run cargo build from the workspace root. Compilation of bitflags should fail.
Root cause is probably that compilation targets are decided before the whole compile graph is known, leading to conflicts when two crates depend upon the same crate but under two different targets.
Notes
No response
Version
cargo 1.72.0-nightly (45782b6b8 2023-07-05)
release: 1.72.0-nightly
commit-hash: 45782b6b8afd1da042d45c2daeec9c0744f72cc7
commit-date: 2023-07-05
host: aarch64-apple-darwin
libgit2: 1.6.4 (sys:0.17.2 vendored)
libcurl: 7.88.1 (sys:0.4.63+curl-8.1.2 system ssl:(SecureTransport) LibreSSL/3.3.6)
ssl: OpenSSL 1.1.1u 30 May 2023
os: Mac OS 13.4.0 [64-bit]
The text was updated successfully, but these errors were encountered:
Problem
In a workspace with two packages, with the two packages set to two different targets with the cargo
per-package-target
nightly feature, compilation fails (when invoked from workspace root) if the two separate packages depend on two crates that respectively share a dependency with one crateHowever, compilation succeeds if compiling each of the packages separately (with
--package
or bycd
ing into each dir and runningcargo build
there).Steps
forced-target
ordefault-target
-- one baremetal and one with stduefi
andclap
respectively that both depend on the same crate. In this case, they both depend uponbitflags
.cargo build
from the workspace root. Compilation ofbitflags
should fail.Here is a link to a cargo package the exhibits the problem: https://github.com/darklyspaced/ppt-bug
Possible Solution(s)
Root cause is probably that compilation targets are decided before the whole compile graph is known, leading to conflicts when two crates depend upon the same crate but under two different targets.
Notes
No response
Version
The text was updated successfully, but these errors were encountered: