Recompilation regression on cdylib on toolchain mixing #15209
Labels
A-rebuild-detection
Area: rebuild detection and fingerprinting
C-bug
Category: bug
S-needs-design
Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.
Problem
Hi,
On a library crate
Cargo.toml
lib.rs
Makefile
make broken
fails on the 2nd call of the stable test doctest compilation witherror[E0514]: found crate `crate_name` compiled by an incompatible version of rustc
Using
+nightly-2024-12-14
instead of+nightly-2024-12-15
fixes the issue (cargo diff 20a4432...769f622)As of
nightly-2025-02-19
, this error still appears.Does not fail with either
crate-type = ["lib"]
orcrate-type = ["cdylib"]
This looks like a cargo regression on compilation artifacts reuse.
I'm not sure what guarantees cargo make when mixing toolchains without cleaning.
When also using
rlib
, there is also error (didn't first appear withnightly-2024-12-15
, already present innightly-2024-12-14
):With
crate-type = ["lib", "rlib"]
,make broken
fails on the 2nd call of the stable test compilationWith
crate-type = ["lib", "cdylib", "rlib"]
,make broken
fails on the 1st call of the nightly test compilationWith
crate-type = ["cdylib", "rlib"]
, we get theerror[E0514]
seen beforeWith
crate-type = ["rlib"]
, no failI can open a separate issue if needed for this different error
Steps
No response
Possible Solution(s)
Running
cargo clean
between compilation when changing toolchainNotes
No response
Version
The text was updated successfully, but these errors were encountered: