Description
Occasionally (perhaps 1/3 of the time, so it's not that rare) when doing multiple builds with extended = true
(and hence building tools including rls and cargo), I get different libcargo.rlib and librls.rlib files.
During a normal build, libcargo gets built once (reproducibly for me), but on these bad builds it gets built twice. The command line is slightly different the second time, as it has ,artifacts
appended to its --json
argument (due to this code). This difference gets propagated to librls, which depends on libcargo.
I believe this is due to rustc's bootstrap compiler invoking cargo separately for each tool. If the cargo build finishes early enough, the rls build can use its result. But if it does not, the rls build seems to fire off its own compile, which causes the above issue.
Note that this is a part of #34902.